GNU bug report logs - #80156
[PATCH] Document 'C-u M-x compile'

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Thu, 8 Jan 2026 19:01:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 80156 AT debbugs.gnu.org.

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#80156; Package emacs. (Thu, 08 Jan 2026 19:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manuel Giraud <manuel <at> ledu-giraud.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 08 Jan 2026 19:01:02 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Document 'C-u M-x compile'
Date: Thu, 08 Jan 2026 20:00:09 +0100
[Message part 1 (text/plain, inline)]
Tags: patch

Hi,

After experiencing being stuck with running a compilation command that
asks for a password, I think that it would be a good idea to document
this 'compile' feature, no?


In GNU Emacs 31.0.50 (build 3, x86_64-unknown-openbsd7.8) of 2026-01-08
 built on computer
Repository revision: 13a7b4d04a0072ebf1f41b1d5342c67f8a440ec7
Repository branch: mgi/building-texi
Windowing system distributor 'The X.Org Foundation', version 11.0.12101020
System Description: OpenBSD computer 7.8 GENERIC.MP#194 amd64

Configured using:
 'configure CC=egcc CPPFLAGS=-I/usr/local/include
 LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs
 --bindir=/home/manuel/bin --with-x-toolkit=no
 --with-toolkit-scroll-bars=no --without-cairo --without-dbus
 --without-gconf --without-gsettings --without-compress-install'

