GNU bug report logs - #55579
29.0.50; Abbrevs not saved on exit anymore

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 22 May 2022 17:13:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

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

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 55579 in the body.
You can then email your comments to 55579 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#55579; Package emacs. (Sun, 22 May 2022 17:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 22 May 2022 17:13:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Abbrevs not saved on exit anymore
Date: Sun, 22 May 2022 20:10:43 +0300
After a recent change, 'C-x C-c' doesn't ask anymore to save abbrevs with:

  Save abbrevs in ~/.emacs.d/abbrev_defs?

It looks like the regression was caused by ce220524fcf.
Before this change, save-buffers-kill-emacs unconditionally
called save-some-buffers that also saves the abbrev table.
But after the change, save-some-buffers that saves abbrevs
is called only when files--buffers-needing-to-be-saved
detects unsaved buffers.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Mon, 23 May 2022 07:48:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 55579 <at> debbugs.gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Mon, 23 May 2022 09:46:48 +0200
Juri Linkov <juri <at> linkov.net> writes:

> After a recent change, 'C-x C-c' doesn't ask anymore to save abbrevs with:
>
>   Save abbrevs in ~/.emacs.d/abbrev_defs?
>
> It looks like the regression was caused by ce220524fcf.
> Before this change, save-buffers-kill-emacs unconditionally
> called save-some-buffers that also saves the abbrev table.
> But after the change, save-some-buffers that saves abbrevs
> is called only when files--buffers-needing-to-be-saved
> detects unsaved buffers.

Wow -- I had no idea that save-some-buffers also randomly saved abbrevs.

I've now separated that this out into a general mechanism that abbrev.el
now hooks into, while also fixing this `C-x C-c' bug.

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




bug marked as fixed in version 29.1, send any further explanations to 55579 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 23 May 2022 07:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Tue, 24 May 2022 19:15:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: 55579 <at> debbugs.gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Tue, 24 May 2022 21:42:58 +0300
> Save abbrevs in ~/.emacs.d/abbrev_defs?

BTW, I noticed that ~/.emacs.d/abbrev_defs
is visited without font-locking.  Here's the fix:

diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 3ee972869b..a3b19107f7 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -264,7 +264,7 @@ write-abbrev-file
       (when (unencodable-char-position (point-min) (point-max) 'utf-8)
 	(setq coding-system-for-write 'utf-8-emacs))
       (goto-char (point-min))
-      (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write))
+      (insert (format ";; -*- coding: %s; mode: lisp-data -*-\n" coding-system-for-write))
       (write-region nil nil file nil (and (not verbose) 0)))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Tue, 24 May 2022 19:18:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 55579 <at> debbugs.gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Tue, 24 May 2022 21:17:11 +0200
Juri Linkov <juri <at> linkov.net> writes:

> BTW, I noticed that ~/.emacs.d/abbrev_defs
> is visited without font-locking.  Here's the fix:

Makes sense to me.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Tue, 24 May 2022 19:28:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 55579 <at> debbugs.gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Tue, 24 May 2022 22:27:03 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Date: Tue, 24 May 2022 21:42:58 +0300
> 
> > Save abbrevs in ~/.emacs.d/abbrev_defs?
> 
> BTW, I noticed that ~/.emacs.d/abbrev_defs
> is visited without font-locking.  Here's the fix:

Won't that make loading abbrevs slower and more expensive?  that file
is normally not edited interactively, only if the user explicitly
wants to do so.  So why is font-lock in it important?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Wed, 25 May 2022 05:52:02 GMT) Full text and rfc822 format available.

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

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Wed, 25 May 2022 07:51:24 +0200
[Message part 1 (text/plain, inline)]
+1

Am 24.05.22 um 21:27 schrieb Eli Zaretskii:
>> From: Juri Linkov<juri <at> linkov.net>
>> Date: Tue, 24 May 2022 21:42:58 +0300
>>
>>> Save abbrevs in ~/.emacs.d/abbrev_defs?
>> BTW, I noticed that ~/.emacs.d/abbrev_defs
>> is visited without font-locking.  Here's the fix:
> Won't that make loading abbrevs slower and more expensive?  that file
> is normally not edited interactively, only if the user explicitly
> wants to do so.  So why is font-lock in it important?
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Wed, 25 May 2022 06:45:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55579 <at> debbugs.gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Wed, 25 May 2022 09:37:20 +0300
>> > Save abbrevs in ~/.emacs.d/abbrev_defs?
>>
>> BTW, I noticed that ~/.emacs.d/abbrev_defs
>> is visited without font-locking.  Here's the fix:
>
> Won't that make loading abbrevs slower and more expensive?  that file
> is normally not edited interactively, only if the user explicitly
> wants to do so.  So why is font-lock in it important?

This is part of recent efforts to add modes to .emacs.d files.
So far we added the mode tag to ~/.emacs.d/bookmarks, ~/.emacs.d/tramp,
~/.emacs.d/.emacs.desktop, ~/.emacs.d/network-security.data,
~/.emacs.d/places, ~/.emacs.d/projects.  But mode is still missing
in ~/.emacs.d/abbrev_defs and ~/.emacs.d/recentf.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Wed, 25 May 2022 12:11:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55579 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Wed, 25 May 2022 14:10:31 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> BTW, I noticed that ~/.emacs.d/abbrev_defs
>> is visited without font-locking.  Here's the fix:
>
> Won't that make loading abbrevs slower and more expensive?  that file
> is normally not edited interactively, only if the user explicitly
> wants to do so.  So why is font-lock in it important?

`read-abbrev-file' just uses `load' on the file, so the mode cookie
doesn't do anything non-interactively.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Wed, 25 May 2022 13:23:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 55579 <at> debbugs.gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Wed, 25 May 2022 16:21:36 +0300
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 55579 <at> debbugs.gnu.org
> Date: Wed, 25 May 2022 09:37:20 +0300
> 
> >> > Save abbrevs in ~/.emacs.d/abbrev_defs?
> >>
> >> BTW, I noticed that ~/.emacs.d/abbrev_defs
> >> is visited without font-locking.  Here's the fix:
> >
> > Won't that make loading abbrevs slower and more expensive?  that file
> > is normally not edited interactively, only if the user explicitly
> > wants to do so.  So why is font-lock in it important?
> 
> This is part of recent efforts to add modes to .emacs.d files.
> So far we added the mode tag to ~/.emacs.d/bookmarks, ~/.emacs.d/tramp,
> ~/.emacs.d/.emacs.desktop, ~/.emacs.d/network-security.data,
> ~/.emacs.d/places, ~/.emacs.d/projects.  But mode is still missing
> in ~/.emacs.d/abbrev_defs and ~/.emacs.d/recentf.

