GNU bug report logs - #24891
25.1: Falsehood on page "Major Modes" of Emacs manual.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sun, 6 Nov 2016 22:26:02 UTC

Severity: minor

Found in version 25.1

Done: Alan Mackenzie <acm <at> muc.de>

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 24891 in the body.
You can then email your comments to 24891 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#24891; Package emacs. (Sun, 06 Nov 2016 22:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 06 Nov 2016 22:26:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Sun, 6 Nov 2016 22:18:32 +0000
Hello, Emacs.

In the Emacs manual, page "Major Modes" appears the following:

    all programming language modes run `prog-mode-hook', prior to
    running their own mode hooks.

This is not true.  A counter example is stand alone CC Mode.  There will
be other examples, too, in code not maintained by Emacs.  I suggest
amending this sentence to something like:

    many programming language modes (including all these distributed
    with Emacs) run `prog-mode-hook', prior to runnuing their own mode
    hooks.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Sun, 06 Nov 2016 23:21:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Alan Mackenzie <acm <at> muc.de>, 24891 <at> debbugs.gnu.org
Subject: RE: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Sun, 6 Nov 2016 15:19:57 -0800 (PST)
> In the Emacs manual, page "Major Modes" appears the following:
>
>     all programming language modes run `prog-mode-hook', prior to
>     running their own mode hooks.
>
> I suggest amending this sentence to something like:
> 
>     many programming language modes (including all these distributed
>     with Emacs) run `prog-mode-hook', prior to runnuing their own
>     mode hooks.

+1.

But: these -> those,
     runnuing -> running,
     and we can drop the comma before "prior".

And I'm not sure why we need to or should say "(including...)".  Why?

I'd suggest just this:

  many programming language modes run `prog-mode-hook' before
  running their own mode hooks

Or even "some" instead of "many".  What does it matter how
many do this?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Sun, 06 Nov 2016 23:56:01 GMT) Full text and rfc822 format available.

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

From: Evgeny Roubinchtein <zhenya1007 <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 24891 <at> debbugs.gnu.org
Subject: Re: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Sun, 6 Nov 2016 18:55:29 -0500
[Message part 1 (text/plain, inline)]
Is it the case that the modes that do run prog-mode-hook are exactly the
modes derived from prog-mode?

On Sun, Nov 6, 2016 at 6:19 PM, Drew Adams <drew.adams <at> oracle.com> wrote:

> > In the Emacs manual, page "Major Modes" appears the following:
> >
> >     all programming language modes run `prog-mode-hook', prior to
> >     running their own mode hooks.
> >
> > I suggest amending this sentence to something like:
> >
> >     many programming language modes (including all these distributed
> >     with Emacs) run `prog-mode-hook', prior to runnuing their own
> >     mode hooks.
>
> +1.
>
> But: these -> those,
>      runnuing -> running,
>      and we can drop the comma before "prior".
>
> And I'm not sure why we need to or should say "(including...)".  Why?
>
> I'd suggest just this:
>
>   many programming language modes run `prog-mode-hook' before
>   running their own mode hooks
>
> Or even "some" instead of "many".  What does it matter how
> many do this?
>
>
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Mon, 07 Nov 2016 00:06:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Alan Mackenzie <acm <at> muc.de>, 24891 <at> debbugs.gnu.org
Subject: Re: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 7 Nov 2016 02:05:24 +0200
On 07.11.2016 00:18, Alan Mackenzie wrote:

> This is not true.  A counter example is stand alone CC Mode.  There will
> be other examples, too, in code not maintained by Emacs.  I suggest
> amending this sentence to something like:
>
>     many programming language modes (including all these distributed
>     with Emacs) run `prog-mode-hook', prior to runnuing their own mode
>     hooks.

I believe the idea is to equate "programming language mode" with 
"deriving from prog-mode".

To give a strong signal to major mode authors.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Mon, 07 Nov 2016 14:44:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 24891 <at> debbugs.gnu.org
Subject: Re: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 07 Nov 2016 09:43:29 -0500
[[[ 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. ]]]

  >     all programming language modes run `prog-mode-hook', prior to
  >     running their own mode hooks.

  > This is not true.  A counter example is stand alone CC Mode.

Shouldn't we arrange for that to get fixed?

