Fix some confusion with ‘format’

* lisp/allout-widgets.el (allout-widgets-before-change-handler)
(allout-graphics-modification-handler):
Protect arbitrary string in a format context with "%s" format.
* lisp/avoid.el:
* lisp/cedet/semantic/bovine/scm.el: Fix comment.
* lisp/calendar/icalendar.el (icalendar--convert-sexp-to-ical):
* lisp/erc/erc-button.el (erc-button-beats-to-time):
* lisp/gnus/message.el (message-send-form-letter):
* lisp/org/ob-core.el (org-babel-check-evaluate)
(org-babel-confirm-evaluate):
* lisp/org/ob-fortran.el (org-babel-fortran-var-to-fortran):
* lisp/org/ox-latex.el (org-latex-compile):
* lisp/org/ox-man.el (org-man-compile):
* lisp/org/ox-odt.el (org-odt-template):
* lisp/org/ox-texinfo.el (org-texinfo-compile):
* lisp/progmodes/prolog.el (prolog-help-info)
(prolog-view-predspec):
* lisp/progmodes/ruby-mode.el (ruby-parse-partial):
* lisp/progmodes/verilog-mode.el (verilog-showscopes):
* lisp/textmodes/rst.el (rst-replace-lines):
Change (message (format ...)) to (message ...), and likewise
for ‘error’.  This lessens the probability of confusion when the
output of ‘format’ contains ‘%’.
This commit is contained in:
Paul Eggert 2015-08-05 19:06:57 -07:00
parent ec044fd2bf
commit 0c856a2c45
16 changed files with 27 additions and 31 deletions

View file

