From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#25581: 25.1; Incorrect statement in (elisp) `Hooks' Date: Mon, 24 Aug 2020 11:54:28 -0400 Message-ID: References: <8e81acfe-ecaa-4fac-9484-24541b232ba1@default> <87k0xo83ww.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 25581@debbugs.gnu.org To: Lars Ingebrigtsen , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 24 17:55:16 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAEoV-0000ud-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 17:55:15 +0200 Original-Received: from localhost ([::1]:52700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAEoU-0005Nr-GG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 11:55:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAEoI-0005Lx-GB for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 11:55:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAEoI-0008SC-5r for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 11:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kAEoI-00023Q-42 for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 11:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Aug 2020 15:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25581 X-GNU-PR-Package: emacs Original-Received: via spool by 25581-submit@debbugs.gnu.org id=B25581.15982844767818 (code B ref 25581); Mon, 24 Aug 2020 15:55:02 +0000 Original-Received: (at 25581) by debbugs.gnu.org; 24 Aug 2020 15:54:36 +0000 Original-Received: from localhost ([127.0.0.1]:58975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAEnr-000221-Uh for submit@debbugs.gnu.org; Mon, 24 Aug 2020 11:54:36 -0400 Original-Received: from mail-yb1-f178.google.com ([209.85.219.178]:46407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAEnq-00021q-59 for 25581@debbugs.gnu.org; Mon, 24 Aug 2020 11:54:34 -0400 Original-Received: by mail-yb1-f178.google.com with SMTP id x10so5417857ybj.13 for <25581@debbugs.gnu.org>; Mon, 24 Aug 2020 08:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc:content-transfer-encoding; bh=+Jm9MHuP1Eblih+rSQ6BsgWuyHUt9LRZrPquCyKDcCA=; b=OCgevn+dUsE3vsQTpdQbhB6Qm4RedN9KmM+vS9RLaKlFY9ENTNhTL7/MLm2pxDIDKX 2queSLWPhAMyo6jGlq9/fnkom30yZISVMat2+i1/egv9GX/oJSv9oTF07TPAlv8edKPW iwOP4oZytR686hTEdHf9fHUTJ2LeIt77Qc5X79afBTh8pw8JUJxVWRJEMSvDFCfX9jE/ ZW9pNNlEZ2hd9dUHJqM3TB4Z/CbP1cDhb0hkjqTIj9h5UHbHCvMzKPRfYN51e6bIwLsF 1w85X5YNpa4v8WJVdKHrPTL0lRFYWky5VI5ZTBOzeVdH+uGkzgmzKpqOrdbEeu2TWH8O L9mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc:content-transfer-encoding; bh=+Jm9MHuP1Eblih+rSQ6BsgWuyHUt9LRZrPquCyKDcCA=; b=m8rEZH5QGSKOu90oUoniM+ifqfWY7/jjMBM4WL6ykBsnz9r9yNq0/jIZYK9++mpadv YAVy3RRDwq35Wf6jHHZJfSzX6GlF9ijm27sISCMxQUaBX6Kiu6Uadu0L16xYo0y+Kpth Wnbfwe67encbgKpwC+QNd7U2vYfzcRSa2ywqLlkBP1zoL9TzaoaFZYticwRlGyRKjrdJ kOs1yhPUhpvE+yvDs8d2PzOBlJKp1GkAOsmi8NI4KWutE9HKi+XR5dMAAlgDBt8cHNMK SNaWAzF5ihs2iglXSK76OjCggJotGVBuMnuNgYLdA/gha/MmG4dvE8CZJhcUnjgPxIpX TvDQ== X-Gm-Message-State: AOAM532e7U/8yphEIduZEvRjwHGyPEkunTWvd/L/mACnFvra875VCXz5 wKMQoG3aJpAeI1wpD8D7DEjoq0LjekEsw2v5Pwmm2mCif9SmZg== X-Google-Smtp-Source: ABdhPJzq27Ywv3hr1aup52W8Xof2CQr+f0Bdy839c6rey4ZGBgI01hYgr1sz2szppKfaVl7CVdAgXyGCxdv8xFehQQI= X-Received: by 2002:a25:b290:: with SMTP id k16mr8113873ybj.389.1598284468567; Mon, 24 Aug 2020 08:54:28 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 24 Aug 2020 11:54:28 -0400 In-Reply-To: <87k0xo83ww.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186176 Archived-At: Lars Ingebrigtsen 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. I'm not sure the above makes sense. Doesn't it usually work like: (setq foo-function 'message) (add-hook 'foo-function 'error) ; should work? (funcall foo-function) ; =3D> Lisp error: (invalid-function (error message)= ) > Well, the name -function suggests that you shouldn't. > > I think the confusing thing here is that foo-function isn't a hook at > all -- variables ending with -function are normally not executed with > run-hooks at all, so using add-hook on such a variable will normally > break. > > So I'm not sure what that section is doing in the Hooks node at all. It > origin starts here, where unfortunately vc-region-history gives up. > > My preference here would be just to remove the paragraph, which is > pretty confusing. It sort of makes sense when read next to the paragraph before, doesn't it? There the concept "abnormal hook" is defined with an explanation of variables ending in '-functions', and the paragraph about variables ending in '-function' is written mostly in contrast to that. I think the confusing thing here is that there are two ways to modify these single function hooks: setq and add-function.