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

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

[elpa] externals/denote 96c09e65b5 15/17: Add denote--file-types-with-ex


From: ELPA Syncer
Subject: [elpa] externals/denote 96c09e65b5 15/17: Add denote--file-types-with-extension
Date: Mon, 15 Aug 2022 01:57:35 -0400 (EDT)

branch: externals/denote
commit 96c09e65b57f1e3be7bbd30aaf3cee262b1fa983
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Add denote--file-types-with-extension
---
 denote.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/denote.el b/denote.el
index 4fbb664597..0199e8fa95 100644
--- a/denote.el
+++ b/denote.el
@@ -1223,6 +1223,13 @@ set to \\='(template title keywords)."
 
 ;;;;; Common helpers for note modifications
 
+(defun denote--file-types-with-extension (extension)
+  "Return only the entries of `denote-file-types' with EXTENSION.
+See the format of `denote-file-types'."
+  (seq-filter (lambda (type)
+                (string-equal (plist-get (cdr type) :extension) extension))
+              denote-file-types))
+
 (defun denote--filetype-heuristics (file)
   "Return likely file type of FILE.
 Use the file extension to detect the file type of the file.
@@ -1233,9 +1240,7 @@ Else, if nothing works, the file type is assumed to be 
the first
 in `denote-file-types'."
   (let* ((file-type)
          (extension (file-name-extension file t))
-         (types (seq-filter (lambda (type)
-                              (string-equal (plist-get (cdr type) :extension) 
extension))
-                            denote-file-types)))
+         (types (denote--file-types-with-extension extension)))
     (if (= (length types) 1)
         (setq file-type (caar types))
       (let ((found-type (seq-find



reply via email to

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