unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71074: 29.3; When doing a backup, the file is missing during interactive questions
@ 2024-05-20  1:07 Vincent Lefevre
  2024-05-20 11:30 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Vincent Lefevre @ 2024-05-20  1:07 UTC (permalink / raw)
  To: 71074

When doing a backup, GNU Emacs renames the file (according to strace).
Under some conditions, the file can be lost.

I noticed that due to a bug in the combination between Emacs and gpg,
where the "save" operation cannot be completed.

To reproduce with "emacs -Q", do for a file that is not under version
control (otherwise --eval="(setq vc-make-backup-files t)" is needed):

1. emacs -Q file.gpg
2. Modify the file.
3. Save with C-x C-s

At this point, gpg gets interactive, with a question

  Untrusted key [...].  Use anyway? (y or n)

and one can see that the file "file.gpg" has been renamed to
"file.gpg~".

And it may happen that the save operation will never be completed,
e.g. because of a bug like

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071372

(where gpg never terminates) or because Emacs may be killed before
the user could complete the save operation.

In short, the file may have silently disappeared. There is a backup,
but the backups may be cleaned up before the user realizes the issue.

Note: I put the backups in a specific directory with

(defun find-backup-file-name (fn)
       (list (concat "~/.poub/" (file-name-nondirectory fn) "~")))

but I look at it only when I know I've done something wrong or if
I get an error message about the save operation. Having a missing
file during interactive questions is bad.

Note: I'm using Debian's package emacs-gtk 1:29.3+1-3.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)





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

end of thread, other threads:[~2024-05-23 14:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-20  1:07 bug#71074: 29.3; When doing a backup, the file is missing during interactive questions Vincent Lefevre
2024-05-20 11:30 ` Eli Zaretskii
2024-05-21  8:44   ` Vincent Lefevre
2024-05-21 12:12     ` Eli Zaretskii
2024-05-21 12:42       ` Eli Zaretskii
2024-05-22 11:08       ` Vincent Lefevre
2024-05-22 13:25         ` Eli Zaretskii
2024-05-23 14:50           ` Vincent Lefevre

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