aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/org
diff options
context:
space:
mode:
authorPaul Eggert2019-03-07 09:02:15 -0800
committerPaul Eggert2019-03-07 09:05:56 -0800
commit3739d51ef3b935b30e40ba4534fe362bc685865f (patch)
treeada093c6c9464828035b59a9f56f90a367b57d3a /lisp/org
parent953cbce77be9a8da1cbf0ca5ee6442923478e186 (diff)
downloademacs-3739d51ef3b935b30e40ba4534fe362bc685865f.tar.gz
emacs-3739d51ef3b935b30e40ba4534fe362bc685865f.zip
Be safer about "%" in message formats
* lisp/calc/calc-store.el (calc-copy-special-constant): * lisp/net/rcirc.el (rcirc-handler-PART, rcirc-handler-KICK): * lisp/org/org-agenda.el (org-agenda): * lisp/org/org-clock.el (org-clock-out, org-clock-display): * lisp/org/org.el (org-refile): * lisp/progmodes/ada-xref.el (ada-goto-declaration): * lisp/progmodes/idlwave.el (idlwave-scan-library-catalogs): Don’t trust arbitrary strings to not contain "%" or "`" in (message (concat STRING1 STRING2 ...)).
Diffstat (limited to 'lisp/org')
-rw-r--r--lisp/org/org-agenda.el13
-rw-r--r--lisp/org/org-clock.el22
-rw-r--r--lisp/org/org.el3
3 files changed, 20 insertions, 18 deletions
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index e416f5f062a..23ee8d71e66 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -2882,13 +2882,12 @@ Pressing `<' twice means to restrict to the current subtree or region
2882 (let* ((m (org-agenda-get-any-marker)) 2882 (let* ((m (org-agenda-get-any-marker))
2883 (note (and m (org-entry-get m "THEFLAGGINGNOTE")))) 2883 (note (and m (org-entry-get m "THEFLAGGINGNOTE"))))
2884 (when note 2884 (when note
2885 (message (concat 2885 (message "FLAGGING-NOTE ([?] for more info): %s"
2886 "FLAGGING-NOTE ([?] for more info): " 2886 (org-add-props
2887 (org-add-props 2887 (replace-regexp-in-string
2888 (replace-regexp-in-string 2888 "\\\\n" "//"
2889 "\\\\n" "//" 2889 (copy-sequence note))
2890 (copy-sequence note)) 2890 nil 'face 'org-warning))))))
2891 nil 'face 'org-warning)))))))
2892 t t)) 2891 t t))
2893 ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects)) 2892 ((equal org-keys "#") (call-interactively 'org-agenda-list-stuck-projects))
2894 ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files)) 2893 ((equal org-keys "/") (call-interactively 'org-occur-in-agenda-files))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 34b694d4879..62c7cd92d12 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1622,9 +1622,10 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
1622 "\\>")))) 1622 "\\>"))))
1623 (org-todo org-clock-out-switch-to-state)))))) 1623 (org-todo org-clock-out-switch-to-state))))))
1624 (force-mode-line-update) 1624 (force-mode-line-update)
1625 (message (concat "Clock stopped at %s after " 1625 (message (if remove
1626 (org-duration-from-minutes (+ (* 60 h) m)) "%s") 1626 "Clock stopped at %s after %s => LINE REMOVED"
1627 te (if remove " => LINE REMOVED" "")) 1627 "Clock stopped at %s after %s")
1628 te (org-duration-from-minutes (+ (* 60 h) m)))
1628 (run-hooks 'org-clock-out-hook) 1629 (run-hooks 'org-clock-out-hook)
1629 (unless (org-clocking-p) 1630 (unless (org-clocking-p)
1630 (setq org-clock-current-task nil))))))) 1631 (setq org-clock-current-task nil)))))))
@@ -1925,13 +1926,14 @@ Use `\\[org-clock-remove-overlays]' to remove the subtree times."
1925 nil 'local)))) 1926 nil 'local))))
1926 (let* ((h (/ org-clock-file-total-minutes 60)) 1927 (let* ((h (/ org-clock-file-total-minutes 60))
1927 (m (- org-clock-file-total-minutes (* 60 h)))) 1928 (m (- org-clock-file-total-minutes (* 60 h))))
1928 (message (concat (format "Total file time%s: " 1929 (message (cond
1929 (cond (todayp " for today") 1930 (todayp
1930 (customp " (custom)") 1931 "Total file time for today: %s (%d hours and %d minutes)")
1931 (t ""))) 1932 (customp
1932 (org-duration-from-minutes 1933 "Total file time (custom): %s (%d hours and %d minutes)")
1933 org-clock-file-total-minutes) 1934 (t
1934 " (%d hours and %d minutes)") 1935 "Total file time: %s (%d hours and %d minutes)"))
1936 (org-duration-from-minutes org-clock-file-total-minutes)
1935 h m)))) 1937 h m))))
1936 1938
1937(defvar-local org-clock-overlays nil) 1939(defvar-local org-clock-overlays nil)
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 3a434d12dfd..e3c78ae90d4 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -11878,7 +11878,8 @@ prefix argument (`C-u C-u C-u C-c C-w')."
11878 (when (featurep 'org-inlinetask) 11878 (when (featurep 'org-inlinetask)
11879 (org-inlinetask-remove-END-maybe)) 11879 (org-inlinetask-remove-END-maybe))
11880 (setq org-markers-to-move nil) 11880 (setq org-markers-to-move nil)
11881 (message (concat actionmsg " to \"%s\" in file %s: done") (car it) file))))))) 11881 (message "%s to \"%s\" in file %s: done" actionmsg
11882 (car it) file)))))))
11882 11883
11883(defun org-refile-goto-last-stored () 11884(defun org-refile-goto-last-stored ()
11884 "Go to the location where the last refile was stored." 11885 "Go to the location where the last refile was stored."