Browse your favorites with Emacs webjump
========================================

Some browsers support `jumps' to quickly open sites or run simple queries.

Jumps are a fine addition to bookmarks, allowing for fast and barrier-free
consulting web pages.

Lynx
----
Lynx support the use of jumps. To use this, create a jump-file which
defines for each site the hot-key and the URL.

Example jump-file:

   <html>
   <head>
       <meta http-equiv="content-type" content="text/html; charset=utf-8">
   </head>
   <body>
   <dl compact>
   <dt>oi<dd><a href="https://oidref.com/%s">OID</a></dd>
   <dt>rfc<dd><a href="https://datatracker.ietf.org/doc/html/rfc%s">RFC</a></dd>
   <dt>s<dd><a href="https://html.duckduckgo.com/html?q=%s">DuckDuckGo</a></dd>
   <dt>w<dd><a href="https://en.wikipedia.org/wiki/%s">WikiEN</a></dd>
   </dl>
   </body>
   </html>

Save this file, e.g., as `~/.lynx/jumpfile.html' and configure it in your lynx.cfg:

   JUMPFILE:~/.lynx/jumpfile.html

Make sure the path to the lynx.cfg file is set in your environment:

   LYNX_CFG=~/.lynx/lynx.cfg;   export LYNX_CFG

Now you can jump to your favorites from within lynx with 'J'.

Emacs
-----
Of course, Emacs enables the usage of jumps. This is provided by the
'webjump' package, which is part of Emacs. You do not need to install
anything to utilize webjump. Neil van Dyke created webjump in 1996.

Webjump uses completion to select the URL to open.

To try it out, just run:

  M-x webjump

When you run this command, the completion prompt is loaded with a list
of pre-defined URLs.

Multiple protocols
------------------
The versatility of Emacs shines through while utilizing webjump.

As you can see in the pre-loaded list, webjump can handle different
protocols like FTP and HTML (make sure your default browser supports
the protocols you want to use).

When eww is your default browser and Elpher is installed, webjump can
also handle gopher URLs.

Simple queries
--------------
Webjump provides a method to perform simple queries. For example, the
URL "duckduckgo.com/?q=' is part of the pre-loaded list.

When running webjump with this URL, it prompts the user with

   DuckDuckGo query:

and you can insert some search argument.

Managing the list of URLs
-------------------------
The list of URLs is in the variable `webjump-sites' and can be
custimized using the usual Emacs customization methods.

Another option is to add a few URLs, like:

   (setq webjump-sites
         (append '(("RFC" . [simple-query
                             "https://datatracker.ietf.org"
                             "https://datatracker.ietf.org/doc/html/rfc" ""])
                   ("Phlog-roll" . "gopher://box.matto.nl/1/phlogroll")
                   ("Bongusta" . "gopher://i-logout.cz/1/bongusta")
                   ) webjump-sample-sites))

After evaluation, the next time webjump starts, the completion prompt
also shows the options `RFC', `Phlog-roll', and `Bongusta'.

Key binding
-----------
Increase the convenience of webjump by adding a key binding.
For example:

   (global-set-key (kbd "s-j") #'webjump)

to bind webjump to the <Super>-<j> key combo.

Happy browsing!



Last edited: $Date: 2024/03/03 16:15:59 $