Adding finger support.
authorTim Vaughan <timv@ughan.xyz>
Wed, 13 May 2020 08:17:03 +0000 (10:17 +0200)
committerTim Vaughan <timv@ughan.xyz>
Wed, 13 May 2020 08:17:03 +0000 (10:17 +0200)
ISSUES.org
elpher.el

index 2b637c0..4624786 100644 (file)
@@ -14,11 +14,6 @@ this can happen:
 - [X] shift history out of node tree and into separate stack
 - [ ] make history stack variables buffer-local
 - [ ] have elpher-with-clean-buffer select appropriate buffer 
 - [X] shift history out of node tree and into separate stack
 - [ ] make history stack variables buffer-local
 - [ ] have elpher-with-clean-buffer select appropriate buffer 
-   
-** OPEN Remove "redraw" command
-This is only necessary for returning from displaying the raw
-server response.  If I can provide a better way of doing that
-then we can get rid of redraw entirely.
 
 ** OPEN Replace support for user-specified starting pages
 This used to be available, but was removed during a refactor.
 
 ** OPEN Replace support for user-specified starting pages
 This used to be available, but was removed during a refactor.
@@ -46,6 +41,10 @@ Here is the checklist of features required before release:
 The last few will be made infinitely easier if we factor the
 gopher "getter" code differently.
 
 The last few will be made infinitely easier if we factor the
 gopher "getter" code differently.
 
+** OPEN Implement Finger support
+
+** OPEN Add history browsing
+
 * Bugs
 
 * Completed improvements
 * Bugs
 
 * Completed improvements
@@ -108,6 +107,14 @@ do, but will process the URL to do it.
 This also means that non-gopher URLs will be explicitly represented
 as such: no more abusing the "h" type for these.
 
 This also means that non-gopher URLs will be explicitly represented
 as such: no more abusing the "h" type for these.
 
+** INVALID Remove "redraw" command
+This is only necessary for returning from displaying the raw
+server response.  If I can provide a better way of doing that
+then we can get rid of redraw entirely.
+
+Actually, this command can be useful to correct rendering issues that
+occasionally pop up in termal windows.  Lets leave it for now.
+
 * Closed issues
   
 ** CLOSED Org mode faces are not present in recent emacs versions
 * Closed issues
   
 ** CLOSED Org mode faces are not present in recent emacs versions
index 474eee1..4feb520 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -89,6 +89,7 @@
     ((gopher ?s) elpher-get-gopher-page elpher-render-download "snd" elpher-binary)
     ((gopher ?h) elpher-get-gopher-page elpher-render-html "htm" elpher-html)
     (gemini elpher-get-gemini-page elpher-render-gemini "gem" elpher-gemini)
     ((gopher ?s) elpher-get-gopher-page elpher-render-download "snd" elpher-binary)
     ((gopher ?h) elpher-get-gopher-page elpher-render-html "htm" elpher-html)
     (gemini elpher-get-gemini-page elpher-render-gemini "gem" elpher-gemini)
+    (finger elpher-get-finger-page elpher-render-text "txt" elpher-text)
     (telnet elpher-get-telnet-page nil "tel" elpher-telnet)
     (other-url elpher-get-other-url-page nil "url" elpher-other-url)
     ((special bookmarks) elpher-get-bookmarks-page nil "/" elpher-index)
     (telnet elpher-get-telnet-page nil "tel" elpher-telnet)
     (other-url elpher-get-other-url-page nil "url" elpher-other-url)
     ((special bookmarks) elpher-get-bookmarks-page nil "/" elpher-index)
@@ -1030,6 +1031,26 @@ For instance, the filename /a/b/../c/./d will reduce to /a/c/d"
     (elpher-page-address elpher-current-page)
     (buffer-string))))
 
     (elpher-page-address elpher-current-page)
     (buffer-string))))
 
+;; Finger page connection
+
+(defun elpher-get-finger-page (renderer)
+  "Opens a finger connection to the current page address and renders it using RENDERER."
+  (let* ((address (elpher-page-address elpher-current-page))
+         (host (elpher-address-host address))
+         (port (elpher-address-port address))
+         (content (elpher-get-cached-content address)))
+    (if (and content (funcall renderer nil))
+        (elpher-with-clean-buffer
+         (insert content)
+         (elpher-restore-pos))
+      (elpher-with-clean-buffer
+       (insert "LOADING... (use 'u' to cancel)"))
+      (condition-case the-error
+          (elpher-get-selector address renderer)
+        (error
+         (elpher-network-error address the-error))))))
+
+
 ;; Other URL page opening
 
 (defun elpher-get-other-url-page (renderer)
 ;; Other URL page opening
 
 (defun elpher-get-other-url-page (renderer)