GNU bug report logs - #26623
24.5; bad variable name: `inside-post-command-hook'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 23 Apr 2017 17:02:01 UTC

Severity: wishlist

Tags: fixed

Found in version 24.5

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #11 received at 26623 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 26623 <at> debbugs.gnu.org
Subject: RE: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 26 Apr 2017 06:39:18 -0700 (PDT)
> > This variable's name should not end in `-hook', because that means,
> > by convention, that this is a hook variable, which it is not.
> 
> No, it's the other way around: a hook variable should have its name
> end in "-hook", but not every symbol whose name ends in "-hook" is a
> hook variable.

Clearly nothing _prevents_ a non-hook-variable symbol from having
such a perverted name as to suggest that it is a hook variable.

But that is not what the convention is for.  I don't think you
can show documentation to support such a use.

This is a perversion, which works against users.  Think `apropos'
or think completion (assuming substring or regexp matching, both
of which are possible now even with vanilla Emacs), to look for
or discover hook variables.

This particular non-hook variable works against users for this
and similar use cases - it simply gives the wrong message,
claiming loud and clear that it is a hook variable.  And to
what end?  What possible reason could we have for keeping such
a misleading name here?

> I think the name of this variable speaks very clearly for its purpose,
> and see no reason for such formalism in this case.

No, it does not speak clearly for its purpose.  Its purpose is
to be a Boolean flag for whether execution is currently inside
that hook.

Simply end the name with `-p' or `?' or some other suffix that
suggests that this is a Boolean variable.  And more importantly
does not suggest that it is a hook variable, which it is not.




This bug report was last modified 8 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.