unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
@ 2022-05-22 17:10 Juri Linkov
  2022-05-23  7:46 ` Lars Ingebrigtsen
  2022-05-24 18:42 ` Juri Linkov
  0 siblings, 2 replies; 12+ messages in thread
From: Juri Linkov @ 2022-05-22 17:10 UTC (permalink / raw)
  To: 55579

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.





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-22 17:10 bug#55579: 29.0.50; Abbrevs not saved on exit anymore Juri Linkov
@ 2022-05-23  7:46 ` Lars Ingebrigtsen
  2022-05-24 18:42 ` Juri Linkov
  1 sibling, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-23  7:46 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 55579

Juri Linkov <juri@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





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-22 17:10 bug#55579: 29.0.50; Abbrevs not saved on exit anymore Juri Linkov
  2022-05-23  7:46 ` Lars Ingebrigtsen
@ 2022-05-24 18:42 ` Juri Linkov
  2022-05-24 19:17   ` Lars Ingebrigtsen
  2022-05-24 19:27   ` Eli Zaretskii
  1 sibling, 2 replies; 12+ messages in thread
From: Juri Linkov @ 2022-05-24 18:42 UTC (permalink / raw)
  To: 55579

> 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)))))





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-24 18:42 ` Juri Linkov
@ 2022-05-24 19:17   ` Lars Ingebrigtsen
  2022-05-24 19:27   ` Eli Zaretskii
  1 sibling, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-24 19:17 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 55579

Juri Linkov <juri@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





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-24 18:42 ` Juri Linkov
  2022-05-24 19:17   ` Lars Ingebrigtsen
@ 2022-05-24 19:27   ` Eli Zaretskii
  2022-05-25  5:51     ` Andreas Röhler
                       ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Eli Zaretskii @ 2022-05-24 19:27 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 55579

> From: Juri Linkov <juri@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?





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-24 19:27   ` Eli Zaretskii
@ 2022-05-25  5:51     ` Andreas Röhler
  2022-05-25  6:37     ` Juri Linkov
  2022-05-25 12:10     ` Lars Ingebrigtsen
  2 siblings, 0 replies; 12+ messages in thread
From: Andreas Röhler @ 2022-05-25  5:51 UTC (permalink / raw)
  To: 55579

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

+1

Am 24.05.22 um 21:27 schrieb Eli Zaretskii:
>> From: Juri Linkov<juri@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?
>
>
>

[-- Attachment #2: Type: text/html, Size: 1166 bytes --]

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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-24 19:27   ` Eli Zaretskii
  2022-05-25  5:51     ` Andreas Röhler
@ 2022-05-25  6:37     ` Juri Linkov
  2022-05-25 13:21       ` Eli Zaretskii
  2022-05-25 12:10     ` Lars Ingebrigtsen
  2 siblings, 1 reply; 12+ messages in thread
From: Juri Linkov @ 2022-05-25  6:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 55579

>> > 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.





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-24 19:27   ` Eli Zaretskii
  2022-05-25  5:51     ` Andreas Röhler
  2022-05-25  6:37     ` Juri Linkov
@ 2022-05-25 12:10     ` Lars Ingebrigtsen
  2022-05-25 13:54       ` Eli Zaretskii
  2 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-25 12:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 55579, Juri Linkov

Eli Zaretskii <eliz@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





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-25  6:37     ` Juri Linkov
@ 2022-05-25 13:21       ` Eli Zaretskii
  2022-05-25 17:34         ` Juri Linkov
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2022-05-25 13:21 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 55579

> From: Juri Linkov <juri@linkov.net>
> Cc: 55579@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?





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-25 12:10     ` Lars Ingebrigtsen
@ 2022-05-25 13:54       ` Eli Zaretskii
  2022-05-27 10:21         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2022-05-25 13:54 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 55579, juri

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Juri Linkov <juri@linkov.net>,  55579@debbugs.gnu.org
> Date: Wed, 25 May 2022 14:10:31 +0200
> 
> Eli Zaretskii <eliz@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.





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-25 13:21       ` Eli Zaretskii
@ 2022-05-25 17:34         ` Juri Linkov
  0 siblings, 0 replies; 12+ messages in thread
From: Juri Linkov @ 2022-05-25 17:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 55579

>> >> > 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.





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

* bug#55579: 29.0.50; Abbrevs not saved on exit anymore
  2022-05-25 13:54       ` Eli Zaretskii
@ 2022-05-27 10:21         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-27 10:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 55579, juri

Eli Zaretskii <eliz@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





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

end of thread, other threads:[~2022-05-27 10:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 17:10 bug#55579: 29.0.50; Abbrevs not saved on exit anymore Juri Linkov
2022-05-23  7:46 ` Lars Ingebrigtsen
2022-05-24 18:42 ` Juri Linkov
2022-05-24 19:17   ` Lars Ingebrigtsen
2022-05-24 19:27   ` Eli Zaretskii
2022-05-25  5:51     ` Andreas Röhler
2022-05-25  6:37     ` Juri Linkov
2022-05-25 13:21       ` Eli Zaretskii
2022-05-25 17:34         ` Juri Linkov
2022-05-25 12:10     ` Lars Ingebrigtsen
2022-05-25 13:54       ` Eli Zaretskii
2022-05-27 10:21         ` 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).