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

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

[elpa] externals/denote 570ac0eebd 1/6: New utility functions


From: ELPA Syncer
Subject: [elpa] externals/denote 570ac0eebd 1/6: New utility functions
Date: Sun, 18 Sep 2022 08:57:31 -0400 (EDT)

branch: externals/denote
commit 570ac0eebdbec2c17407a88797b13376e7fe340c
Author: Alan Schmitt <alan.schmitt@polytechnique.org>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    New utility functions
    
    - `denote-link-or-create-with-date' is identical to
      `denote-link-or-create' with a date prompt in case of creation
    - `denote-open-or-create' opens a denote file if it exists, otherwise it
      proposes to create it
    - `denote-open-or-create-with-date' is identical to
      `denote-open-or-create' with a date prompt in case of creation
---
 denote.el | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/denote.el b/denote.el
index 9aec1977fd..a2e1ae12f3 100644
--- a/denote.el
+++ b/denote.el
@@ -2271,6 +2271,22 @@ file's title.  This has the same meaning as in 
`denote-link'."
 
 (defalias 'denote-link-to-existing-or-new-note (symbol-function 
'denote-link-or-create))
 
+(defun denote-link-or-create-with-date ()
+  (interactive)
+  (let ((denote-prompts '(date title keywords)))
+    (call-interactively #'denote-link-or-create)))
+
+(defun denote-open-or-create (target)
+  (interactive (list (denote-file-prompt)))
+  (if (file-exists-p target)
+      (find-file target)
+    (call-interactively #'denote)))
+
+(defun denote-open-or-create-with-date ()
+  (interactive)
+  (let ((denote-prompts '(date title keywords)))
+    (call-interactively #'denote-open-or-create)))
+
 ;;;;; Link buttons
 
 ;; Evaluate: (info "(elisp) Button Properties")



reply via email to

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