From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60970 Path: news.gmane.org!not-for-mail From: Michael Cook Newsgroups: gmane.emacs.gnus.general Subject: Re: mc-expand-mail-abbrev Date: Sun, 18 Sep 2005 18:04:00 -0400 Organization: http://www.waxrat.com Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1127081371 23180 80.91.229.2 (18 Sep 2005 22:09:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 18 Sep 2005 22:09:31 +0000 (UTC) Original-X-From: ding-owner+m9502@lists.math.uh.edu Mon Sep 19 00:09:29 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EH7KZ-0005MZ-27 for ding-account@gmane.org; Mon, 19 Sep 2005 00:08:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EH7KQ-0000V4-00; Sun, 18 Sep 2005 17:08:06 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EH7Gf-0000Uy-00 for ding@lists.math.uh.edu; Sun, 18 Sep 2005 17:04:13 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1EH7Gd-0000oW-BK for ding@lists.math.uh.edu; Sun, 18 Sep 2005 17:04:13 -0500 Original-Received: from smtp01.mrf.mail.rcn.net ([207.172.4.61]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EH7GU-0004fd-00 for ; Mon, 19 Sep 2005 00:04:02 +0200 Original-Received: from 209-6-214-8.c3-0.lex-ubr2.sbo-lex.ma.cable.rcn.com (HELO pigpen.waxrat.com) ([209.6.214.8]) by smtp01.mrf.mail.rcn.net with ESMTP; 18 Sep 2005 18:04:01 -0400 X-IronPort-AV: i="3.97,120,1125892800"; d="scan'208"; a="83821941:sNHT21118452" Original-Received: from pigpen.waxrat.com (localhost.localdomain [127.0.0.1]) by pigpen.waxrat.com (8.12.11/8.12.11) with ESMTP id j8IM40fL017667 for ; Sun, 18 Sep 2005 18:04:00 -0400 Original-To: ding@gnus.org In-Reply-To: (Reiner Steib's message of "Sun, 18 Sep 2005 12:42:51 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.3 (gnu/linux) X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60970 Archived-At: > 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.