From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/80550 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: advising gnus-summary-resend-message, the clean way Date: Tue, 08 Nov 2011 08:18:08 +0900 Organization: Emacsen advocacy group Message-ID: References: <871utj8uqj.fsf@micropit.couberia.bzh> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1320707951 9468 80.91.229.12 (7 Nov 2011 23:19:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2011 23:19:11 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M28833@lists.math.uh.edu Tue Nov 08 00:19:06 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RNYT2-0006zI-QJ for ding-account@gmane.org; Tue, 08 Nov 2011 00:19:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1RNYSM-0006XK-VR; Mon, 07 Nov 2011 17:18:23 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1RNYSK-0006X5-84 for ding@lists.math.uh.edu; Mon, 07 Nov 2011 17:18:20 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RNYSG-0006x4-EI for ding@lists.math.uh.edu; Mon, 07 Nov 2011 17:18:17 -0600 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1RNYSC-0006sI-1V for ding@gnus.org; Tue, 08 Nov 2011 00:18:12 +0100 Original-Received: from localhost ([127.0.0.1]:35402) by orlando.hostforweb.net with smtp (Exim 4.69) (envelope-from ) id 1RNYS9-00064l-JN for ding@gnus.org; Mon, 07 Nov 2011 17:18:10 -0600 X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (i686-pc-cygwin) Cancel-Lock: sha1:/3B1v4H/mv4JRTrENXS7EEayfuE= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:80550 Archived-At: Peter M=FCnster wrote: > I want to use bbdb completion, even in the mini-buffer, so my first > idea[1] was, to advise gnus-summary-resend-message: > (defadvice gnus-summary-resend-message (around pm/resend-with-bbdb activa= te) > "Resend message with bbdb address completion." > (flet ((message-read-from-minibuffer (p &optional d) > (bbdb-completing-read-mails p d))) > ad-do-it)) > But it does not work, I think it's because > `message-read-from-minibuffer' is called from the `interactive' form. [...] In advice.el there are some examples to tweak the interactive form. Maybe this is what you want: (defadvice gnus-summary-resend-message (before pm/resend-with-bbdb activate) "Resend message with bbdb address completion." (interactive (list (bbdb-completing-read-mails "Resend message(s) to: " (when (and gnus-summary-resend-default-address (gnus-buffer-live-p gnus-original-article-buffer)) (with-current-buffer gnus-original-article-buffer (nnmail-fetch-field "to")))) current-prefix-arg))) This shows advised function definition w/o byte-compilation. (let ((ad-default-compilation-action 'never)) (defadvice gnus-summary-resend-message ...FORMS...) (pp (symbol-function 'gnus-summary-resend-message)) nil)