branch: externals/tempel
commit f6616b7c9b85d57e2c79614c4f8b5baf009adf92
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
tempel--path-templates: Use t as default for the condition
---
tempel.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tempel.el b/tempel.el
index f8112a0e8b..a9d6481ec9 100644
--- a/tempel.el
+++ b/tempel.el
@@ -499,14 +499,14 @@ template.eld file. The return value is a list of (mode
cond . templates)."
(while (and (car data) (symbolp (car data)) (not (keywordp (car
data))))
(push (pop data) modes))
(while (keywordp (car data))
- (push (pop data) plist)
- (push (pop data) plist))
+ (setq plist `(,(car data) ,(cadr data) ,@plist)
+ data (cddr data)))
(while (consp (car data))
(push (pop data) templates))
- (setq plist (plist-get (nreverse plist) :when)
+ (setq plist (or (not (plist-member plist :when)) (plist-get plist
:when))
templates (nreverse templates))
- (dolist (m modes)
- (push `(,m ,plist ,@templates) result))))
+ (dolist (mode modes)
+ (push `(,mode ,plist ,@templates) result))))
result))
(defun tempel-path-templates ()
@@ -544,7 +544,7 @@ TEMPLATES must be a list in the form (mode cond .
templates)."
(when-let* ((remap (alist-get mode major-mode-remap-alist)))
(derived-mode-p remap)))
(or tempel--ignore-condition
- (not cond)
+ (eq cond t)
(save-excursion
(save-restriction
(save-match-data