[0001-Document-C-u-M-x-compile.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Thu, 08 Jan 2026 19:56:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Thu, 08 Jan 2026 21:55:23 +0200
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Date: Thu, 08 Jan 2026 20:00:09 +0100
> 
> After experiencing being stuck with running a compilation command that
> asks for a password, I think that it would be a good idea to document
> this 'compile' feature, no?

Yes, indeed.  (It is already documented, but only in the doc string.)

> diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
> index e90fdce7598..484105d67f1 100644
> --- a/doc/emacs/building.texi
> +++ b/doc/emacs/building.texi
> @@ -53,6 +53,10 @@ Compilation
>  
>  @item M-x kill-compilation
>  Kill the running compilation subprocess.
> +
> +@item C-u M-x compile
> +Run a compiler in Comint mode.

Thanks, but that is not our usual style in these cases.  We don't
usually mention the prefix argument in the @table that lists the
commands described in the section.  Instead, we describe the behavior
with argument in the body of the section, where the command itself is
described, after telling what it does by default, i.e. without the
argument.

>  @findex compile
> @@ -146,6 +150,14 @@ Compilation
>  reveal the hidden portion.  Set this variable to @code{nil} to never
>  hide anything.
>  
> +@findex compile

This is a second @findex for the same command, and it points to the
same node.  This should be avoided.  And if you describe the behavior
with C-u together with the behavior without it, this second index
entry will not be needed at all.

> +  When running @kbd{C-u M-x compile} the @file{*compilation*} buffer is

We usually say "When invoked with a prefix argument, ..."

> +using Comint mode as its major mode.  This is a mode for interacting
> +with shells or interpreters.  By default Comint mode has the nice
> +property of looking for any credential prompts in its contents and make
> +Emacs asks for a password if this happens.  This is useful should the
> +compilation command need such a credential.

Comint moder is already described in the manual, in another section.
So this text should just mention the mode, and have a cross-reference
to that other section.  And if you think that what we currently say
about Comint mode is insufficient, please add whatever you think is
missing there.  This would be in line with our practice of having each
subject described only once, and the other places pointing to that
full description via cross-references.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Fri, 09 Jan 2026 10:44:01 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Fri, 09 Jan 2026 11:43:48 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Date: Thu, 08 Jan 2026 20:00:09 +0100
>> 
>> After experiencing being stuck with running a compilation command that
>> asks for a password, I think that it would be a good idea to document
>> this 'compile' feature, no?
>
> Yes, indeed.  (It is already documented, but only in the doc string.)
>
>> diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
>> index e90fdce7598..484105d67f1 100644
>> --- a/doc/emacs/building.texi
>> +++ b/doc/emacs/building.texi
>> @@ -53,6 +53,10 @@ Compilation
>>  
>>  @item M-x kill-compilation
>>  Kill the running compilation subprocess.
>> +
>> +@item C-u M-x compile
>> +Run a compiler in Comint mode.
>
> Thanks, but that is not our usual style in these cases.  We don't
> usually mention the prefix argument in the @table that lists the
> commands described in the section.  Instead, we describe the behavior
> with argument in the body of the section, where the command itself is
> described, after telling what it does by default, i.e. without the
> argument.
>
>>  @findex compile
>> @@ -146,6 +150,14 @@ Compilation
>>  reveal the hidden portion.  Set this variable to @code{nil} to never
>>  hide anything.
>>  
>> +@findex compile
>
> This is a second @findex for the same command, and it points to the
> same node.  This should be avoided.  And if you describe the behavior
> with C-u together with the behavior without it, this second index
> entry will not be needed at all.
>
>> +  When running @kbd{C-u M-x compile} the @file{*compilation*} buffer is
>
> We usually say "When invoked with a prefix argument, ..."

Thanks for all your inputs.  I'll try to fix them in my patch.

>> +using Comint mode as its major mode.  This is a mode for interacting
>> +with shells or interpreters.  By default Comint mode has the nice
>> +property of looking for any credential prompts in its contents and make
>> +Emacs asks for a password if this happens.  This is useful should the
>> +compilation command need such a credential.
>
> Comint moder is already described in the manual, in another section.
> So this text should just mention the mode, and have a cross-reference
> to that other section.  And if you think that what we currently say
> about Comint mode is insufficient, please add whatever you think is
> missing there.  This would be in line with our practice of having each
> subject described only once, and the other places pointing to that
> full description via cross-references.

That was my intent but I was not able to find a documentation of Comint
in the Emacs manual.  I only found references in "(emacs) Interactive
Shell" and "(emacs) Shell Mode".  That's why I've try come up with
succint paragraph to describe it.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Fri, 09 Jan 2026 11:58:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Fri, 09 Jan 2026 13:57:41 +0200
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 80156 <at> debbugs.gnu.org
> Date: Fri, 09 Jan 2026 11:43:48 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Comint moder is already described in the manual, in another section.
> > So this text should just mention the mode, and have a cross-reference
> > to that other section.  And if you think that what we currently say
> > about Comint mode is insufficient, please add whatever you think is
> > missing there.  This would be in line with our practice of having each
> > subject described only once, and the other places pointing to that
> > full description via cross-references.
> 
> That was my intent but I was not able to find a documentation of Comint
> in the Emacs manual.  I only found references in "(emacs) Interactive
> Shell" and "(emacs) Shell Mode".  That's why I've try come up with
> succint paragraph to describe it.

"Shell Mode" is the place to have Comint documented.  If something
important is missing in that section, let's add it.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Fri, 09 Jan 2026 13:15:02 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Fri, 09 Jan 2026 14:13:56 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: 80156 <at> debbugs.gnu.org
>> Date: Fri, 09 Jan 2026 11:43:48 +0100
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> > Comint moder is already described in the manual, in another section.
>> > So this text should just mention the mode, and have a cross-reference
>> > to that other section.  And if you think that what we currently say
>> > about Comint mode is insufficient, please add whatever you think is
>> > missing there.  This would be in line with our practice of having each
>> > subject described only once, and the other places pointing to that
>> > full description via cross-references.
>> 
>> That was my intent but I was not able to find a documentation of Comint
>> in the Emacs manual.  I only found references in "(emacs) Interactive
>> Shell" and "(emacs) Shell Mode".  That's why I've try come up with
>> succint paragraph to describe it.
>
> "Shell Mode" is the place to have Comint documented.  If something
> important is missing in that section, let's add it.

Ok, thanks.  The more I think about it the more I think we should have a
way for compilation-mode to ask for passwords and the like.  Because
with 'C-u M-x compile' we lose the hability to recompile with 'g' and to
navigate through compilation errors (as explained later in the same
section).

So, do you think we should first document the current state?  Or do you
think we shouldn't do anything for the moment and "wait" until we have a
"read password" feature in compilation-mode? (and sorry to bother you
with my semi-philosophical questions)
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Fri, 09 Jan 2026 14:53:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Fri, 09 Jan 2026 16:52:18 +0200
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 80156 <at> debbugs.gnu.org
> Date: Fri, 09 Jan 2026 14:13:56 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> That was my intent but I was not able to find a documentation of Comint
> >> in the Emacs manual.  I only found references in "(emacs) Interactive
> >> Shell" and "(emacs) Shell Mode".  That's why I've try come up with
> >> succint paragraph to describe it.
> >
> > "Shell Mode" is the place to have Comint documented.  If something
> > important is missing in that section, let's add it.
> 
> Ok, thanks.  The more I think about it the more I think we should have a
> way for compilation-mode to ask for passwords and the like.  Because
> with 'C-u M-x compile' we lose the hability to recompile with 'g' and to
> navigate through compilation errors (as explained later in the same
> section).
> 
> So, do you think we should first document the current state?  Or do you
> think we shouldn't do anything for the moment and "wait" until we have a
> "read password" feature in compilation-mode? (and sorry to bother you
> with my semi-philosophical questions)

It's no bother, so no need to apologize.  But I don't think I
understand well enough the problems to which you allude.  Could you
please elaborate on the problems with "C-u M-x compile" that you
mention?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Fri, 09 Jan 2026 15:55:02 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Fri, 09 Jan 2026 16:53:57 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: 80156 <at> debbugs.gnu.org
>> Date: Fri, 09 Jan 2026 14:13:56 +0100
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> >> That was my intent but I was not able to find a documentation of Comint
>> >> in the Emacs manual.  I only found references in "(emacs) Interactive
>> >> Shell" and "(emacs) Shell Mode".  That's why I've try come up with
>> >> succint paragraph to describe it.
>> >
>> > "Shell Mode" is the place to have Comint documented.  If something
>> > important is missing in that section, let's add it.
>> 
>> Ok, thanks.  The more I think about it the more I think we should have a
>> way for compilation-mode to ask for passwords and the like.  Because
>> with 'C-u M-x compile' we lose the hability to recompile with 'g' and to
>> navigate through compilation errors (as explained later in the same
>> section).
>> 
>> So, do you think we should first document the current state?  Or do you
>> think we shouldn't do anything for the moment and "wait" until we have a
>> "read password" feature in compilation-mode? (and sorry to bother you
>> with my semi-philosophical questions)
>
> It's no bother, so no need to apologize.  But I don't think I
> understand well enough the problems to which you allude.  Could you
> please elaborate on the problems with "C-u M-x compile" that you
> mention?

Yes.  When using "C-u M-x compile", hitting 'g' inside the *compilation*
buffer does not trigger a recompilation but inserts "g" instead.  OTOH,
I was wrong about errors navigation: "M-g n" and "M-g p" are still
working.
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Sat, 10 Jan 2026 08:04:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Sat, 10 Jan 2026 10:02:46 +0200
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 80156 <at> debbugs.gnu.org
> Date: Fri, 09 Jan 2026 16:53:57 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> Yes.  When using "C-u M-x compile", hitting 'g' inside the *compilation*
> buffer does not trigger a recompilation but inserts "g" instead.  OTOH,
> I was wrong about errors navigation: "M-g n" and "M-g p" are still
> working.

Apart of a short note in parentheses saying that 'g' doesn't work in
Comint mode (which should be obvious, but does no harm to say), what
else is needed to cover this?

You seemed to be talking about other, wider issues:

>> Ok, thanks.  The more I think about it the more I think we should have a
>> way for compilation-mode to ask for passwords and the like.  Because
>> with 'C-u M-x compile' we lose the hability to recompile with 'g' and to
>> navigate through compilation errors (as explained later in the same
>> section).
>> 
>> So, do you think we should first document the current state?  Or do you
>> think we shouldn't do anything for the moment and "wait" until we have a
>> "read password" feature in compilation-mode?

This seems to be about passwords, not about 'g'?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80156; Package emacs. (Sat, 10 Jan 2026 14:14:01 GMT) Full text and rfc822 format available.

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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80156 <at> debbugs.gnu.org
Subject: Re: bug#80156: [PATCH] Document 'C-u M-x compile'
Date: Sat, 10 Jan 2026 15:13:13 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

W>> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
>> Cc: 80156 <at> debbugs.gnu.org
>> Date: Fri, 09 Jan 2026 16:53:57 +0100
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>> Yes.  When using "C-u M-x compile", hitting 'g' inside the *compilation*
>> buffer does not trigger a recompilation but inserts "g" instead.  OTOH,
>> I was wrong about errors navigation: "M-g n" and "M-g p" are still
>> working.
>
> Apart of a short note in parentheses saying that 'g' doesn't work in
> Comint mode (which should be obvious, but does no harm to say), what
> else is needed to cover this?
>
> You seemed to be talking about other, wider issues:
>
>>> Ok, thanks.  The more I think about it the more I think we should have a
>>> way for compilation-mode to ask for passwords and the like.  Because
>>> with 'C-u M-x compile' we lose the hability to recompile with 'g' and to
>>> navigate through compilation errors (as explained later in the same
>>> section).
>>> 
>>> So, do you think we should first document the current state?  Or do you
>>> think we shouldn't do anything for the moment and "wait" until we have a
>>> "read password" feature in compilation-mode?
>
> This seems to be about passwords, not about 'g'?

Ok I misunderstood you.  This issue about passwords is when you call
"M-x compile".  If the compilation command ends up asking for a password
there is no way to enter it:  the *compilation* buffer will contain the
prompt ("Password: " for example) but Emacs won't identify it as a
password prompt and switching to the *compilation* buffer to try to
input the password won't work also because this buffer is read-only and
also has a set predefined key binding.
-- 
Manuel Giraud




This bug report was last modified 1 day ago.

Previous Next


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