From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 18:48:21 2019 Received: (at submit) by debbugs.gnu.org; 12 Apr 2019 22:48:21 +0000 Received: from localhost ([127.0.0.1]:56957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hF4y5-0000RH-Dc for submit@debbugs.gnu.org; Fri, 12 Apr 2019 18:48:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hF4y4-0000Qp-4W for submit@debbugs.gnu.org; Fri, 12 Apr 2019 18:48:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:59802) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hF4xy-00012F-V0 for submit@debbugs.gnu.org; Fri, 12 Apr 2019 18:48:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hF4xx-0007Kj-IA for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2019 18:48:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,DATE_IN_PAST_06_12, FROM_EXCESS_BASE64,RCVD_IN_DNSWL_NONE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hF4xw-00010h-Ii for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2019 18:48:13 -0400 Received: from insect.birch.relay.mailchannels.net ([23.83.209.93]:54057) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hF4xw-0000yh-1l for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2019 18:48:12 -0400 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 5BC868C1C60 for ; Fri, 12 Apr 2019 22:48:09 +0000 (UTC) Received: from pdx1-sub0-mail-a61.g.dreamhost.com (100-96-11-84.trex.outbound.svc.cluster.local [100.96.11.84]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DE4618C1CC9 for ; Fri, 12 Apr 2019 22:48:08 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from pdx1-sub0-mail-a61.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Fri, 12 Apr 2019 22:48:09 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Drop-Sponge: 05207f9a28a9a273_1555109289209_3274637181 X-MC-Loop-Signature: 1555109289208:3228535290 X-MC-Ingress-Time: 1555109289208 Received: from pdx1-sub0-mail-a61.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTP id 48EC1820E7 for ; Fri, 12 Apr 2019 15:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type; s= jidanni.org; bh=kbjbSy7PDhdGMeUhHrPtoQOUbt8=; b=klmbJtnHPVSY/6m8 6h0kgR6VORr2SXRaOGC3UiFaWTn5Y45+1RRod91CMCEjwyiKL/ub7k/FrwJT17QN eJ3C9Ay1dUK9dJNhL6upVX8BIrqEktygcV7LrZiw8KDTd/Sixn7xfqVCHQM33SHM m5vdfPA25R/M/VDGkHkKfJ9PpmA= Received: from jidanni.org (1-170-85-26.dynamic-ip.hinet.net [1.170.85.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTPSA id 80B99820E6 for ; Fri, 12 Apr 2019 15:48:04 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a61 From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-gnu-emacs@gnu.org Subject: Add simplest Advice example possible first Date: Fri, 12 Apr 2019 23:19:32 +0800 Message-ID: <878swf1caj.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrvdefgdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddtjeenucfhrhhomhepnjjnnjcuffgrnhculfgrtghosghsohhnuceojhhiuggrnhhnihesjhhiuggrnhhnihdrohhrgheqnecukfhppedurddujedtrdekhedrvdeinecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehjihgurghnnhhirdhorhhgpdhinhgvthepuddrudejtddrkeehrddviedprhgvthhurhhnqdhprghthheppeeruhhtfhdqkeerueerheeimhfphefnihehhegsveekreepucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqedpmhgrihhlfhhrohhmpehjihgurghnnhhisehjihgurghnnhhirdhorhhgpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.209.93 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) (info "(elisp) Advising Functions") starts out with a complicated example. For example, in order to trace the calls to the process filter of a process PROC, you could use: (defun my-tracing-function (proc string) (message "Proc %S received %S" proc string)) (add-function :before (process-filter PROC) #'my-tracing-function) Please first add the simplest example possible: Function A prints "a". Make it print "ab" from now on. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 11:06:59 2019 Received: (at 35250) by debbugs.gnu.org; 9 Jul 2019 15:07:00 +0000 Received: from localhost ([127.0.0.1]:33731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkrhr-0005tD-KT for submit@debbugs.gnu.org; Tue, 09 Jul 2019 11:06:59 -0400 Received: from quimby.gnus.org ([80.91.231.51]:47570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkrhp-0005t4-18 for 35250@debbugs.gnu.org; Tue, 09 Jul 2019 11:06:58 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkrhl-0006Og-5m; Tue, 09 Jul 2019 17:06:55 +0200 From: Lars Ingebrigtsen To: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson Subject: Re: bug#35250: Add simplest Advice example possible first References: <878swf1caj.fsf@jidanni.org> Date: Tue, 09 Jul 2019 17:06:52 +0200 In-Reply-To: <878swf1caj.fsf@jidanni.org> (=?utf-8?B?IuepjeS4ueWwvA==?= Dan Jacobson"'s message of "Fri, 12 Apr 2019 23:19:32 +0800") Message-ID: <87imsbtfg3.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: 積丹尼 Dan Jacobson writes: > (info "(elisp) Advising Functions") starts out with a complicated > example. > > For example, in order to trace the calls to the process filter of a > process PROC, you could use: > > (defun my-trac [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35250 Cc: 35250@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: > (info "(elisp) Advising Functions") starts out with a complicated > example. > > For example, in order to trace the calls to the process filter of= a > process PROC, you could use: > > (defun my-tracing-function (proc string) > (message "Proc %S received %S" proc string)) > > (add-function :before (process-filter PROC) #'my-tracing-functi= on) > > Please first add the simplest example possible: > > Function A prints "a". > > Make it print "ab" from now on. I've never used nadvice before, and I have to say that I found that section a bit confusing, too, because my immediate response was (like Dan's) to say "well, it should be trivial to make an advice that just modifies the output", so I thought "well, :around has to be it". But it isn't, :around is the super-flexible one: (defun my-foo (x) (* x 2)) (defun my-advice (old-fun x) (+ (funcall old-fun x) 1)) (advice-add 'my-foo :around #'my-advice) (my-foo 3) =3D> 7 Instead :filter-return is it, and it's the one mentioned last. So I'm adding this to the manual as an example first: (defun my-double (x) (* x 2)) (defun my-increase (x) (+ x 1)) (advice-add 'my-double :filter-return #'my-increase) (my-double 3) 7 --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 11:13:53 2019 Received: (at control) by debbugs.gnu.org; 9 Jul 2019 15:13:54 +0000 Received: from localhost ([127.0.0.1]:33748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkroX-00064P-LO for submit@debbugs.gnu.org; Tue, 09 Jul 2019 11:13:53 -0400 Received: from quimby.gnus.org ([80.91.231.51]:47674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkroT-00064B-Ba for control@debbugs.gnu.org; Tue, 09 Jul 2019 11:13:49 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkroP-0006Ub-UJ for control@debbugs.gnu.org; Tue, 09 Jul 2019 17:13:48 +0200 Date: Tue, 09 Jul 2019 17:13:45 +0200 Message-Id: <87h87vtf4m.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #35250 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 35250 fixed close 35250 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 35250 fixed close 35250 27.1 quit From unknown Sun Jun 22 07:48:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 07 Aug 2019 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator