# Gemini with Emacs 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. ## elpher With elpher the client side can be covered. Originally a mere Gopher client, elpher can now also display Gemini content. => https://thelambdalab.xyz/elpher/ ### Installation 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: => gemini://gemlog.blue/users/kristof/1612884617.gmi 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. ### Drawbacks 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. ## gemini-mode 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 ### Installation 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. ### Drawbacks 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. ## Final words 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: => https://odysee.com/@SystemCrafters