From: Michael Cook <michael@waxrat.com>
Subject: Re: mc-expand-mail-abbrev
Date: Sun, 18 Sep 2005 18:04:00 -0400 [thread overview]
Message-ID: <m33bo2m3sf.fsf@pigpen.waxrat.com> (raw)
In-Reply-To: <v9hdci4pxw.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Sun, 18 Sep 2005 12:42:51 +0200")
> when using S D r (gnus-summary-resend-message), it'd be nice to be
> able to expand mail aliases and to complete via bbdb.
turns out the previous version didn't behave well when
mail-abbrev-insert-alias decided to evoke auto-fill. the following
version doesn't have that problem. also, i've incorporated reiner
steib's suggestion to use message-minibuffer-local-map.
(defun mc-expand-mail-abbrev (arg)
"Expand the mail abbreviation before point."
(interactive "P")
;; See what is between point and the preceding newline, colon or comma. If
;; it's in the mail-abbrev table, replace it.
(or (vectorp mail-abbrevs)
(mail-abbrevs-setup))
(let* ((end (point))
(beg (save-excursion
(re-search-backward "\\(\\`\\|[\n:,]\\)[ \t]*")
(goto-char (match-end 0))
(point)))
(abbrev (symbol-value (intern-soft (buffer-substring beg end)
mail-abbrevs))))
(when abbrev
(delete-region beg end)
(insert abbrev)))
;; Now try BBDB completion.
(bbdb-complete-name arg))
(define-key message-minibuffer-local-map "\M-," 'mc-expand-mail-abbrev)
(define-key message-mode-map "\M-," 'mc-expand-mail-abbrev)
m.
prev parent reply other threads:[~2005-09-18 22:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-10 1:12 mc-expand-mail-abbrev Michael Cook
2005-09-17 18:39 ` mc-expand-mail-abbrev Michael Cook
2005-09-18 10:42 ` mc-expand-mail-abbrev Reiner Steib
2005-09-18 22:04 ` Michael Cook [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m33bo2m3sf.fsf@pigpen.waxrat.com \
--to=michael@waxrat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).