unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
@ 2022-04-17 17:44 Eli Zaretskii
  2022-04-17 18:38 ` Lars Ingebrigtsen
  2022-04-17 20:17 ` Jim Porter
  0 siblings, 2 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-17 17:44 UTC (permalink / raw)
  To: 54993


  emacs -Q
  C-x C-f etc/NEWS RET

Observe an error message:

  File local-variables error: (void-function emacs-news-mode)

and NEWS is visited in Fundamental mode, which makes it annoyingly
inconvenient to edit the news entries.

I think a new mode that is only available in the development version
should not be forced on all the developers, because not all of them
use the latest-and-the-greatest code all the time while working on
Emacs.

Please make it possible to edit NEWS conveniently with older versions
of Emacs.


In GNU Emacs 28.1 (build 2, i686-pc-mingw32)
 of 2022-04-03 built on HOME-C4E4A596F7
Windowing system distributor 'Microsoft Corp.', version 5.1.2600
System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600)

Configured using:
 'configure --prefix=/d/usr --with-wide-int --with-native-compilation
 'CFLAGS=-O2 -gdwarf-4 -g3''

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS XPM ZLIB

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1255

Major mode: Mail

Minor modes in effect:
  shell-dirtrack-mode: t
  flyspell-mode: t
  desktop-save-mode: t
  save-place-mode: t
  display-battery-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  line-number-mode: t
  auto-fill-function: mail-mode-auto-fill
  indent-tabs-mode: t
  abbrev-mode: t

Load-path shadows:
d:/usr/share/emacs/site-lisp/soap-client hides d:/usr/share/emacs/28.1/lisp/net/soap-client

