💾 Archived View for gemlog.blue › users › kristof › 1613173902.gmi captured on 2023-01-29 at 04:54:46. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-04)
-=-=-=-=-=-=-
Today I wanted to make myself a bit more comfortable with Gemini in Emacs. What it takes: a client to consume Gemini content and, of course, a major-mode to author Gemini content.
With elpher the client side can be covered. Originally a mere Gopher client, elpher can now also display Gemini content.
https://thelambdalab.xyz/elpher/
elpher is available from MELPA, which makes installation easy:
M-x package-install RET elpher
In addition, I have customized elpher a bit to my needs with the help of use-package:
(use-package elpher :ensure t :after visual-fill-colum :commands elpher)
Use :ensure t to make sure that the package is installed (or gets installed if it is not). You can find out what :after and :commands are used for in one of my previous posts:
More about :after and :commands
Furthermore, I use the visual-fill package and the visual-fill-column package to display the content centered in the buffer:
(use-package visual-fill :ensure t :commands visual-line-mode) (use-package visual-fill-column :ensure t :hook ((elpher-mode org-mode) . visual-fill-column-mode) :custom (visual-fill-column-center-text t)
As you can see, visual-fill-column-mode gets also used for org-mode in my configuration.
As a formerly Gopher-only client, elpher is still very Gopher-focused. This is especially apparent in the fact that Gemini URLs must always be entered with the gemini:// prefix. If the prefix is omitted, elpher assumes that it is a Gopher URL and automatically provides it with the gopher:// prefix.
Now that viewing Gemini content in Emacs is possible, authoring Gemini content should obviously be as appealing as possible as well. With gemini-mode Jason McBrayer thankfully provides a major-mode for Emacs:
https://git.carcosa.net/jmcbray/gemini.el.git
gemini-mode is also available from MELPA, which allows for a very simple installation again:
M-x package-install RET gemini-mode
Of course, use-package can be utilized again:
(use-package gemini-mode :ensure t :after visual-fill-column :hook gemini-mode)
Since gemini-mode uses the visual-fill-column package when available, I ensure with :after that gemini-mode is loaded after visual-fill-column. In addition, I defer loading gemini-mode until the first use.
After the first installation of gemini-mode I stumbled across the following error:
File mode specification error: (error Lisp nesting exceeds ‘max-lisp-eval-depth’)
However, I could not determine exactly why this error occurred. A reinstallation ultimately fixed the problem.
At this point I may again refer to my full Emacs configuration, which is available at GitHub:
https://github.com/korwisi/dotfiles/blob/master/.emacs
In addition, I would like to point out the channel of SystemCrafters, who explains the configuration of Emacs very well in a video series dedicated to setting up Emacs from scratch: