X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;h=19eb04a4b196bb8cbb979792f5744c23eeb133a2;hp=75cc82b250fcbed63c41ce24ad34a682640e7419;hb=02cb48665b8bd64589458eb5fc838e392b29b877;hpb=8c00d670414085213c15af346c55efe6aec1d785 diff --git a/elpher.el b/elpher.el index 75cc82b..19eb04a 100644 --- a/elpher.el +++ b/elpher.el @@ -332,7 +332,6 @@ is not explicitly given." (unwind-protect (let ((url (url-generic-parse-url url-string))) (unless (and (not (url-fullness url)) (url-type url)) - (setf (url-fullness url) t) (unless (url-type url) (setf (url-type url) default-scheme)) (unless (url-host url) @@ -342,7 +341,8 @@ is not explicitly given." (if (cdr p) (concat "/" (mapconcat #'identity (cdr p) "/")) "")))) - (when (url-host url) + (when (not (string-empty-p (url-host url))) + (setf (url-fullness url) t) (setf (url-host url) (puny-encode-domain (url-host url)))) (when (or (equal "gopher" (url-type url)) (equal "gophers" (url-type url))) @@ -1492,11 +1492,11 @@ treatment that a separate function is warranted." (let ((address (url-generic-parse-url url)) (current-address (elpher-page-address elpher-current-page))) (unless (and (url-type address) (not (url-fullness address))) ;avoid mangling mailto: urls - (setf (url-fullness address) t) (if (url-host address) ;if there is an explicit host, filenames are absolute (if (string-empty-p (url-filename address)) (setf (url-filename address) "/")) ;ensure empty filename is marked as absolute (setf (url-host address) (url-host current-address)) + (setf (url-fullness address) (url-host address)) ; set fullness to t if host is set (setf (url-portspec address) (url-portspec current-address)) ; (url-port) too slow! (unless (string-prefix-p "/" (url-filename address)) ;deal with relative links (setf (url-filename address)