[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36618: 26.2; Misnamed `*-hooks' variables

From: Drew Adams
Subject: bug#36618: 26.2; Misnamed `*-hooks' variables
Date: Fri, 12 Jul 2019 08:16:56 -0700 (PDT)

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

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

[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 via email to

[Prev in Thread] Current Thread [Next in Thread]