all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phillip.lord@russet.org.uk (Phillip Lord)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] emacs-25 c23c965: Prevent bootstrap autoload backup files
Date: Tue, 12 Apr 2016 13:54:17 +0100	[thread overview]
Message-ID: <87bn5fkmx2.fsf@russet.org.uk> (raw)
In-Reply-To: <jwv8u0jjadw.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Tue, 12 Apr 2016 08:18:06 -0400")

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




  reply	other threads:[~2016-04-12 12:54 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 [this message]
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=87bn5fkmx2.fsf@russet.org.uk \
    --to=phillip.lord@russet.org.uk \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.