Release to allow opening links in new buffer.
[elpher.git] / ISSUES.org
1 #+TITLE: Issues and Dev Notes
2 #+TODO: OPEN(o!) | CLOSED(c!) INVALID(i@)
3 #+STARTUP: logdrawer
4
5 * Open Bugs
6
7 ** OPEN Sanitize certificate names
8    :LOGBOOK:
9    - State "OPEN"       from              [2020-06-22 Mon 10:32]
10    :END:
11    
12 Currently things will break in undefined ways if a name is specified
13 that contains path separators and probably other characters that I
14 haven't thought of.  This is dangerously unacceptable and needs to be
15 fixed right away.
16
17 ** OPEN Set timer after creating network process
18
19 While the current order is necessary for synchronous socks
20 connections, it is unecessary for regular connections which have the
21 no-wait flag set.  Furthermore, for these connections, having the
22 timer fire up early means that it interferes with requests for
23 user interaction that may appear during the initial connection setup.
24 E.g., asking for approval of uknown TLS certificates.
25
26 * Closed Bugs
27
28 ** CLOSED Downloads failing
29 :LOGBOOK:
30 - State "CLOSED"     from "OPEN"       [2022-08-09 Tue 10:38]
31 :END:
32
33 Downloads fail when focus is shifted away from
34 the elpher buffer before the download has completed.
35
36 ** CLOSED Relative Gemini links processed improperly
37 :LOGBOOK:
38 - State "CLOSED"     from "OPEN"       [2021-08-04 Wed 15:54]
39 - State "OPEN"       from              [2021-08-04 Wed 13:53]
40 :END:
41
42 Skyjake's gemlog at gemini://skyjake.fi/gemlog/ demonstrate's the
43 issue.  The link back to the root selector in the footer of that page
44 is a relative link to the parent directory, i.e. "..".  For some
45 reason elpher combines this with the current URL and produces
46 "gemini://skyjake.fi" as the destination of the link.  Such URLs
47 (i.e. without a filename) are allowed as input, but are assumed
48 to not appear internally.
49
50 To see why the internal distinction is important, consider a page
51 where the current URL is gemini://example.com/a_page.  The current
52 directory in this case is "/", meaning a relative link to
53 "another_page" results in a destination link of
54 "gemini://example.com/another_page.  On the other hand, if the current
55 URL is gemini://example.com/a_page/, the same relative link is
56 interpreted as refering to gemini://example.com/a_page/another_page.
57
58 The fix will be to ensure gemini://skyjake.fi/gemlog/.. collapses to
59 gemini://skyjake.fi/ rather than gemini://skyjake.fi.
60
61
62   
63 ** CLOSED Org mode faces are not present in recent emacs versions
64 Even 26.1 doesn't seem to have these.  This means that, for many
65 users, elpher doesn't show any difference between any of the
66 item types.  Not a major problem at all, but the faces we inherit
67 from should definitely be ones which have been present for much
68 longer.  Perhaps the font lock mode faces are the way to go after
69 all.
70
71 Update: changed all default faces to inherit from font-lock and basic faces.
72
73 ** CLOSED URL-centric addressing breaks bookmark file compatibility
74    
75 Need a way to allow people to rescue their old bookmark files
76 following this update.
77
78 ** CLOSED History loops <2019-11-08 Fri>
79
80 Occasionally elpher gets stuck in a "history loop" where a
81 node is its own grandparent.  Obviously this sucks, as history
82 is elpher's main mechanism for making gopherspace exploration
83 painless.
84
85 I suspect the problem is in either ~elpher-visit-node~ or
86 ~elpher-visit-parent~.
87
88 Follow-up: this has been fixed by the new stack-based history system
89 in 2.5.
90
91
92 ** CLOSED Redirects do not rewrite current address
93
94 This is a bug, as gemini://blah.com/hi may get redirected
95 to gemini://blah.com/hi/, at which point link lines
96 of the form "=> there" should be interpreted as pointing
97 at gemini://blah.com/hi/there, while currently they are
98 interpreted as pointing at gemini://blah.com/there.
99
100 ** CLOSED History inconsistency when restarting elpher <2020-05-26 Tue>
101
102 To reproduce:
103 1. open elpher and follow a few links until you're a handful of links below
104    the start page.
105 2. kill the elpher buffer with C-x k
106 3. Open elpher again, which will show the start page.
107 4. Press 'u' to go up.  Elpher wiill respond stating that there is no previous page.
108 5. Press 'u' again. Elpher will then jump to the page that was open when
109    the buffer was originally killed.
110
111 Expected behaviour: elpher should be once again at the bottom of the history
112 stack and should not remember the previous history.
113
114 Observed behaviour: elpher _does_ remember the previous history.
115
116 *** update <2020-05-27 Wed>
117 Turns out this was just because the `elpher` function was merely setting
118 the `elpher-current-page` variable to nil, then using `elpher-visit-page`
119 to visit the start page, resulting in the nil being pushed onto the existing
120 history stack.  Because `elpher-visit-previous-page` always trys to pop from
121 this stack and tests whether the result is nil (which it is when the stack is empty),
122 the first "u" would result in the "no previous page" message but would still
123 pop the stack, meaning that subsequent "u" commands would succeed.
124
125 The fix is just to zero out the history list in the `elpher` function just as
126 `elpher-current-page` is cleared.
127
128 * Open Enhancements
129
130 ** OPEN Allow multiple elpher buffers [33%]
131
132    Shouldn't be too hard, just need elpher-current-node to be
133 buffer-local and allow various buffer-switching procedures to
134 do something sensible.
135
136 Here are the things that need to be implemented before
137 this can happen:
138 - [X] shift history out of node tree and into separate stack
139 - [ ] make history stack variables buffer-local
140 - [ ] have elpher-with-clean-buffer select appropriate buffer 
141    
142 ** OPEN Make installing existing certificates easier
143    :LOGBOOK:
144    - State "OPEN"       from "CLOSED"     [2020-06-22 Mon 10:34]
145    :END:
146
147 It's naive to think that people don't have client certificates created
148 outside of elpher. Thus we need some easy way to "install" these
149 certificates, either by copying them or by referencing them in some
150 way.
151
152 * Closed Enhancements
153   
154 ** CLOSED Turn on lexical scoping
155
156    A branch exists for this, but there are some compilation kinks
157 to iron out.
158
159   
160 ** CLOSED Implement support for telnet entries
161
162 Similar to http entries, telnet entries will be handled by code
163 external to elpher. However it seems I made http entry handling a
164 special case, and I don't want another!  So the only option is to
165 bring both http and telnet entries back into the fold by representing
166 them both as standard nodes and having the grunt work done by getter
167 functions.
168
169 ** CLOSED Allow users to access selected and current node details.
170    
171 ** CLOSED Implement bookmark system
172
173   Currently the bookmark page replaces the current page, and it
174   does so silently (i.e. it doesn't become part of the link hierarchy).
175   I think this is a mistake, as it results in confusing behaviour when
176   traversing the link hierarchy after visiting one of the bookmarked links.
177
178   Instead, I think I should
179   1. Make the bookmark page part of the hierarchy, and
180   2. Reinstate the visited node hash table to avoid excess link hierarchy pollution.
181
182   In order to accomplish 1. it will be necessary to make the bookmark page renderer
183   a proper getter function, and one that never caches the contents of the buffer.
184
185   Actually, I might have to think about that a bit more.  I don't know
186   how to answer the question of what the best thing to do with node
187   parent links when using a cached node in place of a new node.  (Maybe
188   I always update node.parent unless parent is already an ancestor of
189   node?)
190
191   
192 ** CLOSED Support character encoding diversity
193
194 ** CLOSED Make URLs the basic address type.
195 Currently I waste a lot of effort converting between
196 URL and non-URL representations.  This is unnecessary, and
197 actually makes lots of things uglier.
198
199 For example, the bookmarks file contains addresses in Elpher's
200 internal representation, whereas I expect users would prefer
201 it contain URLs.
202
203 So the idea would be for (elpher-node-address node) to be
204 a either a string or a symbol, with symbols used for "special"
205 pages (bookmarks, start page, etc).  The getter functions
206 `elpher-address-selector' etc will still do what they currently
207 do, but will process the URL to do it.
208
209 This also means that non-gopher URLs will be explicitly represented
210 as such: no more abusing the "h" type for these.
211
212 ** INVALID Remove "redraw" command
213 This is only necessary for returning from displaying the raw
214 server response.  If I can provide a better way of doing that
215 then we can get rid of redraw entirely.
216
217 Actually, this command can be useful to correct rendering issues that
218 occasionally pop up in termal windows.  Lets leave it for now.
219
220 ** CLOSED Implement Finger support
221    
222 ** CLOSED Improve download performance
223    This is actually easy to fix - the major problem at the moment is
224    the braindead way the incrementally-retrieved data is recorded:
225    (setq result-string (concat result-string next-bit)).
226    This is O(N^2).  Yuck!
227    
228    Okay, replacing this really does improve things.  Large gemini
229    downloads now seem occur at rates I'd expect.
230    
231 ** CLOSED Download/rendering progress feedback
232    Particularly for large files or complicated pages, elpher can
233    take a few seconds or more to generate a response.  Thhis is
234    frustrating for users, who are left staring at a blinking
235    cursor.
236
237    A small amount of feedback could help with this.
238
239 ** CLOSED Implement Gemini support [100%]
240    :LOGBOOK:
241    - State "CLOSED"     from "OPEN"       [2020-06-20 Sat 22:32]
242    :END:
243    
244 Here is the checklist of features required before release:
245 - [X] basic genimi transactions
246 - [X] gemini transactions requiring client certificates
247 - [X] gemini input handling
248 - [X] gemini map files (text/gemini)
249 - [X] Support for plain text responses (text/*)
250 - [X] Support for image responses (text/image)
251 - [X] Support for mime-specified character encodeing
252 - [X] Saving responses to disk
253 - [X] Viewing raw responses
254   
255 The last few will be made infinitely easier if we factor the
256 gopher "getter" code differently.
257
258
259 ** INVALID Allow for grouping of bookmarks
260 :LOGBOOK:
261 - State "INVALID"    from              [2021-07-23 Fri 10:10] \\
262   Since switching to Emacs native bookmarks, this is no longer our concern.
263 :END:
264 To support this I'd like to add a bookmark page specific
265 set of keybindings.  Currently all bindings available on
266 the bookmark page are available everywhere else.  But
267 expanding and collapsing bookmark groups sounds like it
268 might need more specific bindings.
269
270 *** Priority bump <2020-05-31 Sun>
271
272 As bookmark lists grow, some sort of grouping is becoming more and more
273 important.  Furthermore, with this in place it would become feasible
274 (and I really suspect almost trivial) to implement an update-checking
275 system for chosen groups of bookmarks.
276
277 For instance, we could prefetch content for each of the addresses within
278 a chosen group, indicating which had been changed since the last fetch.
279 (We could just store hashes of earlier content to detect changes.)
280
281 The difficult thing to decide is how the UI for the new bookmark page
282 will work.  It already has its own renderer, and we could easily stop
283 using the gopher directory line renderer in favour of something more
284 amenable to displaying the group information.  Thus we're very free to
285 do whatever we like once we also have a special key map in place as well.
286
287 I guess I need to look into what native widgets Emacs has for displaying
288 collapsable hierarchies.
289
290
291 ** CLOSED Add history browsing
292 :LOGBOOK:
293 - State "CLOSED"     from "OPEN"       [2021-07-23 Fri 10:09]
294 :END:
295
296 ** CLOSED Improve gemeini rendering speed
297 :LOGBOOK:
298 - State "CLOSED"     from "OPEN"       [2021-07-31 Sat 00:18]
299 :END:
300
301 Currently pages with many links render extremely slowly.
302
303 Example (>2000 links, 15s): gemini://rawtext.club/~sloum/geminilist/
304
305 It turns out that by far the main contributor to this is the use of
306 (url-port) in elpher-address-from-gemini-url.  I encountered this
307 problem once before in elpher-remove-redundant-ports.  This function
308 call is just incredibly slow for some bizarre reason.  Happily,
309 (url-portspec) is functionally equivalent and is orders of magnitude
310 faster.  With this replacement, loading the above page takes ~2s
311 and there aren't any other hotspots.
312
313
314 ** CLOSED Replace support for user-specified starting pages
315 :LOGBOOK:
316 - State "CLOSED"     from "OPEN"       [2021-08-09 Mon 17:46]
317 :END:
318 This used to be available, but was removed during a refactor.