From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25581: 25.1; Incorrect statement in (elisp) `Hooks' Date: Mon, 30 Jan 2017 23:16:32 -0500 Message-ID: <87efzjrhi7.fsf@users.sourceforge.net> References: <8e81acfe-ecaa-4fac-9484-24541b232ba1@default> <87k29cq68h.fsf@users.sourceforge.net> <4218ccf3-da3c-43e3-9901-183e4ec81f71@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485836171 24636 195.159.176.226 (31 Jan 2017 04:16:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2017 04:16:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 25581@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 31 05:16:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1cYPrS-0006Et-E2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jan 2017 05:16:06 +0100 Original-Received: from localhost ([::1]:36077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYPrX-0002tn-UT for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Jan 2017 23:16:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYPrS-0002tg-Ff for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 23:16:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYPrO-0007sy-F4 for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 23:16:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53395) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cYPrO-0007sq-CH for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 23:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cYPrN-0005Gy-Ud for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 23:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Jan 2017 04:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25581 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25581-submit@debbugs.gnu.org id=B25581.148583613120217 (code B ref 25581); Tue, 31 Jan 2017 04:16:01 +0000 Original-Received: (at 25581) by debbugs.gnu.org; 31 Jan 2017 04:15:31 +0000 Original-Received: from localhost ([127.0.0.1]:51593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYPqs-0005G1-SO for submit@debbugs.gnu.org; Mon, 30 Jan 2017 23:15:31 -0500 Original-Received: from mail-io0-f173.google.com ([209.85.223.173]:34120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYPqr-0005Fn-Ha for 25581@debbugs.gnu.org; Mon, 30 Jan 2017 23:15:29 -0500 Original-Received: by mail-io0-f173.google.com with SMTP id l66so123586822ioi.1 for <25581@debbugs.gnu.org>; Mon, 30 Jan 2017 20:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+VGlvHC5MSJ2WbVH5ZUH6TIjcAcuYutt8Llj+E+iHdI=; b=ST/wgU33W8toCz8W1RRM0tdLHtPhkoNBqcfz0kiBT2IsYqJm7ihAVluxWYumOgMOvh DMKXTgst2YvA5KQlSOZ7xGC1SH2SdlJXwhbeR7q4SqG8gOF5+b2pKzYIiiKagQMrtCRl 0UB0uhxj/kg6zNd6BsikZN2rVW7sh1gNqCxmNgbYUPHtsHbD8BlfBa6N/nTHtP72QTzg UwPzJ+T/ynV/bZUyoT+NDEU6SKOyNWL2+Xr+0OVUqZznLdMD1cZHSIQV+rC157pcDf1b rcgq6q6dT7Xy1HY3XgecXRDBq8vcZ98lMTN2r6QuecPlQDkSsZhGbMVSP6c1BkyPaCWG socA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=+VGlvHC5MSJ2WbVH5ZUH6TIjcAcuYutt8Llj+E+iHdI=; b=VHPJsVy0pwXL+aeIDVDSaUthwL4cmR1909LxKUQ5Z13fkY54j678gSPnbzrfy4mo4v giNVSsgyLZYrhwHfZ4YMVBSPwbyaWSpflFOuoENRp7VYotsOXZRaiCiH5RdkNXeQZEcg qYeIVR/RiGe4McAE9j3pBaGjYm0rtapcRArt/ubnizQADFbx9fzwFNZJ7atVElz7hmog t1aENt2VGdfV9dNH9uPMBygb+YGhH86cJ83DRpaCpl+KCdr16sukFvEBUtKEKnW4F3Uj piuZFZUH+ruNPQhArn1KFPrtHM1QgSLrIS6hfujuhLNNvgbTD+eNKJDRA5fiQfRDUItN m4gw== X-Gm-Message-State: AIkVDXKJaioCXfdT21lY8kxkvTs9FWUgpt20AdlccZa1u+2f/rWMTEACxh4Sb79OEpq9Mg== X-Received: by 10.107.128.68 with SMTP id b65mr22080374iod.113.1485836124014; Mon, 30 Jan 2017 20:15:24 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id y124sm7655718itd.19.2017.01.30.20.15.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jan 2017 20:15:23 -0800 (PST) In-Reply-To: <4218ccf3-da3c-43e3-9901-183e4ec81f71@default> (Drew Adams's message of "Mon, 30 Jan 2017 19:55:23 -0800 (PST)") 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: 208.118.235.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:128819 Archived-At: Drew Adams writes: >> >> If the variable's name ends in @samp{-function}, then its value is >> +just a single function, not a list of functions. @code{add-hook} >> +should not be used to modify such a @emph{single function hook} > ^^^^^^^^^^ >> +because it would turn the value into a list. Use @code{add-function} > ^^^^^^^ >> +instead (@pxref{Advising Functions}). > > Not in my opinion. The fact that it automatically turns the > value into a list is a _feature_, not something to avoid. Perhaps an example would help clarify things: emacs -Q M-: (add-hook 'blink-paren-function #'ignore) RET insert "()" blink-paren-post-self-insert-function: Invalid function: (ignore blink-matching-open) In my opinion, such errors (triggered by putting a list where a function was wanted) are something to avoid. > Yes, it is true that there are "single-function" hooks > (hooks that happen to have only one function at the > moment) and "single-function" hooks (hooks that are > designed/expected to only ever have a single function, > never zero or more than one). And yes, the current > wording is a bit ambiguous in this regard. IMO the current wording is pretty unambiguous that a variable ending in "-function" should be a single function and not a list. But if you feel differently, please suggest an alternate wording. > > And such code should also _document_ this (exceptional) > need for its hook to have only a single function. >From a quick look at M-x apropos-variable RET .*-function$ RET, every such variable is described as "a function" or "function" which is clearly not a list of functions.