X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;h=5b0f132e67e8620d9a7c1f38415b689084c80004;hp=fbcad2b2258501f5995d621be3d51e82b7b0ded1;hb=refs%2Fheads%2Fpatch_multiple_buffers;hpb=e3b53c818033bf6796e3c2dee2a967ee14f7c56c diff --git a/elpher.el b/elpher.el index fbcad2b..5b0f132 100644 --- a/elpher.el +++ b/elpher.el @@ -529,8 +529,9 @@ unless NO-HISTORY is non-nil." '("gophers" "gemini"))) " [TLS encryption]" "")) - (header (concat display-string - (propertize tls-string 'face 'bold)))) + (header (url-unhex-string + (concat display-string + (propertize tls-string 'face 'bold))))) (setq header-line-format header)))) (defmacro elpher-with-clean-buffer (&rest args) @@ -825,6 +826,8 @@ base for the installed key and certificate files." (defun elpher-list-existing-certificates () "Return a list of the persistent certificates in `elpher-certificate-directory'." + (unless (file-directory-p elpher-certificate-directory) + (make-directory elpher-certificate-directory)) (mapcar (lambda (file) (file-name-sans-extension file)) @@ -2045,6 +2048,7 @@ With an optional argument, add all the history items, too." (define-key map "\C-m" 'elpher-menu-this-window) (define-key map "o" 'elpher-menu-other-window) (define-key map "\C-o" 'elpher-menu-switch-other-window) + (define-key map "c" 'elpher-menu-copy-current-url) (define-key map "d" 'Buffer-menu-delete) (define-key map "k" 'Buffer-menu-delete) (define-key map "\C-k" 'Buffer-menu-delete) @@ -2188,6 +2192,23 @@ and apply FUNC to ARGS." (t (error "There's no entry on this line of the menu"))))) +(defun elpher-menu-copy-current-url () + "Copy the URL of the current menu item." + (interactive) + (let ((data (tabulated-list-get-id))) + (cond ((bufferp data) + (with-current-buffer data + (elpher-copy-page-url elpher-current-page))) + ((listp data) + (elpher-copy-page-url (nth 2 data))) + (t + (error "There's no entry on this line of the menu"))))) + + (defun elpher-copy-current-url () + "Copy URL of current page to `kill-ring'." + (interactive) + (elpher-copy-page-url elpher-current-page)) + (defvar elpher-title nil) (defun elpher-find-title ()