From f117f2f53490dbe521d3a726362b37dba0cd418a Mon Sep 17 00:00:00 2001 From: plugd Date: Fri, 15 Jul 2022 14:58:07 +1000 Subject: [PATCH] Comment cleanup and version bump. --- config.mk | 2 +- elpher-pkg.el | 2 +- elpher.el | 75 ++++++++++++++++++++++++++++++++++----------------- 3 files changed, 52 insertions(+), 27 deletions(-) diff --git a/config.mk b/config.mk index 79071f5..e406f6b 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ PKG = elpher -VERSION = 3.4.1 +VERSION = 3.4.2 INSTALLINFO = install-info MAKEINFO = makeinfo diff --git a/elpher-pkg.el b/elpher-pkg.el index a0a4daa..d7becef 100644 --- a/elpher-pkg.el +++ b/elpher-pkg.el @@ -1,4 +1,4 @@ -(define-package "elpher" "3.4.1" "A friendly gopher and gemini client" +(define-package "elpher" "3.4.2" "A friendly gopher and gemini client" '((emacs "27.1")) :keywords ("convenience") :authors (("Tim Vaughan" . "plugd@thelambdalab.xyz")) diff --git a/elpher.el b/elpher.el index 1959dfe..398aac2 100644 --- a/elpher.el +++ b/elpher.el @@ -5,7 +5,7 @@ ;; Author: Tim Vaughan ;; Created: 11 April 2019 -;; Version: 3.4.1 +;; Version: 3.4.2 ;; Keywords: comm gopher ;; Homepage: https://thelambdalab.xyz/elpher ;; Package-Requires: ((emacs "27.1")) @@ -70,7 +70,7 @@ ;;; Global constants ;; -(defconst elpher-version "3.4.1" +(defconst elpher-version "3.4.2" "Current version of elpher.") (defconst elpher-margin-width 6 @@ -729,7 +729,8 @@ away CRs and any terminating period." 'face 'button))) (buffer-string))) -;;; ANSI colors or XTerm colors (application and filtering) + +;; ANSI colors or XTerm colors (application and filtering) (or (require 'xterm-color nil t) (require 'ansi-color)) @@ -753,7 +754,8 @@ away CRs and any terminating period." (save-match-data (string-match "\x1b\\[" string))) -;;; Processing text for display + +;; Processing text for display (defun elpher-process-text-for-display (string) "Perform any desired processing of STRING prior to display as text. @@ -765,7 +767,7 @@ Currently includes buttonifying URLs and processing ANSI escape codes." string))) -;;; Network error reporting +;;; General network communication ;; (defun elpher-network-error (address error) @@ -779,9 +781,6 @@ ERROR can be either an error object or a string." "Press 'u' to return to the previous page."))) -;;; General network communication -;; - (defvar elpher-network-timer nil "Timer used for network connections.") @@ -1097,7 +1096,9 @@ once they are retrieved from the gopher server." (error (elpher-network-error address the-error)))))) -;; Index rendering + +;;; Gopher index rendering +;; (defun elpher-insert-margin (&optional type-name) "Insert index margin, optionally containing the TYPE-NAME, into current buffer." @@ -1181,7 +1182,9 @@ If ADDRESS is not supplied or nil the record is rendered as an (elpher-cache-content (elpher-page-address elpher-current-page) (buffer-string))))) -;; Text rendering + +;;; Gopher text rendering +;; (defun elpher-render-text (data &optional _mime-type-string) "Render DATA as text. MIME-TYPE-STRING is unused." @@ -1193,7 +1196,9 @@ If ADDRESS is not supplied or nil the record is rendered as an (elpher-page-address elpher-current-page) (buffer-string))))) -;; Image retrieval + +;;; Image retrieval +;; (defun elpher-render-image (data &optional _mime-type-string) "Display DATA as image. MIME-TYPE-STRING is unused." @@ -1214,7 +1219,9 @@ If ADDRESS is not supplied or nil the record is rendered as an (elpher-restore-pos)))) (elpher-render-download data)))) -;; Search retrieval and rendering + +;;; Gopher search retrieval and rendering +;; (defun elpher-get-gopher-query-page (renderer) "Getter for gopher addresses requiring input. @@ -1243,7 +1250,9 @@ The response is rendered using the rendering function RENDERER." (if aborted (elpher-visit-previous-page)))))) -;; Raw server response rendering + +;;; Raw server response rendering +;; (defun elpher-render-raw (data &optional mime-type-string) "Display raw DATA in buffer. MIME-TYPE-STRING is also displayed if provided." @@ -1256,7 +1265,9 @@ The response is rendered using the rendering function RENDERER." (goto-char (point-min))) (message "Displaying raw server response. Reload or redraw to return to standard view."))) -;; File save "rendering" + +;;; File save "rendering" +;; (defun elpher-render-download (data &optional _mime-type-string) "Save DATA to file. MIME-TYPE-STRING is unused." @@ -1278,7 +1289,9 @@ The response is rendered using the rendering function RENDERER." (insert data))) (message (format "Saved to file %s." filename)))))) -;; HTML rendering + +;;; HTML rendering +;; (defun elpher-render-html (data &optional _mime-type-string) "Render DATA as HTML using shr. MIME-TYPE-STRING is unused." @@ -1290,7 +1303,9 @@ The response is rendered using the rendering function RENDERER." (libxml-parse-html-region (point-min) (point-max))))) (shr-insert-document dom))))) -;; Gemini page retrieval + +;;; Gemini page retrieval +;; (defvar elpher-gemini-redirect-chain) @@ -1446,6 +1461,9 @@ is a list of possible answers." (error (elpher-network-error address the-error))))) +;;; Gemini page rendering +;; + (defun elpher-render-gemini (body &optional mime-type-string) "Render gemini response BODY with rendering MIME-TYPE-STRING." (if (not body) @@ -1706,7 +1724,8 @@ can be used to toggle the display of the preformatted text." (reverse headers)))) -;; Finger page connection +;;; Finger page connection +;; (defun elpher-get-finger-page (renderer) "Opens a finger connection to the current page address. @@ -1732,7 +1751,8 @@ The result is rendered using RENDERER." (elpher-network-error address the-error)))))) -;; Telnet page connection +;;; Telnet page connection +;; (defun elpher-get-telnet-page (renderer) "Opens a telnet connection to the current page address (RENDERER must be nil)." @@ -1748,7 +1768,8 @@ The result is rendered using RENDERER." (telnet host)))) -;; Other URL page opening +;;; Other URL page opening +;; (defun elpher-get-other-url-page (renderer) "Getter which attempts to open the URL specified by the current page. @@ -1765,7 +1786,8 @@ The RENDERER argument to this getter must be nil." (browse-url url)))) -;; File page +;;; File page +;; (defun elpher-get-file-page (renderer) "Getter which renders a local file using RENDERER. @@ -1801,7 +1823,8 @@ Assumes UTF-8 encoding for all text files." (elpher-restore-pos)))) -;; Welcome page retrieval +;;; Welcome page retrieval +;; (defun elpher-get-welcome-page (renderer) "Getter which displays the welcome page (RENDERER must be nil)." @@ -1895,7 +1918,8 @@ Assumes UTF-8 encoding for all text files." (elpher-restore-pos))) -;; History page retrieval +;;; History page retrieval +;; (defun elpher-show-history () "Show the current contents of elpher's history stack. @@ -1952,6 +1976,7 @@ This is rendered using `elpher-get-visited-pages-page' via `elpher-type-map'." ;;; Bookmarks +;; ;; This code allows Elpher to use the standard Emacs bookmarks: `C-x r ;; m' to add a bookmark, `C-x r l' to list bookmarks (which is where @@ -2162,7 +2187,7 @@ supports the old protocol elpher, where the link is self-contained." (add-hook 'org-mode-hook #'elpher-org-mode-integration) -;;; Browse URL +;; Browse URL ;;;###autoload (defun elpher-browse-url-elpher (url &rest _args) @@ -2197,13 +2222,13 @@ supports the old protocol elpher, where the link is self-contained." (with-eval-after-load 'thingatpt (add-to-list 'thing-at-point-uri-schemes "gemini://")) -;;; Mu4e: +;; Mu4e: ;; Make mu4e aware of the gemini world (setq mu4e~view-beginning-of-url-regexp "\\(?:https?\\|gopher\\|finger\\|gemini\\)://\\|mailto:") -;;; eww: +;; eww: ;; Let elpher handle gemini, gopher links in eww buffer. (setq eww-use-browse-url -- 2.20.1