[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive a851e24dfd 1/4: Add: (--entry-buffer-p) Split o
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive a851e24dfd 1/4: Add: (--entry-buffer-p) Split out pred for entry-visiting buffer |
Date: |
Thu, 7 Sep 2023 06:59:42 -0400 (EDT) |
branch: elpa/hyperdrive
commit a851e24dfdf5f89c66f0eff35dfd874050a6305e
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Add: (--entry-buffer-p) Split out pred for entry-visiting buffer
---
hyperdrive-lib.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 318ceeb650..fda8e7600f 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1213,10 +1213,7 @@ Affected by option `hyperdrive-reuse-buffers', which
see."
(buffer
(or (when (eq 'any-version hyperdrive-reuse-buffers)
(cl-loop for buffer in (buffer-list)
- when (and (buffer-local-value 'hyperdrive-mode buffer)
- (buffer-local-value
'hyperdrive-current-entry buffer)
- (hyperdrive-entry-equal entry
- (buffer-local-value
'hyperdrive-current-entry buffer)))
+ when (hyperdrive--entry-buffer-p entry buffer)
return buffer))
(get-buffer-create buffer-name))))
(with-current-buffer buffer
@@ -1233,6 +1230,13 @@ Affected by option `hyperdrive-reuse-buffers', which
see."
(setq-local hyperdrive-current-entry entry)
(current-buffer))))
+(defun hyperdrive--entry-buffer-p (entry buffer)
+ "Return non-nil when BUFFER is visiting ENTRY."
+ (and (buffer-local-value 'hyperdrive-mode buffer)
+ (buffer-local-value 'hyperdrive-current-entry buffer)
+ (hyperdrive-entry-equal entry
+ (buffer-local-value 'hyperdrive-current-entry
buffer))))
+
(defun hyperdrive--entry-buffer-name (entry)
"Return buffer name for ENTRY."
(hyperdrive-entry-description entry :format-path 'name))