bug#81443: 31.0.90; excessive backup files created when deleting from vc-dir

Sean Whitton <[email protected]> Fri, 31 Jul 2026 11:41:54 +0100
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Version: 31.1

Charles A. Roelli" via "Bug reports for GNU Emacs, the Swiss army knife of text editors [22/Jul  8:24am GMT] wrote:
>> Deleting an unregistered file backs up that file, even if it is itself
>> a backup.  It seems correct to make the initial backup, but excessive
>> to backup backups.
>
> How about the following fix for emacs-31?
>
> commit f382e349ce0fd69c1669461dfbdede5b0b198e12
> Author: Charles A. Roelli <[email protected]>
> Date:   Wed Jul 22 08:10:39 2026 +0000
>
>     vc-delete-file: Don't backup backup files
>
>     * lisp/vc/vc.el (vc-delete-file): Don't backup backup files.
>
> diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
> index 328fc8bcd2c..4baad2ae8c6 100644
> --- a/lisp/vc/vc.el
> +++ b/lisp/vc/vc.el
> @@ -5180,7 +5180,9 @@ vc-delete-file
>              (backend (if (file-directory-p file)
>                           (vc-responsible-backend file)
>                         (vc-backend file))))
> -        (unless (or (file-directory-p file) (null make-backup-files)
> +        (unless (or (file-directory-p file)
> +                    (null make-backup-files)
> +                    (backup-file-name-p file)
>                      (not (file-exists-p file)))
>            (with-current-buffer (or buf (find-file-noselect file))
>              (let ((backup-inhibited nil))

Thanks, installed and closing the bug.

-- 
Sean Whitton