emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup fi


From: Phillip Lord
Subject: Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files
Date: Tue, 12 Apr 2016 13:54:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Stefan Monnier <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]