We don't need to do that for all of the files, only for files that are
frequently (or always) visited or edited interactively by users.  So
I'm asking this question specifically for abbrev_defs, not for all the
other files there: why do we need this, and how significant is the
reason?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Wed, 25 May 2022 13:55:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 55579 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Wed, 25 May 2022 16:54:41 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Juri Linkov <juri <at> linkov.net>,  55579 <at> debbugs.gnu.org
> Date: Wed, 25 May 2022 14:10:31 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> BTW, I noticed that ~/.emacs.d/abbrev_defs
> >> is visited without font-locking.  Here's the fix:
> >
> > Won't that make loading abbrevs slower and more expensive?  that file
> > is normally not edited interactively, only if the user explicitly
> > wants to do so.  So why is font-lock in it important?
> 
> `read-abbrev-file' just uses `load' on the file, so the mode cookie
> doesn't do anything non-interactively.

Then let's have a comment where the cookie is written to explain
that it assumes 'load', and let's have another comment where we load
the file to explain why using another function should consider this
aspect.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Wed, 25 May 2022 17:49:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55579 <at> debbugs.gnu.org
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Wed, 25 May 2022 20:34:53 +0300
>> >> > Save abbrevs in ~/.emacs.d/abbrev_defs?
>> >>
>> >> BTW, I noticed that ~/.emacs.d/abbrev_defs
>> >> is visited without font-locking.  Here's the fix:
>> >
>> > Won't that make loading abbrevs slower and more expensive?  that file
>> > is normally not edited interactively, only if the user explicitly
>> > wants to do so.  So why is font-lock in it important?
>>
>> This is part of recent efforts to add modes to .emacs.d files.
>> So far we added the mode tag to ~/.emacs.d/bookmarks, ~/.emacs.d/tramp,
>> ~/.emacs.d/.emacs.desktop, ~/.emacs.d/network-security.data,
>> ~/.emacs.d/places, ~/.emacs.d/projects.  But mode is still missing
>> in ~/.emacs.d/abbrev_defs and ~/.emacs.d/recentf.
>
> We don't need to do that for all of the files, only for files that are
> frequently (or always) visited or edited interactively by users.  So
> I'm asking this question specifically for abbrev_defs, not for all the
> other files there: why do we need this, and how significant is the
> reason?

Of course, it's visited frequently.  This is necessary to see
what abbreviations are defined.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55579; Package emacs. (Fri, 27 May 2022 10:23:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 55579 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#55579: 29.0.50; Abbrevs not saved on exit anymore
Date: Fri, 27 May 2022 12:21:58 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Then let's have a comment where the cookie is written to explain
> that it assumes 'load', and let's have another comment where we load
> the file to explain why using another function should consider this
> aspect.

We add these cookies to basically all files like this, so adding
these comments seems superfluous.

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 24 Jun 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 278 days ago.

Previous Next


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