Fix doom-temp-buffer-p & doom-real-buffer-p
A regression caused the former to error out (if the buffer name was less than 2 characters long) and the latter to return t too eagerly (because of an incorrect condition chain).
This commit is contained in:
parent
b731aeea8f
commit
f3aadf6c77
1 changed files with 5 additions and 5 deletions
|
@ -80,7 +80,7 @@ If no project is active, return all buffers."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-temp-buffer-p (buf)
|
(defun doom-temp-buffer-p (buf)
|
||||||
"Returns non-nil if BUF is temporary."
|
"Returns non-nil if BUF is temporary."
|
||||||
(equal (substring (buffer-name buf) 0 2) " *"))
|
(equal (substring (buffer-name buf) 0 1) " "))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-non-file-visiting-buffer-p (buf)
|
(defun doom-non-file-visiting-buffer-p (buf)
|
||||||
|
@ -111,10 +111,10 @@ The exact criteria for a real buffer is:
|
||||||
|
|
||||||
If BUFFER-OR-NAME is omitted or nil, the current buffer is tested."
|
If BUFFER-OR-NAME is omitted or nil, the current buffer is tested."
|
||||||
(when-let* ((buf (ignore-errors (window-normalize-buffer buffer-or-name))))
|
(when-let* ((buf (ignore-errors (window-normalize-buffer buffer-or-name))))
|
||||||
(or (buffer-local-value 'doom-real-buffer-p buf)
|
(and (not (doom-temp-buffer-p buf))
|
||||||
(not (doom-temp-buffer-p buf))
|
(or (buffer-local-value 'doom-real-buffer-p buf)
|
||||||
(run-hook-with-args-until-success 'doom-real-buffer-functions buf)
|
(run-hook-with-args-until-success 'doom-real-buffer-functions buf)
|
||||||
(not (run-hook-with-args-until-success 'doom-unreal-buffer-functions buf)))))
|
(not (run-hook-with-args-until-success 'doom-unreal-buffer-functions buf))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-buffers-in-mode (modes &optional buffer-list derived-p)
|
(defun doom-buffers-in-mode (modes &optional buffer-list derived-p)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue