From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: 1) (elisp) `Advising Named Functions', 2) search filtering example Date: Mon, 17 Oct 2016 10:37:41 -0400 Message-ID: References: <5a44a850-e4fc-4c9f-a266-c74766810ba1@default> <1807679d-1125-4afe-81b7-b8d8e78aa2c6@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1476715288 22098 195.159.176.226 (17 Oct 2016 14:41:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 14:41:28 +0000 (UTC) Cc: emacs-devel To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 16:41:24 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw96D-0003pn-7r for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 16:41:09 +0200 Original-Received: from localhost ([::1]:33535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw96F-0008Db-CS for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 10:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw92u-0005ZS-AU for emacs-devel@gnu.org; Mon, 17 Oct 2016 10:37:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw92t-0004MI-8y for emacs-devel@gnu.org; Mon, 17 Oct 2016 10:37:44 -0400 Original-Received: from mail-oi0-x22e.google.com ([2607:f8b0:4003:c06::22e]:34161) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bw92t-0004Lv-4C for emacs-devel@gnu.org; Mon, 17 Oct 2016 10:37:43 -0400 Original-Received: by mail-oi0-x22e.google.com with SMTP id t73so214542448oie.1 for ; Mon, 17 Oct 2016 07:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=wEK9FDQt5UPQb93pzW6cGlP/S4nC2AY4OMVqHf5ugBI=; b=zXq4VFVSG+lhg2XMbPCV4qxCBraiOq1k15c5qboDTG8aL9RKghQ1iJ8yca59sV7s9U ggDjneG1QxZw6boBtxpFX58furvumWnBy0QhHkX6g4bXi4JR7n3n0Hu202shNKqxHmUb PqyStzKvLcJiizA4TR7Nvk+HEnrP/CEGXpnUavtDVCIm+flusSMvwizLMwjjCQOAfjxc FvCY4zlmLPbgHX7fDFxvGyoCYbOwUNffIukyYe4f1Iepsk/ZVDJT41ZO7Ukw4OfPCPAM YQVu2vDCjUeQ9gzayx1F3zndQA+nTQqoDKnxgZ/Zq7nISuVEdBPjrdzH8Xbmz/n2hsiJ u13w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=wEK9FDQt5UPQb93pzW6cGlP/S4nC2AY4OMVqHf5ugBI=; b=NFi4jSnt8bkYlIFfZi9zH44BkGytd2VvaLpbjaKSojSJHVL+rvDdWYYa1uWH3+qbDu dnAwNiydlGw4KUgXqHrUGlWGLFU5a4ZDsVqbYbt+pTLwIJncCryqE8IhC3Sp+F8hm6NX tLgUSInU5emdLvd95HTI9HLqzwpfAxEafHlFGnVVy0vnpWKVwIQuQPEJMtQQ3RC6vM5e TbPt4+D0Ial5Ku2SwBSQvLM032BgSthJ9vHQCZWApsFmDNnKBahV/83S5T8OUg7nzLkB uYnurqe2E5vAKI1xGX8NH96+fC5nFXCyivVoWMjBVU71GF4HnrYoBbb8hLWYDGNl2H6x O97w== X-Gm-Message-State: AA6/9RkM6Tio6metdvEru40z9k/rgwNQFov+g7diCjRb4e3mjZSTNZzRqi/FgQKK1PW5xDM+FgyQ/a4iLrJ00g== X-Received: by 10.202.90.3 with SMTP id o3mr16270224oib.46.1476715062152; Mon, 17 Oct 2016 07:37:42 -0700 (PDT) Original-Received: by 10.157.29.239 with HTTP; Mon, 17 Oct 2016 07:37:41 -0700 (PDT) In-Reply-To: <1807679d-1125-4afe-81b7-b8d8e78aa2c6@default> X-Google-Sender-Auth: 5wTY6LYX7MXp7VJYTCQaPRNeQWw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208357 Archived-At: On Mon, Oct 17, 2016 at 10:02 AM, Drew Adams wrote: >> `advice-add' puts advice on a function, `add-function' >> does not. > > I don't think so. AFAICS, `add-function' certainly does > "put advice on a function". You're right. I did have the impression that add-function was considered to be okay, just like add-hook is. But the manual doesn't say this (and also, I didn't realize that (add-function ...(symbol-function 'FUN)...) has almost the same effect as advice-add). So I was wrong to look at add-function vs advice-add; the important distinction is between the thing being added to, not the function used to do the adding. > > Do you think that that information does not apply also > to this code, from dired-aux.el? If so, why? > > (add-function :before-while (local 'isearch-filter-predicate) > #'dired-isearch-filter-filenames > '((isearch-message-prefix . "filename "))) I think it falls under this case in `(elisp) Hooks' (which should be updated to mention `-predicate' as a possible suffix) If the variable=E2=80=99s name ends in =E2=80=98-function=E2=80=99, = then its value is just a single function, not a list of functions. =E2=80=98add-hook=E2=80=99 c= annot be used to modify such a _single function hook_, and you have to use =E2=80=98add-= function=E2=80=99 instead (*note Advising Functions::).