From e2cf46e17a315dadc645e9bf8f46ea825fd57131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Marks?= Date: Fri, 31 Oct 2025 14:49:28 -0400 Subject: [PATCH 1/2] Leverage locate-user-emacs-file This is better than our custom code. --- bufferlo.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bufferlo.el b/bufferlo.el index 4a32210..50e637e 100644 --- a/bufferlo.el +++ b/bufferlo.el @@ -1004,7 +1004,7 @@ string, FACE is the face for STR." #'string-equal))) (setq bufferlo--command-line-noload pos) (setq command-line-args (seq-remove-at-position command-line-args pos))) - (when (file-exists-p (expand-file-name "bufferlo-noload" user-emacs-directory)) + (when (locate-user-emacs-file "bufferlo-noload") (message "bufferlo-noload file found; inhibiting bufferlo bookmark loading") (setq bufferlo--command-line-noload t))) From f6e2709c756e50802f9813df696460884f57c9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Marks?= Date: Sun, 4 Jan 2026 07:13:12 -0500 Subject: [PATCH 2/2] Handle nil 'buffer-list frame-parameter in buffer predicates This addresses the situation where there are no bufferlo local buffers and the user has not yet actively selected a buffer window. For the sake of completness, both the bufferlo frame parameter 'buffer-predicate function and 'switch-to-prev-buffer-skip-p' function now treat a passed buffer as local when 'buffer-list is nil. --- bufferlo.el | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bufferlo.el b/bufferlo.el index 50e637e..5c9d015 100644 --- a/bufferlo.el +++ b/bufferlo.el @@ -1350,9 +1350,14 @@ before calling OLDFN with ARGS. See `bufferlo--clear-buffer-lists'." ;; (funcall skip window buffer bury-or-kill) (defun bufferlo--switch-to-prev-buffer-skip-p (_window buffer _bury-or-kill) "Restrict BUFFER to the current tab's locals for buffer switching. -Affects `switch-to-prev-buffer' and `switch-to-next-buffer'. -Includes hidden buffers." - (not (bufferlo-local-buffer-p buffer nil (tab-bar--current-tab-index) t))) +Return non-nil if `switch-to-prev-buffer' (and and +`switch-to-next-buffer') should skip BUFFER. Includes hidden buffers. + +If the frame parameter \\='buffer-list is nil, hence it has no local +buffers, do not skip." + (if (frame-parameter nil 'buffer-list) + (not (bufferlo-local-buffer-p buffer nil (tab-bar--current-tab-index) t)) + nil)) (defvar bufferlo--switch-to-prev-buffer-skip-orig) @@ -1367,8 +1372,13 @@ Includes hidden buffers." (defun bufferlo--buffer-predicate (buffer) "Return whether BUFFER is local to the current frame/tab. -Includes hidden buffers." - (bufferlo-local-buffer-p buffer nil nil t)) +Includes hidden buffers. + +If the frame parameter \\='buffer-list is nil, hence it has no local +buffers, treat BUFFER as local." + (if (frame-parameter nil 'buffer-list) + (bufferlo-local-buffer-p buffer nil nil t) + t)) (defun bufferlo--set-buffer-predicate (frame) "Set the buffer predicate of FRAME to `bufferlo--buffer-predicate'."