浏览代码

org-ctrl-c-ctrl-c: Update timestamp at point inside clock lines

* lisp/org.el (org-ctrl-c-ctrl-c): Update the timestamp at point, if
any; not just the clock sum.

Reported-by: "Bruce E. Robertson" <brucer42@gmail.com>
Link: https://orgmode.org/list/87mtjo2twj.fsf@gmail.com
Ihor Radchenko 2 年之前
父节点
当前提交
dd2212395b
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lisp/org.el

+ 6 - 1
lisp/org.el

@@ -17307,7 +17307,12 @@ This command does many different things, depending on context:
 	((or `babel-call `inline-babel-call)
 	 (let ((info (org-babel-lob-get-info context)))
 	   (when info (org-babel-execute-src-block nil info nil type))))
-	(`clock (org-clock-update-time-maybe))
+	(`clock
+         (if (org-at-timestamp-p 'lax)
+             ;; Update the timestamp as well.  `org-timestamp-change'
+             ;; will call `org-clock-update-time-maybe'.
+             (org-timestamp-change 0 'day)
+           (org-clock-update-time-maybe)))
 	(`dynamic-block
 	 (save-excursion
 	   (goto-char (org-element-property :post-affiliated context))