* Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files
[not found] ` <E1apwlx-0004ag-K5@vcs.savannah.gnu.org>
@ 2016-04-12 12:18 ` Stefan Monnier
2016-04-12 12:54 ` Phillip Lord
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2016-04-12 12:18 UTC (permalink / raw)
To: emacs-devel; +Cc: Phillip Lord
> - (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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files
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
0 siblings, 1 reply; 3+ messages in thread
From: Phillip Lord @ 2016-04-12 12:54 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
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.
The discussion is in the bug report #23203. For myself, I would have
prefered the simpler semantics also.
Phil
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files
2016-04-12 12:54 ` Phillip Lord
@ 2016-04-12 13:30 ` Stefan Monnier
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2016-04-12 13:30 UTC (permalink / raw)
To: Phillip Lord; +Cc: emacs-devel
>>>>> "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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-12 13:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[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
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).