Gnus development mailing list
 help / color / mirror / Atom feed
* mc-expand-mail-abbrev
@ 2005-09-10  1:12 Michael Cook
  2005-09-17 18:39 ` mc-expand-mail-abbrev Michael Cook
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Cook @ 2005-09-10  1:12 UTC (permalink / 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)



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-18 22:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` mc-expand-mail-abbrev Michael Cook

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).