vc-start-logentry: Use current buffer as parent buffer more often
* lisp/vc/vc-dispatcher.el (vc-start-logentry): When determining the parent buffer, if get-file-buffer returns nil, use the current buffer. Also, if the first file is a directory, don't try to call get-file-buffer, just use the current buffer.
This commit is contained in:
parent
b9eb7f1945
commit
475a33adb9
1 changed files with 5 additions and 8 deletions
|
@ -741,14 +741,11 @@ MODE, defaulting to `log-edit-mode' if MODE is nil.
|
|||
AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'.
|
||||
BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer.
|
||||
PATCH-STRING is a patch to check in."
|
||||
(let ((parent
|
||||
(if (vc-dispatcher-browsing)
|
||||
;; If we are called from a directory browser, the parent buffer is
|
||||
;; the current buffer.
|
||||
(current-buffer)
|
||||
(if (and files (equal (length files) 1))
|
||||
(get-file-buffer (car files))
|
||||
(current-buffer)))))
|
||||
(let ((parent (or (and (not (vc-dispatcher-browsing))
|
||||
(length= files 1)
|
||||
(not (file-directory-p (car files)))
|
||||
(get-file-buffer (car files)))
|
||||
(current-buffer))))
|
||||
(if (and comment (not initial-contents))
|
||||
(set-buffer (get-buffer-create logbuf))
|
||||
(pop-to-buffer (get-buffer-create logbuf)))
|
||||
|
|
Loading…
Add table
Reference in a new issue