GNU bug report logs - #8158
Definition of auto-mode-alist

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Wed, 2 Mar 2011 22:03:01 UTC

Severity: wishlist

Fixed in version 29.1

Done: Stefan Kangas <stefan <at> marxist.se>

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 8158 in the body.
You can then email your comments to 8158 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 22:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 02 Mar 2011 22:03:02 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-emacs <bug-emacs <at> gnu.org>
Subject: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 22:02:25 +0000
A comment in files.el says:

  ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
  ;; c++-mode, java-mode and more) are added through autoload
  ;; directives in that file.  That way is discouraged since it
  ;; spreads out the definition of the initial value.

Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?

If the maintainers agree, then the last sentence should be changed to
encourage the removal of the initial values back into the relevant
mode files.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 22:19:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 23:18:09 +0100
On Wed, Mar 2, 2011 at 11:02 PM, Reuben Thomas <rrt <at> sc3d.org> wrote:
> A comment in files.el says:
>
>  ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
>  ;; c++-mode, java-mode and more) are added through autoload
>  ;; directives in that file.  That way is discouraged since it
>  ;; spreads out the definition of the initial value.
>
> Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?
>
> If the maintainers agree, then the last sentence should be changed to
> encourage the removal of the initial values back into the relevant
> mode files.

I think I disagree. This sort of information must be coordinated so it
need to be in a central place.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 22:23:02 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 22:22:47 +0000
On 2 March 2011 22:18, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
> On Wed, Mar 2, 2011 at 11:02 PM, Reuben Thomas <rrt <at> sc3d.org> wrote:
>> A comment in files.el says:
>>
>>  ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
>>  ;; c++-mode, java-mode and more) are added through autoload
>>  ;; directives in that file.  That way is discouraged since it
>>  ;; spreads out the definition of the initial value.
>>
>> Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?
>>
>> If the maintainers agree, then the last sentence should be changed to
>> encourage the removal of the initial values back into the relevant
>> mode files.
>
> I think I disagree. This sort of information must be coordinated so it
> need to be in a central place.

Why does it have to be coordinated? The most obvious reason seems to
me "to avoid clashes", but this is detectable by parsing
auto-mode-alist. Generating a warning when there are clashing settings
for the same suffix would also be handy for 3rd party modes, which
cannot integrate their information in this way.

For modes that are part of Emacs, this system is fragile, as it's easy
to forget that part of the mode is in files.el.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 22:31:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 23:30:33 +0100
On Wed, Mar 2, 2011 at 11:22 PM, Reuben Thomas <rrt <at> sc3d.org> wrote:
> On 2 March 2011 22:18, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>> On Wed, Mar 2, 2011 at 11:02 PM, Reuben Thomas <rrt <at> sc3d.org> wrote:
>>> A comment in files.el says:
>>>
>>>  ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
>>>  ;; c++-mode, java-mode and more) are added through autoload
>>>  ;; directives in that file.  That way is discouraged since it
>>>  ;; spreads out the definition of the initial value.
>>>
>>> Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?
>>>
>>> If the maintainers agree, then the last sentence should be changed to
>>> encourage the removal of the initial values back into the relevant
>>> mode files.
>>
>> I think I disagree. This sort of information must be coordinated so it
>> need to be in a central place.
>
> Why does it have to be coordinated? The most obvious reason seems to
> me "to avoid clashes", but this is detectable by parsing
> auto-mode-alist. Generating a warning when there are clashing settings
> for the same suffix would also be handy for 3rd party modes, which
> cannot integrate their information in this way.

There are not only file extension clashes (which I suppose is what you
think of), but also mode selection clashes.

I think the control of this must be given to the user and that
requires a central system. The current system is not optimal however.
I have tried to implement an addition to it in majmodpri.el in nXhtml.
"majmodpri" stands for "major modes priorities" and that is just what
it implements. (The implementation is not as easy to use as I would
like it to be. Customization features for lists in Emacs is lacking a
lot of functionalities IMO.)

> For modes that are part of Emacs, this system is fragile, as it's easy
> to forget that part of the mode is in files.el.

This is true and perhaps part of the implementation should actually be
distributed. However it must then be implemented in a way that still
leaves control to the user. Just loading a new elisp file should not
override old choices. (See above for clarification.)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 22:36:02 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 22:35:37 +0000
On 2 March 2011 22:30, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>
> I think the control of this must be given to the user and that
> requires a central system.

From the point of view of the user, the system is centralised:
auto-mode-alist and friends, which can be redefined at will.

> Just loading a new elisp file should not
> override old choices. (See above for clarification.)

Sure, but autoloaded lines from mode files aren't rerun when the mode
is loaded, are they? (At least, it seems not, because modes I have
autoloaded still only have one entry per file suffix in
auto-mode-alist.)

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 23:15:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 3 Mar 2011 00:14:26 +0100
On Wed, Mar 2, 2011 at 11:35 PM, Reuben Thomas <rrt <at> sc3d.org> wrote:
> On 2 March 2011 22:30, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>>
>> I think the control of this must be given to the user and that
>> requires a central system.
>
> From the point of view of the user, the system is centralised:
> auto-mode-alist and friends, which can be redefined at will.
>
>> Just loading a new elisp file should not
>> override old choices. (See above for clarification.)
>
> Sure, but autoloaded lines from mode files aren't rerun when the mode
> is loaded, are they? (At least, it seems not, because modes I have
> autoloaded still only have one entry per file suffix in
> auto-mode-alist.)

So you mean that the insertion into auto-mode-alist should be done by
autoloading? I think that is too fragile since it will depend on how
modules are loading.

As I said in a previous message the user must be given some simple
control of this. In my opinion that means that some way to prioritize
must be used, please see my previous message. That would allow for
decentralized additions to auto-mode-alist (but you seem to have
missed that point?).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 23:22:01 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 23:21:31 +0000
On 2 March 2011 23:14, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>
> So you mean that the insertion into auto-mode-alist should be done by
> autoloading? I think that is too fragile since it will depend on how
> modules are loading.

I am only saying that this is what seems to happen at the moment, and
I have no problem with it.

> As I said in a previous message the user must be given some simple
> control of this. In my opinion that means that some way to prioritize
> must be used, please see my previous message.

The user already has a way to prioritize, by removing or adding
elements of auto-mode-alist as they see fit, in their .emacs or
equivalent. When this is run, emacs has already initialised
auto-mode-alist from autoloads, so they will not disturb the user's
settings.

> That would allow for
> decentralized additions to auto-mode-alist (but you seem to have
> missed that point?).

I may have missed the point, but as far as I can see, everything you
want to do can be achieved with the current system, and decentralising
the initialisation of auto-mode-alist would not change that: I have no
problems with my auto-mode-alist from modes whose settings are not
centralised.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 23:40:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 3 Mar 2011 00:39:18 +0100
On Thu, Mar 3, 2011 at 12:21 AM, Reuben Thomas <rrt <at> sc3d.org> wrote:
>
>> As I said in a previous message the user must be given some simple
>> control of this. In my opinion that means that some way to prioritize
>> must be used, please see my previous message.
>
> The user already has a way to prioritize, by removing or adding
> elements of auto-mode-alist as they see fit, in their .emacs or
> equivalent. When this is run, emacs has already initialised
> auto-mode-alist from autoloads, so they will not disturb the user's
> settings.
>
>> That would allow for
>> decentralized additions to auto-mode-alist (but you seem to have
>> missed that point?).
>
> I may have missed the point, but as far as I can see, everything you
> want to do can be achieved with the current system, and decentralising
> the initialisation of auto-mode-alist would not change that: I have no
> problems with my auto-mode-alist from modes whose settings are not
> centralised.

Yes, you have missed it. I wrote majmodpri.el to get around the
problem that some elisp files added things to auto-mode-alist. I got
some bug reports for nXhtml from some of those users.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 23:42:02 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 23:41:31 +0000
On 2 March 2011 23:39, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>
> Yes, you have missed it. I wrote majmodpri.el to get around the
> problem that some elisp files added things to auto-mode-alist.

So, are you saying that elisp files with non-centralized settings
which are part of Emacs were causing you problems?

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 23:43:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 3 Mar 2011 00:42:22 +0100
On Thu, Mar 3, 2011 at 12:41 AM, Reuben Thomas <rrt <at> sc3d.org> wrote:
> On 2 March 2011 23:39, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>>
>> Yes, you have missed it. I wrote majmodpri.el to get around the
>> problem that some elisp files added things to auto-mode-alist.
>
> So, are you saying that elisp files with non-centralized settings
> which are part of Emacs were causing you problems?

