-- Leo's gemini proxy

-- Connecting to ew.srht.site:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini


elpher, revisited

tags: gemini emacs

Some time ago I wrote about elpher



These days Tim (maintainer of elpher) sent me a message, basically explaining that I tried to make sense of elpher in the middle of some bigger commits happening. That's very kind of him, isn't it?

So I took another round reading up and fiddling with emacs, the straight package manager and elpher. Along the way I found a few more useful keybindings and I wrote my first elisp function.

Change the code repository back to thelambdalab

I had resorted to Alex Schröders copy of the code repository. Now I changed it back. However, I had to delete the elpher directories in ~/.emacs.d/straight/{repos,build} --- otherwise the switch wasn't picked up.

Change the start page

Turns out that elpher has a variable to set the page you want to see upon start. It's called elpher-start-page-url and it's initial value is "about:welcome". Also turns out, that Tim had added support for "file:" URLs during that time. So I changed elpher-start-page-url to point to a file, which I had written to my liking: a list of links in my preferred order plus some annotations. So whenever I call elpher this list is shown initially.

(setq elpher-start-page-url "file:~/path/to/my-bookmarks.gmi")

So while this is fine, pressing "B" brings up the emacs bookmarks system with a list of elpher bookmarks. I'm still not friends with that, mostly for its ordering. So I decided to add a key to jump to my-bookmarks.gmi

Add key "H" to jump to my-bookmarks.gmi

Now, this is a first. I wrote my first function in elisp. Digging in the Info system, variable values and function definitions, I looked at the code of elpher-go. This function was used as an inspiration to actually show my-bookmarks.gmi:

(defun ew/elpher-go-home ()
  "Go to my start page."
  (elpher-visit-page (elpher-page-from-url elpher-start-page-url)))

Now this new and shiny function is mapped to "H" while in elpher mode. The :bind pragma nicely takes care of this. See below for the full code snippet.

Keybindings found along the way

As my friend H nicely says: "Doku lesen bildet!" --- Reading (even documentation!) expands the mind. Yes indeed, it does. While skimming the elpher info page for insights I came across a number of key bindings I did not know.

m -- elpher-jump -- select a link in this document using your search/narrow framework (consult). Yay, this has become my favourite of these new keys very quickly.

s -- elpher-show-history -- stack: view the current list of links that "u" will trace up

S -- elpher-show-visited-pages -- full history of current session

o -- elpher-go-current -- open: like "g" but prefill the current link into the minibuffer; this allows me to edit the path to my liking.

O -- elpher-root-dir -- open the root directory of the current host

C-u prefix allows to start several sessions of elpher! Yay!

So I'm an even more happy user of elpher. Thanks to Tim Vaughan, Alex Schröder and all the others making this possible!



Code Snippet

License: CC0 -- recycle to your liking
; --- elpher ---------------------------------------------------------
   :type git
   :repo "https://thelambdalab.xyz/git/elpher.git" :branch "master"
;; :repo "https://alexschroeder.ch/cgit/elpher"
(use-package elpher
  :straight t
  :demand t
  (defun ew/elpher-go-home ()
    "Go to my start page."
    (elpher-visit-page (elpher-page-from-url elpher-start-page-url)))
  (setq elpher-start-page-url "file:~/path/to/my-bookmarks.gmi" )
  :bind ( :map elpher-mode-map
               ("H" . ew/elpher-go-home)


-- Response ended

-- Page fetched on Wed Oct 20 19:17:02 2021