From: Michael Cook <cook@nexthop.com>
Subject: Re: mc-expand-mail-abbrev
Date: Sat, 17 Sep 2005 14:39:19 -0400 [thread overview]
Message-ID: <m3wtlf8roo.fsf@pigpen.waxrat.com> (raw)
In-Reply-To: <m3ek7xg1zu.fsf@pigpen.waxrat.com> (Michael Cook's message of "Fri, 09 Sep 2005 21:12:05 -0400")
> 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.
>
> so, i took a stab at it. i think my solution is not quite right
> yet, but it seems to be close. any thoughts?
here's a better version.
(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 a single word, then attempt to expand it using "mail-abbrev".
(let* ((end (point))
(beg (save-excursion
(re-search-backward "\\(\\`\\|[\n:,]\\)[ \t]*")
(goto-char (match-end 0))
(point)))
(typed (buffer-substring beg end)))
(when (string-match "^\\w+$" typed)
(mail-abbrev-insert-alias typed)
(or (= (point) end)
(delete-region beg end))))
;; Now try BBDB completion.
(bbdb-complete-name arg))
(define-key minibuffer-local-map "\M-," 'mc-expand-mail-abbrev)
(define-key message-mode-map "\M-," 'mc-expand-mail-abbrev)
m.
next prev parent reply other threads:[~2005-09-17 18:39 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 ` Michael Cook [this message]
2005-09-18 10:42 ` mc-expand-mail-abbrev Reiner Steib
2005-09-18 22:04 ` mc-expand-mail-abbrev Michael Cook
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=m3wtlf8roo.fsf@pigpen.waxrat.com \
--to=cook@nexthop.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).