From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ashwin Kafle Newsgroups: gmane.emacs.bugs Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk Date: Wed, 15 Dec 2021 17:41:44 +0000 Message-ID: <85o85hsr3b.fsf@ashwink.com.np> References: <20211215095324.18195-1-ashwin@ashwink.com.np> <86a6h13j4i.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3357"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 52507@debbugs.gnu.org, Ashwin Kafle To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 15 20:12:07 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxZh7-0000f2-5i for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Dec 2021 20:12:05 +0100 Original-Received: from localhost ([::1]:58758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxZh6-0000xq-83 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Dec 2021 14:12:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxYH0-0002n8-J2 for bug-gnu-emacs@gnu.org; Wed, 15 Dec 2021 12:41:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxYH0-00083e-BC for bug-gnu-emacs@gnu.org; Wed, 15 Dec 2021 12:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxYH0-0004Ht-2G for bug-gnu-emacs@gnu.org; Wed, 15 Dec 2021 12:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ashwin Kafle Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Dec 2021 17:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52507 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52507-submit@debbugs.gnu.org id=B52507.163959005616463 (code B ref 52507); Wed, 15 Dec 2021 17:41:01 +0000 Original-Received: (at 52507) by debbugs.gnu.org; 15 Dec 2021 17:40:56 +0000 Original-Received: from localhost ([127.0.0.1]:33598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxYGu-0004HT-GR for submit@debbugs.gnu.org; Wed, 15 Dec 2021 12:40:56 -0500 Original-Received: from forward101o.mail.yandex.net ([37.140.190.181]:59828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxYGr-0004HD-4i for 52507@debbugs.gnu.org; Wed, 15 Dec 2021 12:40:55 -0500 Original-Received: from myt6-0d043a4812e9.qloud-c.yandex.net (myt6-0d043a4812e9.qloud-c.yandex.net [IPv6:2a02:6b8:c12:212b:0:640:d04:3a48]) by forward101o.mail.yandex.net (Yandex) with ESMTP id D885E369C5EA; Wed, 15 Dec 2021 20:40:45 +0300 (MSK) Original-Received: from myt6-016ca1315a73.qloud-c.yandex.net (myt6-016ca1315a73.qloud-c.yandex.net [2a02:6b8:c12:4e0e:0:640:16c:a131]) by myt6-0d043a4812e9.qloud-c.yandex.net (mxback/Yandex) with ESMTP id mNGCpOPYoa-ejfWMPgJ; Wed, 15 Dec 2021 20:40:45 +0300 Authentication-Results: myt6-0d043a4812e9.qloud-c.yandex.net; dkim=pass Original-Received: by myt6-016ca1315a73.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id ZaYSoCh79f-eiSmw10Q; Wed, 15 Dec 2021 20:40:44 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Yandex-Fwd: 2 In-Reply-To: <86a6h13j4i.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 15 Dec 2021 18:53:01 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:222438 Archived-At: Juri Linkov 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.