[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 8c140344e0 03/11: Remove 'denote-barf-duplicate-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 8c140344e0 03/11: Remove 'denote-barf-duplicate-id' and make 'denote' avoid duplicate ids |
Date: |
Sun, 8 Oct 2023 03:57:49 -0400 (EDT) |
branch: externals/denote
commit 8c140344e0fa5af8fce48fd685df0f5cb8dd1332
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Remove 'denote-barf-duplicate-id' and make 'denote' avoid duplicate ids
---
denote.el | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/denote.el b/denote.el
index d86ba50b10..3f7fbab817 100644
--- a/denote.el
+++ b/denote.el
@@ -1651,10 +1651,6 @@ where the former does not read dates without a time
component."
file))
(buffer-list))))
-;; 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'.
(defun denote--id-exists-p (identifier)
"Return non-nil if IDENTIFIER already exists."
(seq-some
@@ -1700,15 +1696,11 @@ Preserve the date component and append to it the
current time."
(setq identifier (denote--increment-identifier identifier)))
identifier)
-(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")
+(make-obsolete 'denote-barf-duplicate-id nil "2.0.1")
(defconst denote-commands-for-new-notes
'(denote
@@ -1790,7 +1782,9 @@ When called from Lisp, all arguments are optional.
(date (if (or (null date) (string-empty-p date))
(current-time)
(denote--valid-date date)))
- (id (format-time-string denote-id-format date))
+ (id (denote--find-first-unused-id
+ (format-time-string denote-id-format date)
+ (denote--get-all-used-ids)))
(directory (if (denote--dir-in-denote-directory-p subdirectory)
(file-name-as-directory subdirectory)
(denote-directory)))
@@ -1798,7 +1792,6 @@ When called from Lisp, all arguments are optional.
template
(or (alist-get template denote-templates) "")))
(signature (or signature "")))
- (denote-barf-duplicate-id id)
(denote--prepare-note title kws date id directory file-type template
signature)
(denote--keywords-add-to-history keywords)
(run-hooks 'denote-after-new-note-hook)))
@@ -3848,12 +3841,13 @@ option `denote-templates'."
(kws (if keywords (denote-keywords-prompt) nil))
(directory (file-name-as-directory (if subdirectory
(denote-subdirectory-prompt) (denote-directory))))
(date (if date (denote--valid-date (denote-date-prompt))
(current-time)))
- (id (format-time-string denote-id-format date))
+ (id (denote--find-first-unused-id
+ (format-time-string denote-id-format date)
+ (denote--get-all-used-ids)))
(template (if template (denote-template-prompt) ""))
(front-matter (denote--format-front-matter
title (denote--date date 'org) kws
(format-time-string denote-id-format date) 'org)))
- (denote-barf-duplicate-id id)
(setq denote-last-path
(denote--path title kws directory id 'org))
(denote--keywords-add-to-history kws)
- [elpa] externals/denote updated (b060dc3548 -> 05a18e36fc), ELPA Syncer, 2023/10/08
- [elpa] externals/denote 8c140344e0 03/11: Remove 'denote-barf-duplicate-id' and make 'denote' avoid duplicate ids,
ELPA Syncer <=
- [elpa] externals/denote c12d4fdb21 02/11: Add 'denote--get-all-used-ids' and 'denote--find-first-unused-id', ELPA Syncer, 2023/10/08
- [elpa] externals/denote 89237ceafd 01/11: Remove files parameter, ELPA Syncer, 2023/10/08
- [elpa] externals/denote a090eb007c 04/11: Add optional parameter no-error to denote-retrieve-filename-identifier, ELPA Syncer, 2023/10/08
- [elpa] externals/denote 03b510f640 05/11: Remove function denote-retrieve-or-create-filename-identifier, ELPA Syncer, 2023/10/08
- [elpa] externals/denote 05a18e36fc 11/11: Fix typo in denote-link-return-backlinks, ELPA Syncer, 2023/10/08
- [elpa] externals/denote c9d024ec30 07/11: Update README.org with new functions, ELPA Syncer, 2023/10/08
- [elpa] externals/denote c5e73c2c99 08/11: Use non obsolete variables, ELPA Syncer, 2023/10/08
- [elpa] externals/denote 1d0eebf7d3 10/11: Merge pull request #159 from jeanphilippegg/duplicate-ids, ELPA Syncer, 2023/10/08
- [elpa] externals/denote fe0659b2f0 09/11: Mention 'denote-link-with-signature' in 'denote-prompts' documentation, ELPA Syncer, 2023/10/08
- [elpa] externals/denote fd880f15a5 06/11: Remove denote--increment-identifier and denote--return-new-identifier-if-duplicate, ELPA Syncer, 2023/10/08