Merge pull request #2371 from vermiculus/sa/copy-link-at-point

Teach mu4e-copy-thing-at-point about SHR links
This commit is contained in:
Dirk-Jan C. Binnema 2022-11-30 23:35:49 +02:00 committed by GitHub
commit 9ce5a22275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -465,8 +465,9 @@ http://cr.yp.to/proto/maildir.html."
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))))
(string-trim (thing-at-point 'email 'no-props) "<" ">")))
(thing (or thing (get-text-property (point) 'shr-url)))
(thing (or thing (thing-at-point 'url 'no-props))))
(when thing
(kill-new thing)
(mu4e-message "Copied '%s' to kill-ring" thing))))