From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#25581: 25.1; Incorrect statement in (elisp) `Hooks' Date: Mon, 24 Aug 2020 17:58:19 +0200 Message-ID: <87zh6k6nok.fsf@gnus.org> 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="22155"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 25581@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 24 17:59:09 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 1kAEsH-0005ce-4A for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 17:59:09 +0200 Original-Received: from localhost ([::1]:33900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAEsG-0001B3-6a for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 11:59:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAEsA-0001Ad-6z for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 11:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAEs9-0000ZA-Tu for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 11:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kAEs9-00029F-RL for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 11:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Aug 2020 15:59:01 +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.15982847128219 (code B ref 25581); Mon, 24 Aug 2020 15:59:01 +0000 Original-Received: (at 25581) by debbugs.gnu.org; 24 Aug 2020 15:58:32 +0000 Original-Received: from localhost ([127.0.0.1]:58987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAErf-00028U-Vm for submit@debbugs.gnu.org; Mon, 24 Aug 2020 11:58:32 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:59204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAEre-00028G-DH for 25581@debbugs.gnu.org; Mon, 24 Aug 2020 11:58:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6PLOMx1QWPOa+CzvOUd6uVZFTYRhKZUDabXRYrGqwiQ=; b=pmiCaaF0J4Ti4gXRC6v+vKyB25 jGwhZLphTNq0bIeUoE6CoXqLAqKnooZxpg9O/FVQvpDNQDT81h4A6GlJmTzCa4zRx6ZUgsbuVoATM lCbJ6e9r3V0OE6FH+HsEzj6kZkrZ+QFzXwXucpapIXvk54WQe0Im9I1PLd58YvLQo86o=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAErV-0008R3-7y; Mon, 24 Aug 2020 17:58:24 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAM1BMVEX+/v6flpLZ0tDC urORbmBRS0+jiHZqYGJRPkA0KS3y7+58eYQRDA0oFhlRKimFTTn///9iki0AAAAAAWJLR0QQlbIN LAAAAAd0SU1FB+QIGA83HRyBTFUAAAFTSURBVEjH7VNdc8MgDINix3aCyf//t5Vg63Vvye1uL6va wqVIyF8p5b+gPu7xm8gtRZWqdxR1M9UbHs3UALeLiiYa4GO55tHArYSoyX5BsFcK1Nr1LKpBY7C4 mvWOaDysXa/rLqxSu8xnVDc7fX+Wfgf0pOEjx3HUF44f2wsPMEvPiJ461957BFdgbZk5CGyeXX1Y wZ6pByYgI4NzppOLp0n2kxhDMU493QrOM/CQgevxr6rFu+A8vxXgD4GDejcLnaGEurvl4mNZApmC gXscOQTvNIQ+aR7w9gif7wAGVDZ88aPAcN1RGIVD0L/iiOFYAOVNIG/k0yEVUSGHXA59BQKgJJM+ fWR6UMAYcFAy0AAkyiTnrWQqXzG6wIJNOoUlQI4jSjeOr67i0wjKpQrGB4vahE3ACctYrDW+Iu9g g9l3NP/YZAMBQc0THPzlFH7wwQdPGiITZaylytEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDgt MjRUMTU6NTU6MjkrMDA6MDDF09D6AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA4LTI0VDE1OjU1 OjI5KzAwOjAwtI5oRgAAAABJRU5ErkJggg== X-Now-Playing: Joe Jackson's _Blaze of Glory_: "Rant and Rave" In-Reply-To: (Stefan Kangas's message of "Mon, 24 Aug 2020 11:54:28 -0400") 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:186178 Archived-At: Stefan Kangas writes: >>> If the variable=E2=80=99s name ends in =E2=80=98-function=E2=80=99, th= en its value is just a >>> single function, not a list of functions. =E2=80=98add-hook=E2=80=99 = cannot 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 messag= e)) run-hooks is very permissive -- you can set the value of a -hooks variable to a single function, and it'll still work: (setq my-hook (lambda () (message "foo"))) (run-hooks 'my-hook) So I think Drew is assuming that this -function variable would be run by run-hook, and then things would still indeed work. > 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. But -functions variables are abnormal hooks. -function variables aren't hooks at all. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no