unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 36618@debbugs.gnu.org
Subject: bug#36618: 26.2; Misnamed `*-hooks' variables
Date: Fri, 12 Jul 2019 08:16:56 -0700 (PDT)	[thread overview]
Message-ID: <aed10b21-f313-4fd1-ac95-64d5f2f49451@default> (raw)

The following variable names end in `-hooks', instead of `-hook' or
`-functions' (there may be more - just noticed these in one of my
sessions):

bookmark-exit-hooks                    (OBS)
delay-mode-hooks                       (Bool)
delayed-mode-hooks                     XXX
ediff-before-session-group-setup-hooks XXX
find-file-hooks                        (OBS)
find-file-not-found-hooks              (OBS)
inhibit-modification-hooks             (Bool)
inhibit-point-motion-hooks             (Bool)
inhibit-startup-hooks                  (Bool)
local-write-file-hooks                 (OBS)
mail-yank-hooks                        (OBS)
recentf-used-hooks                     XXX
unload-feature-special-hooks           (aliased)
write-contents-hooks                   (OBS)
write-file-hooks                       (OBS)

Those marked "OBS" are declared to be obsolete.  Nothing need be done
now for those.

I suggest that `unload-feature-special-hooks', which is already aliased
to `load-hist-hook-functions', be made obsolete.

The ones marked "Bool" are not hooks.  They are Boolean values
indicating whether some behavior associated with particular hooks takes
place - e.g., whether mode hooks should be delayed.  I suggest that
these be renamed to indicate this.  We could, for example, follow the
convention (still encouraged by RMS) of adding the suffix `-flag'.

The ones marked "XXX" are also not hooks.  They're lists of hooks.  I
suggest they be re-suffixed `-functions' and the old names declared
obsolete.

[A code comment for `ediff-before-session-group-setup-hooks' says this:
 ;FIXME: Bad name (should be -hook or -functions) and never run??]

There's some ambiguity in the use of suffix `-functions'.  (elisp)
`Standard Hooks' says that it _usually_ means an abnormal hook.  But it
seems that sometimes it means just a list of hooks that some code will
do something with (not necessarily invoke them as abnormal hooks).

If we wanted to use a different suffix, to distinguish actual abnormal
hooks from such other lists of hooks (normal and abnormal) then those
marked "XXX" here fall into the latter group.


In GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
 of 2019-04-13
Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749
Windowing system distributor `Microsoft Corp.', version 10.0.17134
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





             reply	other threads:[~2019-07-12 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 15:16 Drew Adams [this message]
2019-07-13 14:05 ` bug#36618: 26.2; Misnamed `*-hooks' variables Lars Ingebrigtsen
2019-07-13 17:23   ` Drew Adams
2019-07-13 17:34     ` Eli Zaretskii
     [not found] <<aed10b21-f313-4fd1-ac95-64d5f2f49451@default>
     [not found] ` <<87d0ievxm5.fsf@mouse.gnus.org>
     [not found]   ` <<2b8f5747-6d20-494a-b727-fdd0b9245299@default>
     [not found]     ` <<83o91xzvm3.fsf@gnu.org>
2019-07-13 17:46       ` Drew Adams
2019-07-13 17:50         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aed10b21-f313-4fd1-ac95-64d5f2f49451@default \
    --to=drew.adams@oracle.com \
    --cc=36618@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).