diff options
author | Juri Linkov <juri@linkov.net> | 2020-06-24 02:54:30 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2020-06-24 02:54:30 +0300 |
commit | 4e04ca847fc04ad0b2845143e0788485de0ed997 (patch) | |
tree | 4a9c7275c1213c5994723a0f2ee09e2c8ab423ee /lisp/vc/vc.el | |
parent | 35e881c5303c6ddf23b901bd2805971dc4ecf20b (diff) | |
download | emacs-4e04ca847fc04ad0b2845143e0788485de0ed997.tar.gz emacs-4e04ca847fc04ad0b2845143e0788485de0ed997.tar.bz2 emacs-4e04ca847fc04ad0b2845143e0788485de0ed997.zip |
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)
Diffstat (limited to 'lisp/vc/vc.el')
-rw-r--r-- | lisp/vc/vc.el | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 9b12d449785..65775f8e46e 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)) |