@ -869,7 +869,7 @@ Optional RECURSING is for internal use, to limit recursion."
;; tell the allout-widgets-post-command-business to reestablish the hook: ;; tell the allout-widgets-post-command-business to reestablish the hook:
(setq allout-widgets-reenable-before-change-handler t) (setq allout-widgets-reenable-before-change-handler t)
;; and raise an error to prevent the edit (and disable the hook): ;; and raise an error to prevent the edit (and disable the hook):
(error (error "%s"
(substitute-command-keys allout-structure-unruly-deletion-message))))) (substitute-command-keys allout-structure-unruly-deletion-message)))))
;;;_ > allout-widgets-after-change-handler ;;;_ > allout-widgets-after-change-handler
(defun allout-widgets-after-change-handler (_beg _end _prelength) (defun allout-widgets-after-change-handler (_beg _end _prelength)
@ -2287,7 +2287,7 @@ Deletes allowed only when `inhibit-read-only' is t."
((yes-or-no-p "Unruly edit of outline structure - allow? ") ((yes-or-no-p "Unruly edit of outline structure - allow? ")
(setq allout-widgets-unset-inhibit-read-only (not inhibit-read-only) (setq allout-widgets-unset-inhibit-read-only (not inhibit-read-only)
inhibit-read-only t)) inhibit-read-only t))
(t (error (t (error "%s"
(substitute-command-keys allout-structure-unruly-deletion-message))))) (substitute-command-keys allout-structure-unruly-deletion-message)))))
;;;_ > allout-item-icon-key-handler () ;;;_ > allout-item-icon-key-handler ()
(defun allout-item-icon-key-handler () (defun allout-item-icon-key-handler ()

View file

@ -163,9 +163,9 @@ Analogous to `mouse-position'."
;(defun mouse-avoidance-point-position-test () ;(defun mouse-avoidance-point-position-test ()
; (interactive) ; (interactive)
; (message (format "point=%s mouse=%s" ; (message "point=%s mouse=%s"
; (cdr (mouse-avoidance-point-position)) ; (cdr (mouse-avoidance-point-position))
; (cdr (mouse-position))))) ; (cdr (mouse-position))))
(defun mouse-avoidance-set-mouse-position (pos) (defun mouse-avoidance-set-mouse-position (pos)
;; Carefully set mouse position to given position (X . Y) ;; Carefully set mouse position to given position (X . Y)

View file

@ -1629,8 +1629,8 @@ enumeration, given as a time value, in same format as returned by
(icalendar--convert-ordinary-to-ical (icalendar--convert-ordinary-to-ical
nonmarker (format "%4d/%02d/%02d %s" y m d see)))) nonmarker (format "%4d/%02d/%02d %s" y m d see))))
(;TODO: (;TODO:
(error (format "Unsupported Sexp-entry: %s" (error "Unsupported Sexp-entry: %s"
entry-main)))))) entry-main)))))
(number-sequence (number-sequence
0 (- icalendar-export-sexp-enumeration-days 1)))))) 0 (- icalendar-export-sexp-enumeration-days 1))))))
(t (t

View file

@ -70,7 +70,7 @@ Attempts a simple prototype for calling or using TAG."
(define-lex-regex-analyzer semantic-lex-scheme-symbol (define-lex-regex-analyzer semantic-lex-scheme-symbol
"Detect and create symbol and keyword tokens." "Detect and create symbol and keyword tokens."
"\\(\\sw\\([:]\\|\\sw\\|\\s_\\)*\\)" "\\(\\sw\\([:]\\|\\sw\\|\\s_\\)*\\)"
;; (message (format "symbol: %s" (match-string 0))) ;; (message "symbol: %s" (match-string 0))
(semantic-lex-push-token (semantic-lex-push-token
(semantic-lex-token (semantic-lex-token
(or (semantic-lex-keyword-p (match-string 0)) 'symbol) (or (semantic-lex-keyword-p (match-string 0)) 'symbol)

View file

@ -537,8 +537,8 @@ and `apropos' for other symbols."
(- (car (current-time-zone))))) (- (car (current-time-zone)))))
(hours (mod (floor seconds 3600) 24)) (hours (mod (floor seconds 3600) 24))
(minutes (mod (round seconds 60) 60))) (minutes (mod (round seconds 60) 60)))
(message (format "@%s is %d:%02d local time" (message "@%s is %d:%02d local time"
beats hours minutes)))) beats hours minutes)))
(provide 'erc-button) (provide 'erc-button)
@ -546,4 +546,3 @@ and `apropos' for other symbols."
;; Local Variables: ;; Local Variables:
;; indent-tabs-mode: nil ;; indent-tabs-mode: nil
;; End: ;; End:

View file

@ -8487,7 +8487,7 @@ Header and body are separated by `mail-header-separator'."
(progn (progn
(setq sent (1+ sent)) (setq sent (1+ sent))
(message-send-and-exit)) (message-send-and-exit))
(message (format "Message to `%s' skipped." to)) (message "Message to `%s' skipped." to)
(setq skipped (1+ skipped))) (setq skipped (1+ skipped)))
(when (buffer-live-p buff) (when (buffer-live-p buff)
(kill-buffer buff)))) (kill-buffer buff))))

View file

@ -316,8 +316,8 @@ name of the code block."
Do not query the user." Do not query the user."
(org-babel-check-confirm-evaluate info (org-babel-check-confirm-evaluate info
(not (when noeval (not (when noeval
(message (format "Evaluation of this%scode-block%sis disabled." (message "Evaluation of this%scode-block%sis disabled."
code-block block-name)))))) code-block block-name)))))
;; dynamically scoped for asynchronous export ;; dynamically scoped for asynchronous export
(defvar org-babel-confirm-evaluate-answer-no) (defvar org-babel-confirm-evaluate-answer-no)
@ -343,8 +343,8 @@ of potentially harmful code."
(yes-or-no-p (yes-or-no-p
(format "Evaluate this%scode block%son your system? " (format "Evaluate this%scode block%son your system? "
code-block block-name))) code-block block-name)))
(message (format "Evaluation of this%scode-block%sis aborted." (message "Evaluation of this%scode-block%sis aborted."
code-block block-name))))))) code-block block-name))))))
;;;###autoload ;;;###autoload
(defun org-babel-execute-safely-maybe () (defun org-babel-execute-safely-maybe ()

View file

@ -147,15 +147,14 @@ of the same value."
;; val is a matrix ;; val is a matrix
((and (listp val) (org-every #'listp val)) ((and (listp val) (org-every #'listp val))
(format "real, parameter :: %S(%d,%d) = transpose( reshape( %s , (/ %d, %d /) ) )\n" (format "real, parameter :: %S(%d,%d) = transpose( reshape( %s , (/ %d, %d /) ) )\n"
var (length val) (length (car val)) var (length val) (length (car val))
(org-babel-fortran-transform-list val) (org-babel-fortran-transform-list val)
(length (car val)) (length val))) (length (car val)) (length val)))
((listp val) ((listp val)
(format "real, parameter :: %S(%d) = %s\n" (format "real, parameter :: %S(%d) = %s\n"
var (length val) (org-babel-fortran-transform-list val))) var (length val) (org-babel-fortran-transform-list val)))
(t (t
(error (format "the type of parameter %s is not supported by ob-fortran" (error "the type of parameter %s is not supported by ob-fortran" var)))))
var))))))
(defun org-babel-fortran-transform-list (val) (defun org-babel-fortran-transform-list (val)
"Return a fortran representation of enclose syntactic lists." "Return a fortran representation of enclose syntactic lists."

View file

@ -2846,7 +2846,7 @@ Return PDF file name or an error if it couldn't be produced."
(file-name-directory full-name) (file-name-directory full-name)
default-directory)) default-directory))
errors) errors)
(unless snippet (message (format "Processing LaTeX file %s..." texfile))) (unless snippet (message "Processing LaTeX file %s..." texfile))
(save-window-excursion (save-window-excursion
(cond (cond
;; A function is provided: Apply it. ;; A function is provided: Apply it.

View file

@ -1190,7 +1190,7 @@ Return PDF file name or an error if it couldn't be produced."
(file-name-directory full-name) (file-name-directory full-name)
default-directory)) default-directory))
errors) errors)
(message (format "Processing Groff file %s..." file)) (message "Processing Groff file %s..." file)
(save-window-excursion (save-window-excursion
(cond (cond
;; A function is provided: Apply it. ;; A function is provided: Apply it.

View file

@ -1389,8 +1389,8 @@ original parsed data. INFO is a plist holding export options."
((member styles-file-type '("odt" "ott")) ((member styles-file-type '("odt" "ott"))
(org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir))))) (org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir)))))
(t (t
(error (format "Invalid specification of styles.xml file: %S" (error "Invalid specification of styles.xml file: %S"
org-odt-styles-file)))) org-odt-styles-file)))
;; create a manifest entry for styles.xml ;; create a manifest entry for styles.xml
(org-odt-create-manifest-file-entry "text/xml" "styles.xml") (org-odt-create-manifest-file-entry "text/xml" "styles.xml")