Not me, but a lot of other people.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Wed, 02 Mar 2011 23:44:01 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 2 Mar 2011 23:43:30 +0000
On 2 March 2011 23:42, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
> On Thu, Mar 3, 2011 at 12:41 AM, Reuben Thomas <rrt <at> sc3d.org> wrote:
>> On 2 March 2011 23:39, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>>>
>>> Yes, you have missed it. I wrote majmodpri.el to get around the
>>> problem that some elisp files added things to auto-mode-alist.
>>
>> So, are you saying that elisp files with non-centralized settings
>> which are part of Emacs were causing you problems?
>
> Not me, but a lot of other people.

Sorry, let me try again.

Are you saying that elisp files shipped as part of Emacs, with
non-centralized settings, were causing your users problems?

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Thu, 03 Mar 2011 00:32:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 3 Mar 2011 01:30:47 +0100
On Thu, Mar 3, 2011 at 12:43 AM, Reuben Thomas <rrt <at> sc3d.org> wrote:
> On 2 March 2011 23:42, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>> On Thu, Mar 3, 2011 at 12:41 AM, Reuben Thomas <rrt <at> sc3d.org> wrote:
>>> On 2 March 2011 23:39, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>>>>
>>>> Yes, you have missed it. I wrote majmodpri.el to get around the
>>>> problem that some elisp files added things to auto-mode-alist.
>>>
>>> So, are you saying that elisp files with non-centralized settings
>>> which are part of Emacs were causing you problems?
>>
>> Not me, but a lot of other people.
>
> Sorry, let me try again.
>
> Are you saying that elisp files shipped as part of Emacs, with
> non-centralized settings, were causing your users problems?

No. It is only with third party files I have seen the problem (since
files shipped with Emacs currently does not change auto-mode-alist
when they are loaded).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Thu, 03 Mar 2011 11:44:01 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 3 Mar 2011 11:43:16 +0000
On 3 March 2011 00:30, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
> On Thu, Mar 3, 2011 at 12:43 AM, Reuben Thomas <rrt <at> sc3d.org> wrote:
>> On 2 March 2011 23:42, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>>> On Thu, Mar 3, 2011 at 12:41 AM, Reuben Thomas <rrt <at> sc3d.org> wrote:
>>>> On 2 March 2011 23:39, Lennart Borgman <lennart.borgman <at> gmail.com> wrote:
>>>>>
>>>>> Yes, you have missed it. I wrote majmodpri.el to get around the
>>>>> problem that some elisp files added things to auto-mode-alist.
>>>>
>>>> So, are you saying that elisp files with non-centralized settings
>>>> which are part of Emacs were causing you problems?
>>>
>>> Not me, but a lot of other people.
>>
>> Sorry, let me try again.
>>
>> Are you saying that elisp files shipped as part of Emacs, with
>> non-centralized settings, were causing your users problems?
>
> No. It is only with third party files I have seen the problem (since
> files shipped with Emacs currently does not change auto-mode-alist
> when they are loaded).

Right, but Emacs does not have fully centralized settings. (Many modes
set their own auto-mode-alist entries.) So changing things within
Emacs does not affect your problem.

-- 
http://rrt.sc3d.org




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Fri, 04 Mar 2011 04:23:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 8158 <at> debbugs.gnu.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 03 Mar 2011 23:22:03 -0500
>   ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
>   ;; c++-mode, java-mode and more) are added through autoload
>   ;; directives in that file.  That way is discouraged since it
>   ;; spreads out the definition of the initial value.

> Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?

I agree, but I think Richard disagrees.  Also, order of entries in
auto-mode-alist can be important, so autoloading those entries does not
work for all cases.  But for 90% of the cases, it's perfectly fine and
indeed we do use it already in several cases.

