From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Phillip Lord <phillip.lord@russet.org.uk>
Subject: Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files
Date: Tue, 12 Apr 2016 08:18:06 -0400 [thread overview]
Message-ID: <jwv8u0jjadw.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <E1apwlx-0004ag-K5@vcs.savannah.gnu.org> (Phillip Lord's message of "Tue, 12 Apr 2016 11:46:21 +0000")
> - (let ((delay-mode-hooks t))
> - (find-file-noselect
> - (autoload-ensure-default-file (autoload-generated-file))))))
> + (let* ((delay-mode-hooks t)
> + (file (autoload-generated-file))
> + (file-missing (not (file-exists-p file))))
> + (when file-missing
> + (autoload-ensure-default-file file))
> + (with-current-buffer
> + (find-file-noselect
> + (autoload-ensure-file-writeable
> + file))
> + ;; block backups when the file has just been created, since
> + ;; the backups will just be the auto-generated headers.
> + ;; bug#23203
> + (when file-missing
> + (setq buffer-backed-up t)
> + (save-buffer))
> + (current-buffer)))))
That looks quite complicated just to suppress backups.
Could you explain why we couldn't just do something like:
(let ((delay-mode-hooks t)
(make-backup-files))
(find-file-noselect
(autoload-ensure-default-file (autoload-generated-file))))))
or
(let ((delay-mode-hooks t))
(with-current-buffer
(find-file-noselect
(autoload-ensure-default-file (autoload-generated-file)))
(setq-local backup-inhibited t)))))
-- Stefan
next parent reply other threads:[~2016-04-12 12:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160412114621.17612.69908@vcs.savannah.gnu.org>
[not found] ` <E1apwlx-0004ag-K5@vcs.savannah.gnu.org>
2016-04-12 12:18 ` Stefan Monnier [this message]
2016-04-12 12:54 ` [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files Phillip Lord
2016-04-12 13:30 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv8u0jjadw.fsf-monnier+emacsdiffs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=phillip.lord@russet.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.