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