Such ordering conflicts are difficult to detect automatically: detecting
them when we compile Emacs requires checking which regexps overlap
(which is perfectly doable in theory, but we'd need a "regexp-to-DFA
compiler" for that, basically), detecting them at run-time is too late
(often it'd be wrong to ask the user to resolve such conflicts).


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Fri, 04 Mar 2011 04:24:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 8158 <at> debbugs.gnu.org, Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 03 Mar 2011 23:22:59 -0500
> So you mean that the insertion into auto-mode-alist should be done by
> autoloading? I think that is too fragile since it will depend on how
> modules are loading.

Then we need to autoload something like an `add-to-list' supplemented
with some ordering info.


        Stefan




Removed tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 07 Oct 2019 05:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Thu, 21 Oct 2021 20:30:04 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 8158 <at> debbugs.gnu.org, Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Thu, 21 Oct 2021 13:29:08 -0700
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>>   ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
>>   ;; c++-mode, java-mode and more) are added through autoload
>>   ;; directives in that file.  That way is discouraged since it
>>   ;; spreads out the definition of the initial value.
>
>> Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?
>
> I agree, but I think Richard disagrees.  Also, order of entries in
> auto-mode-alist can be important, so autoloading those entries does not
> work for all cases.  But for 90% of the cases, it's perfectly fine and
> indeed we do use it already in several cases.
>
> Such ordering conflicts are difficult to detect automatically: detecting
> them when we compile Emacs requires checking which regexps overlap
> (which is perfectly doable in theory, but we'd need a "regexp-to-DFA
> compiler" for that, basically), detecting them at run-time is too late
> (often it'd be wrong to ask the user to resolve such conflicts).

Does anyone object to just removing the above comment?  And similarly
for `interpreter-mode-alist', I suppose.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Fri, 22 Oct 2021 14:32:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 8158 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Fri, 22 Oct 2021 16:31:08 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> Does anyone object to just removing the above comment?  And similarly
> for `interpreter-mode-alist', I suppose.

I think removing the comment is fine.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Fri, 22 Oct 2021 23:47:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 8158 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, rrt <at> sc3d.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Fri, 22 Oct 2021 19:45:57 -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. ]]]

  > > I agree, but I think Richard disagrees.

What is the question that maybe I disagree about?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Sat, 23 Oct 2021 00:16:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Richard Stallman <rms <at> gnu.org>
Cc: 8158 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, rrt <at> sc3d.org
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Fri, 22 Oct 2021 17:15:45 -0700
Richard Stallman <rms <at> gnu.org> writes:

>   > > I agree, but I think Richard disagrees.
>
> What is the question that maybe I disagree about?

The full initial message was:

> A comment in files.el says:
>
>   ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
>   ;; c++-mode, java-mode and more) are added through autoload
>   ;; directives in that file.  That way is discouraged since it
>   ;; spreads out the definition of the initial value.
>
> Isn't this a bit unmodular as Emacs continues to grow, and given loaddefs.el?
>
> If the maintainers agree, then the last sentence should be changed to
> encourage the removal of the initial values back into the relevant
> mode files.

What I propose is to make no concrete change besides removing that
comment.  This avoids people rushing off to change everything around,
which is probably not what we want at this point, but also doesn't very
strongly discourage a more modular design.  If any problems crop up, we
can address them with specific fixes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#8158; Package emacs. (Thu, 27 Jan 2022 03:15:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 8158 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Reuben Thomas <rrt <at> sc3d.org>
Subject: Re: bug#8158: Definition of auto-mode-alist
Date: Wed, 26 Jan 2022 19:14:11 -0800
close 8158 29.1
thanks

Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Does anyone object to just removing the above comment?  And similarly
>> for `interpreter-mode-alist', I suppose.
>
> I think removing the comment is fine.

No further comments here within 3 months, so I've now installed the
below change on master.

diff --git a/lisp/files.el b/lisp/files.el
index aabe8f445e..4ba71e6144 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2757,8 +2757,7 @@ auto-mode-case-fold
 (defvar auto-mode-alist
   ;; Note: The entries for the modes defined in cc-mode.el (c-mode,
   ;; c++-mode, java-mode and more) are added through autoload
-  ;; directives in that file.  That way is discouraged since it
-  ;; spreads out the definition of the initial value.
+  ;; directives in that file.
   (mapcar
    (lambda (elt)
      (cons (purecopy (car elt)) (cdr elt)))
@@ -3056,8 +3055,7 @@ conf-mode-maybe
 (defvar interpreter-mode-alist
   ;; Note: The entries for the modes defined in cc-mode.el (awk-mode
   ;; and pike-mode) are added through autoload directives in that
-  ;; file.  That way is discouraged since it spreads out the
-  ;; definition of the initial value.
+  ;; file.
   (mapcar
    (lambda (l)
      (cons (purecopy (car l)) (cdr l)))




bug marked as fixed in version 29.1, send any further explanations to 8158 <at> debbugs.gnu.org and Reuben Thomas <rrt <at> sc3d.org> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 27 Jan 2022 03: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. (Thu, 24 Feb 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 61 days ago.

Previous Next


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