GNU bug report logs - #52507
[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:02 UTC

Severity: normal

Merged with 52508

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: Juri Linkov <juri <at> linkov.net>
Cc: 52507 <at> debbugs.gnu.org, Ashwin Kafle <ashwin <at> ashwink.com.np>
Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk
Date: Wed, 15 Dec 2021 17:41:44 +0000
Juri Linkov <juri <at> linkov.net> writes:

>> -  (interactive (list (read-file-name "VC delete file: " nil
>> -                                     (when (vc-backend buffer-file-name)
>> -                                       buffer-file-name)
>> -                                     t)))
>> +  (interactive "f\nP")
>
> I wonder why no prompt?  You can add `current-prefix-arg' to the
> interactive list to keep the existing prompt.

Thanks, I didn't knew about that. 

>
>> +	(let ((backup-inhibited nil)
>> + ;; if you don't set this, then for some reason, the file is never
>> brought back
>> +              (backup-by-copying t))
>
> I remember having the same problem while improving `vc-rename-file'.
> To solve the problem, it required adding `vc-file-clearprops'.
> Maybe it could here as well?

There was a call to vc-file-clearprops later. I moved that earlier
before backup and that didn't seem to work. 

>
>> -    (vc-resynch-buffer file nil t)))
>> +    (vc-resynch-buffer file keep-file t)))
>
> It seems vc-resynch-window already uses `vc-file-clearprops'
> when `keep-file' is specified, but also on some more conditions.

I'm sorry, but I didn't really understand the above. I don't really know
elisp to be honest.




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.