diff options
-rw-r--r-- | nov.el | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -394,6 +394,7 @@ Each alist item consists of the identifier and full path." (define-key map (kbd "l") 'nov-history-back) (define-key map (kbd "r") 'nov-history-forward) (define-key map (kbd "RET") 'nov-browse-url) + (define-key map (kbd "c") 'nov-copy-url) (define-key map (kbd "<follow-link>") 'mouse-face) (define-key map (kbd "<mouse-2>") 'nov-browse-url) (define-key map (kbd "TAB") 'shr-next-link) @@ -673,6 +674,15 @@ Internal URLs are visited with `nov-visit-relative-file'." (browse-url url) (apply 'nov-visit-relative-file (nov-url-filename-and-target url))))) +(defun nov-copy-url (&optional mouse-event) + (interactive (list last-nonmenu-event)) + (mouse-set-point mouse-event) + (let ((url (get-text-property (point) 'shr-url))) + (when (not url) + (user-error "No link under point")) + (kill-new url) + (message url))) + (defun nov-saved-places () "Retrieve saved places in `nov-save-place-file'." (when (and nov-save-place-file (file-exists-p nov-save-place-file)) |