GNU bug report logs - #52508
[PATCH] Option for vc-delete-file to keep file on disk

Previous Next

Package: emacs;

Reported by: Ashwin Kafle <ashwin <at> ashwink.com.np>

Date: Wed, 15 Dec 2021 12:56:03 UTC

Severity: normal

Merged with 52507

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ashwin Kafle <ashwin <at> ashwink.com.np>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Ashwin Kafle <ashwin <at> ashwink.com.np>, 52508 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: bug#52508: [PATCH] Option for vc-delete-file to keep file on disk
Date: Wed, 15 Dec 2021 18:07:27 +0000
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:


[...]
>> I've created the attached patch to have vc-delete file to keep files on
>> disk using a prefix argument. I've only tested it for vc-git.
>
> Thanks, sounds useful.
>
> A few minor comments below, mainly to the documentation parts:
[...]

Thanks, now fixed and attached.

>
>> -	(let ((backup-inhibited nil))
>> +	(let ((backup-inhibited nil)
>> + ;; if you don't set this, then for some reason, the file is never
>> brought back
>> +              (backup-by-copying t))
>
> Wouldn't it be better to understand why this mystery happens?

Yeah, a backup function should bring back the original file.  That is
indeed weird.  But I can't read much elisp yet to be of help in here.

In this case, backup-by-copying seems to be the better method for
backups since the intention is to not touch the original files at all.
Reading the docstring of backup-buffer, backup-by-rename doesn't look
fit for this use case.

[0001-Option-for-vc-delete-file-to-keep-file-on-disk.patch (text/x-diff, attachment)]

This bug report was last modified 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.