[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tempel 0aa4e8c37f 63/82: Only erase default value if th
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tempel 0aa4e8c37f 63/82: Only erase default value if the point is at the beginning or end |
Date: |
Sun, 9 Jan 2022 20:58:45 -0500 (EST) |
branch: externals/tempel
commit 0aa4e8c37fbc96e90ae4eafcc33c7583a056c29c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Only erase default value if the point is at the beginning or end
---
tempel.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tempel.el b/tempel.el
index 74aba08daf..cee3ec646e 100644
--- a/tempel.el
+++ b/tempel.el
@@ -153,12 +153,10 @@ WIDTH, SEP and ELLIPSIS configure the formatting."
AFTER is non-nil after the modification.
BEG and END are the boundaries of the modification."
(cond
- ;; Overwrite default before modification
- ((and (not after) (eq 'tempel-default (overlay-get ov 'face)))
- (setq beg (overlay-start ov) end (overlay-end ov))
- (goto-char beg)
- (overlay-put ov 'face 'tempel-field)
- (delete-region beg end))
+ ;; Erase default before modification if at beginning or end
+ ((and (not after) (eq 'tempel-default (overlay-get ov 'face))
+ (or (= beg (overlay-start ov)) (= end (overlay-end ov))))
+ (delete-region (overlay-start ov) (overlay-end ov)))
;; Update field after modification
(after
(let ((st (overlay-get ov 'tempel--state)))
@@ -170,6 +168,8 @@ BEG and END are the boundaries of the modification."
(overlay-start ov) (overlay-end ov))))
(unless undo-in-progress
(template--synchronize-fields st ov)))))
+ (when (eq 'tempel-default (overlay-get ov 'face))
+ (overlay-put ov 'face 'tempel-field))
(tempel--update-mark ov))
(defun template--synchronize-fields (st current)
- [elpa] branch externals/tempel created (now aec4f10253), ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 20589b8a6a 18/82: Simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 507e9ed4de 40/82: Improve field initialization, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 11301795d8 51/82: Fix commentary, ELPA Syncer, 2022/01/09
- [elpa] externals/tempel 3aa1a7fca8 01/82: Initial commit, ELPA Syncer, 2022/01/09
- [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 <=
- [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, 2022/01/09
- [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