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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26623 in the body.
You can then email your comments to 26623 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Sun, 23 Apr 2017 17:02:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 23 Apr 2017 17:02:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; bad variable name: `inside-post-command-hook'
Date: Sun, 23 Apr 2017 10:00:52 -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.

This is a Boolean-valued, internal variable whose value indicates only
whether execution is currently inside the post-command-hook.

It should have a name that indicates (1) that it is Boolean and
perhaps (2) that it is internal.

In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 26 Apr 2017 05:37:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 26623 <at> debbugs.gnu.org
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 26 Apr 2017 08:35:31 +0300
> Date: Sun, 23 Apr 2017 10:00:52 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> 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.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 26 Apr 2017 13:40:02 GMT) Full text and rfc822 format available.

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 26 Apr 2017 15:38:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 26623 <at> debbugs.gnu.org
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 26 Apr 2017 18:37:08 +0300
> Date: Wed, 26 Apr 2017 06:39:18 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 26623 <at> debbugs.gnu.org
> 
> This is a perversion, which works against users.

It can only work in a few exceptional cases, I agree.  And I think
this is one such case.  If this were wide-spread, then yes, we should
have done something about it.

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

We disagree, that's all.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 26 Apr 2017 17:20:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 26623 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 26 Apr 2017 13:18:51 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

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

I think it is a good idea to avoid making more variables that are not
hooks but have names which suggest they were hooks.  Let's aim to have
-hook mean it's a hook.


Perhaps `inside-post-command-hook-call' is a good name for this
variable.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 26 Apr 2017 17:20:02 GMT) Full text and rfc822 format available.

Message #20 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 10:19:33 -0700 (PDT)
> > > I think the name of this variable speaks very clearly for its purpose,
> >
> > No, it does not speak clearly for its purpose.

Reasons given elided, not addressed.

> We disagree, that's all.

No reasons given.

Ever use an `apropos' command on variables whose names end in
`-hook'?  Do you expect to see only hook variables for that?

Ever use regexp-matching completion with `C-h v' for `-hook$'?
Do you expect to see only hook variables for that?

Is there an actual reason why you will not add a suffix (or
make another suitable name change) to indicate clearly that
this is not a hook variable?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 26 Apr 2017 18:44:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: rms <at> gnu.org
Cc: 26623 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 26 Apr 2017 21:42:23 +0300
> From: Richard Stallman <rms <at> gnu.org>
> CC: drew.adams <at> oracle.com, 26623 <at> debbugs.gnu.org
> Date: Wed, 26 Apr 2017 13:18:51 -0400
> 
> I think it is a good idea to avoid making more variables that are not
> hooks but have names which suggest they were hooks.  Let's aim to have
> -hook mean it's a hook.

I agree, and I wrote that much.  But having a single variable ending
in a "-hook" that is an exception from that rule is hardly a
catastrophe.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 26 Apr 2017 19:34:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 26623 <at> debbugs.gnu.org
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 26 Apr 2017 22:32:09 +0300
> Date: Wed, 26 Apr 2017 10:19:33 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 26623 <at> debbugs.gnu.org
> 
> > > > I think the name of this variable speaks very clearly for its purpose,
> > >
> > > No, it does not speak clearly for its purpose.
> 
> Reasons given elided, not addressed.

There's no need for reasons to disagree about clarity of something.

> > We disagree, that's all.
> 
> No reasons given.

Reasons were given, but were elided and ignored.

And btw, where's that variable defined?  I cannot find its definition,
and C-h commands cannot find anything whose name is
inside-post-command-hook or similar.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Thu, 27 Apr 2017 10:20:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 26623 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Thu, 27 Apr 2017 06:19:29 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  >   But having a single variable ending
  > in a "-hook" that is an exception from that rule is hardly a
  > catastrophe.

It's not a catastrophe, but it's a flaw -- and easy to fix.
So let's fix it.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 10 May 2017 02:10:01 GMT) Full text and rfc822 format available.

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

From: npostavs <at> users.sourceforge.net
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 26623 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Tue, 09 May 2017 22:10:45 -0400
tags 26623 unreproducible moreinfo
quit

Eli Zaretskii <eliz <at> gnu.org> writes:

> And btw, where's that variable defined?  I cannot find its definition,
> and C-h commands cannot find anything whose name is
> inside-post-command-hook or similar.

Yeah, there's seems to have been quite a bit of discussion over a
variable that apparently doesn't actually exist.




Added tag(s) moreinfo and unreproducible. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Wed, 10 May 2017 02:10:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 10 May 2017 06:27:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: Eli Zaretskii <eliz <at> gnu.org>, 26623 <at> debbugs.gnu.org
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 10 May 2017 02:25:49 -0400
follow-inside-post-command-hook




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Wed, 10 May 2017 06:34:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: 26623 <at> debbugs.gnu.org
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Wed, 10 May 2017 02:33:34 -0400
PS simply make the initial report a patch next time, please.
Think of the users! (And the developers.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26623; Package emacs. (Sat, 20 May 2017 23:15:02 GMT) Full text and rfc822 format available.

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

From: npostavs <at> users.sourceforge.net
To: Richard Stallman <rms <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 26623 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#26623: 24.5; bad variable name: `inside-post-command-hook'
Date: Sat, 20 May 2017 19:16:12 -0400
tags 26623 = fixed
close 26623 26.1
quit

Richard Stallman <rms <at> gnu.org> writes:
>
> Perhaps `inside-post-command-hook-call' is a good name for this
> variable.
[...]
> It's not a catastrophe, but it's a flaw -- and easy to fix.
> So let's fix it.

Done [1: abd098200b].

[1: abd098200b]: 2017-05-20 19:13:57 -0400
  Don't end non-hook variable with "-hook" (Bug#26623)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=abd098200bfba2577dfff800f27d5474f13cc1f3




Added tag(s) fixed; removed tag(s) unreproducible and moreinfo. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 20 May 2017 23:15:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 26623 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 20 May 2017 23:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Jun 2017 11:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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