Backport commit 3739d51ef from Emacs
* lisp/org-agenda.el (org-agenda): * lisp/org-clock.el (org-clock-out, org-clock-display): * lisp/org.el (org-refile): Don’t trust arbitrary strings to not contain "%" or "`" in (message (concat STRING1 STRING2 ...)). Be safer about "%" in message formats 3739d51ef3b935b30e40ba4534fe362bc685865f Paul Eggert Thu Mar 7 09:05:56 2019 -0800
This commit is contained in:
parent
602f2280e3
commit
7c9bfa142f
|
@ -2907,13 +2907,12 @@ Pressing `<' twice means to restrict to the current subtree or region
|
||||||
(let* ((m (org-agenda-get-any-marker))
|
(let* ((m (org-agenda-get-any-marker))
|
||||||
(note (and m (org-entry-get m "THEFLAGGINGNOTE"))))
|
(note (and m (org-entry-get m "THEFLAGGINGNOTE"))))
|
||||||
(when note
|
(when note
|
||||||
(message (concat
|
(message "FLAGGING-NOTE ([?] for more info): %s"
|
||||||
"FLAGGING-NOTE ([?] for more info): "
|
|
||||||
(org-add-props
|
(org-add-props
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"\\\\n" "//"
|
"\\\\n" "//"
|
||||||
(copy-sequence note))
|
(copy-sequence note))
|
||||||
nil 'face 'org-warning)))))))
|
nil 'face 'org-warning))))))
|
||||||
t t))
|
t t))
|
||||||
((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects))
|
((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects))
|
||||||
((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files))
|
((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files))
|
||||||
|
|
|
@ -1633,9 +1633,10 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
|
||||||
"\\>"))))
|
"\\>"))))
|
||||||
(org-todo org-clock-out-switch-to-state))))))
|
(org-todo org-clock-out-switch-to-state))))))
|
||||||
(force-mode-line-update)
|
(force-mode-line-update)
|
||||||
(message (concat "Clock stopped at %s after "
|
(message (if remove
|
||||||
(org-duration-from-minutes (+ (* 60 h) m)) "%s")
|
"Clock stopped at %s after %s => LINE REMOVED"
|
||||||
te (if remove " => LINE REMOVED" ""))
|
"Clock stopped at %s after %s")
|
||||||
|
te (org-duration-from-minutes (+ (* 60 h) m)))
|
||||||
(run-hooks 'org-clock-out-hook)
|
(run-hooks 'org-clock-out-hook)
|
||||||
(unless (org-clocking-p)
|
(unless (org-clocking-p)
|
||||||
(setq org-clock-current-task nil)))))))
|
(setq org-clock-current-task nil)))))))
|
||||||
|
@ -1934,13 +1935,14 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree times."
|
||||||
nil 'local))))
|
nil 'local))))
|
||||||
(let* ((h (/ org-clock-file-total-minutes 60))
|
(let* ((h (/ org-clock-file-total-minutes 60))
|
||||||
(m (- org-clock-file-total-minutes (* 60 h))))
|
(m (- org-clock-file-total-minutes (* 60 h))))
|
||||||
(message (concat (format "Total file time%s: "
|
(message (cond
|
||||||
(cond (todayp " for today")
|
(todayp
|
||||||
(customp " (custom)")
|
"Total file time for today: %s (%d hours and %d minutes)")
|
||||||
(t "")))
|
(customp
|
||||||
(org-duration-from-minutes
|
"Total file time (custom): %s (%d hours and %d minutes)")
|
||||||
org-clock-file-total-minutes)
|
(t
|
||||||
" (%d hours and %d minutes)")
|
"Total file time: %s (%d hours and %d minutes)"))
|
||||||
|
(org-duration-from-minutes org-clock-file-total-minutes)
|
||||||
h m))))
|
h m))))
|
||||||
|
|
||||||
(defvar-local org-clock-overlays nil)
|
(defvar-local org-clock-overlays nil)
|
||||||
|
|
|
@ -11473,7 +11473,8 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
||||||
(when (featurep 'org-inlinetask)
|
(when (featurep 'org-inlinetask)
|
||||||
(org-inlinetask-remove-END-maybe))
|
(org-inlinetask-remove-END-maybe))
|
||||||
(setq org-markers-to-move nil)
|
(setq org-markers-to-move nil)
|
||||||
(message (concat actionmsg " to \"%s\" in file %s: done") (car it) file)))))))
|
(message "%s to \"%s\" in file %s: done" actionmsg
|
||||||
|
(car it) file)))))))
|
||||||
|
|
||||||
(defun org-refile-goto-last-stored ()
|
(defun org-refile-goto-last-stored ()
|
||||||
"Go to the location where the last refile was stored."
|
"Go to the location where the last refile was stored."
|
||||||
|
|
Loading…
Reference in New Issue