emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sesman 95f8354d1a 041/100: Add sesman-relevant-[link|sessi


From: ELPA Syncer
Subject: [nongnu] elpa/sesman 95f8354d1a 041/100: Add sesman-relevant-[link|session]-p functions
Date: Tue, 28 Dec 2021 14:06:01 -0500 (EST)

branch: elpa/sesman
commit 95f8354d1aea41d263f2b4c1056c9efc24a1bb45
Author: Vitalie Spinu <spinuvit@gmail.com>
Commit: Vitalie Spinu <spinuvit@gmail.com>

    Add sesman-relevant-[link|session]-p functions
---
 sesman.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sesman.el b/sesman.el
index 646008f4d5..a350ca853e 100644
--- a/sesman.el
+++ b/sesman.el
@@ -794,6 +794,20 @@ buffers."
     (string-match-p (concat "^" proj)
                     (expand-file-name default-directory))))
 
+(defun sesman-relevant-link-p (link &optional cxt-types)
+  "Return non-nil if LINK is relevant to the current context.
+If CXT-TYPES is non-nil, only check relevance for those contexts."
+  (when (or (null cxt-types)
+            (member (sesman--lnk-context-type lnk) cxt-types))
+    (sesman-relevant-context-p
+     (sesman--lnk-context-type link)
+     (sesman--lnk-value link))))
+
+(defun sesman-relevant-session-p (system session &optional cxt-types)
+  "Return non-nil if SYSTEM's SESSION is relevant to the current context.
+If CXT-TYPES is non-nil, only check relevance for those contexts."
+  (seq-some #'sesman-relevant-link-p
+            (sesman-links system session cxt-types)))
 
 (provide 'sesman)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]