From: plugd Date: Fri, 6 May 2022 09:20:42 +0000 (+0200) Subject: Spartan expects relative links to be collapsed too. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=commitdiff_plain;h=5ba9c1af644debb243f71522d5dd8936628e7cc8 Spartan expects relative links to be collapsed too. --- diff --git a/elpher.el b/elpher.el index bb628de..42816c8 100644 --- a/elpher.el +++ b/elpher.el @@ -276,7 +276,7 @@ meaningfully." "Face used for Gemini type directory records.") (defface elpher-spartan - '((t :inherit font-lock-constant-face)) + '((t :inherit font-lock-type-face)) "Face used for Spartan type directory records.") (defface elpher-spartan-post @@ -475,12 +475,6 @@ If no address is defined, returns 0. (This is for compatibility with the URL library.)" (url-port address)) -(defun elpher-address-path-and-query (address) - "Retrieve path and query portion of ADDRESS as a pair." - (let ((path-and-query (url-path-and-query address))) - (cons (car path-and-query) - (url-unhex-string (cdr path-and-query))))) - (defun elpher-gopher-address-selector (address) "Retrieve gopher selector from ADDRESS object." (if (member (url-filename address) '("" "/")) @@ -1539,7 +1533,7 @@ treatment that a separate function is warranted." (setf (url-host address) (puny-encode-domain (url-host address)))) (unless (url-type address) (setf (url-type address) (url-type current-address))) - (when (equal (url-type address) "gemini") + (when (member (url-type address) '("gemini" "spartan")) (setf (url-filename address) (elpher-collapse-dot-sequences (url-filename address))))) (elpher-remove-redundant-ports address))) @@ -1733,7 +1727,7 @@ can be used to toggle the display of the preformatted text." (defun elpher-get-spartan-response (address renderer) "Get response string from spartan server at ADDRESS and render using RENDERER." (let* ((host (elpher-address-host address)) - (path-and-query (elpher-address-path-and-query address)) + (path-and-query (url-path-and-query address)) (filename (car path-and-query)) (data (cdr path-and-query)) (data-len (length data)))