emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4e04ca8: More not-state-changing vc commands can be used from non


From: Juri Linkov
Subject: master 4e04ca8: More not-state-changing vc commands can be used from non-file buffers
Date: Tue, 23 Jun 2020 19:54:39 -0400 (EDT)

branch: master
commit 4e04ca847fc04ad0b2845143e0788485de0ed997
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    More not-state-changing vc commands can be used from non-file buffers
    
    * lisp/vc/vc.el (vc-deduce-fileset): Instead of checking for
    log-view-mode, check for '(not buffer-file-name)' before trying to
    get the backend for default-directory.  Remove the branch that
    checks for '(not buffer-file-name)' and signals the error because
    vc-responsible-backend used in previous condition already signals
    its error.  (Bug#41974)
---
 etc/NEWS      | 3 +++
 lisp/vc/vc.el | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index d501c2a..32ceec1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -173,6 +173,9 @@ directories with the help of new command 
'dired-vc-next-action'.
 
 ** Change Logs and VC
 
+*** More vc commands that don't change VC state can be used from non-file 
buffers.
+Such non-file buffers should have default-directory under vc.
+
 *** New command 'vc-dir-root' uses the root directory without asking.
 
 *** New commands 'vc-dir-mark-registered-files' (bound to '* r') and
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 9b12d44..65775f8 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1074,11 +1074,9 @@ BEWARE: this function may change the current buffer."
       (progn                  ;FIXME: Why not `with-current-buffer'? --Stef.
        (set-buffer vc-parent-buffer)
        (vc-deduce-fileset not-state-changing allow-unregistered 
state-model-only-files)))
-     ((and (derived-mode-p 'log-view-mode)
+     ((and (not buffer-file-name)
           (setq backend (vc-responsible-backend default-directory)))
       (list backend nil))
-     ((not buffer-file-name)
-       (error "Buffer %s is not associated with a file" (buffer-name)))
      ((and allow-unregistered (not (vc-registered buffer-file-name)))
       (if state-model-only-files
          (list (vc-backend-for-registration (buffer-file-name))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]