[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 196e68c30b 1/2: Add denote--extensions-with-encr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 196e68c30b 1/2: Add denote--extensions-with-encryption helper function |
Date: |
Tue, 24 Jan 2023 14:57:39 -0500 (EST) |
branch: externals/denote
commit 196e68c30b5bfa7a108415af6c0a63460263eeec
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add denote--extensions-with-encryption helper function
---
denote.el | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/denote.el b/denote.el
index bc1b8b8eaa..c0d2822472 100644
--- a/denote.el
+++ b/denote.el
@@ -1127,6 +1127,20 @@ for new note creation. The default is `org'.")
(plist-get (cdr type) :extension))
denote-file-types)))
+;; TODO 2023-01-24: Perhaps there is a good reason to make this a user
+;; option, but I am keeping it as a private variable for now.
+(defvar denote--encryption-file-extensions '(".gpg" ".age")
+ "List of strings specifying file extensions for encryption.")
+
+(defun denote--extensions-with-encryption ()
+ "Derive `denote--extensions' including `denote--encryption-file-extensions'."
+ (let ((file-extensions (denote--extensions))
+ all)
+ (dolist (ext file-extensions)
+ (dolist (enc denote--encryption-file-extensions)
+ (push (concat ext enc) all)))
+ (append file-extensions all)))
+
(defun denote--file-type-keys ()
"Return all `denote-file-types' keys."
(delete-dups (mapcar #'car denote-file-types)))