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 22:05:18 -0500 Message-ID: <87k29cq68h.fsf@users.sourceforge.net> References: <8e81acfe-ecaa-4fac-9484-24541b232ba1@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 1485831917 16908 195.159.176.226 (31 Jan 2017 03:05:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2017 03:05:17 +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 04:05:13 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 1cYOko-00042Y-0m for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jan 2017 04:05:10 +0100 Original-Received: from localhost ([::1]:35905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYOkq-0007dL-Ag for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Jan 2017 22:05:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYOkj-0007c0-NN for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:05:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYOkg-0005hB-Im for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:05:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cYOkg-0005h7-G0 for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cYOkg-0007vw-2b for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:05:02 -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 03:05:02 +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.148583185730333 (code B ref 25581); Tue, 31 Jan 2017 03:05:02 +0000 Original-Received: (at 25581) by debbugs.gnu.org; 31 Jan 2017 03:04:17 +0000 Original-Received: from localhost ([127.0.0.1]:51553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYOjx-0007tA-E4 for submit@debbugs.gnu.org; Mon, 30 Jan 2017 22:04:17 -0500 Original-Received: from mail-io0-f176.google.com ([209.85.223.176]:36505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYOjv-0007sf-LN for 25581@debbugs.gnu.org; Mon, 30 Jan 2017 22:04:15 -0500 Original-Received: by mail-io0-f176.google.com with SMTP id j13so122376177iod.3 for <25581@debbugs.gnu.org>; Mon, 30 Jan 2017 19:04:15 -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:content-transfer-encoding; bh=Lm1k8pDCX018N8yQGg/ShSiZ6Cs7FXVP5yxWchqm+iU=; b=N4/vTwszTwZRQ67ZUeEtDdw3vPMLRfilJwYRd8H9dZs4MT9MOBjpyFcdJkpdaMLMtR n9BrWTd64Da8C4BoIXpmOoEOYm67OzH3Xzje0wCKIlOEtNk0FY/RBskI+AJKtQc+tvCx 4Na8IDj+xnJ4QvcmPQES6KFO1S0bjeGYr1R/sWFW3hJknmr9Z1f+CGRJa/znnEcP2wFB 0egDYFwHQTeBGMJ/p70wASTK4Rc/uN2dnvK1FFIDvqU/kl4uVbUdrKCTXKhPt48D79xP 5M4Eq0d9Icm3QBiNK1bMOUVjEF6uCt2p+1M6TtmVsk5rxIEVjadUrKTNS1Plq7XYouTl gzrg== 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 :content-transfer-encoding; bh=Lm1k8pDCX018N8yQGg/ShSiZ6Cs7FXVP5yxWchqm+iU=; b=AnBIpWvWO37D9JxBTMy7vdgE1Uwq3Q7Irnt5nzCfoWixvERxNxPLf/J3RHnH+CsXpI ETiICLbyldc0Pe00p2VcaKEU9GXszC1WF+1ircCPl+7EGxcOx5TtsS5UCmlIM2kWn9xK BPEX/78pQmcmJdNQXGUEyazFF/fGTiq3hTLBvSuau2PFufYTCfWF5Kg7HlHoJD8kHw1F xs8WVA3mJlDKQ+yn1sA6q+r+NuoxLvH1eLMfmiQPz/CKuAB2X1JTpQ8Hh4mJ1TmNf8JN 87j9RK5cCnaFcdTSRyo21OICyIqDREMFiRhIwJaEprHpO/n9j9VbarROgV6Xin+hWjV2 x73w== X-Gm-Message-State: AIkVDXKuaIM9AzlTPM1aoMQix3mZT10x8a4BBi6ZxhfZggr1QhU8kF+RHtt3NpW93gy6DA== X-Received: by 10.107.12.88 with SMTP id w85mr20567682ioi.96.1485831850121; Mon, 30 Jan 2017 19:04:10 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id r203sm7602563itc.5.2017.01.30.19.04.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jan 2017 19:04:09 -0800 (PST) In-Reply-To: <8e81acfe-ecaa-4fac-9484-24541b232ba1@default> (Drew Adams's message of "Mon, 30 Jan 2017 08:51:20 -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:128813 Archived-At: Drew Adams writes: > The second sentence here is incorrect: > > 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 ca= nnot be used to > modify such a _single function hook_, and you have to use =E2=80=98add-f= unction=E2=80=99 > instead (*note Advising Functions::). > > You CAN use `add-hook' to modify such a single-function hook. > Nothing prevents you from doing so. And nothing even suggests > that you should not. And you have always been able to do so. > > And this is the case whether or not the "single function hook" > is intended to always be single-function (which intention > AFAIK, is not enforced anywhere) or it is intended to have > any number (including zero and one) of functions. > So something like this? --- i/doc/lispref/modes.texi +++ w/doc/lispref/modes.texi @@ -74,9 +74,10 @@ Hooks =20 @cindex single-function hook 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} cannot be -used to modify such a @emph{single function hook}, and you have to use -@code{add-function} instead (@pxref{Advising Functions}). +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}). =20 @menu * Running Hooks:: How to run a hook.