From f3aadf6c77dfe25a27036149cae719eabfe725c4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 17 Jun 2018 02:30:02 +0200 Subject: [PATCH] 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). --- core/autoload/buffers.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index df417f493..6b7a36e61 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -80,7 +80,7 @@ If no project is active, return all buffers." ;;;###autoload (defun doom-temp-buffer-p (buf) "Returns non-nil if BUF is temporary." - (equal (substring (buffer-name buf) 0 2) " *")) + (equal (substring (buffer-name buf) 0 1) " ")) ;;;###autoload (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." (when-let* ((buf (ignore-errors (window-normalize-buffer buffer-or-name)))) - (or (buffer-local-value 'doom-real-buffer-p buf) - (not (doom-temp-buffer-p buf)) - (run-hook-with-args-until-success 'doom-real-buffer-functions buf) - (not (run-hook-with-args-until-success 'doom-unreal-buffer-functions buf))))) + (and (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) + (not (run-hook-with-args-until-success 'doom-unreal-buffer-functions buf)))))) ;;;###autoload (defun doom-buffers-in-mode (modes &optional buffer-list derived-p)