Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions bufferlo.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down Expand Up @@ -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)

Expand All @@ -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'."
Expand Down