From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: phillip.lord@russet.org.uk (Phillip Lord)
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files
Date: Tue, 12 Apr 2016 09:30:49 -0400 [thread overview]
Message-ID: <jwv7fg30xi7.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <87bn5fkmx2.fsf@russet.org.uk> (Phillip Lord's message of "Tue, 12 Apr 2016 13:54:17 +0100")
>>>>> "Phillip" == Phillip Lord <phillip.lord@russet.org.uk> writes:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> - (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)))))
> It has different semantics. My patch preserves backup files except when
> the autoload file is created for the first time. This only happens
> because we create the header and footer in one place, then reopen with
> find-file-noselect.
I see. Yuck!
And thanks for the explanation.
Stefan
prev parent reply other threads:[~2016-04-12 13:30 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 ` [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files Stefan Monnier
2016-04-12 12:54 ` Phillip Lord
2016-04-12 13:30 ` Stefan Monnier [this message]
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=jwv7fg30xi7.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.