From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: 1) (elisp) `Advising Named Functions', 2) search filtering example Date: Mon, 17 Oct 2016 15:25:05 -0400 Message-ID: References: <5a44a850-e4fc-4c9f-a266-c74766810ba1@default> <1807679d-1125-4afe-81b7-b8d8e78aa2c6@default> <9f1cf1a7-6f05-449a-a4a2-c013cf326e9c@default> <6c7a705c-c810-49ec-a70c-376ba150205e@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476733557 26662 195.159.176.226 (17 Oct 2016 19:45:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 19:45:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 21:45:53 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 1bwDqd-0003Qi-7V for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 21:45:23 +0200 Original-Received: from localhost ([::1]:35455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwDqf-0006B6-9Y for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 15:45:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwDX5-0006Xc-Up for emacs-devel@gnu.org; Mon, 17 Oct 2016 15:25:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwDX2-0000MR-J4 for emacs-devel@gnu.org; Mon, 17 Oct 2016 15:25:11 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:33925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwDX2-0000J5-EL for emacs-devel@gnu.org; Mon, 17 Oct 2016 15:25:08 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u9HJOhEl027666; Mon, 17 Oct 2016 15:24:44 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 183E466239; Mon, 17 Oct 2016 15:25:05 -0400 (EDT) In-Reply-To: (Drew Adams's message of "Mon, 17 Oct 2016 11:41:56 -0700 (PDT)") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5830=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5830> : inlines <5350> : streams <1716486> : uri <2309630> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:208381 Archived-At: > That's one interpretation. There is no mention of the fact that > the hook it is talking about is necessarily a "multiple-function > hook" that happens to have a single function as value. That's because you misunderstand its doc. The confusion comes from the multiple uses of the name "hook". There are basically two uses of the word "hook" in the context of Emacs: - a very generic sense, which refers to some kind of way to influence the behavior of something. Used also sometimes as a verb "you can hook directly into ..." which might be used even in cases where the "hooking" is done by modifying some chunk of code. Sometimes "hook" is even used to just mean a customization point ("that package doesn't give me any hook to specify which char to insert"). - a specific sense, which refers to an "object" implemented as a symbol where the symbol-value slot holds a list of functions (and the "hook" is really the symbol, not the list of functions, because we can also use its various buffer-local values). The second subsumes the first. So *-function is a hook in the first sense but not in the second. Whereas *-functions and *-hook are hooks in both senses. add-hook and remove-hook only apply to hooks in the second sense. The advice mechanism treats every symbol's function definition as a hook (in the first sense), whether the author intended it that way (as is the case for `ask-user-about-supersession-threat') or not. Stefan