Better handling of terminating period in gopher map files.
authorTim Vaughan <tgvaughan@gmail.com>
Sat, 25 May 2019 11:36:25 +0000 (13:36 +0200)
committerTim Vaughan <tgvaughan@gmail.com>
Sat, 25 May 2019 11:36:25 +0000 (13:36 +0200)
elpher.el

index 30ec292..ff69c93 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -291,7 +291,8 @@ content and cursor position fields of the node."
   ;; Should be able to split directly on CRLF, but some non-conformant
   ;; LF-only servers sadly exist, hence the following.
   (dolist (line (split-string (replace-regexp-in-string "\r" "" string) "\n"))
-    (unless (= (length line) 0)
+    (unless (or (= (length line) 0)
+                (string-equal line "."))
       (elpher-insert-index-record line))))
 
 (defun elpher-insert-margin (&optional type-name)
@@ -342,7 +343,6 @@ content and cursor position fields of the node."
                                   'action #'elpher-click-url
                                   'follow-link t
                                   'help-echo (format "mouse-1, RET: open url %s" url))))
-        (?.) ;; Occurs at end of index, can safely ignore.
         (tp (elpher-insert-margin (concat (char-to-string tp) "?"))
             (insert (propertize display-string
                                 'face 'elpher-unknown-face)))))