From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#25581: 25.1; Incorrect statement in (elisp) `Hooks' Date: Mon, 30 Jan 2017 22:36:51 -0500 Message-ID: <87y3xrdhnw.fsf@holos> References: <8e81acfe-ecaa-4fac-9484-24541b232ba1@default> <87k29cq68h.fsf@users.sourceforge.net> 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 1485833833 28119 195.159.176.226 (31 Jan 2017 03:37:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2017 03:37:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 25581@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 31 04:37: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 1cYPFi-00075W-T5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jan 2017 04:37:07 +0100 Original-Received: from localhost ([::1]:35962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYPFo-0006Ba-FK for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Jan 2017 22:37:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYPFi-0006BH-D2 for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:37:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYPFe-0006JV-FT for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53375) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cYPFe-0006JR-AJ for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cYPFe-00035v-3D for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2017 22:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Jan 2017 03:37: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.148583382111886 (code B ref 25581); Tue, 31 Jan 2017 03:37:02 +0000 Original-Received: (at 25581) by debbugs.gnu.org; 31 Jan 2017 03:37:01 +0000 Original-Received: from localhost ([127.0.0.1]:51574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYPFc-00035c-SX for submit@debbugs.gnu.org; Mon, 30 Jan 2017 22:37:01 -0500 Original-Received: from mail-qk0-f182.google.com ([209.85.220.182]:36208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYPFa-000358-S8 for 25581@debbugs.gnu.org; Mon, 30 Jan 2017 22:36:59 -0500 Original-Received: by mail-qk0-f182.google.com with SMTP id 11so151328801qkl.3 for <25581@debbugs.gnu.org>; Mon, 30 Jan 2017 19:36:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=v3Hb1iXwI3R7FAg+fYGxUVUsX8Z9MHZuSM/TWmWE79U=; b=R3gBLgBKEFyOUVgsEPy8epp0bDzpqdMIdpS/13Rcti7TuZ8vEYvKTnxwa36FaBJuGx tmQt54fg4dJcwkBbbavliGIZ64M3yomvPej5ZZtlyJhLtattbHmSOeJWSgMShYkc36PG JI7SWXOmpWw52yrdxiNTqUJZAe4T30WPXS+KuwA2lX7E+MBj959UEoZnq7CC2Pdyrq2B 3BaRTmNh3IYwCuKoebtU/1Oyy2ECgT20JpiMKosmXP54evddxFPfUZf5YyVnBvkuqhkp E1SLO92Byy3wm9HlGsrM9qZDWIzM2yF7gDELHpyAWDl6RkKTjjsL5gEUypjx4vS6BrjX f2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=v3Hb1iXwI3R7FAg+fYGxUVUsX8Z9MHZuSM/TWmWE79U=; b=k6VKCeD8usq2fmAxW7lou7uaKfseoUtBp1XCH3Gh8n85O5d3crP2yBoUZu4RUbQTa4 CydwkHgJIfT4KWtbAqF4tFHJdR1TCFikCcRMKiLt4veYHEznp9WgbG/to7jCZ1g0VzR2 hm6IWdVB5G4ADby+r8GX/wnceMDn4ZsQID9KIGYycBkYvyDvBY8elhOOkerg6qCboqg4 +4TdnOz683ueKbkSjTq5QGwD0UpnFTAWNQNIxGo3rjHl6j+MIJ+Z90fWUKDXtWdOO9ro zi+SY0439y5ZeS/i75x2MUeVC2GR+kGyJq8WJZwmQRNFxg2B9p4HoN9loXc6qfAG1V15 4ewA== X-Gm-Message-State: AIkVDXLBgtDIv/qJMWV4rVJryglLnpmjEjj+GIzKvGYPOpe31FTd5SOudNRM0ueFL6L7EoRm X-Received: by 10.55.190.199 with SMTP id o190mr24437825qkf.292.1485833813319; Mon, 30 Jan 2017 19:36:53 -0800 (PST) Original-Received: from holos.localdomain (pool-173-67-40-97.bltmmd.fios.verizon.net. [173.67.40.97]) by smtp.gmail.com with ESMTPSA id k67sm11644131qkk.46.2017.01.30.19.36.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 19:36:52 -0800 (PST) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 8637560D6A; Mon, 30 Jan 2017 22:36:51 -0500 (EST) In-Reply-To: <87k29cq68h.fsf@users.sourceforge.net> (npostavs's message of "Mon, 30 Jan 2017 22:05:18 -0500") 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:128816 Archived-At: npostavs@users.sourceforge.net writes: > 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, the= n 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::). >> >> 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=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}). Better, but the typical practice of setq'ing to another named function should be mentioned before advice.