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

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

[elpa] externals/denote bde60acd80 04/12: Make denote-get-path-by-id pub


From: ELPA Syncer
Subject: [elpa] externals/denote bde60acd80 04/12: Make denote-get-path-by-id public
Date: Wed, 14 Sep 2022 05:57:39 -0400 (EDT)

branch: externals/denote
commit bde60acd802ae4e46cb69d03aa69d4f4f2df013e
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Make denote-get-path-by-id public
    
    We are working towards version 1.0.0.  The idea is to provide functions
    that users/developers can rely on.  By making them public (removing the
    double hyphens) we signify that those forms are (i) in a stable
    state, and (ii) any change to them will be handled with care and
    documented accordingly.
---
 README.org |  3 +++
 denote.el  | 15 ++++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 82f1d054e6..5b1de85e62 100644
--- a/README.org
+++ b/README.org
@@ -2045,6 +2045,9 @@ might change them without further notice.
   =FILE= relative to the variable ~denote-directory~.  =FILE= must be an
   absolute path.
 
++ ~denote-get-path-by-id~ :: Return absolute path of =ID= string in
+  ~denote-directory-files~.
+
 + ~denote-sluggify~ :: Make =STR= an appropriate slug for file names and
   related ([[#h:ae8b19a1-7f67-4258-96b3-370a72c43f4e][Sluggified title and 
keywords]]).
 
diff --git a/denote.el b/denote.el
index 79e08719af..6898867820 100644
--- a/denote.el
+++ b/denote.el
@@ -569,13 +569,18 @@ value, as explained in its doc string."
   'denote-directory-files
   "1.0.0")
 
-(defun denote--get-note-path-by-id (id)
-  "Return the absolute path of ID note in variable `denote-directory'."
+(defun denote-get-path-by-id (id)
+  "Return absolute path of ID string in `denote-directory-files'."
   (seq-find
    (lambda (f)
      (string-prefix-p id (file-name-nondirectory f)))
    (denote-directory-files)))
 
+(define-obsolete-function-alias
+  'denote--get-note-path-by-id
+  'denote-get-path-by-id
+  "1.0.0")
+
 (defun denote-directory-files-matching-regexp (regexp)
   "Return list of files matching REGEXP in `denote-directory-files'."
   (seq-filter
@@ -2218,7 +2223,7 @@ format is always [[denote:IDENTIFIER]]."
   (if-let* ((regexp (denote-link--file-type-regexp (buffer-file-name)))
             (files (denote-link--expand-identifiers regexp)))
       (find-file ; TODO 2022-09-05: Revise for possible refinement
-       (denote--get-note-path-by-id
+       (denote-get-path-by-id
         (denote-link--id-from-string
          (denote-link--find-file-prompt files))))
     (user-error "No links found in the current buffer")))
@@ -2319,7 +2324,7 @@ file's title.  This has the same meaning as in 
`denote-link'."
               (buffer-substring-no-properties
                (button-start button)
                (button-end button))))
-         (file (denote--get-note-path-by-id id)))
+         (file (denote-get-path-by-id id)))
     (funcall denote-link-button-action file)))
 
 ;;;###autoload
@@ -2554,7 +2559,7 @@ and the identifier."
          (id (if (and (stringp search) (not (string-empty-p search)))
                  (substring link 0 (match-beginning 0))
                link))
-         (path (denote--get-note-path-by-id id)))
+         (path (denote-get-path-by-id id)))
     (cond
      (path-id
       (cons (format "%s" path) (format "%s" id)))



reply via email to

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