Features:
(shadow emacsbug quail lao-util enriched smerge-mode diff calc-ext
calc calc-loaddefs rect calc-macs arc-mode archive-mode thai-util
thai-word pcase descr-text rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt
rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode
nxml-util nxml-enc xmltok ede/speedbar ede/files ede ede/detect
ede/base ede/auto ede/source eieio-base eieio-speedbar eieio-custom
cedet edebug backtrace gud completion find-cmd grep find-dired
skeleton tabify autoconf autoconf-mode ffap ebuff-menu compile pulse
etags fileloop generator vc-mtn vc-hg vc-src vc-sccs vc-svn cl-print
thingatpt eieio-opt speedbar ezimage dframe find-func shortdoc
help-fns radix-tree sh-script smie executable texinfo texinfo-loaddefs
novice misearch multi-isearch dabbrev shr-color color rmailout shell
pcomplete comint ansi-color rfc2104 gnutls network-stream nsm
mail-extr smtpmail mailalias sendmail cc-awk jka-compr bat-mode
dired-aux vc-bzr generic noutline outline make-mode vc-cvs vc-rcs
conf-mode vc bug-reference add-log mule-util info vc-git diff-mode
easy-mmode vc-dispatcher flyspell rmailsum shr kinsoku svg dom
browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse url-vars mailcap
qp rmailmm message rmc puny rfc822 mml mml-sec epa epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231
rmail rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs
password-cache json map rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils desktop frameset server find-lisp dired dired-loaddefs
filecache mairix cus-edit pp cus-load wid-edit saveplace midnight
facemenu ispell derived generic-x cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs xref project ring
format-spec battery dbus xml time comp comp-cstr warnings subr-x rx
cl-seq cl-macs cl-extra help-mode seq byte-opt gv cl-loaddefs cl-lib
bytecomp byte-compile cconv iso-transl tooltip eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32
ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice button loaddefs faces
cus-face macroexp files window text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote threads w32notify w32 lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 3198865 323401)
 (symbols 48 43159 3)
 (strings 16 264038 30739)
 (string-bytes 1 8154768)
 (vectors 16 98734)
 (vector-slots 8 2868549 238198)
 (floats 8 365 538)
 (intervals 40 589593 24500)
 (buffers 888 317))





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 17:44 bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error Eli Zaretskii
@ 2022-04-17 18:38 ` Lars Ingebrigtsen
  2022-04-17 18:49   ` Eli Zaretskii
  2022-04-17 20:17 ` Jim Porter
  1 sibling, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-17 18:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 54993

Eli Zaretskii <eliz@gnu.org> writes:

> I think a new mode that is only available in the development version
> should not be forced on all the developers, because not all of them
> use the latest-and-the-greatest code all the time while working on
> Emacs.

Not using the trunk to edit files from the trunk sounds rather
error-prone.  Indentation rules etc has changed.

> Please make it possible to edit NEWS conveniently with older versions
> of Emacs.

You can still edit the file -- you just get an error message (which you
can ignore).

We could remove the mode cookie, of course, but then we'd have to put
etc/NEWS in auto-mode-alist, which would yield false positives for other
files with that name.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 18:38 ` Lars Ingebrigtsen
@ 2022-04-17 18:49   ` Eli Zaretskii
  2022-04-17 18:54     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-17 18:49 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 54993@debbugs.gnu.org
> Date: Sun, 17 Apr 2022 20:38:57 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I think a new mode that is only available in the development version
> > should not be forced on all the developers, because not all of them
> > use the latest-and-the-greatest code all the time while working on
> > Emacs.
> 
> Not using the trunk to edit files from the trunk sounds rather
> error-prone.  Indentation rules etc has changed.

It is IMO unreasonable to expect everyone to use the latest
development code.  What about people who sync with Git once a month,
for example?  Or what about editing the file on a system that doesn't
even have the master branch built?

> > Please make it possible to edit NEWS conveniently with older versions
> > of Emacs.
> 
> You can still edit the file -- you just get an error message (which you
> can ignore).

No, I get Fundamental mode -- which means no highlighting of headings,
not auto-filling, not Flyspell, etc. -- all I have in Outline mode is
suddenly gone.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 18:49   ` Eli Zaretskii
@ 2022-04-17 18:54     ` Lars Ingebrigtsen
  2022-04-17 19:15       ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-17 18:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 54993

Eli Zaretskii <eliz@gnu.org> writes:

> It is IMO unreasonable to expect everyone to use the latest
> development code.  What about people who sync with Git once a month,
> for example?

If they don't sync, they don't get the new NEWS file.  If they sync,
they can then build Emacs.

> Or what about editing the file on a system that doesn't even have the
> master branch built?

That seems rather theoretical.  We do expect people that work on Emacs
to use the Emacs they're working on.  We introduce new stuff all the
time.

> No, I get Fundamental mode -- which means no highlighting of headings,
> not auto-filling, not Flyspell, etc. -- all I have in Outline mode is
> suddenly gone.

What's your suggestion for how this should work, then?  etc/NEWS in
auto-mode-alist?

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 18:54     ` Lars Ingebrigtsen
@ 2022-04-17 19:15       ` Eli Zaretskii
  2022-04-17 19:37         ` Lars Ingebrigtsen
  2022-04-18  8:40         ` Michael Albinus
  0 siblings, 2 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-17 19:15 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 54993@debbugs.gnu.org
> Date: Sun, 17 Apr 2022 20:54:38 +0200
> 
> > No, I get Fundamental mode -- which means no highlighting of headings,
> > not auto-filling, not Flyspell, etc. -- all I have in Outline mode is
> > suddenly gone.
> 
> What's your suggestion for how this should work, then?  etc/NEWS in
> auto-mode-alist?

Either that, or private customizations.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 19:15       ` Eli Zaretskii
@ 2022-04-17 19:37         ` Lars Ingebrigtsen
  2022-04-17 20:12           ` Eli Zaretskii
  2022-04-18  8:40         ` Michael Albinus
  1 sibling, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-17 19:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 54993

Eli Zaretskii <eliz@gnu.org> writes:

>> What's your suggestion for how this should work, then?  etc/NEWS in
>> auto-mode-alist?
>
> Either that, or private customizations.

Sure, it might make sense for people that use Emacs 28 to edit NEWS in
Emacs 29 to use something like the following customisation:

(unless (fboundp 'emacs-news-mode)
  (defun emacs-news-mode ()
    (let ((inhibit-local-variables-regexps '(".*")))
      (outline-mode))))

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 19:37         ` Lars Ingebrigtsen
@ 2022-04-17 20:12           ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-17 20:12 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 54993@debbugs.gnu.org
> Date: Sun, 17 Apr 2022 21:37:36 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> What's your suggestion for how this should work, then?  etc/NEWS in
> >> auto-mode-alist?
> >
> > Either that, or private customizations.
> 
> Sure, it might make sense for people that use Emacs 28 to edit NEWS in
> Emacs 29 to use something like the following customisation:
> 
> (unless (fboundp 'emacs-news-mode)
>   (defun emacs-news-mode ()
>     (let ((inhibit-local-variables-regexps '(".*")))
>       (outline-mode))))

That's not what I meant, and you know it.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 17:44 bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error Eli Zaretskii
  2022-04-17 18:38 ` Lars Ingebrigtsen
@ 2022-04-17 20:17 ` Jim Porter
  2022-04-17 20:27   ` Lars Ingebrigtsen
  2022-04-17 21:32   ` Lars Ingebrigtsen
  1 sibling, 2 replies; 43+ messages in thread
From: Jim Porter @ 2022-04-17 20:17 UTC (permalink / raw)
  To: Eli Zaretskii, 54993

On 4/17/2022 10:44 AM, Eli Zaretskii wrote:
>    emacs -Q
>    C-x C-f etc/NEWS RET
> 
> Observe an error message:
> 
>    File local-variables error: (void-function emacs-news-mode)
> 
> and NEWS is visited in Fundamental mode, which makes it annoyingly
> inconvenient to edit the news entries.
> 
> I think a new mode that is only available in the development version
> should not be forced on all the developers, because not all of them
> use the latest-and-the-greatest code all the time while working on
> Emacs.

This doesn't seem to work in Emacs 28.1 anymore, but at least on 27.2, I 
used the following strategy:

   # -*- mode: FOO; mode: BAR -*-

This way, it would try to load FOO-mode and then BAR-mode in order, and 
so I could set up the mode for files to ensure that users with BAR-mode 
available can use that, but it falls back to FOO-mode otherwise. 
Unfortunately, in Emacs 28.1, this now fails with:

   File local-variables error: (error Lisp nesting exceeds 
‘max-lisp-eval-depth’)

Maybe the strategy I was using is just an abuse of file-local variables, 
but I think it's a convenient way to do things like this, and would 
nicely solve this issue too. (If you prefer, I could file a separate bug 
for the regression with file-local variable handling.)





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 20:17 ` Jim Porter
@ 2022-04-17 20:27   ` Lars Ingebrigtsen
  2022-04-17 21:32   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-17 20:27 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Jim Porter <jporterbugs@gmail.com> writes:

>   # -*- mode: FOO; mode: BAR -*-
>
> This way, it would try to load FOO-mode and then BAR-mode in order,
> and so I could set up the mode for files to ensure that users with
> BAR-mode available can use that, but it falls back to FOO-mode
> otherwise. Unfortunately, in Emacs 28.1, this now fails with:
>
>   File local-variables error: (error Lisp nesting exceeds
>   ‘max-lisp-eval-depth’)

Yes, there's something weird going on with the mode: spec.  With the
following, and Emacs 28.1 (and NEWS from 29), it infloops.

(unless (fboundp 'emacs-news-mode)
  (defun emacs-news-mode ()
    (outline-mode)))

Like this:

  emacs-news-mode()
  hack-one-local-variable(mode emacs-news)
  hack-local-variables-apply()
  hack-local-variables(no-mode)
  run-mode-hooks(outline-mode-hook)
  outline-mode()
  emacs-news-mode()
  hack-one-local-variable(mode emacs-news)
  hack-local-variables-apply()
  hack-local-variables(no-mode)
  run-mode-hooks(outline-mode-hook)
  outline-mode()
  emacs-news-mode()
  set-auto-mode-0(emacs-news-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)

The mode: parsing stuff was largely redone for Emacs 28.1, and
I guess this is a fallout from that.  

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 20:17 ` Jim Porter
  2022-04-17 20:27   ` Lars Ingebrigtsen
@ 2022-04-17 21:32   ` Lars Ingebrigtsen
  2022-04-18  8:41     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-17 21:32 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Here's a must simpler recipe.  Put this into a buffer:

Local variables:
mode: text
end:

Then say `M-x emacs-lisp-mode'.  After doing so, the major mode will be
`text-mode'.

This is a regression in 28.1 from 27.2.  I'll have a look at it
tomorrow if nobody beats me to it.

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






^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 19:15       ` Eli Zaretskii
  2022-04-17 19:37         ` Lars Ingebrigtsen
@ 2022-04-18  8:40         ` Michael Albinus
  2022-04-18  8:45           ` Lars Ingebrigtsen
  2022-04-18  9:27           ` Eli Zaretskii
  1 sibling, 2 replies; 43+ messages in thread
From: Michael Albinus @ 2022-04-18  8:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Lars Ingebrigtsen, 54993

Eli Zaretskii <eliz@gnu.org> writes:

>> > No, I get Fundamental mode -- which means no highlighting of headings,
>> > not auto-filling, not Flyspell, etc. -- all I have in Outline mode is
>> > suddenly gone.
>>
>> What's your suggestion for how this should work, then?  etc/NEWS in
>> auto-mode-alist?
>
> Either that, or private customizations.

FTR, I find the new emacs-news-mode very convenient. Hiding it in
private customizations would remove its convenience.

What about

--8<---------------cut here---------------start------------->8---
Local variables:
coding: utf-8
eval: (or (fboundp 'emacs-news-mode) (defalias 'emacs-news-mode 'outline-mode))
mode: emacs-news
paragraph-separate: "[ 	\f]*$"
end:
--8<---------------cut here---------------end--------------->8---

It requires you to confirm the eval form, but this is the price when you
edit etc/NEWS from master with an older Emacs version.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-17 21:32   ` Lars Ingebrigtsen
@ 2022-04-18  8:41     ` Lars Ingebrigtsen
  2022-04-18  8:44       ` Lars Ingebrigtsen
  2022-04-18 16:48       ` Jim Porter
  0 siblings, 2 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-18  8:41 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Here's a must simpler recipe.  Put this into a buffer:
>
> Local variables:
> mode: text
> end:
>
> Then say `M-x emacs-lisp-mode'.  After doing so, the major mode will be
> `text-mode'.
>
> This is a regression in 28.1 from 27.2.  I'll have a look at it
> tomorrow if nobody beats me to it.

I've now fixed this regression, but I see there's (at least) one other:
In Emacs 27, if the mode: had a mode that's not defined, it just says
that it's ignored instead of trying to call it, which seems sensible, so
I'll fix that regression, too.

But I can't get this to work in Emacs 27.2 -- Jim, are you sure that
this worked at some point?

mode: emacs-news; mode: outline-mode

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:41     ` Lars Ingebrigtsen
@ 2022-04-18  8:44       ` Lars Ingebrigtsen
  2022-04-18 19:05         ` Juri Linkov
  2022-04-18 16:48       ` Jim Porter
  1 sibling, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-18  8:44 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've now fixed this regression, but I see there's (at least) one other:
> In Emacs 27, if the mode: had a mode that's not defined, it just says
> that it's ignored instead of trying to call it, which seems sensible, so
> I'll fix that regression, too.

Oh, that was fixed by the same fix.  :-/

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:40         ` Michael Albinus
@ 2022-04-18  8:45           ` Lars Ingebrigtsen
  2022-04-18  8:48             ` Michael Albinus
  2022-04-18  9:27           ` Eli Zaretskii
  1 sibling, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-18  8:45 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 54993

Michael Albinus <michael.albinus@gmx.de> writes:

> Local variables:
> coding: utf-8
> eval: (or (fboundp 'emacs-news-mode) (defalias 'emacs-news-mode 'outline-mode))
> mode: emacs-news
> paragraph-separate: "[ 	\f]*$"
> end:
>
> It requires you to confirm the eval form, but this is the price when you
> edit etc/NEWS from master with an older Emacs version.

That would prompt you in Emacs 29 too, though?  I think?

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:45           ` Lars Ingebrigtsen
@ 2022-04-18  8:48             ` Michael Albinus
  2022-04-18  8:56               ` Michael Albinus
  0 siblings, 1 reply; 43+ messages in thread
From: Michael Albinus @ 2022-04-18  8:48 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> Local variables:
>> coding: utf-8
>> eval: (or (fboundp 'emacs-news-mode) (defalias 'emacs-news-mode 'outline-mode))
>> mode: emacs-news
>> paragraph-separate: "[ 	\f]*$"
>> end:
>>
>> It requires you to confirm the eval form, but this is the price when you
>> edit etc/NEWS from master with an older Emacs version.
>
> That would prompt you in Emacs 29 too, though?  I think?

No, it doesn't (surprisingly). Perhaps, because fboundp is regarded as
safe, and defalias isn't (just a guess).

Best regards, Michael.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:48             ` Michael Albinus
@ 2022-04-18  8:56               ` Michael Albinus
  2022-04-18  9:35                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Michael Albinus @ 2022-04-18  8:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

Michael Albinus <michael.albinus@gmx.de> writes:

>>> Local variables:
>>> coding: utf-8
>>> eval: (or (fboundp 'emacs-news-mode) (defalias 'emacs-news-mode 'outline-mode))
>>> mode: emacs-news
>>> paragraph-separate: "[ 	\f]*$"
>>> end:
>>>
>>> It requires you to confirm the eval form, but this is the price when you
>>> edit etc/NEWS from master with an older Emacs version.
>>
>> That would prompt you in Emacs 29 too, though?  I think?
>
> No, it doesn't (surprisingly). Perhaps, because fboundp is regarded as
> safe, and defalias isn't (just a guess).

I stay corrected. It prompts when I start "emacs -Q".  Somewhere in my
config I must have allowed the eval.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:40         ` Michael Albinus
  2022-04-18  8:45           ` Lars Ingebrigtsen
@ 2022-04-18  9:27           ` Eli Zaretskii
  2022-04-18  9:34             ` Lars Ingebrigtsen
  2022-04-18 10:08             ` Michael Albinus
  1 sibling, 2 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-18  9:27 UTC (permalink / raw)
  To: Michael Albinus; +Cc: larsi, 54993

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,  54993@debbugs.gnu.org
> Date: Mon, 18 Apr 2022 10:40:04 +0200
> 
> FTR, I find the new emacs-news-mode very convenient. Hiding it in
> private customizations would remove its convenience.

??? How's that?  You make that customization once, and then get to
enjoy the convenience happily ever after.  What am I missing?

The customization I had in mind is to tell Emacs to turn on
emacs-news-mode when you visit a file called "NEWS".

> What about
> 
> --8<---------------cut here---------------start------------->8---
> Local variables:
> coding: utf-8
> eval: (or (fboundp 'emacs-news-mode) (defalias 'emacs-news-mode 'outline-mode))
> mode: emacs-news
> paragraph-separate: "[ 	\f]*$"
> end:
> --8<---------------cut here---------------end--------------->8---
> 
> It requires you to confirm the eval form, but this is the price when you
> edit etc/NEWS from master with an older Emacs version.

The need to confirm the eval form is an annoyance, because, unlike
some people, I actually read the message and think about it before I
confirm, and that takes time and is a distraction from the main job,
which is to make some change in NEWS.

Really, I very much object to this disruption of my long-time workflow
of working on Emacs, which is that I almost always use the released
version of Emacs and not the development version.  I can work around
this, but the need to come up with a good workaround is in itself
almost an insult.  And it goes against the basic principle that people
who want a feature should bear the burden of having it.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  9:27           ` Eli Zaretskii
@ 2022-04-18  9:34             ` Lars Ingebrigtsen
  2022-04-18  9:36               ` Eli Zaretskii
  2022-04-18 10:08             ` Michael Albinus
  1 sibling, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-18  9:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Michael Albinus, 54993

Eli Zaretskii <eliz@gnu.org> writes:

> Really, I very much object to this disruption of my long-time workflow
> of working on Emacs, which is that I almost always use the released
> version of Emacs and not the development version.  I can work around
> this, but the need to come up with a good workaround is in itself
> almost an insult.  And it goes against the basic principle that people
> who want a feature should bear the burden of having it.

You're seeing insults where there aren't any.  And I've posted code that
you can use to avoid having your work flow disrupted.

You're demanding that all Emacs developers that want to use the new and
handy mode alter their .emacs files, instead of doing so yourself.
Isn't that almost an insult?

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:56               ` Michael Albinus
@ 2022-04-18  9:35                 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-18  9:35 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 54993

Michael Albinus <michael.albinus@gmx.de> writes:

> I stay corrected. It prompts when I start "emacs -Q".  Somewhere in my
> config I must have allowed the eval.

Ah, right.  :-)  I was starting to doubt my memory about eval: more than
usual.  

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  9:34             ` Lars Ingebrigtsen
@ 2022-04-18  9:36               ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-18  9:36 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: michael.albinus, 54993

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Michael Albinus <michael.albinus@gmx.de>,  54993@debbugs.gnu.org
> Date: Mon, 18 Apr 2022 11:34:59 +0200
> 
> You're demanding that all Emacs developers that want to use the new and
> handy mode alter their .emacs files, instead of doing so yourself.
> Isn't that almost an insult?

No.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  9:27           ` Eli Zaretskii
  2022-04-18  9:34             ` Lars Ingebrigtsen
@ 2022-04-18 10:08             ` Michael Albinus
  2022-04-18 10:45               ` Eli Zaretskii
  1 sibling, 1 reply; 43+ messages in thread
From: Michael Albinus @ 2022-04-18 10:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: larsi, 54993

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> FTR, I find the new emacs-news-mode very convenient. Hiding it in
>> private customizations would remove its convenience.
>
> ??? How's that?  You make that customization once, and then get to
> enjoy the convenience happily ever after.  What am I missing?
>
> The customization I had in mind is to tell Emacs to turn on
> emacs-news-mode when you visit a file called "NEWS".

Midterm, I have the hope to extend emacs-news-mode for some checks when
adding something to etc/NEWS. Something like checking proper quotation
etc.

However, this works only when this mode is enabled. If we need to tell
every occasional contributor to enable this mode, it would be less useful.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18 10:08             ` Michael Albinus
@ 2022-04-18 10:45               ` Eli Zaretskii
  2022-04-18 11:12                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-18 10:45 UTC (permalink / raw)
  To: Michael Albinus; +Cc: larsi, 54993

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: larsi@gnus.org,  54993@debbugs.gnu.org
> Date: Mon, 18 Apr 2022 12:08:28 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> Hi Eli,
> 
> >> FTR, I find the new emacs-news-mode very convenient. Hiding it in
> >> private customizations would remove its convenience.
> >
> > ??? How's that?  You make that customization once, and then get to
> > enjoy the convenience happily ever after.  What am I missing?
> >
> > The customization I had in mind is to tell Emacs to turn on
> > emacs-news-mode when you visit a file called "NEWS".
> 
> Midterm, I have the hope to extend emacs-news-mode for some checks when
> adding something to etc/NEWS. Something like checking proper quotation
> etc.
> 
> However, this works only when this mode is enabled. If we need to tell
> every occasional contributor to enable this mode, it would be less useful.

We could add NEWS to auto-mode-alist instead, and that would solve the
issue cleanly for everyone.  That was one of the original
alternatives, but somehow it was forgotten now.

Btw, another issue with emacs-news-mode is that it invokes
outline-minor-mode, which means all the headings-related commands are
now bound to different keys than they were before.  Wouldn't it be
better if emacs-news-mode were a minor mode invoked by Outline
instead?





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18 10:45               ` Eli Zaretskii
@ 2022-04-18 11:12                 ` Lars Ingebrigtsen
  2022-04-18 14:15                   ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-18 11:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Michael Albinus, 54993

Eli Zaretskii <eliz@gnu.org> writes:

> We could add NEWS to auto-mode-alist instead, and that would solve the
> issue cleanly for everyone.  That was one of the original
> alternatives, but somehow it was forgotten now.

My worry with that was that adding etc/NEWS to auto-mode-alist would be
false positives (for other files with that name).  But I guess we could
check that it's actually an Emacs NEWS file before enabling the mode.

But that would mean removing the mode: setting from NEWS itself, because
mode: takes precedence over auto-mode-alist, I think?  (But I may well
be misremembering.)  So then we're back to people editing the file in
Emacs 28 in fundamental-mode.

> Btw, another issue with emacs-news-mode is that it invokes
> outline-minor-mode, which means all the headings-related commands are
> now bound to different keys than they were before.  Wouldn't it be
> better if emacs-news-mode were a minor mode invoked by Outline
> instead?

emacs-news-mode is quite major-modeish, though, so I think that would be
awkward.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18 11:12                 ` Lars Ingebrigtsen
@ 2022-04-18 14:15                   ` Eli Zaretskii
  2022-04-19 12:04                     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-18 14:15 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: michael.albinus, 54993

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Michael Albinus <michael.albinus@gmx.de>,  54993@debbugs.gnu.org
> Date: Mon, 18 Apr 2022 13:12:31 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > We could add NEWS to auto-mode-alist instead, and that would solve the
> > issue cleanly for everyone.  That was one of the original
> > alternatives, but somehow it was forgotten now.
> 
> My worry with that was that adding etc/NEWS to auto-mode-alist would be
> false positives (for other files with that name).  But I guess we could
> check that it's actually an Emacs NEWS file before enabling the mode.

I looked at several NEWS files in various projects, and they look well
under outline mode.  Which doesn't really surprise me, since NEWS is
AFAIR a GNU thing.

> But that would mean removing the mode: setting from NEWS itself, because
> mode: takes precedence over auto-mode-alist, I think?

Yes.

> So then we're back to people editing the file in Emacs 28 in
> fundamental-mode.

Yes.  So maybe instead Outline mode in Emacs 29 could turn on
emacs-news-mode automatically when the file's name is NEWS or NEWS.*
or ONEWS.

> > Btw, another issue with emacs-news-mode is that it invokes
> > outline-minor-mode, which means all the headings-related commands are
> > now bound to different keys than they were before.  Wouldn't it be
> > better if emacs-news-mode were a minor mode invoked by Outline
> > instead?
> 
> emacs-news-mode is quite major-modeish, though, so I think that would be
> awkward.

I don't see why.  What do you see in emacs-news-mode that doesn't fit
a minor mode?

I guess my point is that making it a major mode makes this a
backward-incompatible change, when we consider editing of NEWS.  If we
can avoid that, it would be better.

Or maybe it's enough to make it be derived from Outline (if that
doesn't interfere with editing NEWS with older Emacsen)?





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:41     ` Lars Ingebrigtsen
  2022-04-18  8:44       ` Lars Ingebrigtsen
@ 2022-04-18 16:48       ` Jim Porter
  2022-04-19 12:08         ` Lars Ingebrigtsen
  1 sibling, 1 reply; 43+ messages in thread
From: Jim Porter @ 2022-04-18 16:48 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

On 4/18/2022 1:41 AM, Lars Ingebrigtsen wrote:
> I've now fixed this regression, but I see there's (at least) one other:
> In Emacs 27, if the mode: had a mode that's not defined, it just says
> that it's ignored instead of trying to call it, which seems sensible, so
> I'll fix that regression, too.
> 
> But I can't get this to work in Emacs 27.2 -- Jim, are you sure that
> this worked at some point?

I just tried it in 27.2, and it works fine for me. If the "preferred" 
mode is defined, it uses that. Otherwise, it says "Ignoring unknown 
mode..." and uses the "basic" mode.

> mode: emacs-news; mode: outline-mode

It's probably failing for you because you need to do this in the 
opposite order (and remove the "-mode"):

   mode: outline; mode: emacs-news

It's a bit surprising at first, since as humans, we'd probably expect 
the "preferred" mode to be first, but the way this works is to activate 
outline-mode, and then (try to) activate emacs-news-mode. That's a 
little bit inefficient, but since this would mostly be used in cases 
where the "preferred" mode is derived from the "basic" mode, it's 
probably not too bad.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18  8:44       ` Lars Ingebrigtsen
@ 2022-04-18 19:05         ` Juri Linkov
  2022-04-19 12:10           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Juri Linkov @ 2022-04-18 19:05 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

>> I've now fixed this regression, but I see there's (at least) one other:
>> In Emacs 27, if the mode: had a mode that's not defined, it just says
>> that it's ignored instead of trying to call it, which seems sensible, so
>> I'll fix that regression, too.
>
> Oh, that was fixed by the same fix.  :-/

emacs-news is a nice mode, but I found another regression:
there are different outline header colors between Emacs 28 and 29
because of different outline levels.  The additional level comes
from the space character at the end of outline-regexp "^\\*+ ".





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18 14:15                   ` Eli Zaretskii
@ 2022-04-19 12:04                     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-19 12:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: michael.albinus, 54993

Eli Zaretskii <eliz@gnu.org> writes:

> Yes.  So maybe instead Outline mode in Emacs 29 could turn on
> emacs-news-mode automatically when the file's name is NEWS or NEWS.*
> or ONEWS.

That sounds like a very ugly and unpredictable hack.

>> emacs-news-mode is quite major-modeish, though, so I think that would be
>> awkward.
>
> I don't see why.  What do you see in emacs-news-mode that doesn't fit
> a minor mode?

It sets font-lock keywords, for instance.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18 16:48       ` Jim Porter
@ 2022-04-19 12:08         ` Lars Ingebrigtsen
  2022-04-19 13:56           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-19 12:08 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Jim Porter <jporterbugs@gmail.com> writes:

> It's probably failing for you because you need to do this in the
> opposite order (and remove the "-mode"):
>
>   mode: outline; mode: emacs-news
>
> It's a bit surprising at first, since as humans, we'd probably expect
> the "preferred" mode to be first, but the way this works is to
> activate outline-mode, and then (try to) activate
> emacs-news-mode. That's a little bit inefficient, but since this would
> mostly be used in cases where the "preferred" mode is derived from the
> "basic" mode, it's probably not too bad.

Hm....  I tried that with the NEWS file, and emacs-27.2/emacs-28 indeed
used outline mode.  But it didn't try to use emacs-news-mode, as far as
I can tell, and neither does master.  (But we can fix that on master, of
course, which might be generally useful anyway.  That is, as a way to
introduce new modes in a backwards-compatible way in mode: strings.)

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-18 19:05         ` Juri Linkov
@ 2022-04-19 12:10           ` Lars Ingebrigtsen
  2022-04-19 13:18             ` Michael Albinus
  2022-04-19 19:15             ` Juri Linkov
  0 siblings, 2 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-19 12:10 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 54993

Juri Linkov <juri@linkov.net> writes:

> emacs-news is a nice mode, but I found another regression:
> there are different outline header colors between Emacs 28 and 29
> because of different outline levels.  The additional level comes
> from the space character at the end of outline-regexp "^\\*+ ".

I wanted to avoid having stuff like

** New thing for help buffers.
*Help* buffers can be etc...

triggering an outline thing on the second line.  Is there a way to do
that without including the space in outline-regexp?

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 12:10           ` Lars Ingebrigtsen
@ 2022-04-19 13:18             ` Michael Albinus
  2022-04-19 13:21               ` Lars Ingebrigtsen
  2022-04-19 19:15             ` Juri Linkov
  1 sibling, 1 reply; 43+ messages in thread
From: Michael Albinus @ 2022-04-19 13:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Juri Linkov, 54993

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> emacs-news is a nice mode, but I found another regression:
>> there are different outline header colors between Emacs 28 and 29
>> because of different outline levels.  The additional level comes
>> from the space character at the end of outline-regexp "^\\*+ ".
>
> I wanted to avoid having stuff like
>
> ** New thing for help buffers.
> *Help* buffers can be etc...
>
> triggering an outline thing on the second line.  Is there a way to do
> that without including the space in outline-regexp?

The correct spelling would be

--8<---------------cut here---------------start------------->8---
"*Help*" buffers can be etc...
--8<---------------cut here---------------end--------------->8---

At least *this* example doesn't hurt.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 13:18             ` Michael Albinus
@ 2022-04-19 13:21               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-19 13:21 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Juri Linkov, 54993

Michael Albinus <michael.albinus@gmx.de> writes:

> The correct spelling would be
>
> "*Help*" buffers can be etc...

I don't much like that spelling in NEWS.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 12:08         ` Lars Ingebrigtsen
@ 2022-04-19 13:56           ` Lars Ingebrigtsen
  2022-04-19 14:24             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-19 13:56 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> It's probably failing for you because you need to do this in the
>> opposite order (and remove the "-mode"):
>>
>>   mode: outline; mode: emacs-news

Aha!  This works:

-*- mode: outline; mode: emacs-news -*-

But it doesn't work in the Local variables: section, which can only have
one mode/variable per line.

But!  Emacs only interprets the first mode: line it finds, so having

mode: outline
mode: emacs-news

and then extending Emacs on the trunk heed the final (defined) mode
would be both backwards and forwards compatible (as well as making this
an alternative to -*-, making things more regular), so I'll take a peek
at doing that.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 13:56           ` Lars Ingebrigtsen
@ 2022-04-19 14:24             ` Lars Ingebrigtsen
  2022-04-19 16:06               ` Eli Zaretskii
  2022-04-19 16:09               ` Lars Ingebrigtsen
  0 siblings, 2 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-19 14:24 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Lars Ingebrigtsen <larsi@gnus.org> writes:

> But!  Emacs only interprets the first mode: line it finds, so having
>
> mode: outline
> mode: emacs-news
>
> and then extending Emacs on the trunk heed the final (defined) mode
> would be both backwards and forwards compatible (as well as making this
> an alternative to -*-, making things more regular), so I'll take a peek
> at doing that.

I've now fixed this, and it seems to be both backwards and forwards
compatible.  But while testing, I found another new bug in the -*-
parsing of mode: variables, so I'll be fixing that, too.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 14:24             ` Lars Ingebrigtsen
@ 2022-04-19 16:06               ` Eli Zaretskii
  2022-04-20  6:14                 ` Kévin Le Gouguec
  2022-04-20 10:45                 ` Lars Ingebrigtsen
  2022-04-19 16:09               ` Lars Ingebrigtsen
  1 sibling, 2 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-19 16:06 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: jporterbugs, 54993

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 19 Apr 2022 16:24:09 +0200
> Cc: 54993@debbugs.gnu.org
> 
> Lars Ingebrigtsen <larsi@gnus.org> writes:
> 
> > But!  Emacs only interprets the first mode: line it finds, so having
> >
> > mode: outline
> > mode: emacs-news
> >
> > and then extending Emacs on the trunk heed the final (defined) mode
> > would be both backwards and forwards compatible (as well as making this
> > an alternative to -*-, making things more regular), so I'll take a peek
> > at doing that.
> 
> I've now fixed this, and it seems to be both backwards and forwards
> compatible.

Thank you!

Now the only issue that remains, AFAICT, is the different key bindings
for outline-related commands in NEWES, caused by the fact that
emacs-news-mode activates outline-minor-mode.  Could we perhaps solve
this by having emacs-news-mode be derived from outline-mode, not from
text-mode?  If not, why not?





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 14:24             ` Lars Ingebrigtsen
  2022-04-19 16:06               ` Eli Zaretskii
@ 2022-04-19 16:09               ` Lars Ingebrigtsen
  1 sibling, 0 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-19 16:09 UTC (permalink / raw)
  To: Jim Porter; +Cc: 54993

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've now fixed this, and it seems to be both backwards and forwards
> compatible.  But while testing, I found another new bug in the -*-
> parsing of mode: variables, so I'll be fixing that, too.

And I've pushed a fix and tests for this to Emacs 29, and a fix for this
to emacs-28.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 12:10           ` Lars Ingebrigtsen
  2022-04-19 13:18             ` Michael Albinus
@ 2022-04-19 19:15             ` Juri Linkov
  2022-04-20  6:22               ` Kévin Le Gouguec
  1 sibling, 1 reply; 43+ messages in thread
From: Juri Linkov @ 2022-04-19 19:15 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54993

>> there are different outline header colors between Emacs 28 and 29
>> because of different outline levels.  The additional level comes
>> from the space character at the end of outline-regexp "^\\*+ ".
>
> I wanted to avoid having stuff like
>
> ** New thing for help buffers.
> *Help* buffers can be etc...
>
> triggering an outline thing on the second line.  Is there a way to do
> that without including the space in outline-regexp?

I see only 1 way: to set buffer-local outline-level where to subtract 1.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 16:06               ` Eli Zaretskii
@ 2022-04-20  6:14                 ` Kévin Le Gouguec
  2022-04-20  6:46                   ` Eli Zaretskii
  2022-04-20 10:45                 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 43+ messages in thread
From: Kévin Le Gouguec @ 2022-04-20  6:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jporterbugs, Lars Ingebrigtsen, 54993

Eli Zaretskii <eliz@gnu.org> writes:

> Now the only issue that remains, AFAICT, is the different key bindings
> for outline-related commands in NEWES, caused by the fact that
> emacs-news-mode activates outline-minor-mode.  Could we perhaps solve
> this by having emacs-news-mode be derived from outline-mode, not from
> text-mode?  If not, why not?

I second that request.

outline-minor-mode's extra "@" doesn't bother me that much (because
repeat-mode makes it easy to chain commands), but it'd still be nice if
outline-mode's shorter bindings could remain ("@" is a bit awkward on
AZERTY).

The only issue I see is that it entails rebinding
emacs-news-find-heading and emacs-news-count-untagged-entries?

(I've only looked at navigation commands; didn't check
section-visibility commands because I mindlessly spam TAB)





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 19:15             ` Juri Linkov
@ 2022-04-20  6:22               ` Kévin Le Gouguec
  2022-04-20 10:49                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Kévin Le Gouguec @ 2022-04-20  6:22 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Ingebrigtsen, 54993

Juri Linkov <juri@linkov.net> writes:

>>> there are different outline header colors between Emacs 28 and 29
>>> because of different outline levels.  The additional level comes
>>> from the space character at the end of outline-regexp "^\\*+ ".
>>
>> I wanted to avoid having stuff like
>>
>> ** New thing for help buffers.
>> *Help* buffers can be etc...
>>
>> triggering an outline thing on the second line.  Is there a way to do
>> that without including the space in outline-regexp?
>
> I see only 1 way: to set buffer-local outline-level where to subtract 1.

FWIW, this is exactly what org-outline-level does, since Org also sets
outline-regexp to "\\*+ ".

(NB: IIUC from outline-regexp's docstring, it is not necessary to anchor
the regexp with "^")





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-20  6:14                 ` Kévin Le Gouguec
@ 2022-04-20  6:46                   ` Eli Zaretskii
  0 siblings, 0 replies; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-20  6:46 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: jporterbugs, larsi, 54993

> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,  jporterbugs@gmail.com,
>   54993@debbugs.gnu.org
> Date: Wed, 20 Apr 2022 08:14:18 +0200
> 
> The only issue I see is that it entails rebinding
> emacs-news-find-heading and emacs-news-count-untagged-entries?

These are new commands, so IMO it's reasonable to have them on new key
sequences.  By contrast, the need to switch to the keybindings of
outline-minor-mode breaks muscle memory.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-19 16:06               ` Eli Zaretskii
  2022-04-20  6:14                 ` Kévin Le Gouguec
@ 2022-04-20 10:45                 ` Lars Ingebrigtsen
  2022-04-20 12:28                   ` Eli Zaretskii
  1 sibling, 1 reply; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-20 10:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jporterbugs, 54993

Eli Zaretskii <eliz@gnu.org> writes:

> Now the only issue that remains, AFAICT, is the different key bindings
> for outline-related commands in NEWES, caused by the fact that
> emacs-news-mode activates outline-minor-mode.  Could we perhaps solve
> this by having emacs-news-mode be derived from outline-mode, not from
> text-mode?  If not, why not?

I thought it would be more consistent to have both emacs-news-view-mode
and emacs-news-mode use outline-minor-mode, but I don't really have a
strong opinion here.  (We're moving all the "help"-ish buffers to use
outline-minor-mode, after all.)

But emacs-news-mode is for editing, so perhaps it makes sense to use
outline-mode here.  It does steal an awful lot of the `C-c C-*' keys,
though, so I'm not very enthusiastic about outline-mode in general and
think we should avoid it.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-20  6:22               ` Kévin Le Gouguec
@ 2022-04-20 10:49                 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-20 10:49 UTC (permalink / raw)
  To: Kévin Le Gouguec; +Cc: Juri Linkov, 54993

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

>> I see only 1 way: to set buffer-local outline-level where to subtract 1.
>
> FWIW, this is exactly what org-outline-level does, since Org also sets
> outline-regexp to "\\*+ ".
>
> (NB: IIUC from outline-regexp's docstring, it is not necessary to anchor
> the regexp with "^")

Ah, yes; thanks.  I've now fixed both things on the trunk.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-20 10:45                 ` Lars Ingebrigtsen
@ 2022-04-20 12:28                   ` Eli Zaretskii
  2022-04-21 11:32                     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 43+ messages in thread
From: Eli Zaretskii @ 2022-04-20 12:28 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: jporterbugs, 54993

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: jporterbugs@gmail.com,  54993@debbugs.gnu.org
> Date: Wed, 20 Apr 2022 12:45:15 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Now the only issue that remains, AFAICT, is the different key bindings
> > for outline-related commands in NEWES, caused by the fact that
> > emacs-news-mode activates outline-minor-mode.  Could we perhaps solve
> > this by having emacs-news-mode be derived from outline-mode, not from
> > text-mode?  If not, why not?
> 
> I thought it would be more consistent to have both emacs-news-view-mode
> and emacs-news-mode use outline-minor-mode, but I don't really have a
> strong opinion here.  (We're moving all the "help"-ish buffers to use
> outline-minor-mode, after all.)
> 
> But emacs-news-mode is for editing, so perhaps it makes sense to use
> outline-mode here.  It does steal an awful lot of the `C-c C-*' keys,
> though, so I'm not very enthusiastic about outline-mode in general and
> think we should avoid it.

Perhaps in general that is true, but I think in this case previous
behavior is an important aspect that we should try to preserve.





^ permalink raw reply	[flat|nested] 43+ messages in thread

* bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error
  2022-04-20 12:28                   ` Eli Zaretskii
@ 2022-04-21 11:32                     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 43+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-21 11:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jporterbugs, 54993

Eli Zaretskii <eliz@gnu.org> writes:

> Perhaps in general that is true, but I think in this case previous
> behavior is an important aspect that we should try to preserve.

I think having convenient C-c C-* commands in the NEWS file is more
important than having to adjust to using the outline-minor-mode
commands.  (And there will probably be more of them.)  Outline mode
takes 22 C-c keystrokes, which makes things really awkward.

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





^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2022-04-21 11:32 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-17 17:44 bug#54993: 28.1; Editing etc/NEWS on master with Emacs 28 signals an error Eli Zaretskii
2022-04-17 18:38 ` Lars Ingebrigtsen
2022-04-17 18:49   ` Eli Zaretskii
2022-04-17 18:54     ` Lars Ingebrigtsen
2022-04-17 19:15       ` Eli Zaretskii
2022-04-17 19:37         ` Lars Ingebrigtsen
2022-04-17 20:12           ` Eli Zaretskii
2022-04-18  8:40         ` Michael Albinus
2022-04-18  8:45           ` Lars Ingebrigtsen
2022-04-18  8:48             ` Michael Albinus
2022-04-18  8:56               ` Michael Albinus
2022-04-18  9:35                 ` Lars Ingebrigtsen
2022-04-18  9:27           ` Eli Zaretskii
2022-04-18  9:34             ` Lars Ingebrigtsen
2022-04-18  9:36               ` Eli Zaretskii
2022-04-18 10:08             ` Michael Albinus
2022-04-18 10:45               ` Eli Zaretskii
2022-04-18 11:12                 ` Lars Ingebrigtsen
2022-04-18 14:15                   ` Eli Zaretskii
2022-04-19 12:04                     ` Lars Ingebrigtsen
2022-04-17 20:17 ` Jim Porter
2022-04-17 20:27   ` Lars Ingebrigtsen
2022-04-17 21:32   ` Lars Ingebrigtsen
2022-04-18  8:41     ` Lars Ingebrigtsen
2022-04-18  8:44       ` Lars Ingebrigtsen
2022-04-18 19:05         ` Juri Linkov
2022-04-19 12:10           ` Lars Ingebrigtsen
2022-04-19 13:18             ` Michael Albinus
2022-04-19 13:21               ` Lars Ingebrigtsen
2022-04-19 19:15             ` Juri Linkov
2022-04-20  6:22               ` Kévin Le Gouguec
2022-04-20 10:49                 ` Lars Ingebrigtsen
2022-04-18 16:48       ` Jim Porter
2022-04-19 12:08         ` Lars Ingebrigtsen
2022-04-19 13:56           ` Lars Ingebrigtsen
2022-04-19 14:24             ` Lars Ingebrigtsen
2022-04-19 16:06               ` Eli Zaretskii
2022-04-20  6:14                 ` Kévin Le Gouguec
2022-04-20  6:46                   ` Eli Zaretskii
2022-04-20 10:45                 ` Lars Ingebrigtsen
2022-04-20 12:28                   ` Eli Zaretskii
2022-04-21 11:32                     ` Lars Ingebrigtsen
2022-04-19 16:09               ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).