[mu4e] Basic implementation of recipient's name extraction

master
Jacopo De Simoi 2 years ago
parent ff0e951918
commit ba25406cba
  1. 22
      global.org

@ -797,6 +797,28 @@
#+end_src
This function inserts recipients name at point; might be useful
with abbrev mode shortcuts
#+begin_src emacs-lisp
(defun recipients-ng ()
(interactive)
(message (save-excursion
(goto-char (point-min))
(search-forward-regexp "To: \\(\\(.\\|\n\\)*\\)\\(Subject\\|CC\\|BCC\\)")
(mapcar (lambda (s) (substring-no-properties (string-trim (car (split-string s "<"))))) (mapcar #'string-trim (split-string (match-string 1) ">,"))))))
(defun mu4e-insert-recipients-name ()
"Inserts the name of the recipients at point"
;; needs several improvements: at the moment it only handles very
;; basic situations (one recipient, single-word first name)
(insert (concat (save-excursion
(goto-char (point-min))
(search-forward "To: ")
(current-word)))
"," ))
#+end_src
Customize ~mu4e~ bookmarks
#+begin_src emacs-lisp

Loading…
Cancel
Save