quoting "%"s in messages

This commit is contained in:
Eric Schulte 2009-06-12 13:07:56 -07:00
parent fe8393bf71
commit 8ab8bf6ed4
1 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ the header arguments specified at the source code block."
(member "vector" (split-string (cdr (assoc :results params))))) (member "vector" (split-string (cdr (assoc :results params)))))
(setq result (list result))) (setq result (list result)))
(if arg (if arg
(message (format "%S" result)) (message (replace-regexp-in-string "%" "%%" (format "%S" result)))
(org-babel-insert-result result (cdr (assoc :results params)))) (org-babel-insert-result result (cdr (assoc :results params))))
result)) result))
@ -269,7 +269,7 @@ silent -- no results are inserted"
(if (= (length result) 0) (if (= (length result) 0)
(message "no result returned by source block") (message "no result returned by source block")
(if (and insert (member "silent" insert)) (if (and insert (member "silent" insert))
(progn (message (format "%S" result)) result) (progn (message (replace-regexp-in-string "%" "%%" (format "%S" result))) result)
(when (and (stringp result) ;; ensure results end in a newline (when (and (stringp result) ;; ensure results end in a newline
(not (or (string-equal (substring result -1) "\n") (not (or (string-equal (substring result -1) "\n")
(string-equal (substring result -1) "\r")))) (string-equal (substring result -1) "\r"))))