mirror of https://github.com/djcb/mu.git
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:
parent
ed93ff4968
commit
46476fc001
|
@ -453,6 +453,17 @@ http://cr.yp.to/proto/maildir.html."
|
||||||
|
|
||||||
|
|
||||||
;;; Misc
|
;;; 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)
|
(defun mu4e-display-size (size)
|
||||||
"Get a human-friendly string representation of SIZE (in bytes)."
|
"Get a human-friendly string representation of SIZE (in bytes)."
|
||||||
(cond
|
(cond
|
||||||
|
|
|
@ -949,9 +949,11 @@ This is useful for advising some Gnus-functionality that does not work in mu4e."
|
||||||
;; misc
|
;; misc
|
||||||
(define-key map "M" #'mu4e-view-massage)
|
(define-key map "M" #'mu4e-view-massage)
|
||||||
|
|
||||||
(define-key map "w" 'visual-line-mode)
|
(define-key map "w" #'visual-line-mode)
|
||||||
(define-key map "h" #'mu4e-view-toggle-html)
|
(define-key map "h" #'mu4e-view-toggle-html)
|
||||||
(define-key map (kbd "M-q") 'article-fill-long-lines)
|
(define-key map (kbd "M-q") #'article-fill-long-lines)
|
||||||
|
|
||||||
|
(define-key map "c" #'mu4e-copy-thing-at-point)
|
||||||
|
|
||||||
;; next 3 only warn user when attempt in the message view
|
;; next 3 only warn user when attempt in the message view
|
||||||
(define-key map "u" #'mu4e-view-unmark)
|
(define-key map "u" #'mu4e-view-unmark)
|
||||||
|
|
Loading…
Reference in New Issue