View file

@ -1513,7 +1513,7 @@ Return INFO file name or an error if it couldn't be produced."
(file-name-directory full-name) (file-name-directory full-name)
default-directory)) default-directory))
errors) errors)
(message (format "Processing Texinfo file %s..." file)) (message "Processing Texinfo file %s..." file)
(save-window-excursion (save-window-excursion
;; Replace %b, %f and %o with appropriate values in each command ;; Replace %b, %f and %o with appropriate values in each command
;; before applying it. Output is redirected to "*Org INFO ;; before applying it. Output is redirected to "*Org INFO

View file

@ -2305,7 +2305,7 @@ In effect it sets the `fill-prefix' when inside comments and then calls
(pop-to-buffer nil) (pop-to-buffer nil)
(Info-goto-node prolog-info-predicate-index) (Info-goto-node prolog-info-predicate-index)
(if (not (re-search-forward str nil t)) (if (not (re-search-forward str nil t))
(error (format "Help on predicate `%s' not found." predicate))) (error "Help on predicate `%s' not found." predicate))
(setq oldp (point)) (setq oldp (point))
(if (re-search-forward str nil t) (if (re-search-forward str nil t)
@ -2975,7 +2975,7 @@ Return the final point or nil if no such a beginning was found."
(let* ((pinfo (prolog-clause-info)) (let* ((pinfo (prolog-clause-info))
(predname (nth 0 pinfo)) (predname (nth 0 pinfo))
(arity (nth 1 pinfo))) (arity (nth 1 pinfo)))
(message (format "%s/%d" predname arity)))) (message "%s/%d" predname arity)))
(defun prolog-insert-predicate-template () (defun prolog-insert-predicate-template ()
"Insert the template for the current clause." "Insert the template for the current clause."

View file

@ -1178,9 +1178,7 @@ delimiter."
(setq in-string (match-end 0)) (setq in-string (match-end 0))
(goto-char ruby-indent-point))) (goto-char ruby-indent-point)))
(t (t
(error (format "Bad string %s" (error "Bad string %s" (buffer-substring (point) pnt))))))
(buffer-substring (point) pnt)
))))))
(list in-string nest depth pcol)) (list in-string nest depth pcol))
(defun ruby-parse-region (start end) (defun ruby-parse-region (start end)

View file

@ -7533,7 +7533,7 @@ If search fails, other files are checked based on
(regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)")) (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)"))
(with-output-to-temp-buffer "*Occur*" (with-output-to-temp-buffer "*Occur*"
(save-excursion (save-excursion
(message (format "Searching for %s ..." regexp)) (message "Searching for %s ..." regexp)
;; Find next match, but give up if prev match was at end of buffer. ;; Find next match, but give up if prev match was at end of buffer.
(while (and (not (= prevpos (point-max))) (while (and (not (= prevpos (point-max)))
(verilog-re-search-forward regexp nil t)) (verilog-re-search-forward regexp nil t))

View file

@ -4161,7 +4161,7 @@ cand replace with char: ")
(let ((width (current-column))) (let ((width (current-column)))
(rst-delete-entire-line) (rst-delete-entire-line)
(insert-char tochar width))) (insert-char tochar width)))
(message (format "%d lines replaced." found))))) (message "%d lines replaced." found))))
;; FIXME: Unbound command - should be bound or removed. ;; FIXME: Unbound command - should be bound or removed.
(defun rst-join-paragraph () (defun rst-join-paragraph ()