From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60930 Path: news.gmane.org!not-for-mail From: Michael Cook Newsgroups: gmane.emacs.gnus.general Subject: mc-expand-mail-abbrev Date: Fri, 09 Sep 2005 21:12:05 -0400 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1126316506 7792 80.91.229.2 (10 Sep 2005 01:41:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Sep 2005 01:41:46 +0000 (UTC) Original-X-From: ding-owner+m9462@lists.math.uh.edu Sat Sep 10 03:41:45 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EDuMZ-0000KK-Op for ding-account@gmane.org; Sat, 10 Sep 2005 03:41:03 +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 1EDuMQ-0006Vl-00; Fri, 09 Sep 2005 20:40:54 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EDtur-0006UX-00 for ding@lists.math.uh.edu; Fri, 09 Sep 2005 20:12:25 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1EDtup-0000NP-4G for ding@lists.math.uh.edu; Fri, 09 Sep 2005 20:12:24 -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 1EDtuj-0008RS-00 for ; Sat, 10 Sep 2005 03:12:18 +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; 09 Sep 2005 21:12:11 -0400 X-IronPort-AV: i="3.97,95,1125892800"; d="scan'208"; a="80026278:sNHT20899832" 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 j8A1C5gJ005849 for ; Fri, 9 Sep 2005 21:12:10 -0400 Original-To: ding@gnus.org 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:60930 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. 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)