Header now displays TLS encryption status instead of url.
[elpher.git] / elpher.el
index acb7083..acc20ba 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -426,11 +426,13 @@ unless PRESERVE-PARENT is non-nil."
   (if elpher-use-header
       (let* ((display-string (elpher-node-display-string elpher-current-node))
              (address (elpher-node-address elpher-current-node))
-             (url-string (if (elpher-address-special-p address)
-                             ""
-                           (concat "  -  " (elpher-address-to-url address) "")))
-             (header (replace-regexp-in-string "%" "%%" (concat display-string
-                                                                url-string))))
+             (tls-string (if (and (not (elpher-address-special-p address))
+                                  (member (elpher-address-protocol address)
+                                          '("gophers" "gemini")))
+                             " [TLS]"
+                           ""))
+             (header (concat display-string
+                             (propertize tls-string 'face 'bold))))
         (setq header-line-format header))))
 
 (defmacro elpher-with-clean-buffer (&rest args)
@@ -654,7 +656,7 @@ If ADDRESS is not supplied or nil the record is rendered as an
     (insert string)
     (goto-char (point-min))
     (while (re-search-forward elpher-url-regex nil t)
-      (let ((node (elpher-make-node (match-string 0)
+      (let ((node (elpher-make-node (substring-no-properties (match-string 0))
                                     (elpher-address-from-url (match-string 0)))))
           (make-text-button (match-beginning 0)
                             (match-end 0)