[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 71630b9510 08/14: Add denote-sequence-get-relati
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 71630b9510 08/14: Add denote-sequence-get-relative function |
Date: |
Fri, 17 Jan 2025 03:58:15 -0500 (EST) |
branch: externals/denote
commit 71630b951082379485372ea0337fff01f8046c78
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add denote-sequence-get-relative function
This foreshadows commands I will introduce shortly.
---
denote-sequence.el | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/denote-sequence.el b/denote-sequence.el
index 8538b31b3b..f383b75f65 100644
--- a/denote-sequence.el
+++ b/denote-sequence.el
@@ -569,6 +569,23 @@ return value of `denote-sequence-get-all-sequences'."
('sibling (denote-sequence--get-new-sibling sequence sequences))
(_ (error "The type `%s' is not among `denote-sequence-types'" type))))
+(defun denote-sequence-get-relative (sequence type &optional files)
+ "Get files of TYPE given the SEQUENCE.
+With optional FILES consider only those, otherwise operate on all files
+returned by `denote-sequence-get-all-files'."
+ (let* ((depth (denote-sequence-depth sequence))
+ (components (denote-sequence-split sequence))
+ (filter (lambda (comparison prefix)
+ (seq-filter
+ (lambda (file)
+ (funcall comparison (denote-sequence-depth
(denote-retrieve-filename-signature file)) depth))
+ (denote-sequence-get-all-files-with-prefix prefix
files)))))
+ (pcase type
+ ('parent (funcall filter '< (car components)))
+ ('sibling (funcall filter '= (denote-sequence-join (butlast components)
(cdr (denote-sequence-and-scheme-p sequence)))))
+ ('child (funcall filter '> sequence))
+ (_ (error "The type `%s' is not among the `denote-sequence-types'"
type)))))
+
(defvar denote-sequence-type-history nil
"Minibuffer history of `denote-sequence-type-prompt'.")
- [elpa] externals/denote updated (15eaa656e7 -> 4470e316fa), ELPA Syncer, 2025/01/17
- [elpa] externals/denote 7d4c194365 03/14: Make denote-sequence-get-all-files accept optional FILES, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 9a5d7f912e 05/14: Make denote-sequence-get-new accept SEQUENCES like all its helper functions, ELPA Syncer, 2025/01/17
- [elpa] externals/denote ee33e1081c 02/14: Rename denote-sequence-get to denote-sequence-get-new, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 3a3cc6603d 04/14: Use denote-sequence-get-all-files instead of its helper (extend 7d4c194), ELPA Syncer, 2025/01/17
- [elpa] externals/denote 0c4fcdedcc 06/14: Update dt-denote-sequence--get-new-child-and-sibling to use denote-sequence-get-new, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 71630b9510 08/14: Add denote-sequence-get-relative function,
ELPA Syncer <=
- [elpa] externals/denote dd72f341dd 01/14: Make the denote-file-prompt 'let' bind the default-directory, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 78392b86ba 07/14: Rename dt-denote-sequence--get-new-child-and-sibling to dt-denote-sequence--get-new-exhaustive, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 47fbde671a 09/14: Make denote-sequence-get-relative correctly get the parents, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 2fe245806e 10/14: Update dt-denote-sequence--get-new-exhaustive to all test for relatives, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 14fc0197a2 12/14: Make denote-sequence-get-relative get parents more reliably, ELPA Syncer, 2025/01/17
- [elpa] externals/denote f6b5770b97 13/14: Add denote-sequence-find command and helper wrappers to get relatives, ELPA Syncer, 2025/01/17
- [elpa] externals/denote 4470e316fa 14/14: Document in the manual the denote-sequence-find command and related, ELPA Syncer, 2025/01/17
- [elpa] externals/denote dc59f0477c 11/14: Make denote-sequence-type-prompt accepte optional PROMPT-TEXT, ELPA Syncer, 2025/01/17