Fix #2992: wrong-type-arg stringp on switch-to-buffer
(switch-to-buffer nil) should switch to other-buffer, as per its documentation, which was not respected by our switch-buffer hook mechanism.
This commit is contained in:
parent
d34633cb0a
commit
6e8487e1d4
1 changed files with 4 additions and 1 deletions
|
@ -105,7 +105,10 @@ size.")
|
||||||
(defun doom-run-switch-buffer-hooks-a (orig-fn buffer-or-name &rest args)
|
(defun doom-run-switch-buffer-hooks-a (orig-fn buffer-or-name &rest args)
|
||||||
(let ((gc-cons-threshold most-positive-fixnum))
|
(let ((gc-cons-threshold most-positive-fixnum))
|
||||||
(if (or doom-inhibit-switch-buffer-hooks
|
(if (or doom-inhibit-switch-buffer-hooks
|
||||||
(eq (current-buffer) (get-buffer buffer-or-name))
|
(eq (current-buffer)
|
||||||
|
(get-buffer (or buffer-or-name
|
||||||
|
(if (eq orig-fn #'switch-to-buffer)
|
||||||
|
(other-buffer)))))
|
||||||
(and (eq orig-fn #'switch-to-buffer) (car args)))
|
(and (eq orig-fn #'switch-to-buffer) (car args)))
|
||||||
(apply orig-fn buffer-or-name args)
|
(apply orig-fn buffer-or-name args)
|
||||||
(let ((doom-inhibit-switch-buffer-hooks t)
|
(let ((doom-inhibit-switch-buffer-hooks t)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue