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

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

[elpa] externals/denote f39b517428 08/12: Make denote-barf-duplicate-id


From: ELPA Syncer
Subject: [elpa] externals/denote f39b517428 08/12: Make denote-barf-duplicate-id public
Date: Wed, 14 Sep 2022 05:57:40 -0400 (EDT)

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

    Make denote-barf-duplicate-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  | 13 +++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 1c732bf54c..780d8c3926 100644
--- a/README.org
+++ b/README.org
@@ -2048,6 +2048,9 @@ might change them without further notice.
 + ~denote-get-path-by-id~ :: Return absolute path of =ID= string in
   ~denote-directory-files~.
 
++ ~denote-barf-duplicate-id~ :: Throw a ~user-error~ if =IDENTIFIER=
+  already exists.
+
 + ~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 b830c40467..88fd20110e 100644
--- a/denote.el
+++ b/denote.el
@@ -1202,7 +1202,7 @@ where the former does not read dates without a time 
component."
 ;; In normal usage, this should only be relevant for `denote-date',
 ;; otherwise the identifier is always unique (we trust that no-one
 ;; writes multiple notes within fractions of a second).  Though the
-;; `denote' command does call `denote--barf-duplicate-id'.
+;; `denote' command does call `denote-barf-duplicate-id'.
 (defun denote--id-exists-p (identifier)
   "Return non-nil if IDENTIFIER already exists."
   (seq-some (lambda (file)
@@ -1210,11 +1210,16 @@ where the former does not read dates without a time 
component."
             (append (denote-directory-files)
                     (denote--buffer-file-names))))
 
-(defun denote--barf-duplicate-id (identifier)
-  "Throw a user-error if IDENTIFIER already exists."
+(defun denote-barf-duplicate-id (identifier)
+  "Throw a `user-error' if IDENTIFIER already exists."
   (when (denote--id-exists-p identifier)
     (user-error "`%s' already exists; aborting new note creation" identifier)))
 
+(define-obsolete-function-alias
+  'denote--barf-duplicate-id
+  'denote-barf-duplicate-id
+  "1.0.0")
+
 (defun denote--subdirs ()
   "Return list of subdirectories in variable `denote-directory'."
   (seq-remove
@@ -1282,7 +1287,7 @@ When called from Lisp, all arguments are optional.
          (template (if (stringp template)
                        template
                      (or (alist-get template denote-templates) ""))))
-    (denote--barf-duplicate-id id)
+    (denote-barf-duplicate-id id)
     (denote--prepare-note title keywords date id directory file-type template)
     (denote--keywords-add-to-history keywords)))
 



reply via email to

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