1 \input texinfo @c -*-texinfo-*-
3 @setfilename elpher.info
4 @settitle Elpher Manual v3.0.0
8 * Elpher: (elpher). A gopher and gemini client for Emacs.
12 This manual documents Elpher, a gopher and gemini client for Emacs.
14 Copyright @copyright{} 2019, 2020, 2021 Tim Vaughan@*
15 Copyright @copyright{} 2021 Daniel Semyonov@*
16 Copyright @copyright{} 2021 Alex Schroeder
19 The source and documentation of Elpher is free software. You can
20 redistribute it and/or modify it under the terms of the GNU General
21 Public License as published by the Free Software Foundation; either
22 version 3, or (at your option) any later version.
24 Elpher is distributed in the hope that it will be useful, but WITHOUT
25 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 FITNElpher FOR A PARTICULAR PURPOSE. See the GNU General Public License in
27 the file COPYING in the same directory as this file for more details.
32 @title Elpher Gopher and Gemini Client Manual
36 @vskip 0pt plus 1filll
43 @node Top, Introduction, (dir), (dir)
49 * Introduction:: Elpher Overview: what's this all about?
50 * Installation:: Installing Elpher
51 * Quick Start:: Get up and running quickly
52 * Navigation:: Fundamentals of Elpher navigation
53 * Bookmarks:: How to record and visit bookmarks
54 * Gopher character encodings:: How Elpher selects encodings for gopher pages
55 * Encrypted gopher connections:: How and when TLS is enabled for gopher
56 * Gemini support:: Support for the Gemini protocol
57 * Finger support:: Support for the Finger protocol
58 * Customization:: How to customize various aspects of Elpher
62 --- The Detailed Node Listing ---
66 * Within-page navigation:: Moving about within a page
67 * Between-page navigation:: Commands for moving between pages
68 * History and Caching:: Explanation of how Elpher represents history
74 @macro keycmd{key,cmd}
75 @item \key\ (@code{\cmd\})
79 @node Introduction, Installation, Top, Top
82 Elpher aims to be a capable and practical gopher and gemini client for
83 Emacs. Its focus is on easy keyboard-driven navigation based on
84 sensible default bindings (with out-of-the-box support for Evil). It is
85 intended to be robust and behave in non-surprising ways at all times.
86 Additionally, Elpher provides the following bells and whistles:
90 followable web and gopher links in plain text,
93 an easily navigable history, sporting caching of visited pages (both
94 content and cursor position),
97 auto-completing menu item navigation,
100 direct visualization of image files where supported (no writing to
104 basic support for the new ``heavier than gopher, lighter than the web'' Gemini protocol,
107 support for the Finger protocol.
111 Elpher is still under active development. Although we try very hard to
112 ensure that releases are bug-free, this cannot be guaranteed. However,
113 this also means that any usability features that you feel are missing
114 can likely by incorporated quickly, so please get in touch if you
117 @node Installation, Quick Start, Introduction, Top
118 @chapter Installation
120 Elpher is available from the MELPA package repository. If you have
121 never installed packages from this repository before, you'll need
122 to follow the instructions at @url{https://melpa.org/#/getting-started}.
124 @noindent To install Elpher, enter the following:
127 @kbd{M-x package-install @key{RET} elpher @key{RET}}
130 @noindent To uninstall, use
133 @kbd{M-x package-delete @key{RET} elpher @key{RET}}.
136 While not recommended, it is also possible to install Elpher directly
137 by downloading the file @file{elpher.el} from
138 @url{https://alexschroeder.ch/cgit/elpher}, adding it to a directory
139 in your @code{load-path}, and then adding
145 @noindent to your Emacs initialization file.
147 @node Quick Start, Navigation, Installation, Top
150 Before diving into the minutiae of the different commands available,
151 we will quickly describe how to get up and running with Elpher.
153 Once installed, you can launch Elpher using
156 @kbd{M-x elpher @key{RET}}
159 @noindent This will switch to the *Elpher* buffer and display a start
160 page, with information on each of the default keyboard bindings.
162 From here you can move point between links (which may be menu items or
163 inline URLs in text files) by using @key{TAB} and @kbd{S-@key{TAB}},
164 as in Info. You can also jump directly to a menu item using @key{m}, or
165 use the standard Emacs or Evil motion and search commands to find your
166 way around. To open a link, press @key{RET}. (Where a mouse is
167 available, Clicking on a link with the mouse cursor has the same
170 To return to the page you just followed the link from, press @key{u}.
172 Elpher caches (for the duration of an Emacs session) both page contents
173 and the position of point on each of the pages (gopher menus, gemini
174 pages, query results, or text pages) you visit, restoring these when you
175 next visit the same page. Thus, pressing @key{u} displays the previous
176 page in exactly the same state as when you left, meaning that you can
177 quickly and visually explore the different documents in a menu without
178 having to wait for anything to reload.
180 Of course, sometimes you'll @emph{want} to reload the current page
181 rather than stick with the cached version. To do this use @key{R}.
182 (This is particularly useful for search query results, where this
183 allows you to perform a different search.)
185 That's more-or-less it. Elpher supports a number of other features,
186 such a support for different coding schemes and TLS encryption, and a
187 variety of customization options, all of which are explained in the
188 rest of this document. However the emphasis is on keeping the basic
189 navigation experience as intuitive and responsive as possible.
191 Note that you can launch multiple Elpher sessions in parallel by using
195 @kbd{C-u M-x elpher @key{RET}}
198 @node Navigation, Bookmarks, Quick Start, Top
200 Throughout this manual, we use the word ``page'' to refer to any
201 visualization of a response from a gopher or gemini server, be it a
202 menu/directory, query result, text file or image. We use
204 Elpher's navigation interface is inspired by the Emacs Info mode.
205 Movement within a page is essentially the same as moving
206 around any other text file in Emacs, but with special keys
207 for quickly jumping between menu items and URLs in text files.
208 Movement between pages is facilitated by a simple linear history
209 coupled with caching of pages and cursor position.
212 * Within-page navigation:: Moving about within a page
213 * Between-page navigation:: Commands for moving between pages
214 * History and Caching:: Explanation of how Elpher represents history
218 @node Within-page navigation, Between-page navigation, Navigation, Navigation
219 @section Within-page navigation
221 To move about within a page, you should be able use the same keys you usually
222 use to browse files in Emacs. This is even true when Evil mode is
223 enabled. Paragraph hopping, searching etc should work as usual.
225 In addition, the following commands are provided for quickly moving between
226 links and menu items.
229 @keycmd{@key{TAB}, elpher-next-link}
230 Move to the next link or menu item in the file.
232 @item @kbd{Shift-@key{TAB}} or @key{BACKTAB} (@code{elpher-prev-link})
233 @findex elpher-prev-link
234 Move to the previous link or menu item in the file.
236 @keycmd{@key{m}, elpher-jump}
237 Jump directly to a link within a file by specifying its display string
238 or link text. (Unlike the previous two commands, this immediately opens
243 The following commands can be used to retrieve information about the
244 current page, or the address of the link at point:
247 @keycmd{@key{i}, elpher-info-link}
248 Display host, port and selector information for the link at point.
250 @keycmd{@key{I}, elpher-info-current}
251 Display host, port and selector information for the current page.
253 @keycmd{@key{c}, elpher-copy-link-url}
254 Add URL representing address of link at point to the kill-ring and the
255 system clipboard (if available).
257 @keycmd{@key{C}, elpher-copy-current-url}
258 Add URL representing address of the current page to the kill-ring and
259 the system clipboard (if available).
261 @keycmd{@key{d}, elpher-download}
262 Download link at point and save the result as a file. The minibuffer
263 will prompt for the name of the file to write, with the default name being
264 the display string (if available) associated with the link.
266 @keycmd{@key{D}, elpher-download-current}
267 This is similar to @code{elpher-download}, but instead applies to the
268 current page rather than a link.
270 @keycmd{@key{.}, elpher-view-raw}
271 This displays the raw server response for the current page. While not
272 useful for general browsing, it is useful for debugging incorrect rendering
273 or out-of-spec server responses.
276 @node Between-page navigation, History and Caching, Within-page navigation, Navigation
277 @section Between-page navigation
279 Moving to a different page can be accomplished in several ways,
280 described by the following command:
283 @keycmd{@key{RET}\, @kbd{mouse-1}, elpher-follow-link}
284 Follow the menu item or link at point (or selected with the mouse).
286 Exactly what is meant by ``follow'' depends on the kind of item selected:
290 For text or menu type items or links, the current page text is replaced
291 by the text of this item. Unless the customization variable
292 @code{elpher-use-header} (@pxref{Customization}) is
293 @code{nil}, the display string of the link is displayed in the buffer header.
294 Links to images behave similarly on Emacs systems supporting the display of
295 bitmap graphics, however their content is not cached in memory by default.
298 When followed, links to search/query items (type 7) prompt for input in
299 the minibuffer then display the results in the same way as for text and menu
303 Following links to binary files (and image files on unsupported systems)
304 causes Elpher to prompt for a filename in which to save the content.
307 Following links of type `h' with a selector having the `URL:' prefix, or
308 unsuported URLs in text files, will result in Elpher using an external
309 programme to open the URL. This will be either the default system browser
310 or, if the @code{elpher-open-urls-with-eww} customization variable is non-nil,
311 Emacs' own EWW browser. (See @pxref{Customization}.)
315 Once a text, menu or query response page has been displayed, its contents are
316 cached for the duration of the Emacs session.
318 @keycmd{@key{g}, elpher-go}
319 Open a particular page by specifying either its full URL or just
320 entering a gopher host name. (The protocol defaults to gopher, so gemini
321 links must include the @code{gemini://} prefix.
323 If a unsupported protocol is used in the URL the result will be the same
324 as following a URL link of the same type from a link in a page.
326 @keycmd{@key{o}, elpher-go-current}
327 Prompts for a URL similar to @code{elpher-go}, but initialized to the URL
328 of the current page. This allows you to easily try other selectors for the
331 Remember however, that the Gopher RFC 1436 provides @emph{no} guarantees about the
332 structure of selectors.
334 @keycmd{@key{O}, elpher-root-dir}
335 Open the root page (empty selector) on the current host.
337 @keycmd{@key{u}\, @key{-}\, @key{^}\, @kbd{mouse-3}, elpher-back}
338 Return to the previous page, where ``previous'' means the page where the
339 page which was displayed immediately before the current page.
343 @node History and Caching, , Between-page navigation, Navigation
344 @section History and Caching
346 The history and caching strategy in Elpher is extremely simple, but
347 may be confusing without a good mental model of how it works. That
348 is what this section attempts to provide.
350 Essentially, @strong{every} time you navigate to a new page, either
351 by clicking or pressing @key{RET} on a link, using @key{g} to jump
352 to a new page by its address, or using @key{O} to open the root selector,
353 the following two things occur:
357 the cursor position and content for the original page are recorded in an
361 the original page is set as the ``parent'' of the new page.
364 The only way to return to pages in this history is by using @key{u},
365 which returns to the previous of the current page. @footnote{The
366 addition of the new page to the history happens even if the new page is
367 one that has been seen before. This is mostly the desired behaviour.
368 However, opening an explicit ``back'' link provided by a gopher menu or
369 gemini page will also add a new entry to the history. Unless you
370 haven't yet visited that menu, it's therefore better to use @key{u} to
371 go back in this case.}
373 One aspect that may seem peculiar is that Elpher lacks a corresponding ``next'' or
374 ``forward'' command. However, since Elpher caches the position of point,
375 this will be automatically positioned on the link that was most recently followed
376 from a given page. This means that, at least for links followed from menus
377 and text files, the inverse of @key{u} is actually just @key{RET}.
379 Elpher actually maintains two histories, and there are two different
380 commands to access them:
383 @keycmd{@key{s}, elpher-show-history}
384 This shows the history of the current buffer. This shows all the links
385 you would visit if you were to use @key{u} again and again.
387 @keycmd{@key{S}, elpher-show-visited-pages}
388 This shows the entire Elpher browsing history. It includes all the
389 pages you visited in your current Emacs session.
393 @node Bookmarks, Gopher character encodings, Navigation, Top
396 Elpher makes use of standard Emacs bookmarks. @xref{Bookmarks, , ,
397 emacs, The Emacs Editor}. The following commands are perhaps the most
401 @keycmd{@key{a}, elpher-bookmark-link}
402 Add a bookmark for the link at point. The minibuffer will prompt for
403 a name for the bookmark, which defaults to the display string.
405 @keycmd{@key{A}, elpher-bookmark-current}
406 Add a bookmark for the current page. The minibuffer will prompt for
407 a name for the bookmark, defaulting to the display string associated
408 with the link that was followed to reach the current page.
410 @keycmd{@key{B}, elpher-open-bookmarks}
411 Open a page displaying all current bookmarks. This is where you can
412 delete and search bookmarks, for example.
415 On opening the bookmarks page, elpher will offer to import any legacy
416 (2.x) bookmarks files into the new system. Once the import is complete,
417 the original bookmarks file will have ``-legacy'' appended to it, so
418 so that elpher knows not to import it again.
420 If you have any other legacy bookmark files (besides the one in the
421 original location, or specified in the @code{elpher-bookmarks-file}
422 customization variable, which should be automatically detected), you can
423 can import these using
426 @kbd{M-x elpher-bookmark-import @key{RET}}
429 Once this is done, you may delete these legacy bookmarks files.
431 @node Gopher character encodings, Encrypted gopher connections, Bookmarks, Top
432 @chapter Gopher character encodings
434 Responses Elpher retrieves from servers are initially read as pure
435 binary data. When the data is intended to be interpreted as textual (as
436 determined by the type parameter of the gopher menu item or the gopher
437 URL), this data needs to be @emph{decoded} into a sequence of
438 characters. To do this properly requires knowledge of the encoding
439 system used by whoever authored the document.
441 Unfortunately gopher lacks a systematic way of acquiring this necessary
442 information. Thus, the details of the coding system must be either
443 inferred from the binary data, or must be specified by the user.
445 By default, Elpher applies Emacs' built-in character encoding detection
446 system to the full (undecoded) response data and uses this to attempt to
447 convert it into a character string.
448 (See @pxref{Recognize coding, Recognizing coding systems, ,emacs}.) While
449 this approach can be okay, it is important to realize that its inference
450 algorithm is extremely primitive and depends heavily on assumptions based
451 on the language settings of your emacs system.
453 The alternative is to explicitly set the coding system used for decoding
454 using the following command:
457 @keycmd{@key{!},elpher-set-coding-system}
458 Causes a elpher to prompt for a coding system to use for decoding
459 future gopher text. The @key{TAB} key can be used at this prompt to display a
460 list of alternatives (which is extensive) and to auto-complete. An empty
461 response will cause Elpher to return to its default auto-detection
465 Note that changing the coding system only affects newly loaded text.
466 Thus, if text has already been decoded using an incorrect system, you
467 will need to select the correct coding and then reload the text using
471 @node Encrypted gopher connections, Gemini support, Gopher character encodings, Top
472 @chapter Encrypted gopher connections
474 While RFC 1436 does not broach the topic of encryption at all, several
475 modern gopher servers can serve content over encrypted connections,
476 and a common choice for this is TLS.
478 Elpher can retrieve selectors using Emacs' built-in TLS support which
479 uses the GnuTLS library. (It is possible to build emacs without
480 GnuTLS, in which case encryption is not supported.)
482 To retrieve documents using TLS, Elpher's TLS mode must be enabled.
483 This can be directly toggled using @key{T}, but note that just as with
484 the character encoding, changing this mode only affects subsequent
487 Alternatively, TLS mode is @emph{automatically} enabled whenever
488 gopher URLs starting with @code{gophers://} are followed.
490 The mode is sticky, so it remains active until switched off.
491 It can also be automatically switched off when a TLS connection fails.
492 In this case Elpher will prompt for your confirmation to ensure that
493 you can't accidentally make a non-TLS connection.
495 @node Gemini support, Finger support, Encrypted gopher connections, Top
496 @chapter Gemini support
498 @uref{gopher://gemini.circumlunar.space, Gemini}
499 is a new protocol being developed by several members of
500 gopherspace. It aims to solve some of the long-standing technical
501 issues associated with gopher as a protocol, while keeping the major benefits.
502 For instance, it _requires_ encrypted connections, it does away with
503 the selector type, and allows servers to explicitly specify the
504 character coding scheme used for text documents.
506 The latest versions of Elpher aim to provide seamless transitions between
507 gemini and gopher documents. Basically you should be able to open,
508 bookmark, download and otherwise interact with gemini pages in exactly
509 the same way as you do with other non-gemini pages. The only major
510 difference from your perspective as a user is that you should no longer
511 have to worry about manually toggling TLS on or off (for gemini it's
512 always on), and you should never have to manually set a character coding
515 The gemini protocol specification recommends a Trust on First Use (TOFU)
516 behaviour when validating gemini server TLS certificates. This is
517 because many gemini servers rely on self-signed certificates rather
518 than certificates signed by a CA. Sadly however, this TOFU behaviour is
519 far from straight-forward to configure using Emacs' existing Network
520 Security Manager. For this reason, elpher defaults to performing no
521 certificate verification by default. This behaviour can be easily
522 customized by setting the @code{elpher-gemini-TLS-cert-checks}
523 customization variable to non-nil.
525 The gemini specification concerns both the protocol and a simple text
526 document format (mimetype text/gemini) which is like a mixture between
527 gophermap files and markdown-formatted files but simpler than both.
528 Elpher renders gemini responses which are provided in this format in
529 line with the rules in the spec. This includes wrapping long lines at
530 word boundaries. The specific column at which this text is wrapped is
531 defined by the customization variable
532 @code{elpher-gemini-max-fill-width}, which is set to 80 columns by
533 default. (This is slightly wider than Emacs' default fill width of 70
534 columns due to the fact that there are a significant amount of older
535 gemini content which, against the advice of the current spec, hard wraps
536 at <80 columns. The larger default allows this to still look okay,
537 while still keeping content without hard wraps looking pleasant.)
539 The text/gemini format also possesses a section header syntax similar to
540 markdown. Elpher allows different header levels to be drawn with
541 different, customizable, faces. By default, on graphically-capable
542 emacs systems, these faces are given different heights to distinguish
543 among levels. On terminal systems, the level is indicated by the
544 number of preceding # symbols.
546 I should emphasize however that, while it is definitely functional,
547 Elpher's gemini support is still experimental, and various aspects will
548 change as the protocol develops further.
550 @section Client Certificates for Gemini
552 Gemini makes explicit use of the client certificate mechanism that TLS
553 provides for allowing clients to authenticate themselves with servers.
554 The Gemini specification suggests two distinct classes of client
555 certificates: short-lived certificates used to identify you for a single
556 session, and more permanent certificates used to identify you over a
559 When Elpher receives a request for a client certificate from a server,
560 it will present you with the option to create and use a single-use
561 ``throwaway'' certificate, or to use a ``persistent''
562 certificate (optionally creating it or installing pre-existing key and
565 Certificate creation in Elpher requires an installation of OpenSSL, and
566 ---in particular---that Elpher be able to run the @command{openssl} command-line
567 utility. By default, Elpher assumes that the @command{openssl} is on the
568 system path, but the precise location can be set by customizing the
569 @code{elpher-openssl-command} variable.
571 Each generated certificate results in the creation of a .key file and
572 a .crt file. In the case of a throwaway certificate, these files are
573 stored in the temporary directory indicated by the Emacs variable
574 @code{temporary-file-directory} and are deleted when ``forgotten''
575 (as described below).
577 In the case of persistent certificates, these files are stored in the
578 folder defined by the Elpher variable
579 @code{elpher-certificate-directory}, and are never deleted by Elpher.
580 (Of course you can delete them yourself whenever you like.)
581 The base name of the files (i.e. sans extension) is what Elpher uses
582 to identify the certificate.
584 Using throwaway certificates is as simple as pressing the @key{t}
585 key at the prompt which appears following a certificate request from
586 a server. There is nothing more to do.
588 Using a persistent certificate requires instead selecting @key{p} from the same
589 menu. This will result in Elpher asking you for the name identifying
590 the certificate. This entry autocompletes to the list of known certificate
591 names, so you can use @key{TAB} to display the list.
593 In the case that you choose a name that does not belong to the list of
594 known certificates, Elpher will offer to create one for you or to
595 ``install'' one from existing key and certificate files.
596 Pressing the @key{n} key will cause Elpher to begin the process of
597 creating a new persistent certificate, using some additional
598 details for which you will be prompted.
599 Alternatively, pressing the @key{i} key will cause Elpher to ask for the
600 locations of edisting key and certificate files to add to
601 @code{elpher-certificate-directory} under the chosen name.
603 Once a certificate is selected, it will be used for all subsequent TLS
604 transactions to the host for which the certificate was created.
605 It is immediately ``forgotten'' when a TLS connection to another host
606 is attempted, or the following command is issued:
609 @keycmd{@key{F},elpher-forget-certificate}
610 Causes Elpher to immediately forget any currently-loaded client certificate.
613 In either case, ``forgetting'' means that the details of the key and
614 certificate file pair are erased from memory. Furthermore, in the case
615 of throw-away certificates, the corresponding files are deleted.
618 @node Finger support, Customization, Gemini support, Top
619 @chapter Finger support
621 Incidentally, Elpher has native support for querying finger servers.
622 Of course, one could argue that this functionality is more easily
623 provided by one's local telnet client. However finger URLs do appear
624 on occasion in gopherspace, and it's nice to be able to open them
627 Elpher interprets @code{finger://} URLs as follows:
632 The host is determined by the host name portion of the URL.
635 In the case that the @emph{file name} portion of the URL is non-empty (besides
636 the leading slash), this is interpreted as the user to finger.
639 Otherwise, the @emph{user} portion of the URL is interpreted as the user to finger.
642 If no user is provided, the root directory of the finger server is requested.
646 Thus @code{finger://user@@hostname} and @code{finger://hostname/user} are both equivalent.
648 (The precedence of the /user notation over the user@ notation reflects a
649 preference of the community.)
651 @node Customization, Command Index, Finger support, Top
652 @chapter Customization
654 Various parts of Elpher can be customized via the
655 variables belonging to the elpher customization group, accessible
659 @kbd{M-x customize-group elpher @key{RET}}
662 @noindent This group contains a number of faces that can be modified to change
663 the appearance of Elpher, including one face per menu item type.
665 The group also contains variables for customizing the behaviour of
666 Elpher. This includes how to open arbitrary (non-gopher) URLs, whether
667 to display buffer headers, how to deal with ANSI escape sequences in
668 text, the timeout to impose on network connections, and whether to
669 prompt for confirmation when switching away from TLS.
671 See the customization group itself for details.
673 @node Command Index, , Customization, Top
674 @unnumbered Command Index