[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tempel eb4882d9a6 1/3: Disable trivial templates right
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tempel eb4882d9a6 1/3: Disable trivial templates right away |
Date: |
Sun, 9 Jan 2022 21:57:52 -0500 (EST) |
branch: externals/tempel
commit eb4882d9a68b9fc08e9068c6ce9440e5d981325b
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Disable trivial templates right away
---
tempel.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tempel.el b/tempel.el
index 503cf1a7a9..82ef45b321 100644
--- a/tempel.el
+++ b/tempel.el
@@ -329,11 +329,15 @@ PROMPT is the optional prompt/default value."
(push (make-overlay (point) (point) nil t t) (car st))
(overlay-put (caar st) 'face 'cursor) ;; TODO debug
(push st tempel--active)))
- ;; Jump to first field
- (unless (cl-loop for ov in (caar tempel--active)
- thereis (and (overlay-get ov 'tempel--state)
- (eq (point) (overlay-start ov))))
- (tempel-next 1)))
+ (if (cddaar tempel--active)
+ (unless (cl-loop for ov in (caar tempel--active)
+ thereis (and (overlay-get ov 'tempel--state)
+ (eq (point) (overlay-start ov))))
+ ;; Jump to first field
+ (tempel-next 1))
+ ;; Disable right away
+ (goto-char (overlay-start (caaar tempel--active)))
+ (tempel--disable)))
(defun tempel--save ()
"Save template file buffer."