[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tempel b54036f1fa 21/82: Add comment
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tempel b54036f1fa 21/82: Add comment |
Date: |
Sun, 9 Jan 2022 20:58:42 -0500 (EST) |
branch: externals/tempel
commit b54036f1fa8bf1cf64fabcf490816fb73aed4d93
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add comment
---
tempel.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tempel.el b/tempel.el
index 6ca4637500..1fe4de76cc 100644
--- a/tempel.el
+++ b/tempel.el
@@ -125,17 +125,22 @@ AFTER is non-nil after the modification.
BEG and END are the boundaries of the modification."
(when (and after (>= beg (overlay-start ov)) (<= beg (overlay-end ov)))
(save-excursion
+ ;; TODO: We use silent modifications such that the undo list is
+ ;; not affected and that the modification hooks are not triggered
+ ;; recursively. However since the edits which are made to the
+ ;; other fields are not recorded in the undo list, we will end up
+ ;; with an invalid undo state after tempel-done.
(with-silent-modifications
(move-overlay ov (overlay-start ov) (max end (overlay-end ov)))
(when-let (name (overlay-get ov 'tempel--name))
(let ((state (overlay-get ov 'tempel--state))
(str (buffer-substring-no-properties (overlay-start ov)
(overlay-end ov))))
(setf (alist-get name (cddr state)) str)
- ;; Update overlays
+ ;; Update other fields
(dolist (other (alist-get name (car state)))
(unless (eq other ov)
(tempel--replace-field other str)))
- ;; Update forms
+ ;; Update evaluated forms
(dolist (other (cadr state))
(tempel--replace-field other (eval (overlay-get other
'tempel--form) (cddr state))))))))))
- [elpa] externals/tempel e4839df533 53/82: Add temple-key, (continued)
- [elpa] externals/tempel e4839df533 53/82: Add temple-key, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 4a6fc2d0ab 46/82: Fix customization type, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 0aa4e8c37f 63/82: Only erase default value if the point is at the beginning or end, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel def7a1ca3f 07/82: README: Update links, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 311f310b82 72/82: Remove todo, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 9cf5cc35b3 16/82: Use insert-file-contents, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel db24ec0c9e 22/82: Reevaluate forms when arbitrary fields are modified, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 09a0e3bfb0 19/82: Improve annotations, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 16b0fa274a 09/82: Rename commands, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 73cee5feb6 12/82: Update comments, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel b54036f1fa 21/82: Add comment,
ELPA Syncer <=
- [elpa] externals/tempel 11cfbe239d 36/82: Fix undo, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel ffdf2c792a 77/82: Document the abbrev modes (See #14), ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 460f8fe806 81/82: Fix the MELPA issues, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel aec4f10253 82/82: Addition to GNU ELPA, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel d4bd649645 59/82: Minor renaming, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 2cff879181 30/82: Do not call modification hooks from forms, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 1222c59b30 39/82: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 07d16fded7 67/82: Update fields when new field is inserted, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel f0df571f66 17/82: Respect derived modes, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel bf95b3f1c2 31/82: Add support for (q (FORM ...) var), ELPA Syncer, 2022/01/09