-- 
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#24891; Package emacs. (Mon, 07 Nov 2016 19:48:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: Richard Stallman <rms <at> gnu.org>
Cc: 24891 <at> debbugs.gnu.org
Subject: Re: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 7 Nov 2016 19:46:42 +0000
Hello, Richard.

On Mon, Nov 07, 2016 at 09:43:29AM -0500, Richard Stallman wrote:
> [[[ 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. ]]]

>   >     all programming language modes run `prog-mode-hook', prior to
>   >     running their own mode hooks.

>   > This is not true.  A counter example is stand alone CC Mode.

> Shouldn't we arrange for that to get fixed?

No, because it's not broken.  One of the purposes of stand alone CC Mode
is to run on versions of (X)Emacs other than the latest Emacs.
Traditionally, define-derived-mode has had defects which have resulted
in bugs revealed by CC Mode - hopefully the last of these has now been
fixed.  So it's handy to have a CC Mode which isn't defined by
define-derived-mode.

The main point of my bug report still stands - there are an unknown
number of programming language modes out there which are not derived
from prog-mode.  This makes the sentence fragment referred to untrue, so
it should be modified.

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

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Mon, 07 Nov 2016 20:31:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: Evgeny Roubinchtein <zhenya1007 <at> gmail.com>
Cc: Drew Adams <drew.adams <at> oracle.com>, 24891 <at> debbugs.gnu.org
Subject: Re: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 7 Nov 2016 20:29:58 +0000
Hello, Evgeny.

On Sun, Nov 06, 2016 at 06:55:29PM -0500, Evgeny Roubinchtein wrote:
> Is it the case that the modes that do run prog-mode-hook are exactly the
> modes derived from prog-mode?

It is, yes.  It would be sort of nice to put this in the manual, but that
manual is the Emacs manual, not the Elisp manual, where it really
belongs.  Maybe a footnote pointing at the Elisp manual would be the
thing, here.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Mon, 07 Nov 2016 20:41:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 24891 <at> debbugs.gnu.org
Subject: Re: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 7 Nov 2016 20:39:59 +0000
Hello, Drew.

On Sun, Nov 06, 2016 at 03:19:57PM -0800, Drew Adams wrote:
> > In the Emacs manual, page "Major Modes" appears the following:

> >     all programming language modes run `prog-mode-hook', prior to
> >     running their own mode hooks.

> > I suggest amending this sentence to something like:

> >     many programming language modes (including all these distributed
> >     with Emacs) run `prog-mode-hook', prior to runnuing their own
> >     mode hooks.

> +1.

> But: these -> those,
>      runnuing -> running,

Yes, thanks.

>      and we can drop the comma before "prior".

Maybe, maybe not.  The bit beginning with "prior" isn't qualifying what
comes before, it's adding an extra bit of independent information, so the
comma is justified.

> And I'm not sure why we need to or should say "(including...)".  Why?

I'm told there are users who put things in prog-mode-hook to get effects
in (nearly) all programming modes.  It will avoid confusing them.  Also,
on a purely pragmatic point, the "(including...)" bit is likely to reduce
objections to my proposed change, allowing it to get into Emacs 25.2 more
smoothly.

> I'd suggest just this:

>   many programming language modes run `prog-mode-hook' before
>   running their own mode hooks

> Or even "some" instead of "many".  What does it matter how
> many do this?

"Some" is not incorrect, but it's not quite accurate either.  "Some"
tends to carry connotations of "not that many" in English when a context
hasn't been established.  I think it's the case that most programming
language modes are now derived from prog-mode, so "many" warns users to
be aware of exceptions.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Mon, 07 Nov 2016 20:52:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 24891 <at> debbugs.gnu.org
Subject: RE: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 7 Nov 2016 12:51:02 -0800 (PST)
> >      and we can drop the comma before "prior".
> 
> Maybe, maybe not.  The bit beginning with "prior" isn't qualifying
> what comes before, it's adding an extra bit of independent information,
> so the comma is justified.

I don't agree.  It is not an independent clause - it cannot stand
alone.  It is an adverbial clause that qualifies how (when) the modes
run the p-g-m hook.

> > And I'm not sure why we need to or should say "(including...)".
> > Why?
> 
> I'm told there are users who put things in prog-mode-hook to get
> effects in (nearly) all programming modes.  It will avoid confusing
> them.

OK.

> Also, on a purely pragmatic point, the "(including...)" bit is likely to
> reduce objections to my proposed change, allowing it to get into Emacs 25.2
> more smoothly.

