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 13:53:55 -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 1476727488 1505 195.159.176.226 (17 Oct 2016 18:04:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 18:04:48 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 20:04:44 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 1bwCGv-0006FM-UU for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 20:04:26 +0200 Original-Received: from localhost ([::1]:34838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwCGx-0002JG-QA for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 14:04:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwC7K-0002y7-QS for emacs-devel@gnu.org; Mon, 17 Oct 2016 13:54:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwC7G-0003IR-Qp for emacs-devel@gnu.org; Mon, 17 Oct 2016 13:54:30 -0400 Original-Received: from [195.159.176.226] (port=48792 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwC7G-0003I1-K0 for emacs-devel@gnu.org; Mon, 17 Oct 2016 13:54:26 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bwC76-0000YY-3k for emacs-devel@gnu.org; Mon, 17 Oct 2016 19:54:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:ZC43WLqRnqXZvjeVmfgwaYB5OQw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 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:208375 Archived-At: >> If you do this, then you will break the callers, which expect the >> value of this variable to be a single function. > Tell that to the doc string for `add-hook', which has said what it > says in this regard for a very long time. There is no contradiction between the two. `add-hook's doc talks about the case where a "multiple-function hook" has a value which happens to be a single function (which is an acceptable value for those hooks, for historical reasons). Whereas we're here talking about "single-function hooks", i.e. variables which should only ever hold a single function and not a list of functions. You can use (add-hook ) on them, just like you can use (setq 5) on them. That doesn't mean that it's correct to do so. Stefan