Gnus development mailing list
 help / color / mirror / Atom feed
From: Michael Cook <cook@nexthop.com>
Subject: mc-expand-mail-abbrev
Date: Fri, 09 Sep 2005 21:12:05 -0400	[thread overview]
Message-ID: <m3ek7xg1zu.fsf@pigpen.waxrat.com> (raw)

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?

(defun mc-expand-mail-abbrev (arg)
  "Expand the mail abbreviation before point."
  (interactive "P")
  (save-restriction
    (if mark-active
	(narrow-to-region (region-beginning) (region-end))
      (let ((syntax-table (syntax-table)))
	(narrow-to-region (unwind-protect
			      (save-excursion
				(set-syntax-table mail-abbrev-syntax-table)
				(backward-word 1)
				(point))
			    (set-syntax-table syntax-table))
			  (point))))
    (goto-char (point-max))
    (let ((point-was (point)))
      (mail-abbrev-insert-alias (buffer-substring (point-min) (point-max)))
      (or (= (point) point-was)
	  (delete-region (point-min) point-was)))
    (bbdb-complete-name arg)))
(define-key minibuffer-local-map "\M-," 'mc-expand-mail-abbrev)
(define-key message-mode-map "\M-," 'mc-expand-mail-abbrev)



             reply	other threads:[~2005-09-10  1:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-10  1:12 Michael Cook [this message]
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     ` 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=m3ek7xg1zu.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).