[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tempel bffc5f3336 2/2: Add comments
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tempel bffc5f3336 2/2: Add comments |
Date: |
Tue, 11 Oct 2022 11:58:26 -0400 (EDT) |
branch: externals/tempel
commit bffc5f3336455553e336e2c9c8b0a6885741e836
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add comments
---
tempel.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tempel.el b/tempel.el
index d7f41109fb..435e35c1d2 100644
--- a/tempel.el
+++ b/tempel.el
@@ -313,6 +313,7 @@ Return the added field."
(pcase elt
('nil)
('n (insert "\n"))
+ ;; `indent-according-to-mode' fails sometimes in Org. Ignore errors.
('n> (insert "\n") (with-demoted-errors (indent-according-to-mode)))
('> (with-demoted-errors (indent-according-to-mode)))
((pred stringp) (insert elt))
@@ -589,6 +590,8 @@ This is meant to be a source in `tempel-template-sources'."
"Finalize template ST, or last template."
(let ((st (or st (car tempel--active)))
(buf (current-buffer)))
+ ;; Ignore errors in post expansion to ensure that templates can be
+ ;; terminated gracefully.
(with-demoted-errors
(eval (overlay-get (caar st) 'tempel--post) (cdr st)))
(with-current-buffer buf