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

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

[elpa] externals/denote 2d1664c276 16/17: Use when-let in denote--filety


From: ELPA Syncer
Subject: [elpa] externals/denote 2d1664c276 16/17: Use when-let in denote--filetype-heuristics
Date: Mon, 15 Aug 2022 01:57:35 -0400 (EDT)

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

    Use when-let in denote--filetype-heuristics
---
 denote.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/denote.el b/denote.el
index 0199e8fa95..c9e1607ada 100644
--- a/denote.el
+++ b/denote.el
@@ -1243,12 +1243,11 @@ in `denote-file-types'."
          (types (denote--file-types-with-extension extension)))
     (if (= (length types) 1)
         (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)))))
+      (when-let ((found-type (seq-find
+                              (lambda (type)
+                                (denote--regexp-in-file-p (plist-get (cdr 
type) :title-key-regexp) file))
+                              types)))
+        (setq file-type (car found-type))))
     (unless file-type
       (setq file-type (caar denote-file-types)))
     file-type))



reply via email to

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