summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-03-07 09:02:15 -0800
committerKyle Meyer <kyle@kyleam.com>2019-03-17 22:52:48 -0400
commit7c9bfa142fb8fa981d07fc2454656a8d2399bbcd (patch)
treea2bae757b434efa4c355bf9ce85b6c517bc9df39
parent602f2280e37b1d4f7a41b685cbb7cc39b41d0d69 (diff)
downloadorg-mode-7c9bfa142fb8fa981d07fc2454656a8d2399bbcd.tar.gz
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
-rw-r--r--lisp/org-agenda.el13
-rw-r--r--lisp/org-clock.el22
-rw-r--r--lisp/org.el3
3 files changed, 20 insertions, 18 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 31f3dac..67a0f33 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2907,13 +2907,12 @@ Pressing `<' twice means to restrict to the current subtree or region
(let* ((m (org-agenda-get-any-marker))
(note (and m (org-entry-get m "THEFLAGGINGNOTE"))))
(when note
- (message (concat
- "FLAGGING-NOTE ([?] for more info): "
- (org-add-props
- (replace-regexp-in-string
- "\\\\n" "//"
- (copy-sequence note))
- nil 'face 'org-warning)))))))
+ (message "FLAGGING-NOTE ([?] for more info): %s"
+ (org-add-props
+ (replace-regexp-in-string
+ "\\\\n" "//"
+ (copy-sequence note))
+ nil 'face 'org-warning))))))
t t))
((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects))
((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files))
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 792f4b8..98acdae 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1633,9 +1633,10 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
"\\>"))))
(org-todo org-clock-out-switch-to-state))))))
(force-mode-line-update)
- (message (concat "Clock stopped at %s after "
- (org-duration-from-minutes (+ (* 60 h) m)) "%s")
- te (if remove " => LINE REMOVED" ""))
+ (message (if remove
+ "Clock stopped at %s after %s => LINE REMOVED"
+ "Clock stopped at %s after %s")
+ te (org-duration-from-minutes (+ (* 60 h) m)))
(run-hooks 'org-clock-out-hook)
(unless (org-clocking-p)
(setq org-clock-current-task nil)))))))
@@ -1934,13 +1935,14 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree times."
nil 'local))))
(let* ((h (/ org-clock-file-total-minutes 60))
(m (- org-clock-file-total-minutes (* 60 h))))
- (message (concat (format "Total file time%s: "
- (cond (todayp " for today")
- (customp " (custom)")
- (t "")))
- (org-duration-from-minutes
- org-clock-file-total-minutes)
- " (%d hours and %d minutes)")
+ (message (cond
+ (todayp
+ "Total file time for today: %s (%d hours and %d minutes)")
+ (customp
+ "Total file time (custom): %s (%d hours and %d minutes)")
+ (t
+ "Total file time: %s (%d hours and %d minutes)"))
+ (org-duration-from-minutes org-clock-file-total-minutes)
h m))))
(defvar-local org-clock-overlays nil)
diff --git a/lisp/org.el b/lisp/org.el
index d5a7bf5..5f1ab27 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11473,7 +11473,8 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(when (featurep 'org-inlinetask)
(org-inlinetask-remove-END-maybe))
(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 ()
"Go to the location where the last refile was stored."