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

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

[elpa] externals/denote fb92d22a57 6/6: Make denote-file-name-relative-t


From: ELPA Syncer
Subject: [elpa] externals/denote fb92d22a57 6/6: Make denote-file-name-relative-to-denote-directory public
Date: Wed, 14 Sep 2022 04:57:32 -0400 (EDT)

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

    Make denote-file-name-relative-to-denote-directory 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 |  4 ++++
 denote.el  | 17 +++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index b6b1fc52ae..82f1d054e6 100644
--- a/README.org
+++ b/README.org
@@ -2041,6 +2041,10 @@ might change them without further notice.
 + ~denote-directory-files-matching-regexp~ :: Return list of files
   matching =REGEXP= in ~denote-directory-files~.
 
++ ~denote-file-name-relative-to-denote-directory~ :: Return name of
+  =FILE= relative to the variable ~denote-directory~.  =FILE= must be an
+  absolute path.
+
 + ~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 acfbd2b6f1..b059092b94 100644
--- a/denote.el
+++ b/denote.el
@@ -523,7 +523,7 @@ Supported extensions are those implied by 
`denote-file-type'."
   'denote-file-is-writable-and-supported-p
   "1.0.0")
 
-(defun denote--file-name-relative-to-denote-directory (file)
+(defun denote-file-name-relative-to-denote-directory (file)
   "Return name of FILE relative to the variable `denote-directory'.
 FILE must be an absolute path."
   (when-let* ((dir (denote-directory))
@@ -532,6 +532,11 @@ FILE must be an absolute path."
               ((string-prefix-p dir file-name)))
     (substring-no-properties file-name (length dir))))
 
+(define-obsolete-function-alias
+  'denote--file-name-relative-to-denote-directory
+  'denote-file-name-relative-to-denote-directory
+  "1.0.0")
+
 (defun denote--default-dir-has-denote-prefix ()
   "Test `default-directory' for variable `denote-directory' prefix."
   (string-prefix-p (denote-directory)
@@ -573,7 +578,7 @@ value, as explained in its doc string."
   "Return list of files matching REGEXP in `denote-directory-files'."
   (seq-filter
    (lambda (f)
-     (string-match-p regexp (denote--file-name-relative-to-denote-directory 
f)))
+     (string-match-p regexp (denote-file-name-relative-to-denote-directory f)))
    (denote-directory-files)))
 
 (define-obsolete-function-alias
@@ -1211,8 +1216,8 @@ where the former does not read dates without a time 
component."
   (seq-remove
    (lambda (filename)
      (or (not (file-directory-p filename))
-         (string-match-p "\\`\\." 
(denote--file-name-relative-to-denote-directory filename))
-         (string-match-p "/\\." 
(denote--file-name-relative-to-denote-directory filename))))
+         (string-match-p "\\`\\." 
(denote-file-name-relative-to-denote-directory filename))
+         (string-match-p "/\\." (denote-file-name-relative-to-denote-directory 
filename))))
    (directory-files-recursively (denote-directory) ".*" t t)))
 
 ;;;;; The `denote' command and its prompts
@@ -2197,7 +2202,7 @@ format is always [[denote:IDENTIFIER]]."
 
 (defun denote-link--find-file-prompt (files)
   "Prompt for linked file among FILES."
-  (let ((file-names (mapcar #'denote--file-name-relative-to-denote-directory
+  (let ((file-names (mapcar #'denote-file-name-relative-to-denote-directory
                             files)))
     (completing-read
      "Find linked file "
@@ -2390,7 +2395,7 @@ Use optional TITLE for a prettier heading."
                   (l (length heading)))
         (insert (format "%s\n%s\n\n" heading (make-string l ?-))))
       (mapc (lambda (f)
-              (insert (denote--file-name-relative-to-denote-directory f))
+              (insert (denote-file-name-relative-to-denote-directory f))
               (make-button (line-beginning-position) (line-end-position) :type 
'denote-link-backlink-button)
               (newline))
             files)



reply via email to

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