[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tempel 2ba940809a 42/82: Add temple-abort (Fix #2)
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tempel 2ba940809a 42/82: Add temple-abort (Fix #2) |
Date: |
Sun, 9 Jan 2022 20:58:43 -0500 (EST) |
branch: externals/tempel
commit 2ba940809a249086a8cc6d461631d5c26ae7062a
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add temple-abort (Fix #2)
Co-authored-by: Trey Peacock <git@treypeacock.com>
---
tempel.el | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tempel.el b/tempel.el
index 64cc25e00b..c4c4e59fbb 100644
--- a/tempel.el
+++ b/tempel.el
@@ -84,6 +84,8 @@ may be named with `tempel--name' or carry an evaluatable Lisp
expression
(let ((map (make-sparse-keymap)))
(define-key map [remap forward-paragraph] #'tempel-next)
(define-key map [remap backward-paragraph] #'tempel-previous)
+ (define-key map [remap keyboard-quit] #'tempel-abort)
+ (define-key map [remap keyboard-escape-quit] #'tempel-abort)
map)
"Keymap to navigate across template markers.")
@@ -324,6 +326,18 @@ INIT is the optional initial input."
(interactive "p")
(tempel-next (- arg)))
+(defun tempel-abort ()
+ "Abort template insertion."
+ (interactive)
+ ;; TODO quit only the topmost template?
+ (when tempel--active
+ (let ((beg (cl-loop for st in tempel--active minimize
+ (cl-loop for ov in (car st) minimize (overlay-start
ov))))
+ (end (cl-loop for st in tempel--active maximize
+ (cl-loop for ov in (car st) maximize (overlay-end
ov)))))
+ (tempel-done)
+ (delete-region beg end))))
+
(defun tempel-done ()
"Template completion is done."
(interactive)
- [elpa] externals/tempel 91f6978ddd 60/82: Use Tempo PROMPT as default value, (continued)
- [elpa] externals/tempel 91f6978ddd 60/82: Use Tempo PROMPT as default value, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel e20f982dc5 25/82: Remove global variable tempel--state, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel fa99fb7f96 34/82: README: Update keybindings, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel c4cd6e0f69 73/82: Rename tempel-expand -> tempel-complete, add tempel-expand (Fix #13), ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 8f8588985a 04/82: Simplify template markers, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel d9efb707b3 20/82: Improve undo behavior, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 4bc75c1aba 52/82: Use the more subtle face colors from Modus, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 52d8556c05 57/82: Improve annotation function, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 675e759bde 64/82: Add special prompt treatment, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel e6aa1892af 14/82: README: Simplify template, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 2ba940809a 42/82: Add temple-abort (Fix #2),
ELPA Syncer <=
- [elpa] externals/tempel 5521546f48 10/82: README: Add header, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel d2d5566282 65/82: Improve description of PROMPT/DEFAULT value, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel e529887d5d 70/82: tempel-expand: Fix exit function, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 349e9735ac 08/82: Remove global temple-region variable, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel bdf04d8c48 05/82: Improved field movement, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 76a5ab120b 15/82: Add customization variables, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel f7990f528b 11/82: README update, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 5807ca4d28 33/82: Use remappings, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 9291904a84 24/82: Simplify overlay updates, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 5e1a864123 68/82: Add tempel-abbrev to define an abbrev, ELPA Syncer, 2022/01/09