Release to allow opening links in new buffer.
[elpher.git] / elpher.texi
1 \input texinfo @c -*-texinfo-*-
2
3 @setfilename elpher.info
4 @settitle Elpher Manual v3.4.0
5
6 @dircategory Emacs
7 @direntry
8 * Elpher: (elpher). A gopher and gemini client for Emacs.
9 @end direntry
10
11 @copying
12 This manual documents Elpher, a gopher and gemini client for Emacs.
13
14 Copyright @copyright{} 2019-2022  Tim Vaughan@*
15 Copyright @copyright{} 2021 Daniel Semyonov@*
16 Copyright @copyright{} 2021 Alex Schroeder
17
18 @quotation
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.
23
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 FITNESS 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.
28 @end quotation
29 @end copying
30
31 @titlepage
32 @title Elpher Gopher and Gemini Client Manual
33 @author Tim Vaughan
34
35 @page
36 @vskip 0pt plus 1filll
37 @insertcopying
38 @end titlepage
39
40 @contents
41
42 @ifnottex
43 @node Top, Introduction, (dir), (dir)
44 @top Elpher
45
46 @insertcopying
47
48 @menu
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 * Local files::                 Opening local files in elpher
59 * About pages::                 Special pages and how to reference them
60 * ANSI support::                Notes in Elpher's ANSI support
61 * Customization::               How to customize various aspects of Elpher
62 * Command Index::
63 * News::                        Changes introduced by major releases
64 * Contributors::                Contributors to Elpher
65
66 @detailmenu
67  --- The Detailed Node Listing ---
68
69 Navigation
70
71 * Within-page navigation::      Moving about within a page
72 * Between-page navigation::     Commands for moving between pages
73 * History and Caching::         Explanation of how Elpher represents history
74
75 @end detailmenu
76 @end menu
77
78 @end ifnottex
79
80 @macro keycmd{key,cmd}
81 @item \key\  (@code{\cmd\})
82 @findex \cmd\
83 @end macro
84
85 @node Introduction, Installation, Top, Top
86 @chapter Introduction
87
88 Elpher aims to be a capable and practical gopher and gemini client for
89 Emacs.  Its focus is on easy keyboard-driven navigation based on
90 sensible default bindings (with out-of-the-box support for Evil).  It is
91 intended to be robust and behave in non-surprising ways at all times.
92 Additionally, Elpher provides the following bells and whistles:
93
94 @itemize
95 @item
96 followable web and gopher links in plain text,
97
98 @item
99 an easily navigable history, sporting caching of visited pages (both
100 content and cursor position),
101
102 @item
103 auto-completing menu item navigation,
104
105 @item
106 direct visualization of image files where supported (no writing to
107 disk),
108
109 @item
110 basic support for the new ``heavier than gopher, lighter than the web'' Gemini protocol,
111
112 @item
113 support for the Finger protocol.
114
115 @end itemize
116
117 Elpher is still under active development.  Although we try very hard to
118 ensure that releases are bug-free, this cannot be guaranteed.  However,
119 this also means that any usability features that you feel are missing
120 can likely by incorporated quickly, so please get in touch if you
121 have some ideas.
122
123 @node Installation, Quick Start, Introduction, Top
124 @chapter Installation
125
126 @section Installing from ELPA or MELPA
127
128 Elpher is available on the non-GNU ELPA package archive.  If you are
129 using Emacs 28 or later, this archive should be available on your system
130 by default.  For Emacs 27, you'll need to follow the instructions at
131 @url{https://elpa.nongnu.org} to make the archive accessible.
132
133 Alternatively, Elpher is available from the MELPA package archive.  If you have
134 never installed packages from this repository before, you'll need
135 to follow the instructions at @url{https://melpa.org/#/getting-started}.
136
137 Once one of these package archives is installed, enter the following to
138 install Elpher:
139
140 @example
141 @kbd{M-x package-install @key{RET} elpher @key{RET}}
142 @end example
143
144 @noindent To uninstall, use
145
146 @example
147 @kbd{M-x package-delete @key{RET} elpher @key{RET}}.
148 @end example
149
150 @section Installing by hand
151
152 It is also possible to install Elpher directly by downloading the file
153 @file{elpher.el} from @url{gopher://thelambdalab.xyz/1/projects/elpher}
154 (you'll need to download the ``source archive'' and extract it), adding
155 it to a directory in your @code{load-path}, and then adding
156
157 @example
158 (require 'elpher)
159 @end example
160
161 @noindent to your Emacs initialization file.
162
163 @node Quick Start, Navigation, Installation, Top
164 @chapter Quick Start
165
166 Before diving into the minutiae of the different commands available,
167 we will quickly describe how to get up and running with Elpher.
168
169 Once installed, you can launch Elpher using
170
171 @example
172 @kbd{M-x elpher @key{RET}}
173 @end example
174
175 @noindent This will switch to the *Elpher* buffer and display a start
176 page, with information on each of the default keyboard bindings.
177
178 From here you can move point between links (which may be menu items or
179 inline URLs in text files) by using @key{TAB} and @kbd{S-@key{TAB}},
180 as in Info.  You can also jump directly to a menu item using @key{m}, or
181 use the standard Emacs or Evil motion and search commands to find your
182 way around.  To open a link, press @key{RET}.  (Where a mouse is
183 available, Clicking on a link with the mouse cursor has the same
184 effect.)
185
186 To return to the page you just followed the link from, press @key{u}.
187
188 Elpher caches (for the duration of an Emacs session) both page contents
189 and the position of point on each of the pages (gopher menus, gemini
190 pages, query results, or text pages) you visit, restoring these when you
191 next visit the same page.  Thus, pressing @key{u} displays the previous
192 page in exactly the same state as when you left, meaning that you can
193 quickly and visually explore the different documents in a menu without
194 having to wait for anything to reload.
195
196 Of course, sometimes you'll @emph{want} to reload the current page
197 rather than stick with the cached version.  To do this use @key{R}.
198 (This is particularly useful for search query results, where this
199 allows you to perform a different search.)
200
201 That's more-or-less it. Elpher supports a number of other features,
202 such a support for different coding schemes and TLS encryption, and a
203 variety of customization options, all of which are explained in the
204 rest of this document. However the emphasis is on keeping the basic
205 navigation experience as intuitive and responsive as possible.
206
207 Note that you can launch multiple Elpher sessions in parallel by using
208 a prefix:
209
210 @example
211 @kbd{C-u M-x elpher @key{RET}}
212 @end example
213
214 @node Navigation, Bookmarks, Quick Start, Top
215 @chapter Navigation
216 Throughout this manual, we use the word ``page'' to refer to any
217 visualization of a response from a gopher or gemini server, be it a
218 menu/directory, query result, text file or image.
219
220 Elpher's navigation interface is inspired by the Emacs Info mode.
221 Movement within a page is essentially the same as moving
222 around any other text file in Emacs, but with special keys
223 for quickly jumping between menu items and URLs in text files.
224 Movement between pages is facilitated by a simple linear history
225 coupled with caching of pages and cursor position.
226
227 @menu
228 * Within-page navigation::      Moving about within a page
229 * Between-page navigation::     Commands for moving between pages
230 * History and Caching::         Explanation of how Elpher represents history
231 @end menu
232
233
234 @node Within-page navigation, Between-page navigation, Navigation, Navigation
235 @section Within-page navigation
236
237 To move about within a page, you should be able use the same keys you usually
238 use to browse files in Emacs.  This is even true when Evil mode is
239 enabled. Paragraph hopping, searching etc should work as usual.
240
241 In addition, the following commands are provided for quickly moving between
242 links and menu items.
243
244 @table @asis
245 @keycmd{@key{TAB}, elpher-next-link}
246 Move to the next link or menu item in the file.
247
248 @item @kbd{Shift-@key{TAB}} or @key{BACKTAB} (@code{elpher-prev-link})
249 @findex elpher-prev-link
250 Move to the previous link or menu item in the file.
251
252 @keycmd{@key{m}, elpher-jump}
253 Jump directly to a link within a file by specifying its display string
254 or link text.  (Unlike the previous two commands, this immediately opens
255 the selected link.
256 @end table
257
258
259 The following commands can be used to retrieve information about the
260 current page, or the address of the link at point:
261
262 @table @asis
263 @keycmd{@key{i}, elpher-info-link}
264 Display host, port and selector information for the link at point.
265
266 @keycmd{@key{I}, elpher-info-current}
267 Display host, port and selector information for the current page.
268
269 @keycmd{@key{c}, elpher-copy-link-url}
270 Add URL representing address of link at point to the kill-ring and the
271 system clipboard (if available).
272
273 @keycmd{@key{C}, elpher-copy-current-url}
274 Add URL representing address of the current page to the kill-ring and
275 the system clipboard (if available).
276
277 @keycmd{@key{d}, elpher-download}
278 Download link at point and save the result as a file.  The minibuffer
279 will prompt for the name of the file to write, with the default name being
280 the display string (if available) associated with the link.
281
282 @keycmd{@key{D}, elpher-download-current}
283 This is similar to @code{elpher-download}, but instead applies to the
284 current page rather than a link.
285
286 @keycmd{@key{.}, elpher-view-raw}
287 This displays the raw server response for the current page.  While not
288 useful for general browsing, it is useful for debugging incorrect rendering
289 or out-of-spec server responses.
290 @end table
291
292 @node Between-page navigation, History and Caching, Within-page navigation, Navigation
293 @section Between-page navigation
294
295 Moving to a different page can be accomplished in several ways,
296 described by the following command:
297
298 @table @asis
299 @keycmd{@key{RET}\, @key{mouse-1}, elpher-follow-link}
300 Follow the menu item or link at point (or selected with the mouse).
301
302 Exactly what is meant by ``follow'' depends on the kind of item selected:
303
304 @itemize
305 @item
306 For text or menu type items or links, the current page text is replaced
307 by the text of this item.  Unless the customization variable
308 @code{elpher-use-header} (@pxref{Customization}) is 
309 @code{nil}, the display string of the link is displayed in the buffer header.
310 Links to images behave similarly on Emacs systems supporting the display of
311 bitmap graphics, however their content is not cached in memory by default.
312
313 @item
314 When followed, links to search/query items (type 7) prompt for input in
315 the minibuffer then display the results in the same way as for text and menu
316 items.
317
318 @item
319 Following links to binary files (and image files on unsupported systems)
320 causes Elpher to prompt for a filename in which to save the content.
321
322 @item
323 Following links of type `h' with a selector having the `URL:' prefix, or
324 unsupported URLs in text files, will result in Elpher using an external
325 programme to open the URL.  This will be either the default system browser
326 or, if the @code{elpher-open-urls-with-eww} customization variable is non-nil,
327 Emacs' own EWW browser. (See @pxref{Customization}.) 
328
329 @end itemize
330
331 Once a text, menu or query response page has been displayed, its contents are
332 cached for the duration of the Emacs session. 
333
334 @keycmd{@key{g}, elpher-go}
335 Open a particular page by specifying either its full URL or just
336 entering a gopher host name. (The protocol defaults to gopher, so gemini
337 links must include the @code{gemini://} prefix.
338
339 If a unsupported protocol is used in the URL the result will be the same
340 as following a URL link of the same type from a link in a page.
341
342 @keycmd{@key{o}, elpher-go-current}
343 Prompts for a URL similar to @code{elpher-go}, but initialized to the URL
344 of the current page.  This allows you to easily try other selectors for the
345 same server.
346
347 Remember however, that the Gopher RFC 1436 provides @emph{no} guarantees about the
348 structure of selectors.
349
350 @keycmd{@key{O}, elpher-root-dir}
351 Open the root page (empty selector) on the current host.
352
353 @keycmd{@key{u}\, @key{-}\, @key{^}\, @key{mouse-3}, elpher-back}
354 Return to the previous page, where ``previous'' means the page where the
355 page which was displayed immediately before the current page.
356 @end table
357
358
359 @node History and Caching,  , Between-page navigation, Navigation
360 @section History and Caching 
361
362 The history and caching strategy in Elpher is extremely simple, but
363 may be confusing without a good mental model of how it works.  That
364 is what this section attempts to provide.
365
366 Essentially, @strong{every} time you navigate to a new page, either
367 by clicking or pressing @key{RET} on a link, using @key{g} to jump
368 to a new page by its address, or using @key{O} to open the root selector,
369 the following two things occur:
370
371 @enumerate
372 @item
373 the cursor position and content for the original page are recorded in an
374 in-memory cache, and
375
376 @item
377 the original page is set as the ``parent'' of the new page.
378 @end enumerate
379
380 The only way to return to pages in this history is by using @key{u},
381 which returns to the previous of the current page.  @footnote{The
382 addition of the new page to the history happens even if the new page is
383 one that has been seen before. This is mostly the desired behaviour.
384 However, opening an explicit ``back'' link provided by a gopher menu or
385 gemini page will also add a new entry to the history.  Unless you
386 haven't yet visited that menu, it's therefore better to use @key{u} to
387 go back in this case.}
388
389 One aspect that may seem peculiar is that Elpher lacks a corresponding ``next'' or
390 ``forward'' command.  However, since Elpher caches the position of point,
391 this will be automatically positioned on the link that was most recently followed
392 from a given page.  This means that, at least for links followed from menus
393 and text files, the inverse of @key{u} is actually just @key{RET}.
394
395 Elpher actually maintains two histories, and there are two different
396 commands to access them:
397
398 @table @asis
399 @keycmd{@key{s}, elpher-show-history}
400 This shows the history of the current buffer. This shows all the links
401 you would visit if you were to use @key{u} again and again.
402
403 @keycmd{@key{S}, elpher-show-visited-pages}
404 This shows the entire Elpher browsing history. It includes all the
405 pages you visited in your current Emacs session.
406
407 @end table
408
409 @node Bookmarks, Gopher character encodings, Navigation, Top
410 @chapter Bookmarks
411
412 Elpher makes use of standard Emacs bookmarks.
413 @xref{Bookmarks, , , emacs, The Emacs Editor}.
414 The following commands are used to add new bookmarks:
415
416 @table @asis
417 @keycmd{@key{a}, elpher-bookmark-link}
418 Add a bookmark for the link at point.  The minibuffer will prompt for
419 a name for the bookmark, which defaults to the display string.
420
421 @keycmd{@key{A}, elpher-bookmark-current}
422 Add a bookmark for the current page.  The minibuffer will prompt for
423 a name for the bookmark, defaulting to the display string associated
424 with the link that was followed to reach the current page.
425
426
427 @keycmd{@key{B}, elpher-open-bookmarks}
428 Visit a page displaying all elpher bookmarks. 
429 The behaviour of the this function depends on the customization variable
430 @code{elpher-use-emacs-bookmark-menu}.  If nil (the default), the
431 command will visit a special elpher page listing all elpher-specific
432 bookmarks.  If non-nil, the command will simply open the standard Emacs
433 bookmark list displaying all current bookmarks (including non-elpher
434 bookmarks).
435
436 @keycmd{@kbd{C-x r l}, bookmark-bmenu-list}
437 This command opens the standard Emacs bookmark menu, with which bookmarks
438 can be renamed, deleted or annotated.
439
440 @end table
441
442 On opening the bookmarks page, elpher will offer to import any legacy
443 (2.x) bookmarks files into the new system. Once the import is complete,
444 the original bookmarks file will have ``-legacy'' appended to it, so
445 so that elpher knows not to import it again.
446
447 If you have any other legacy bookmark files (besides the one in the
448 original location, or specified in the @code{elpher-bookmarks-file}
449 customization variable, which should be automatically detected), you can
450 can import these using
451
452 @example
453 @kbd{M-x elpher-bookmark-import @key{RET}}
454 @end example
455
456 Once this is done, you may delete these legacy bookmarks files.
457
458 @node Gopher character encodings, Encrypted gopher connections, Bookmarks, Top
459 @chapter Gopher character encodings
460
461 Responses Elpher retrieves from servers are initially read as pure
462 binary data.  When the data is intended to be interpreted as textual (as
463 determined by the type parameter of the gopher menu item or the gopher
464 URL), this data needs to be @emph{decoded} into a sequence of
465 characters.  To do this properly requires knowledge of the encoding
466 system used by whoever authored the document.
467
468 Unfortunately gopher lacks a systematic way of acquiring this necessary
469 information. Thus, the details of the coding system must be either
470 inferred from the binary data, or must be specified by the user.
471
472 By default, Elpher applies Emacs' built-in character encoding detection
473 system to the full (undecoded) response data and uses this to attempt to
474 convert it into a character string.
475 (See @pxref{Recognize coding, Recognizing coding systems, ,emacs}.) While
476 this approach can be okay, it is important to realize that its inference
477 algorithm is extremely primitive and depends heavily on assumptions based
478 on the language settings of your emacs system.
479
480 The alternative is to explicitly set the coding system used for decoding
481 using the following command:
482
483 @table @asis
484 @keycmd{@key{!},elpher-set-coding-system}
485 Causes a elpher to prompt for a coding system to use for decoding
486 future gopher text.  The @key{TAB} key can be used at this prompt to display a
487 list of alternatives (which is extensive) and to auto-complete.  An empty
488 response will cause Elpher to return to its default auto-detection
489 behaviour.
490 @end table
491
492 Note that changing the coding system only affects newly loaded text.
493 Thus, if text has already been decoded using an incorrect system, you
494 will need to select the correct coding and then reload the text using
495 @key{R}.
496
497
498 @node Encrypted gopher connections, Gemini support, Gopher character encodings, Top
499 @chapter Encrypted gopher connections
500
501 While RFC 1436 does not broach the topic of encryption at all, several
502 modern gopher servers can serve content over encrypted connections,
503 and a common choice for this is TLS.
504
505 Elpher can retrieve selectors using Emacs' built-in TLS support which
506 uses the GnuTLS library. (It is possible to build emacs without
507 GnuTLS, in which case encryption is not supported.)
508
509 To retrieve documents using TLS, Elpher's TLS mode must be enabled.
510 This can be directly toggled using @key{T}, but note that just as with
511 the character encoding, changing this mode only affects subsequent
512 connections.
513
514 Alternatively, TLS mode is @emph{automatically} enabled whenever
515 gopher URLs starting with @code{gophers://} are followed.
516
517 The mode is sticky, so it remains active until switched off.
518 It can also be automatically switched off when a TLS connection fails.
519 In this case Elpher will prompt for your confirmation to ensure that
520 you can't accidentally make a non-TLS connection.
521
522 @node Gemini support, Finger support, Encrypted gopher connections, Top
523 @chapter Gemini support
524
525 @uref{gopher://gemini.circumlunar.space, Gemini}
526 is a new protocol being developed by several members of
527 gopherspace.  It aims to solve some of the long-standing technical
528 issues associated with gopher as a protocol, while keeping the major benefits.
529 For instance, it _requires_ encrypted connections, it does away with
530 the selector type, and allows servers to explicitly specify the
531 character coding scheme used for text documents.
532
533 The latest versions of Elpher aim to provide seamless transitions between
534 gemini and gopher documents.  Basically you should be able to open,
535 bookmark, download and otherwise interact with gemini pages in exactly
536 the same way as you do with other non-gemini pages.  The only major
537 difference from your perspective as a user is that you should no longer
538 have to worry about manually toggling TLS on or off (for gemini it's
539 always on), and you should never have to manually set a character coding
540 scheme.
541
542 The gemini protocol specification recommends a Trust on First Use (TOFU)
543 behaviour when validating gemini server TLS certificates.  This is
544 because many gemini servers rely on self-signed certificates rather
545 than certificates signed by a CA. Sadly however, this TOFU behaviour is
546 far from straight-forward to configure using Emacs' existing Network
547 Security Manager.  For this reason, elpher defaults to performing no
548 certificate verification by default.  This behaviour can be easily
549 customized by setting the @code{elpher-gemini-TLS-cert-checks}
550 customization variable to non-nil.
551
552 The gemini specification concerns both the protocol and a simple text
553 document format (mimetype text/gemini) which is like a mixture between
554 gophermap files and markdown-formatted files but simpler than both.
555 Elpher renders gemini responses which are provided in this format in
556 line with the rules in the spec.  This includes wrapping long lines at
557 word boundaries.  The specific column at which this text is wrapped is
558 defined by the customization variable
559 @code{elpher-gemini-max-fill-width}, which is set to 80 columns by
560 default. (This is slightly wider than Emacs' default fill width of 70
561 columns due to the fact that there are a significant amount of older
562 gemini content which, against the advice of the current spec, hard wraps
563 at <80 columns.  The larger default allows this to still look okay,
564 while still keeping content without hard wraps looking pleasant.)
565
566 The text/gemini format also possesses a section header syntax similar to
567 markdown.  Elpher allows different header levels to be drawn with
568 different, customizable, faces.  By default, on graphically-capable
569 emacs systems, these faces are given different heights to distinguish
570 among levels.  On terminal systems, the level is indicated by the
571 number of preceding # symbols.
572
573 I should emphasize however that, while it is definitely functional,
574 Elpher's gemini support is still experimental, and various aspects will
575 change as the protocol develops further.
576
577 @section Client Certificates for Gemini
578
579 Gemini makes explicit use of the client certificate mechanism that TLS
580 provides for allowing clients to authenticate themselves with servers.
581 The Gemini specification suggests two distinct classes of client
582 certificates: short-lived certificates used to identify you for a single
583 session, and more permanent certificates used to identify you over a
584 longer time period.
585
586 When Elpher receives a request for a client certificate from a server,
587 it will present you with the option to create and use a single-use
588 ``throwaway'' certificate, or to use a ``persistent''
589 certificate (optionally creating it or installing pre-existing key and
590 certificate files).
591
592 Certificate creation in Elpher requires an installation of OpenSSL, and
593 ---in particular---that Elpher be able to run the @command{openssl} command-line
594 utility.  By default, Elpher assumes that the @command{openssl} is on the
595 system path, but the precise location can be set by customizing the
596 @code{elpher-openssl-command} variable.
597
598 Each generated certificate results in the creation of a .key file and
599 a .crt file.  In the case of a throwaway certificate, these files are
600 stored in the temporary directory indicated by the Emacs variable
601 @code{temporary-file-directory} and are deleted when ``forgotten''
602 (as described below).
603
604 In the case of persistent certificates, these files are stored in the
605 folder defined by the Elpher variable
606 @code{elpher-certificate-directory}, and are never deleted by Elpher.
607 (Of course you can delete them yourself whenever you like.)
608 The base name of the files (i.e. sans extension) is what Elpher uses
609 to identify the certificate.
610
611 Using throwaway certificates is as simple as pressing the @key{t} 
612 key at the prompt which appears following a certificate request from
613 a server.  There is nothing more to do.
614
615 Using a persistent certificate requires instead selecting @key{p} from the same
616 menu.  This will result in Elpher asking you for the name identifying
617 the certificate.  This entry autocompletes to the list of known certificate
618 names, so you can use @key{TAB} to display the list.
619
620 In the case that you choose a name that does not belong to the list of
621 known certificates, Elpher will offer to create one for you or to
622 ``install'' one from existing key and certificate files.
623 Pressing the @key{n} key will cause Elpher to begin the process of
624 creating a new persistent certificate, using some additional
625 details for which you will be prompted.
626 Alternatively, pressing the @key{i} key will cause Elpher to ask for the
627 locations of existing key and certificate files to add to
628 @code{elpher-certificate-directory} under the chosen name.
629
630 Once a certificate is selected, it will be used for all subsequent TLS
631 transactions to the host for which the certificate was created.
632 It is immediately ``forgotten'' when a TLS connection to another host
633 is attempted, or the following command is issued:
634
635 @table @asis
636 @keycmd{@key{F},elpher-forget-certificate}
637 Causes Elpher to immediately forget any currently-loaded client certificate.
638 @end table
639
640 In either case, ``forgetting'' means that the details of the key and
641 certificate file pair are erased from memory.  Furthermore, in the case
642 of throw-away certificates, the corresponding files are deleted.
643
644 @section Hiding preformatted text in text/gemini documents
645
646 Preformatted text is often used to display ``ASCII art'' or other
647 similar text-based artwork.  While for many this is a fun way to
648 introduce personality into their gemini documents, such text can
649 pose difficulties for screen readers.
650
651 Setting the @code{elpher-gemini-hide-preformatted} customization option
652 to non-nil causes Elpher to hide all preformatted text blocks by
653 default.  In place of the preformatted text, Elpher instead displays the
654 ``alt text'' (if any is available), along with a button which can be
655 used to make specific blocks visible as required.
656
657 Other related customization options are
658 @code{elpher-gemini-preformatted-toggle-label}, which is the label used
659 for the toggle button, and
660 @code{elpher-gemini-preformatted-toggle-bullet}, which is the margin
661 string used to distinguish the line replacing the preformatted text.
662
663 @node Finger support, Local files, Gemini support, Top
664 @chapter Finger support
665
666 Incidentally, Elpher has native support for querying finger servers.
667 Of course, one could argue that this functionality is more easily
668 provided by one's local telnet client.  However finger URLs do appear
669 on occasion in gopherspace, and it's nice to be able to open them
670 in place.
671
672 Elpher interprets @code{finger://} URLs as follows:
673
674 @itemize
675
676 @item
677 The host is determined by the host name portion of the URL.
678
679 @item
680 In the case that the @emph{file name} portion of the URL is non-empty (besides
681 the leading slash), this is interpreted as the user to finger.
682
683 @item
684 Otherwise, the @emph{user} portion of the URL is interpreted as the user to finger.
685
686 @item
687 If no user is provided, the root directory of the finger server is requested.
688
689 @end itemize
690
691 Thus @code{finger://user@@hostname} and @code{finger://hostname/user} are both equivalent.
692
693 (The precedence of the /user notation over the user@ notation reflects a
694 preference of the community.)
695
696 @node Local files, About pages, Finger support, Top
697 @chapter Local files
698
699 Elpher supports opening local files via @samp{file:} URLs.
700
701 For instance, pressing @key{g} and entering @code{file:~/document.gmi}
702 will load the file named @samp{document.gmi} in your home directory,
703 provided this file exists.
704
705 Files opened in this way are rendered according to their name, and in
706 particular their extension.  The current mappings are as follows:
707
708 @table @asis
709
710 @item @samp{txt}
711
712 Plain text documents.  All local text files are assumed to be
713 UTF-8-encoded.
714
715 @item @samp{gophermap},@samp{gopher}
716
717 Gophermap files, i.e. files containing a valid directory list as specified
718 by RFC 1436.
719
720 @item @samp{gemini},@samp{gmi}
721
722 Gemini documents (i.e. documents of MIME type ``text/gemini'').  All
723 local gemini files are assumed to be UTF-8-encoded.
724
725 @item @samp{html},@samp{htm}
726
727 HTML documents.  All local HTML files are assumed to be UTF-8-encoded.
728
729 @item @samp{png},@samp{jpg},@samp{jpeg},@samp{gif},@samp{bmp},@samp{tif},@samp{tiff}
730
731 Image files.
732
733 @item Anything else
734 A binary document, which elpher will simply offer to save somewhere
735 else. (Obviously this is not useful in its own right, but there's not
736 much that elpher can sensibly do with unknown binary files.)
737
738 @end table
739
740
741 @node About pages, ANSI support, Local files, Top
742 @chapter About pages
743
744 Like other browsers, elpher makes certain internally-generated pages
745 such as the initial welcome page, the bookmarks page, the history
746 stack and the list of visited pages pages accessible as URLs with
747 the ``about:'' type.
748
749 This means that these pages can be bookmarked and, more usefully,
750 added to a local file to be rendered as a user-defined start page.
751
752 To see the address of a special page, simply visit the page and
753 press @key{I}.
754
755 @node ANSI support, Customization, About pages, Top
756 @chapter ANSI support
757
758 Depending on which parts of the gopher/gemini universe you frequent,
759 you may occasionally stumble on sites which use ANSI escape codes to
760 either produce specific characters or to colour text.
761
762 By default, elpher uses Emacs' built-in ANSI rendering library,
763 @samp{ansi-color}, to process ANSI codes.  This robustly interprets
764 the escape codes but only supports 8 colours.  Any colours unsupported
765 by the library are simply stripped, leaving uncoloured text in the
766 majority of cases.
767
768 To drastically improve the number of colours produced, install the
769 @samp{xterm-color} package from MELPA.  This package will be automatically
770 used by elpher if it is available, and supports 256 colours.
771 This should be sufficient to properly render many ANSI colour
772 gopher holes and gemini capsules quite nicely.
773
774 In case you prefer to completely strip out the ANSI escape codes entirely
775 by customizing the @code{elpher-filter-ansi-from-text} variable.
776
777
778 @node Customization, Command Index, ANSI support, Top
779 @chapter Customization
780
781 Various parts of Elpher can be customized via the 
782 variables belonging to the elpher customization group, accessible
783 using
784
785 @example
786 @kbd{M-x customize-group elpher @key{RET}}
787 @end example
788
789 @noindent This group contains a number of faces that can be modified to change
790 the appearance of Elpher, including one face per menu item type.
791
792 The group also contains variables for customizing the behaviour of
793 Elpher.  This includes how to open arbitrary (non-gopher) URLs, whether
794 to display buffer headers, how to deal with ANSI escape sequences in
795 text, the timeout to impose on network connections, and whether to
796 prompt for confirmation when switching away from TLS.
797
798 One particularly important customization is the @code{elpher-start-page-url}
799 variable, which holds the URL of the page displayed initially when
800 elpher starts, and when @key{U} is pressed.  By default this is set to
801 @samp{about:welcome}, but any URL can be substituted.  For example, you
802 might want to create a text/gemini file named
803 @samp{~/.emacs/start-page.gmi} containing useful links and set the value
804 of @code{elpher-start-page-url} to @samp{file:~/.emacs/start-page.gmi} to have
805 these links displayed at startup.  Alternatively, you might prefer
806 to set the value to @samp{about:bookmarks} so that the bookmarks page
807 is used as the start page instead.
808
809 See the customization group itself for details.
810
811 @node Command Index, News, Customization, Top
812 @unnumbered Command Index
813
814 @printindex fn
815
816 @node News, Contributors, Command Index, Top
817 @chapter News
818
819 This chapter documents the major changes introduced by Elpher releases.
820
821 @section v3.4.0
822
823 @subsection Toggling preformatted text visibility
824
825 This version introduces the ability to hide preformatted text in
826 text/gemini documents by default.  To enable this, set the customization
827 variable @code{elpher-gemini-hide-preformatted} to non-nil.  This causes
828 all preformated text blocks to be replaced with their ``alt-text'' (if
829 any is available) and a button for toggling the visibility of the text
830 block.
831
832 This feature is intended to make it easier for people using screen
833 readers to read text/gemini documents.
834
835 @section v3.3.0
836
837 This version includes lots of bug fixes, as well as a couple of new
838 features.
839
840 @subsection Local gophermaps
841
842 Local gophermaps can now be displayed using @samp{file:}. To render
843 correctly, they must have the suffix @samp{.gopher} or @samp{.gophermap}.
844
845 @subsection IRI support
846
847 Internationalized Resource Identifiers (IRI) are an extension of URLs
848 (or, more accurately, URIs) to support a larger set of characters beyond
849 those in the US-ASCII character set.  They map directly onto URIs for
850 backwards compatibility, but look like gibberish if not properly
851 decoded.  When displaying URLs, Elpher now automatically decodes any IRI
852 characters and displays the decoded IRI.  (For security reasons, the
853 @code{elpher-info-current} command (@kbd{I}) always displays both the
854 decoded IRI and the URI when they differ.)
855
856 @section v3.2.0
857
858 This version introduces several minor changes which, together, make it
859 possible to set up alternative start pages configured to your liking.
860
861 @subsection About pages
862
863 Special elpher pages such as the welcome page (previously ``start''
864 page), the bookmarks page, the browsing history stack and list of
865 visited pages are now addressable via @samp{about:} URLs.  For instance,
866 the standard welcome page has the address @samp{about:welcome}.
867
868 @subsection Local files
869
870 Local files can now be opened in elpher using @samp{file:} URLs. For
871 example, @kbd{g @samp{file:~/my-start.gmi}} will open
872 @samp{~/my-start.gmi} as a text/gemini document. @pxref{Local files}
873 for details.
874
875 @subsection Customizable start pages
876
877 The new customization variable @code{elpher-start-page-url} contains the URL
878 of the document to be loaded as elpher's ``start page''.  By default
879 this is set to @samp{about:welcome}, but any elpher-accessible URL is
880 valid. @pxref{Customization} for suggestions.
881
882 @section v3.1.0
883
884 @subsection Bookmarks system
885
886 While Elpher bookmarks are still handled by the Emacs bookmark
887 system, this release introduces the option to retain the
888 original elpher bookmark page for the purpose of visiting those
889 bookmarks.  In v3.1.0, @key{B} visits this page (and adds it to
890 the history stack, as in previous versions), which can be interacted
891 with using the standard elpher key bindings.
892
893 Of course you can still view the bookmarks in the Emacs bookmark
894 menu, which you can access from anywhere using the default
895 binding @kbd{C-x r l} (or by following the link from the Elpher bookmarks
896 page).  Indeed you will need to use this to rename, delete or otherwise
897 edit your bookmarks.
898
899 If you prefer to avoid using the Elpher bookmark page entirely, you
900 use the customization variable @code{elpher-use-emacs-bookmark-menu}
901 to have the @key{B} key open the Emacs bookmark menu directly, as in
902 the previous release.
903
904 @section v3.0.0
905
906 @subsection Bookmarks system
907
908 Bookmarks are now handled by Emacs' own bookmark management system,
909 instead of Elpher's own system.
910 (For details, @xref{Bookmarks, , , emacs, The Emacs Editor}.)
911 This means two things.  Firstly,
912 the bookmarks file (elpher-bookmarks by default) and format used by
913 previous versions are now deprecated.  If these are detected, Elpher
914 will offer to import your old bookmarks when you first accessing the
915 bookmark list with the new version.  A suffix will be added to your
916 old bookmarks file so that Elpher knows that the import is complete.
917
918 Secondly, the old Elpher bookmark menu has been removed in the new
919 version.  Instead, @key{B} brings up the menu provided by the Emacs
920 function @code{bookmark-bmenu-list}. This has different key and mouse
921 bindings to Elpher's old menu, but is much more functional.  Bookmarks
922 can be renamed, deleted in groups, and much more.  (Use @kbd{C-h m} with
923 the menu open to see the complete list.)
924
925 @subsection History
926
927 Browsing history can now be accessed via new bindings to @key{s} and @key{S}.
928 The former shows the current history ``stack'' (pages accessible with
929 the @key{u} key), while the latter shows a list of all pages which have
930 been visited in the current session.
931
932 @subsection Socks connections
933
934 Elpher can now use socks connections to browse via TOR.
935
936 @subsection browse-url, Org and mu4e integration
937
938 These integrations provide support for elpher-handling of gemini, gopher
939 and finger URLs using @code{browse-url}, in Org documents, and the mu4e
940 mail system.
941
942 @subsection imenu integration
943
944 Gemini document headers are now navigable via imenu.
945 For details, @xref{Imenu, , , emacs, The Emacs Editor}.
946
947 @node Contributors,  , News, Top
948 @chapter Contributors
949
950 Elpher was originally written and is currently maintained by Tim Vaughan
951 @email{plugd@@thelambdalab.xyz}.  Significant improvements and
952 maintenance have also been contributed by and with the help of Alex
953 Schroeder @email{alex@@gnu.org}.  In addition, the following people have
954 all generously provided assistance and/or patches:
955
956 @itemize
957 @item Jens Östlund @email{jostlund@@gmail.com}
958 @item F. Jason Park @email{jp@@neverwas.me}
959 @item Christopher Brannon @email{chris@@the-brannons.com}
960 @item Omar Polo @email{op@@omarpolo.com}
961 @item Noodles! @email{nnoodle@@chiru.no}
962 @item Abhiseck Paira @email{abhiseckpaira@@disroot.org}
963 @item Zhiwei Chen @email{chenzhiwei03@@kuaishou.com}
964 @item condy0919 @email{condy0919@@gmail.com}
965 @item Alexis @email{flexibeast@@gmail.com}
966 @item Étienne Deparis @email{etienne@@depar.is}
967 @item Simon Nicolussi @email{sinic@@sinic.name}
968 @item Michel Alexandre Salim @email{michel@@michel-slm.name}
969 @item Koushk Roy @email{kroy@@twilio.com}
970 @item Vee @email{vee@@vnsf.xyz}
971 @item Simon South @email{simon@@simonsouth.net}
972 @item Daniel Semyonov @email{daniel@@dsemy.com}
973 @item Bradley Thornton @email{bradley@@northtech.us}
974 @end itemize
975
976 @bye