Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2023-01-13 12:08:49 +03:00
commit d71bb04f78
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 19 additions and 11 deletions

View File

@ -1801,6 +1801,10 @@ Optional argument N tells to change by that many units."
(time-subtract (time-subtract
(org-time-string-to-time org-last-changed-timestamp) (org-time-string-to-time org-last-changed-timestamp)
(org-time-string-to-time ts))) (org-time-string-to-time ts)))
;; `save-excursion' won't work because
;; `org-timestamp-change' deletes and re-inserts the
;; timestamp.
(let ((origin (point)))
(save-excursion (save-excursion
(goto-char begts) (goto-char begts)
(org-timestamp-change (org-timestamp-change
@ -1811,7 +1815,11 @@ Optional argument N tells to change by that many units."
(`day (* 24 3600)) (`day (* 24 3600))
(`month (* 24 3600 31)) (`month (* 24 3600 31))
(`year (* 24 3600 365.2))))) (`year (* 24 3600 365.2)))))
timestamp? 'updown))))))) timestamp? 'updown))
;; Move back to initial position, but never beyond updated
;; clock.
(unless (< (point) origin)
(goto-char origin))))))))
;;;###autoload ;;;###autoload
(defun org-clock-cancel () (defun org-clock-cancel ()