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

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

[elpa] externals/denote e7ebd85b41 4/5: Make denote-format-file-name pub


From: ELPA Syncer
Subject: [elpa] externals/denote e7ebd85b41 4/5: Make denote-format-file-name public
Date: Wed, 14 Sep 2022 03:57:33 -0400 (EDT)

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

    Make denote-format-file-name 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 |  5 +++++
 denote.el  | 17 +++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index cbb601fe8a..0ffd9b4737 100644
--- a/README.org
+++ b/README.org
@@ -2047,6 +2047,11 @@ might change them without further notice.
   If no file types in ~denote-file-types~ has the file extension, the
   file type is assumed to be the first of ~denote-file-types~.
 
++ ~denote-format-file-name~ :: Format file name.  =PATH=, =ID=,
+  =KEYWORDS=, =TITLE-SLUG= are expected to be supplied by ~denote~ or
+  equivalent: they will all be converted into a single string.
+  =EXTENSION= is the file type extension, as a string.
+
 + ~denote-retrieve-filename-identifier~ :: Extract identifier from
   =FILE= name.  To only return an existing identifier or create a new
   one, refer to the ~denote-retrieve-or-create-file-identifier~
diff --git a/denote.el b/denote.el
index bf2f5c61a7..cd9ad8fab8 100644
--- a/denote.el
+++ b/denote.el
@@ -1023,7 +1023,7 @@ Parse `denote--retrieve-xrefs'."
 
 ;;;;; Common helpers for new notes
 
-(defun denote--format-file (path id keywords title-slug extension)
+(defun denote-format-file-name (path id keywords title-slug extension)
   "Format file name.
 PATH, ID, KEYWORDS, TITLE-SLUG are expected to be supplied by
 `denote' or equivalent: they will all be converted into a single
@@ -1036,6 +1036,11 @@ string.  EXTENSION is the file type extension, as a 
string."
       (setq file-name (concat file-name "__" kws)))
     (concat file-name extension)))
 
+(define-obsolete-function-alias
+  'denote--format-file
+  'denote-format-file-name
+  "1.0.0")
+
 (defun denote--format-front-matter-title (title file-type)
   "Format TITLE according to FILE-TYPE for the file's front matter."
   (funcall (denote--title-value-function file-type) title))
@@ -1060,7 +1065,7 @@ provided by `denote'.  FILETYPE is one of the values of
 
 (defun denote--path (title keywords dir id file-type)
   "Return path to new file with ID, TITLE, KEYWORDS and FILE-TYPE in DIR."
-  (denote--format-file
+  (denote-format-file-name
    dir id
    (denote-sluggify-keywords keywords)
    (denote-sluggify title)
@@ -1666,7 +1671,7 @@ files)."
          (id (denote-retrieve-or-create-file-identifier file))
          (extension (file-name-extension file t))
          (file-type (denote-filetype-heuristics file))
-         (new-name (denote--format-file
+         (new-name (denote-format-file-name
                     dir id keywords (denote-sluggify title) extension))
          (max-mini-window-height 0.33)) ; allow minibuffer to be resized
     (when (denote--rename-file-prompt file new-name)
@@ -1731,7 +1736,7 @@ The operation does the following:
                      (file-type (denote-filetype-heuristics file))
                      (title (denote--retrieve-title-or-filename file 
file-type))
                      (extension (file-name-extension file t))
-                     (new-name (denote--format-file
+                     (new-name (denote-format-file-name
                                 dir id keywords (denote-sluggify title) 
extension)))
                 (denote--rename-file file new-name)
                 (when (denote--writable-and-supported-p new-name)
@@ -1775,7 +1780,7 @@ typos and the like."
             (extension (file-name-extension file t))
             (id (denote-retrieve-or-create-file-identifier file))
             (dir (file-name-directory file))
-            (new-name (denote--format-file
+            (new-name (denote-format-file-name
                        dir id keywords (denote-sluggify title) extension)))
       (when (denote--rename-file-prompt file new-name)
         (denote--rename-file file new-name)
@@ -1824,7 +1829,7 @@ their respective front matter."
                  (title (denote-retrieve-title-value file file-type))
                  (keywords (denote-retrieve-keywords-value file file-type))
                  (extension (file-name-extension file t))
-                 (new-name (denote--format-file
+                 (new-name (denote-format-file-name
                             dir id keywords (denote-sluggify title) 
extension)))
             (denote--rename-file file new-name)))
         (revert-buffer))



reply via email to

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