From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function? Date: Sun, 18 Aug 2019 16:06:27 -0700 Message-ID: <87k1ba3wgc.fsf@mouse.gnus.org> References: <400906ac-35f1-48e4-8df9-8e65b340209b@default> <87vbrjdajs.fsf@web.de> <82178260-247b-4653-85db-d6586480419e@default> <87d2dqdsyj.fsf@web.de> <8736ihb0ds.fsf@mouse.gnus.org> <87d0hl3xqx.fsf@web.de> <878ss99jhi.fsf@mouse.gnus.org> <87o914xh50.fsf@web.de> <87ftmgdl2d.fsf@mouse.gnus.org> <8736hy1wxt.fsf@web.de> <87ef1i38g4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="61519"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Michael Heerdegen , Stefan Monnier , 17871@debbugs.gnu.org To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 19 01:08:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzUHa-000FpW-NQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2019 01:08:18 +0200 Original-Received: from localhost ([::1]:43502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzUHZ-0007FN-Jm for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Aug 2019 19:08:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49631) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzUGN-0006Jn-Au for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2019 19:07:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzUGM-0005Ev-6U for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2019 19:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzUGM-0005EJ-2w for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2019 19:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hzUGL-0002TP-RE for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2019 19:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Aug 2019 23:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17871 X-GNU-PR-Package: emacs Original-Received: via spool by 17871-submit@debbugs.gnu.org id=B17871.15661695999444 (code B ref 17871); Sun, 18 Aug 2019 23:07:01 +0000 Original-Received: (at 17871) by debbugs.gnu.org; 18 Aug 2019 23:06:39 +0000 Original-Received: from localhost ([127.0.0.1]:58912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzUFz-0002SG-1q for submit@debbugs.gnu.org; Sun, 18 Aug 2019 19:06:39 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:46834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzUFx-0002S6-Oy for 17871@debbugs.gnu.org; Sun, 18 Aug 2019 19:06:38 -0400 Original-Received: from [12.144.191.101] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hzUFq-0003Ij-Gc; Mon, 19 Aug 2019 01:06:33 +0200 In-Reply-To: <87ef1i38g4.fsf@gmail.com> ("=?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?="'s message of "Sun, 18 Aug 2019 15:32:43 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165361 Archived-At: =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > Well, the closest I see in my init is this (in fact I have been doing it > differently and more uglily, but now I see this is simpler): > > (defun my-compose-mail-advice (orig &rest args) > "Read From: address interactively." > (interactive (lambda (spec) > (let* ((user-mail-address > (completing-read "From: " '("one.address@example= .net" > "alternative.address= @example.net"))) > (from (message-make-from user-full-name > user-mail-address)) > (spec (advice-eval-interactive-spec spec))) > ;; notmuch doesn't understand "From", it has to be a s= ymbol > (push (cons 'From from) (nth 2 spec)) > spec))) > (apply orig args)) > > (advice-add 'compose-mail :around #'my-compose-mail-advice) That's a good example. I've now added it to the trunk with some slight modifications. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no