mu4e: add mu4e-copy-thing-at-point

Copy the thing (url or email) at point, similar to the feature in the
pre-gnus view. Bind to 'c' in the message-view.
This commit is contained in:
Dirk-Jan C. Binnema
2022-07-13 23:35:16 +03:00
parent ed93ff4968
commit 46476fc001
2 changed files with 15 additions and 2 deletions

View File

@ -453,6 +453,17 @@ http://cr.yp.to/proto/maildir.html."
;;; Misc
(defun mu4e-copy-thing-at-point ()
"Copy e-mail address or URL at point to the kill ring.
If there is not e-mail address at point, do nothing."
(interactive)
(let* ((thing (and (thing-at-point 'email)
(string-trim (thing-at-point 'email 'no-props) "<" ">")))
(thing (or thing (thing-at-point 'url 'no-props))))
(when thing
(kill-new thing)
(mu4e-message "Copied '%s' to kill-ring" thing))))
(defun mu4e-display-size (size)
"Get a human-friendly string representation of SIZE (in bytes)."
(cond