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

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

[elpa] externals/denote 759fe4cb4e 10/17: Fix denote--filetype-heuristic


From: ELPA Syncer
Subject: [elpa] externals/denote 759fe4cb4e 10/17: Fix denote--filetype-heuristics
Date: Mon, 15 Aug 2022 01:57:35 -0400 (EDT)

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

    Fix denote--filetype-heuristics
---
 denote.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/denote.el b/denote.el
index e4478b9cf6..140d4d1293 100644
--- a/denote.el
+++ b/denote.el
@@ -1224,13 +1224,16 @@ in `denote-file-types'."
                               (string-equal (plist-get (cdr type) :extension) 
extension))
                             denote-file-types)))
     (if (= (length types) 1)
-        (setq file-type types)
-      (setq file-type (seq-find
-                       (lambda (type)
-                         (denote--regexp-in-file-p (plist-get (cdr type) 
:title-key-regexp) file))
-                       types)))
+        (setq file-type (caar types))
+      (let ((found-type (seq-find
+                         (lambda (type)
+                           (denote--regexp-in-file-p (plist-get (cdr type) 
:title-key-regexp) file))
+                         types)))
+        (when found-type
+          (setq file-type (car found-type)))))
     (unless file-type
-      (caar denote-file-types))))
+      (setq file-type (caar denote-file-types)))
+    file-type))
 
 (defun denote--file-attributes-time (file)
   "Return `file-attribute-modification-time' of FILE as identifier."



reply via email to

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