Added history+caching and bookmarks chapters.
[elpher.git] / elpher.texi
1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename elpher.info
4 @settitle Elpher Manual v1.0.0
5 @c %**end of header
6
7 @copying
8 This manual documents Elpher, a gopher client for Emacs.
9
10 Copyright @copyright{} 2019 Tim Vaughan
11
12 @quotation
13 The source and documentation of Elpher is free software.  You can
14 redistribute it and/or modify it under the terms of the GNU General
15 Public License as published by the Free Software Foundation; either
16 version 3, or (at your option) any later version.
17
18 Elpher is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNElpher FOR A PARTICULAR PURPOSE. See the GNU General Public License in
21 the file COPYING in the same directory as this file for more details.
22 @end quotation
23 @end copying
24
25 @titlepage
26 @title Elpher Gopher Client Manual
27 @author Tim Vaughan
28
29 @page
30 @vskip 0pt plus 1filll
31 @insertcopying
32 @end titlepage
33
34 @contents
35
36 @ifnottex
37 @node Top, Introduction, (dir), (dir)
38 @top Elpher
39
40 @insertcopying
41 @end ifnottex
42
43 @menu
44 * Introduction::                Elpher Overview: what's this all about?
45 * Installation::                Installing Elpher
46 * Quick Start::                 Get up and running quickly
47 * Navigation::                  Fundamentals of Elpher navigation
48 * Bookmarks::                   How to record and visit bookmarks
49 * Character encodings::         How Elpher handles different character encodings
50 * Encrypted connections::       How and when TLS is enabled
51 * Customization::               How to customize various aspects of Elpher
52 * Index::
53 @end menu
54
55 @node Introduction, Installation, Top, Top
56 @chapter Introduction
57
58 Elpher aims to be a capable and practical gopher client for Emacs.  Its
59 focus is on easy keyboard-driven navigation based on sensible default
60 bindings (with out-of-the-box support for Evil).  It is intended to be
61 robust and behave in non-surprising ways at all times.  Additionally,
62 Elpher provides the following bells and whistles:
63
64 @itemize
65 @item
66 an easily navigable history, sporting caching of visited pages (both
67 content and cursor position),
68
69 @item
70 auto-completing menu item navigation,
71
72 @item
73 followable web and gopher links in plain text,
74
75 @item
76 direct visualization of image files where supported (no writing to
77 disk), and
78
79 @item
80 a simple bookmark management system.
81 @end itemize
82
83 Elpher is still under active development.  Although we try very hard to
84 ensure that releases are bug-free, this cannot be guaranteed.  However,
85 this also means that any usability features that you feel are missing
86 can likely by incoroporated quickly, so please get in touch if you
87 have some ideas.
88
89 @node Installation, Quick Start, Introduction, Top
90 @chapter Installation
91
92 Elpher is available from the MELPA package repository.  If you have
93 never installed packages from this repository before, you'll need
94 to follow the instructions at @url{https://melpa.org/#/getting-started}.
95
96 @noindent To install Elpher, enter the following:
97
98 @example
99 @kbd{M-x package-install @key{RET} elpher @key{RET}}
100 @end example
101
102 @noindent To uninstall, use
103
104 @example
105 @kbd{M-x package-delete @key{RET} elpher @key{RET}}.
106 @end example
107
108 While not recommended, it is also possible to install Elpher directly by
109 downloading the file @file{elpher.el} from
110 @url{https://github.com/tgvaughan/elpher}, adding it to a directory in
111 your @code{load-path}, and then adding
112
113 @example
114 (require 'elpher)
115 @end example
116
117 @noindent to your Emacs initialization file.
118
119 @node Quick Start, Navigation, Installation, Top
120 @chapter Quick Start
121
122 Before diving into the minutiae of the different commands available,
123 we will quickly describe how to get up and running with Elpher.
124
125 Once installed, you can launch Elpher using
126
127 @example
128 @kbd{M-x elpher @key{RET}}
129 @end example
130
131 @noindent This will switch to the *Elpher* buffer and display a start
132 page, with information on each of the default keyboard bindings.
133
134 From here you can move point between links (which may be menu items or
135 inline URLs in text files) by using @key{TAB} and @kbd{S-@key{TAB}},
136 as in Info.  You can also jump directly to a menu item using @key{m}, or
137 use the standard Emacs or Evil motion and search commands to find your
138 way around.  To open a link, press @key{RET}.  (Where a mouse is
139 available, Clicking on a link with the mouse cursor has the same
140 effect.)
141
142 To return to the page you just followed the link from, press @key{u}.
143
144 Elpher caches (for the duration of an Emacs session) both page contents
145 and the position of point on each of the pages (gopher menus, query
146 results, or text pages) you visit, restoring these when you next visit
147 the same page.  Thus, pressing @key{u} displays the previous page in
148 exactly the same state as when you left, meaning that you can quickly
149 and visually explore the different documents in a menu without having to
150 wait for anything to reload.
151
152 Of course, sometimes you'll @emph{want} to reload the current page
153 rather than stick with the cached version.  To do this use @key{R}.
154 (This is particularly useful for search query results, where this
155 allows you to perform a different search.)
156
157 That's more-or-less it. Elpher supports a number of other features, such
158 as bookmarking, support for different coding schemes and TLS encryption,
159 and a variety of customization options, all of which are explained in
160 the rest of this document.  However the emphasis is on keeping the basic
161 navigation experience as intuitive and responsive as possible.
162
163 @node Navigation, Bookmarks, Quick Start, Top
164 @chapter Navigation
165 by 
166 Throughout this manual, we use the word ``page'' to refer to any
167 visualization of a response from a gopher server, be it a
168 menu/directory, query result, text file or image.  We use
169
170 Elpher's navigation interface is inspired by the Emacs Info mode.
171 Movement within a page is essentially the same as moving
172 around any other text file in Emacs, but with special keys
173 for quickly jumping between menu items and URLs in text files.
174 Movement between pages is facilitated by a simple linear history
175 coupled with caching of pages and cursor position.
176
177 @menu
178 * Within-page navigation::      Moving about within a page
179 * Between-page navigation::     Commands for moving between pages
180 * History and Caching::         Explanation of how Elpher represents history
181 @end menu
182
183
184 @node Within-page navigation, Between-page navigation, Navigation, Navigation
185 @section Within-page navigation
186
187 To move about within a page, you should be able use the same keys you usually
188 use to browse files in Emacs.  This is even true when Evil mode is
189 enabled. Paragraph hopping, searching etc should work as usual.
190
191 In addition, the following commands are provided for quickly moving between
192 links and menu items.
193
194 @table @asis
195 @item @key{TAB}  (@code{elpher-next-link})
196 Move to the next link or menu item in the file.
197
198 @item @kbd{Shift-@key{TAB}}/@key{backtab}  (@code{elpher-prev-link})
199 Move to the previous link or menu item in the file.
200
201 @item @kbd{m}  (@code{elpher-jump})
202 Jump directly to a link within a file by specifying its display string
203 or link text.  (Unlike the previous two commands, this immediately opens
204 the selected link.
205 @end table
206
207 The following commands can be used to retrieve information about the
208 current page, or the address of the link at point:
209
210 @table @asis
211 @item @kbd{i}  (@code{elpher-info-link})
212 Display host, port and selector information for the link at point.
213
214 @item @kbd{I}  (@code{elpher-info-current})
215 Display host, port and selector information for the current page.
216
217 @item @kbd{c}  (@code{elpher-copy-link-url})
218 Add URL representing address of link at point to the kill-ring and the
219 system clipboard (if available).
220
221 @item @kbd{C}  (@code{elpher-copy-current-url})
222 Add URL representing address of the current page to the kill-ring and
223 the system clipboard (if available).
224
225 @item @kbd{d}  (@code{elpher-download})
226 Download link at point and save the result as a file.  The minibuffer
227 will prompt for the name of the file to write, with the default name being
228 the display string (if available) associated with the link.
229
230 @item @kbd{D}  (@code{elpher-download-current})
231 This is similar to @code{elpher-downlowd}, but instead applies to the
232 current page rather than a link.
233
234 @item @kbd{w} (@code{elpher-view-raw})
235 This displays the raw server response for the current page.  While not
236 useful for general browsing, it is useful for debugging incorrect rendering
237 or out-of-spec server responses.
238 @end table
239
240 @node Between-page navigation, History and Caching, Within-page navigation, Navigation
241 @section Between-page navigation
242
243 Moving to a different page can be accomplished in several ways,
244 described by the following command:
245
246 @table @asis
247 @item @kbd{RET}, @kbd{mouse-1}  (@code{elpher-follow-link})
248 Follow the menu item or link at point (or selected with the mouse).
249
250 Exactly what is meant by ``follow'' depends on the kind of item selected:
251
252 @itemize
253 @item
254 For text or menu type items or links, the curent page text is replaced
255 by the text of this item.  Unless the customization variable
256 @code{elpher-use-header} (@pxref{Customization}) is 
257 @code{nil}, the display string of the link is displayed in the buffer header.
258 Links to images behave similarly on Emacs systems supporting the display of
259 bitmap graphics, however their content is not cached in memory by default.
260
261 @item
262 When followed, links to search/query items (type 7) prompt for input in
263 the minibuffer then display the results in the same way as for text and menu
264 items.
265
266 @item
267 Following links to binary files (and image files on unsupported systems)
268 causes Elpher to prompt for a filename in which to save the content.
269
270 @item
271 Following links of type `h' with a selector having the `URL:' prefix, or
272 non-gopher URLs in text files, will result in Elpher using an external
273 programme to open the URL.  This will be either the default system browser
274 or, if the @code{elpher-open-urls-with-eww} customization variable is non-nil,
275 Emacs' own EWW browser. (See @pxref{Customization}.) 
276
277 @end itemize
278
279 Once a text, menu or query response page has been displayed, its contents are
280 cached for the duration of the Emacs session. 
281
282 @item @kbd{g}  (@code{elpher-go})
283 Open a particular page by specifying either its URL or directly entering
284 a host, port and selector.
285
286 Note that if a non-gopher protocol is used in the URL the result will be 
287 the same as following a URL link of the same type from a gopher menu.
288
289 @item @kbd{O}  (@code{elpher-root-dir})
290 Open the root page (empty selector) on the current host.
291
292 @item @kbd{u}  (@code{elpher-back})
293 Return to the previous page, where ``previous'' means the page where the
294 page which was displayed immediately before the current page.
295 @end table
296
297 @node History and Caching,  , Between-page navigation, Navigation
298 @section History and Caching 
299
300 The history and caching strategy in Elpher is extremely simple, but
301 may be confusing without a good mental model of how it works.  That
302 is what this section attempts to provide.
303
304 Essentially, @strong{every} time you navigate to a new page, either
305 by clicking or pressing @key{RET} on a link, using @key{g} to jump
306 to a new page by its address, or using @key{O} to open the root selector,
307 the following two things occur:
308
309 @enumerate
310 @item
311 the cursor position and content for the original page are recorded in an
312 in-memory cache, and
313
314 @item
315 the original page is set as the ``parent'' of the new page.
316 @end enumerate
317
318 The only way to return to pages in this history is by using @key{u},
319 which returns to the previous of the current page.
320 @footnote{The addition of the new page to the history happens even if
321 the new page is one that has been seen before. This is mostly the
322 desired behaviour.  However, opening an explicit ``back'' link provided
323 by a gopher menu will also add a new entry to the history.  Unless you
324 haven't yet visited that menu, it's therefore better to use @key{u} to
325 go back in this case.}
326
327 One aspect that may seem peculiar is that Elpher lacks a corresponding ``next'' or
328 ``forward'' command.  However, since Elpher caches the position of point,
329 this will be automatically positioned on the link that was most recently followed
330 from a given page.  This means that, at least for links followed from menus
331 and text files, the inverse of @key{u} is actually just @key{RET}.
332
333 @node Bookmarks, Character encodings, Navigation, Top
334 @chapter Bookmarks
335
336 Elpher has a very simple link bookmarking system involving the
337 following commands:
338
339 @table @asis
340 @item @key{a}  (@code{elpher-bookmark-link})
341 Add a bookmark for the link at point.  The minibuffer will prompt for
342 a name for the bookmark, which defaults to the display string.
343
344 @item @key{A}  (@code{elpher-bookmark-current})
345 Add a bookmark for the current page.  The minibuffer will prompt for
346 a name for the bookmark, defaulting to the display string associated
347 with the link that was followed to reach the current page.
348
349 @item @key{x}  (@code{elpher-unbookmark-link})
350 Immediately remove the bookmark (if one exists) to the link at point.
351
352 @item @key{X}  (@code{elpher-unbookmark-current})
353 Immediately remove the bookmark (if one exists) to the current page.
354
355 @item @key{B}  (@code{elpher-bookmarks})
356 Open a page displaying all current bookmarks.  Note that this bookmark
357 page is added to the history just as if you had opened it using a link.
358 Thus to return to the previous page, use @kbd{u}.  This also means
359 that you can peruse the various bookmarks by visiting them in turn, 
360 using @kbd{u} to return to the bookmark page (where the position of point
361 is cached), then moving to another bookmarked link and so on.
362 @end table
363
364 Bookmarks are stored as a s-exp in the file @file{elpher-bookmarks}
365 in the user emacs directory (usually @file{~/.emacs.d/}).
366 Any command which modifies the list of bookmarks immediately updates
367 this file.
368
369 @node Character encodings, Encrypted connections, Bookmarks, Top
370 @chapter Character encodings
371
372 @node Encrypted connections, Customization, Character encodings, Top
373 @chapter Encrypted connections
374
375 @node Customization, Index, Encrypted connections, Top
376 @chapter Customization
377
378 @node Index,  , Customization, Top
379 @unnumbered Index
380
381 @printindex cp
382
383 @bye