all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#36618: 26.2; Misnamed `*-hooks' variables
@ 2019-07-12 15:16 Drew Adams
  2019-07-13 14:05 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2019-07-12 15:16 UTC (permalink / raw)
  To: 36618

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''





^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <<aed10b21-f313-4fd1-ac95-64d5f2f49451@default>]

end of thread, other threads:[~2019-07-13 17:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-12 15:16 bug#36618: 26.2; Misnamed `*-hooks' variables Drew Adams
2019-07-13 14:05 ` 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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.