;-)

> > I'd suggest just this:
> 
> >   many programming language modes run `prog-mode-hook' before
> >   running their own mode hooks
> 
> > Or even "some" instead of "many".  What does it matter how
> > many do this?
> 
> "Some" is not incorrect, but it's not quite accurate either.  "Some"
> tends to carry connotations of "not that many" in English when a
> context hasn't been established.

Tends to?  No, I don't think so.  Can?  Sure.  But without context
"some" suggests only at least one.  It contrasts with none, not with
many.  "Only some" (esp "only a few"), on the other hand, is as you say.

> I think it's the case that most
> programming language modes are now derived from prog-mode, so "many"
> warns users to be aware of exceptions.

Fair enough.  I'd still use "some", as it tends to have the effect of
soliciting examination of whether to do so (when you write a mode),
and to think about why and why not.  Thinking about whether & why is
more important than how many might use it.

Anyway, these are all minor points, and I don't feel strongly about
any of them.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Mon, 07 Nov 2016 22:05:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: 24891 <at> debbugs.gnu.org
Cc: acm <at> muc.de
Subject: Re: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 7 Nov 2016 22:03:59 +0000
Hello, Emacs.

On Sun, Nov 06, 2016 at 10:18:32PM +0000, Alan Mackenzie wrote:

> In the Emacs manual, page "Major Modes" appears the following:

>     all programming language modes run `prog-mode-hook', prior to
>     running their own mode hooks.

> This is not true.  A counter example is stand alone CC Mode.  There will
> be other examples, too, in code not maintained by Emacs.  I suggest
> amending this sentence to something like:

>     many programming language modes (including all these distributed
>     with Emacs) run `prog-mode-hook', prior to runnuing their own mode
>     hooks.

Here's a patch incorporating some of the points other people have made:


diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index c1564e9..c8da68a 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -113,7 +113,10 @@ Major Modes
 is enabled in a buffer.  @xref{Hooks}, for more information about
 hooks.  Each mode hook is named after its major mode, e.g., Fortran
 mode has @code{fortran-mode-hook}.  Furthermore, all text-based major
-modes run @code{text-mode-hook}, and all programming language modes
+modes run @code{text-mode-hook}, and many programming language modes
+(including all those distributed with Emacs)@footnote{More
+specifically, the modes which are ''derived'' from @code{prog-mode}
+(@pxref{Derived Modes,,, elisp, The Emacs Lisp Reference Manual}).}
 run @code{prog-mode-hook}, prior to running their own mode hooks.
 Hook functions can look at the value of the variable @code{major-mode}
 to see which mode is actually being entered.


Any objections to me installing this in the Emacs-25 branch?

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24891; Package emacs. (Mon, 07 Nov 2016 22:15:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 24891 <at> debbugs.gnu.org
Subject: Re: bug#24891: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Mon, 7 Nov 2016 22:14:05 +0000
Hello, Drew.

On Mon, Nov 07, 2016 at 12:51:02PM -0800, Drew Adams wrote:
> > >      and we can drop the comma before "prior".

> > Maybe, maybe not.  The bit beginning with "prior" isn't qualifying
> > what comes before, it's adding an extra bit of independent information,
> > so the comma is justified.

> I don't agree.  It is not an independent clause - it cannot stand
> alone.  It is an adverbial clause that qualifies how (when) the modes
> run the p-g-m hook.

Sorry to keep pounding on at this one, but I see the reason for the comma
now.  It's because the "prior ..." bit applies to the "text-mode-hook"
bit as well as the "prog-mode-hook" bit.  The comma prevents "prior ..."
from attaching exclusively to the "prog-mode-hook" bit.

Anyway, good afternoon (for you), good night (for me)!

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).




Reply sent to Alan Mackenzie <acm <at> muc.de>:
You have taken responsibility. (Thu, 10 Nov 2016 21:28:02 GMT) Full text and rfc822 format available.

Notification sent to Alan Mackenzie <acm <at> muc.de>:
bug acknowledged by developer. (Thu, 10 Nov 2016 21:28:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: 24891-done <at> debbugs.gnu.org
Subject: Re: 25.1: Falsehood on page "Major Modes" of Emacs manual.
Date: Thu, 10 Nov 2016 21:26:41 +0000
Bug fixed.

-- 
Alan Mackenzie (Nuremberg, Germany).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 09 Dec 2016 12:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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