GNU bug report logs - #50674
Major mode for etc/AUTHORS with basic font-locking

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Sun, 19 Sep 2021 14:13:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 28.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 50674 in the body.
You can then email your comments to 50674 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#50674; Package emacs. (Sun, 19 Sep 2021 14:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 19 Sep 2021 14:13:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: Major mode for etc/AUTHORS with basic font-locking
Date: Sun, 19 Sep 2021 07:12:40 -0700
[Message part 1 (text/plain, inline)]
Severity: wishlist

Please find attached a small visual improvement for the splash screen,
or rather the AUTHORS file that is reachable from the splash screen.
It comes in the form of a major mode for etc/AUTHORS that has some basic
font-locking and nothing else.

The motivation for this is basically that I have clicked the "AUTHORS"
button on the splash screen and found the file thus reached to be a bit
bare-bone visually.  (It's just a text file.)  Other software tend to
have a bit more formatting, and it's nice to show off in this small way
that Emacs has such capabilities as well.

We could of course live without it, but there's not much reason to.
[0001-New-major-mode-with-font-locking-for-etc-AUTHORS.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Sun, 19 Sep 2021 15:20:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Sun, 19 Sep 2021 17:19:20 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> The motivation for this is basically that I have clicked the "AUTHORS"
> button on the splash screen and found the file thus reached to be a bit
> bare-bone visually.  (It's just a text file.)  Other software tend to
> have a bit more formatting, and it's nice to show off in this small way
> that Emacs has such capabilities as well.

Looks very nice, I think.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Sun, 19 Sep 2021 16:26:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Sun, 19 Sep 2021 19:25:19 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sun, 19 Sep 2021 07:12:40 -0700
> 
> Please find attached a small visual improvement for the splash screen,
> or rather the AUTHORS file that is reachable from the splash screen.
> It comes in the form of a major mode for etc/AUTHORS that has some basic
> font-locking and nothing else.

Thanks, LGTM.

Did you try these faces on TTY frames, in particular those with 8 or
16 colors?  I think those will need separate face definitions.

> +(defgroup etc-authors-mode nil
> +  "Display the etc/AUTHORS file in the Emacs distribution."

If we only intend this to be used for our etc/AUTHORS, then how about
saying that explicitly in the other doc strings, instead of
referencing etc-authors-mode?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Sun, 19 Sep 2021 16:35:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Sun, 19 Sep 2021 19:33:45 +0300
> +;;;###autoload
> +(define-derived-mode etc-authors-mode special-mode "Authors View"
> +  "Major mode for viewing \"etc/AUTHORS\" from the Emacs distribution.
> +Provides some basic font locking and not much else."
> +  (setq-local font-lock-defaults
> +              '(etc-authors-mode-font-lock-keywords nil nil ((?_ . "w"))))
> +  (setq font-lock-multiline nil)
> +  (etc-authors-mode--hide-local-variables))

Isn't generic-x.el a more suitable place for such small modes?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Sun, 19 Sep 2021 17:39:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Sun, 19 Sep 2021 10:38:32 -0700
Juri Linkov <juri <at> linkov.net> writes:

>> +;;;###autoload
>> +(define-derived-mode etc-authors-mode special-mode "Authors View"
>> +  "Major mode for viewing \"etc/AUTHORS\" from the Emacs distribution.
>> +Provides some basic font locking and not much else."
>> +  (setq-local font-lock-defaults
>> +              '(etc-authors-mode-font-lock-keywords nil nil ((?_ . "w"))))
>> +  (setq font-lock-multiline nil)
>> +  (etc-authors-mode--hide-local-variables))
>
> Isn't generic-x.el a more suitable place for such small modes?

The problem I see is that this does not use `define-generic-mode',
unlike the other modes in there, and also I'm not sure it makes sense to
drop autoloaded functions in there.  AFAIU, that file and its modes is
supposed to be optional (not that I agree that they should be).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Sun, 19 Sep 2021 21:59:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Sun, 19 Sep 2021 14:58:38 -0700
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> Did you try these faces on TTY frames, in particular those with 8 or
> 16 colors?  I think those will need separate face definitions.

I've updated the face definitions to check for such capabilities, and
tested it in xterm (256 colors) and the Linux console (8 colors
according to `display-color-cells').  It looks good with my pair of
eyes, but I sometimes have a hard time differentiating between certain
colors.

If anyone feels that they are good with colors, feel free to suggest
something better.

I've attached a new patch.

> If we only intend this to be used for our etc/AUTHORS, then how about
> saying that explicitly in the other doc strings, instead of
> referencing etc-authors-mode?

Yes, that makes sense, changed in the attached.

Thanks for reviewing this.
[0001-New-major-mode-with-font-locking-for-etc-AUTHORS.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Mon, 20 Sep 2021 07:11:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Mon, 20 Sep 2021 09:41:45 +0300
>> Isn't generic-x.el a more suitable place for such small modes?
>
> The problem I see is that this does not use `define-generic-mode',
> unlike the other modes in there, and also I'm not sure it makes sense to
> drop autoloaded functions in there.  AFAIU, that file and its modes is
> supposed to be optional (not that I agree that they should be).

I really see no difference from etc-authors-mode and e.g.
etc-fstab-generic-mode defined in generic-x.el by define-generic-mode.
And still it can be autoloaded like c++-mode-syntax-table used to be autoloaded.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Mon, 20 Sep 2021 07:44:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Mon, 20 Sep 2021 00:42:54 -0700
Juri Linkov <juri <at> linkov.net> writes:

> I really see no difference from etc-authors-mode and e.g.
> etc-fstab-generic-mode defined in generic-x.el by define-generic-mode.
> And still it can be autoloaded like c++-mode-syntax-table used to be autoloaded.

That means that a user will see font-locking in some files, only if she
has first visited AUTHORS.  In a subsequent Emacs session, the user will
be surprised to see that the font-locking is no longer there.

IOW, I can agree to put it in generic-x.el, but only if we autoload some
other modes in there.  Such as the fstab mode.  Otherwise this makes no
sense to me.

A natural first step would be to make those modes load unconditionally,
but that proposal has been rejected; see my last two commits to
generic-x.el.  Perhaps it will be okay to load only some of the modes
unconditionally.

This would also have to be coupled with the necessary documentation
changes to generic-x.el, to explain that this file is not only about
`define-generic-mode'.

Personally, I'd rather create a new file for small modes than go down
this rabbit hole.  generic-x.el is hardly the best library name or
location.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Mon, 20 Sep 2021 09:15:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Mon, 20 Sep 2021 11:14:01 +0200
Stefan Kangas <stefan <at> marxist.se>:

> Personally, I'd rather create a new file for small modes than go down
> this rabbit hole.  generic-x.el is hardly the best library name or
> location.

Thinking about this a bit more, what is the problem with just keeping
this in its own file?  It is fairly self-contained and not really
related to anything else.  If the worry is that it will clutter
lisp/textmodes, perhaps we could add a new directory where such
"small" modes could go.

In general, I'm not a fan of mega-files with many bits and pieces in
them -- see for example time.el that for some reason contains both
'display-time' and 'world-clock'.  The latter could easily be in its
own file instead, and from working in that file I can say that it
would have been easier to understand and modify if it was.  ("Large"
files is a common practice in ELisp, but not in many other programming
languages AFAIK.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Mon, 20 Sep 2021 15:29:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Mon, 20 Sep 2021 18:24:32 +0300
> Thinking about this a bit more, what is the problem with just keeping
> this in its own file?  It is fairly self-contained and not really
> related to anything else.  If the worry is that it will clutter
> lisp/textmodes, perhaps we could add a new directory where such
> "small" modes could go.

It really will clutter lisp/textmodes.  For the same reasoning
all modes in generic-x.el should be moved to separate files
that makes no sense.

So the current situation is following: we have generic-x.el for such
small modes like etc-passwd-generic-mode and etc-authors-mode.
But the problem is that modes in generic-x.el are not autoloaded.
I don't understand why visiting /etc/passwd doesn't highlight it
properly when etc-passwd-generic-mode is available for this file?
But I see no problem to autoload all available modes from generic-x.el.

> A natural first step would be to make those modes load unconditionally,
> but that proposal has been rejected; see my last two commits to
> generic-x.el.  Perhaps it will be okay to load only some of the modes
> unconditionally.

I agree that only some should be loaded unconditionally.  For example,
we should not use modes for filename regexps that are not specific,
such as '("alias\\'") and '("inventory\\'") that has too wide coverage
to produce false matches.  OTOH, autoloaded modes should be enabled
by default for "/etc/passwd", "/etc/fstab", "emacs.*/etc/AUTHORS\\'"
that has no problem of mismatching.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 06:13:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 08:12:04 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> If the worry is that it will clutter
>> lisp/textmodes, perhaps we could add a new directory where such
>> "small" modes could go.
>
> It really will clutter lisp/textmodes.

I'd prefer to have it as a separate file.  However, it is a really,
really specialised mode -- for one single Emacs file -- so perhaps it
would make sense to create a specific sub-directory for it (and similar
things that are kinda meta-Emacsey).

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 06:26:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50674 <at> debbugs.gnu.org, stefan <at> marxist.se, juri <at> linkov.net
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 09:25:27 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 21 Sep 2021 08:12:04 +0200
> Cc: 50674 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
> 
> Juri Linkov <juri <at> linkov.net> writes:
> 
> >> If the worry is that it will clutter
> >> lisp/textmodes, perhaps we could add a new directory where such
> >> "small" modes could go.
> >
> > It really will clutter lisp/textmodes.
> 
> I'd prefer to have it as a separate file.  However, it is a really,
> really specialised mode -- for one single Emacs file -- so perhaps it
> would make sense to create a specific sub-directory for it (and similar
> things that are kinda meta-Emacsey).

That directory is 'admin', I think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 06:29:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 50674 <at> debbugs.gnu.org, stefan <at> marxist.se, juri <at> linkov.net
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 08:28:10 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> That directory is 'admin', I think.

I thought that wasn't included in the distributions?  Hm...  no, doesn't
look like it -- Debian includes lisp and etc in /usr/share/emacs/27.1,
for instance.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 07:58:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 50674 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 00:57:28 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> That directory is 'admin', I think.
>
> I thought that wasn't included in the distributions?  Hm...  no, doesn't
> look like it -- Debian includes lisp and etc in /usr/share/emacs/27.1,
> for instance.

But it's not in `load-path', AFAICT.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 08:29:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 01:28:05 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Juri Linkov <juri <at> linkov.net> writes:
>
>>> If the worry is that it will clutter
>>> lisp/textmodes, perhaps we could add a new directory where such
>>> "small" modes could go.
>>
>> It really will clutter lisp/textmodes.
>
> I'd prefer to have it as a separate file.

Same.

> However, it is a really, really specialised mode -- for one single
> Emacs file -- so perhaps it would make sense to create a specific
> sub-directory for it (and similar things that are kinda meta-Emacsey).

Yes, we could add a new directory.

It seems to me that very few things would be in a directory for
meta-Emacsey things.  The only other file I could think to add
font-locking for is COPYING and perhaps DISTRIB (as those are reachable
from the splash-screen).  Maybe the tutorial could use some font-locking
as well, but we could put that in tutorial.el.

Another idea is to add, on the same level as progmodes and textmodes, a
new directory "display-modes", in which we would put modes that are not
really meant for editing.  I can see several modes that would in
principle fit in such a directory: help-mode, tabulated-list-mode,
world-clock, etc.  (There would be no immediate need to move anything,
however.)

Or, you know, we just live with having it in textmodes.  I don't think
it's too bad, all things considered.  We are talking of a very small
number of files here, and it's not like we add new textmodes every week.
Worst case, we move it later; it's small enough that convenient access
to its git history is probably not even a concern.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 08:37:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50674 <at> debbugs.gnu.org, stefan <at> marxist.se, juri <at> linkov.net
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 11:36:30 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: juri <at> linkov.net,  50674 <at> debbugs.gnu.org,  stefan <at> marxist.se
> Date: Tue, 21 Sep 2021 08:28:10 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > That directory is 'admin', I think.
> 
> I thought that wasn't included in the distributions?  Hm...  no, doesn't
> look like it -- Debian includes lisp and etc in /usr/share/emacs/27.1,
> for instance.

You mean, binary distributions?  Do we care?  Do users of binary
distributions read the AUTHORS file?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 09:00:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50674 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 01:58:58 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> You mean, binary distributions?  Do we care?  Do users of binary
> distributions read the AUTHORS file?

It is reachable from the splash screen, so yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 09:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org, larsi <at> gnus.org, juri <at> linkov.net
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 12:24:21 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Tue, 21 Sep 2021 01:58:58 -0700
> Cc: juri <at> linkov.net, 50674 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > You mean, binary distributions?  Do we care?  Do users of binary
> > distributions read the AUTHORS file?
> 
> It is reachable from the splash screen, so yes.

The splash screen button could load the file from any place we want,
so if that is the problem, I don't understand all the sub-thread about
where to put the file.  E.g., we could put it in etc/.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 11:19:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 50674 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 13:18:02 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> The splash screen button could load the file from any place we want,
> so if that is the problem, I don't understand all the sub-thread about
> where to put the file.  E.g., we could put it in etc/.

I'm also not sure what problem this are trying to solve, indeed.
IIUC, it is that "lisp/textmodes" is too cluttered, or something?

If we put it outside of 'load-path' we can't put it in
'auto-mode-alist', and you can't just M-x etc-authors-mode, etc.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 11:26:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org, larsi <at> gnus.org, juri <at> linkov.net
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 14:25:19 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Tue, 21 Sep 2021 13:18:02 +0200
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Juri Linkov <juri <at> linkov.net>, 50674 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > The splash screen button could load the file from any place we want,
> > so if that is the problem, I don't understand all the sub-thread about
> > where to put the file.  E.g., we could put it in etc/.
> 
> I'm also not sure what problem this are trying to solve, indeed.
> IIUC, it is that "lisp/textmodes" is too cluttered, or something?

Doesn't sound like a problem to me.

> If we put it outside of 'load-path' we can't put it in
> 'auto-mode-alist', and you can't just M-x etc-authors-mode, etc.

Indeed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 16:52:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 18:51:50 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> Or, you know, we just live with having it in textmodes.  I don't think
> it's too bad, all things considered.  We are talking of a very small
> number of files here, and it's not like we add new textmodes every week.
> Worst case, we move it later; it's small enough that convenient access
> to its git history is probably not even a concern.

Yeah, I'm fine with putting it in textmodes.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 17:33:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 20:28:01 +0300
> diff --git a/lisp/files.el b/lisp/files.el
> index b113ff32f2..171b69e01e 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -3006,7 +3006,8 @@ auto-mode-alist
>       ("\\.xcf\\'" . image-mode)
>       ("\\.xmp\\'" . image-mode)
>       ("\\.xwd\\'" . image-mode)
> -     ("\\.yuv\\'" . image-mode)))
> +     ("\\.yuv\\'" . image-mode)
> +     ("emacs.*/etc/AUTHORS\\'" . etc-authors-mode)))

I think cluttering auto-mode-alist is worse than cluttering lisp/textmodes
because you can add ‘mode: etc-authors’ to Local Variables of etc/AUTHORS.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 17:57:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 19:56:40 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> It seems to me that very few things would be in a directory for
> meta-Emacsey things.  The only other file I could think to add
> font-locking for is COPYING and perhaps DISTRIB (as those are reachable
> from the splash-screen).

I thought of another one -- NEWS should really have its own major mode
to make it easier to edit.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 18:34:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 11:33:17 -0700
Juri Linkov <juri <at> linkov.net> writes:

> I think cluttering auto-mode-alist is worse than cluttering lisp/textmodes
> because you can add ‘mode: etc-authors’ to Local Variables of etc/AUTHORS.

That's a very good point.  I'll change that part.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 18:34:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50674 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 11:33:22 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I thought of another one -- NEWS should really have its own major mode
> to make it easier to edit.

Indeed.  In comparison to the others, such a mode wouldn't (or
shouldn't) be purely cosmetic.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 18:46:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50674 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 21:41:43 +0300
>> I thought of another one -- NEWS should really have its own major mode
>> to make it easier to edit.
>
> Indeed.  In comparison to the others, such a mode wouldn't (or
> shouldn't) be purely cosmetic.

Gradually it will grow to become a doppelgänger of org-mode.
And this will be the punishment for not using org-mode in NEWS :-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 18:57:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org, larsi <at> gnus.org, stefan <at> marxist.se
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 21:56:18 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Date: Tue, 21 Sep 2021 21:41:43 +0300
> Cc: 50674 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
> 
> >> I thought of another one -- NEWS should really have its own major mode
> >> to make it easier to edit.
> >
> > Indeed.  In comparison to the others, such a mode wouldn't (or
> > shouldn't) be purely cosmetic.
> 
> Gradually it will grow to become a doppelgänger of org-mode.

I don't see why.  We don't need any of the bells-and-whistles of Org
to edit NEWS, but we do need a couple of features that Org doesn't
have, like better support for marking the entries documented, easier
quoting, and a few more.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 19:23:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Juri Linkov <juri <at> linkov.net>
Cc: 50674 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 12:22:08 -0700
Juri Linkov <juri <at> linkov.net> writes:

> Gradually it will grow to become a doppelgänger of org-mode.
> And this will be the punishment for not using org-mode in NEWS :-)

This is the way.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50674; Package emacs. (Tue, 21 Sep 2021 19:55:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 50674 <at> debbugs.gnu.org
Subject: Re: bug#50674: Major mode for etc/AUTHORS with basic font-locking
Date: Tue, 21 Sep 2021 12:54:02 -0700
tags 50674 fixed
close 50674 28.1
thanks

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

> I've attached a new patch.

I've pushed this to master as commit 6478ce4a4b with the following
changes:

- Added two commands to go to the previous and next author, bound to "p"
  and "n" respectively.

- As Juri suggested, I removed the entry from `auto-mode-alist' and
  replaced it with a "mode: etc-authors" line in AUTHORS.  That was a
  much cleaner way to do it.

- Some other very minor clean-up, such as putting a :group on the
  defgroup.

- Added a NEWS entry.




Added tag(s) fixed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 21 Sep 2021 19:55:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 50674 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 21 Sep 2021 19:55: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. (Wed, 20 Oct 2021 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 336 days ago.

Previous Next


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