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

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

[elpa] externals/denote b3443ca6ff 02/13: Add denote-file-prompt instead


From: ELPA Syncer
Subject: [elpa] externals/denote b3443ca6ff 02/13: Add denote-file-prompt instead of private function
Date: Wed, 14 Sep 2022 00:57:40 -0400 (EDT)

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

    Add denote-file-prompt instead of private function
    
    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.
---
 denote.el | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/denote.el b/denote.el
index bd1d8640f9..b998f34edc 100644
--- a/denote.el
+++ b/denote.el
@@ -533,6 +533,18 @@ include files that are not implied by `denote-file-types'."
   'denote-directory-files-matching-regexp
   "1.0.0")
 
+(defun denote-file-prompt ()
+  "Prompt for file with identifier in variable `denote-directory'."
+  (read-file-name "Select note: " (denote-directory) nil nil nil
+                  (lambda (f)
+                    (or (denote--file-has-identifier-p f)
+                        (file-directory-p f)))))
+
+(define-obsolete-function-alias
+  'denote--retrieve-read-file-prompt
+  'denote-file-prompt
+  "1.0.0")
+
 ;;;; Keywords
 
 (defun denote--extract-keywords-from-path (path)
@@ -946,13 +958,6 @@ contain the newline."
       (denote-retrieve-title-value file type)
     (denote-retrieve-filename-title file)))
 
-(defun denote--retrieve-read-file-prompt ()
-  "Prompt for regular file in variable `denote-directory'."
-  (read-file-name "Select note: " (denote-directory) nil nil nil
-                  (lambda (f)
-                    (or (denote--file-has-identifier-p f)
-                        (file-directory-p f)))))
-
 (defun denote--retrieve-xrefs (identifier)
   "Return xrefs of IDENTIFIER in variable `denote-directory'.
 The xrefs are returned as an alist."
@@ -2049,7 +2054,7 @@ With optional ID-ONLY, such as a universal prefix
 argument (\\[universal-argument]), insert links with just the
 identifier and no further description.  In this case, the link
 format is always [[denote:IDENTIFIER]]."
-  (interactive (list (denote--retrieve-read-file-prompt) current-prefix-arg))
+  (interactive (list (denote-file-prompt) current-prefix-arg))
   (let ((beg (point)))
     (insert
      (denote-link--format-link
@@ -2144,7 +2149,7 @@ The established link will then be targeting that new file.
 With optional ID-ONLY as a prefix argument create a link that
 consists of just the identifier.  Else try to also include the
 file's title.  This has the same meaning as in `denote-link'."
-  (interactive (list (denote--retrieve-read-file-prompt) current-prefix-arg))
+  (interactive (list (denote-file-prompt) current-prefix-arg))
   (if (file-exists-p target)
       (denote-link target id-only)
     (call-interactively #'denote-link-after-creating)))
@@ -2469,7 +2474,7 @@ This lets the user complete a link through the 
`org-insert-link'
 interface by first selecting the `denote:' hyperlink type."
   (concat
    "denote:"
-   (denote-retrieve-filename-identifier (denote--retrieve-read-file-prompt))))
+   (denote-retrieve-filename-identifier (denote-file-prompt))))
 
 (declare-function org-link-store-props "ol.el" (&rest plist))
 (defvar org-store-link-plist)



reply via email to

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