org-timestamp-change: Add FIXME

* lisp/org.el (org-timestamp-change): Add FIXME comment to
re-implement the logic in future to avoid `save-excursion' markers
being moved to the end of timestamp.
This commit is contained in:
Ihor Radchenko 2023-01-13 12:05:11 +03:00
parent dc29c7d81f
commit 76f9a3c2cb
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 6 additions and 0 deletions

View File

@ -14845,6 +14845,12 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like
(setq timestamp? (or what timestamp?)
inactive (= (char-after (match-beginning 0)) ?\[)
ts (match-string 0))
;; FIXME: Instead of deleting everything and then inserting
;; later, we should make use of `replace-match', which preserves
;; markers. The current implementation suffers from
;; `save-excursion' not preserving point inside the timestamp
;; once we delete the timestamp here. The point moves to the
;; updated timestamp end.
(replace-match "")
(when (string-match
"\\(\\(-[012][0-9]:[0-5][0-9]\\)?\\( +[.+]?-?[-+][0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)*\\)[]>]"