Skip to content

Instantly share code, notes, and snippets.

View dimitri's full-sized avatar

Dimitri Fontaine dimitri

View GitHub Profile
;; automate adding mail at point to ~/.mailrc
(require 'mail-parse)
(defun thing-at-point-bounds-of-email-address ()
"return a cons of begin and end position of email address at point, including full name"
(save-excursion
(let* ((search-point (point))
(start (re-search-backward "[:,]" (line-beginning-position) 'move))
(dummy (goto-char search-point))
(end (re-search-forward "[:,]" (line-end-position) t)))