[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing numerous `message' bugs..

From: David Kastrup
Subject: Re: Fixing numerous `message' bugs..
Date: Thu, 06 Dec 2007 17:58:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> This will automatically fix all such code.  The only problem with it is
>>> that there is 
>> .. (in principle)..
> Not just in principle.  A quick "grep '(message.*%%' lisp/**/*.el" shows
> a fair number.
>>> code out there that calls message with a single arg and expects
>>> `message' to dequote "%%" into "%".
>> Indeed.   We should leave `message' itelf alone.
> Actually, I'd prefer changing message, but I already suggested it and it
> was rejected (maybe I even installed the change and then backed it out,
> can't remember).
> The problem I wanted to address with this change was not just to fix
> existing code but to try and avoid such bugs in the future as well.

How about the following (hopefully more or less exhaustive) patch?  Not
all occurences might have the proper caution (or too much) regarding
possible nil arguments, though.

diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 140335a..56b95ef 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1434,7 +1434,7 @@ calc-kill calc-kill-region calc-yank))))
      (calc-set-command-flag 'no-align)
      (setq prefix (set flag (not (symbol-value flag)))
           prefix-arg n)
-     (message (if prefix msg "")))
+     (message "%s" (if prefix msg "")))
     (and prefix
         (not calc-is-keypad-press)
         (if (boundp 'overriding-terminal-local-map)
diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el
index d7daf1b..85ae4d7 100644
--- a/lisp/calc/calc-mode.el
+++ b/lisp/calc/calc-mode.el
@@ -505,7 +505,7 @@
                      (and (not (eq calc-simplify-mode mode))
-  (message (if (eq calc-simplify-mode mode)
+  (message "%s" (if (eq calc-simplify-mode mode)
             "Default simplifications enabled")))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 69cacec..6e12fbe 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1228,7 +1228,7 @@ If nil, selections displayed but ignored.")
   (let ((prompt2 (format "%s " (key-description (this-command-keys))))
        (glob (current-global-map))
        (loc (current-local-map)))
-    (or (input-pending-p) (message prompt))
+    (or (input-pending-p) (message "%s" prompt))
     (let ((key (calc-read-key t)))
       (calc-unread-command (cdr key))
@@ -1244,7 +1244,7 @@ If nil, selections displayed but ignored.")
 (defun calc-version ()
   "Return version of this version of Calc."
-  (message (concat "Calc version " calc-version)))
+  (message "Calc version %s" calc-version))
 (defun calc-mode ()
   "Calculator major mode.
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index 4afed43..1259642 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -746,7 +746,7 @@
                      (setq math-integ-msg (format
                                            "Working... Integrating %s"
                                            (math-format-flat-expr expr 0)))
-                     (message math-integ-msg)))
+                     (message "%s" math-integ-msg)))
                (if math-cur-record
                    (setcar (cdr math-cur-record)
                            (if same-as-above (vector simp) 'busy))
@@ -773,7 +773,7 @@
                              (setq val (math-integral simp 'no t))))))))
              (if (eq calc-display-working-message 'lots)
-                 (message math-integ-msg)))
+                 (message "%s" math-integ-msg)))
          (setcar (cdr math-cur-record) (or val
                                       (if (or math-enable-subst
                                               (not math-any-substs))
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el
index 374b048..77e8b15 100644
--- a/lisp/calc/calcalg3.el
+++ b/lisp/calc/calcalg3.el
@@ -416,7 +416,7 @@
              (calc-record (calc-normalize calc-fit-to-trail) "parm"))))
   (when plot
     (if (stringp plot)
-        (message plot)
+        (message "%s" plot)
       (let ((calc-graph-no-auto-view t))
         (calc-graph-delete t)
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index d49667d..da87a19 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -3154,7 +3154,7 @@ Defaults to today's date if DATE is not given."
 (defun calendar-print-day-of-year ()
   "Show day number in year/days remaining in year for date under the cursor."
-  (message (calendar-day-of-year-string (calendar-cursor-to-date t))))
+  (message "%s" (calendar-day-of-year-string (calendar-cursor-to-date t))))
 (defun calendar-set-mode-line (str)
   "Set mode line to STR, centered, surrounded by dashes."
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 185df6f..742e134 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -978,7 +978,7 @@ Optional argument INTERACT permits more interactive fixing."
     (if (not (interactive-p))
       (if e
-         (message (checkdoc-error-text e))
+         (message "%s" (checkdoc-error-text e))
        (message "Space Check: done.")))))
@@ -1038,15 +1038,15 @@ space at the end of each line."
             (end (save-excursion (end-of-defun) (point)))
             (msg (checkdoc-this-string-valid)))
        (if msg (if no-error
-                   (message (checkdoc-error-text msg))
+                   (message "%s" (checkdoc-error-text msg))
                  (error "%s" (checkdoc-error-text msg)))
          (setq msg (checkdoc-message-text-search beg end))
          (if msg (if no-error
-                     (message (checkdoc-error-text msg))
+                     (message "%s" (checkdoc-error-text msg))
                    (error "%s" (checkdoc-error-text msg)))
            (setq msg (checkdoc-rogue-space-check-engine beg end))
            (if msg (if no-error
-                       (message (checkdoc-error-text msg))
+                       (message "%s" (checkdoc-error-text msg))
                      (error "%s" (checkdoc-error-text msg))))))
        (if (interactive-p) (message "Checkdoc: done."))))))
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index e3ade01..4dc7bdb 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -3295,12 +3295,12 @@ With prefix argument, make it a temporary breakpoint."
   (if (eq (1+ edebug-recursion-depth) (recursion-depth))
        (setq edebug-execution-mode mode)
-       (message shortmsg)
+       (message "%s" shortmsg)
        ;; Continue execution
     ;; This is not terribly useful!!
     (setq edebug-next-execution-mode mode)
-    (message msg)))
+    (message "%s" msg)))
 (defalias 'edebug-step-through-mode 'edebug-step-mode)
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index ea6a96c..c9dc657 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -562,7 +562,7 @@ copyright notice is allowed."
     (if verbose
-       (message ret))
+       (message (and ret "%s") ret))
 (defun lm-synopsis (&optional file showall)
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 87bf523..f496d34 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -636,7 +636,7 @@
         (regexp (format "^[^;]*%s[ \t\n]*[a-zA-Z---_']*[ \t\n)]" var-name))
         (buf (find-file-noselect (substitute-in-file-name custom-file)))
-    (message message)
+    (message (and message "%s") message)
       (set-buffer buf)
       (goto-char (point-min))
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index c0f4205..04ddab1 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -515,7 +515,7 @@ We will store server variables in the buffer given by 
       (set-process-filter process 'erc-server-filter-function)
       (set-process-buffer process buffer)))
   (erc-log "\n\n\n********************************************\n")
-  (message (erc-format-message
+  (message "%s" (erc-format-message
             'login ?n
             (with-current-buffer buffer (erc-current-nick))))
   ;; wait with script loading until we receive a confirmation (first
diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el
index e61156f..b11721d 100644
--- a/lisp/erc/erc-lang.el
+++ b/lisp/erc/erc-lang.el
@@ -197,7 +197,7 @@ Normungsinstitut (ON), Postfach 130, A-1021 Vienna, 
   "Return the language name for the ISO CODE."
   (interactive (list (completing-read "ISO language code: "
-  (message (cdr (assoc code iso-638-languages))))
+  (message "%s" (cdr (assoc code iso-638-languages))))
 (defun erc-cmd-LANG (language)
   "Display the language name for the language code given by LANGUAGE."
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 64b0405..ae9bb51 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -412,8 +412,8 @@ NOW is position of point currently."
   (when erc-echo-timestamps
     (let ((stamp (get-text-property now 'timestamp)))
       (when stamp
-       (message (format-time-string erc-echo-timestamp-format
-                                    stamp))))))
+       (message "%s" (format-time-string erc-echo-timestamp-format
+                                         stamp))))))
 (provide 'erc-stamp)
diff --git a/lisp/gnus/ecomplete.el b/lisp/gnus/ecomplete.el
index 42a7591..285aca4 100644
--- a/lisp/gnus/ecomplete.el
+++ b/lisp/gnus/ecomplete.el
@@ -119,7 +119,7 @@
       (if (not choose)
-           (message matches)
+           (message "%s" matches)
        (setq highlight (ecomplete-highlight-match-line matches line))
        (while (not (memq (setq command (read-event highlight)) '(? return)))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b082a8b..826fdd7 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -4028,7 +4028,7 @@ If NO-DISPLAY, don't generate a summary buffer."
   "Query where the respool algorithm would put this article."
-  (message (gnus-general-simplify-subject (gnus-summary-article-subject))))
+  (message "%s" (gnus-general-simplify-subject 
 (defun gnus-gather-threads-by-subject (threads)
   "Gather threads by looking at Subject headers."
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index e7c9b63..d7add6f 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -558,7 +558,7 @@ To get complete usage, invoke:
         (while l
           (setq count (1+ count))
           (if (= (% count 10000) 0)
-              (message (format "%d entries" count)))
+              (message "%d entries" count))
           (setq entry (skkdic-extract-conversion-data (car l)))
           (set-nested-alist (car entry) (cdr entry) map)
           (setq l (cdr l)))
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 096d35b..ebb3a4a 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -404,7 +404,7 @@ Optional arg EMPTY is message to print if no macros are 
                   (format " [%s]"
                           (format kmacro-counter-format-start kmacro-counter)))
                 (if z (substring m 0 (1- x)) m) (if z "..." "")))
-    (message (or empty "No keyboard macros defined"))))
+    (message "%s" (or empty "No keyboard macros defined"))))
 (defun kmacro-repeat-on-last-key (keys)
diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el
index 24dd9ab..0777c60 100644
--- a/lisp/mail/reporter.el
+++ b/lisp/mail/reporter.el
@@ -118,7 +118,7 @@ composed.")
   "Periodically output a status message."
   (if (zerop (% reporter-status-count 10))
-       (message reporter-status-message)
+       (message "%s" reporter-status-message)
        (setq reporter-status-message (concat reporter-status-message "."))))
   (setq reporter-status-count (1+ reporter-status-count)))
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index ef24de4..a1a0e0c 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1708,13 +1708,13 @@ With prefix ARG, go to the next low priority buffer 
with activity."
            (recenter -1)))
       (if (eq major-mode 'rcirc-mode)
          (switch-to-buffer (rcirc-non-irc-buffer))
-       (message (concat
-                 "No IRC activity."
-                 (when lopri
-                   (concat
-                    "  Type C-u "
-                    (key-description (this-command-keys))
-                    " for low priority activity."))))))))
+       (message "%s" (concat
+                      "No IRC activity."
+                      (when lopri
+                        (concat
+                         "  Type C-u "
+                         (key-description (this-command-keys))
+                         " for low priority activity."))))))))
 (defvar rcirc-activity-hooks nil
   "Hook to be run when there is channel activity.
diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el
index 4cd3bd6..8b40b41 100644
--- a/lisp/play/mpuz.el
+++ b/lisp/play/mpuz.el
@@ -489,7 +489,7 @@ You may abort a game by typing 
                               ((< mpuz-nb-errors 10)   "bad!")
                               ((< mpuz-nb-errors 15)   "awful.")
                               (t                       "not serious.")))))
-    (message message)
+    (message "%s" message)
     (sit-for 4)
     (if (y-or-n-p (concat message "  Start a new game? "))
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 9f6e70d..3750eed 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -1875,7 +1875,7 @@ cell where the two values determine the area inside the 
                                        (read initial)
                               (cdr value))))
-       (message (cadr value))
+       (message (and (cadr value) "%s") (cadr value))
        (setq value nil)))
     ;; insert value ----------------------------------------------------------
     (if (consp old)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 4a397a9..4f10f4f 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -4581,7 +4581,7 @@ the sections using `cperl-pod-head-face', 
                                           (setq qtag "Can't find })")))
                                    (goto-char (1- e))
-                                   (message qtag))
+                                   (message "%s" qtag))
                                 (1- tag) (1- (point))
                                 'face font-lock-variable-name-face)
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 5acbe70..3fe83d9 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -896,10 +896,10 @@ this is the first progress message displayed."
   (let (message-log-max)
     (when start (setq ebrowse-n-boxes 0))
     (setq ebrowse-n-boxes (mod (1+ ebrowse-n-boxes) ebrowse-max-boxes))
-    (message (concat title ": "
-                    (propertize (make-string ebrowse-n-boxes
-                                             (if (display-color-p) ?\  ?+))
-                                'face 'ebrowse-progress)))))
+    (message "%s: %s" title
+            (propertize (make-string ebrowse-n-boxes
+                                     (if (display-color-p) ?\  ?+))
+                        'face 'ebrowse-progress))))
 ;;; Reading a tree from disk
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 9648494..49e8859 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -3799,7 +3799,7 @@ unless the optional second argument NOINDENT is non-nil."
       (if (not noindent)
          (indent-region beg end nil))
       (if (stringp prompt)
-         (message prompt)))))
+         (message "%s" prompt)))))
 (defun idlwave-rw-case (string)
   "Make STRING have the case required by `idlwave-reserved-word-upcase'."
@@ -7038,7 +7038,7 @@ sort the list before displaying"
                         (select-window win)
                         (eval idlwave-complete-after-success-form))
                     (set-window-start cwin (point-min)))))
-         (and message (message message)))
+         (and message (message "%s" message)))
       (select-window win))))
 (defun idlwave-display-completion-list (list &optional message beg complete)
@@ -7069,7 +7069,7 @@ sort the list before displaying"
   (run-hooks 'idlwave-completion-setup-hook)
   ;; Display the message
-  (message (or message "Making completion list...done")))
+  (message "%s" (or message "Making completion list...done")))
 (defun idlwave-choose (function &rest args)
   "Call FUNCTION as a completion chooser and pass ARGS to it."
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index df315e4..a9f93b4 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -10432,7 +10432,7 @@ with double-quotes is to be inserted.  DEFAULT 
specifies a default string."
   "Query a decision from the user."
   (let ((start (point)))
     (when string (vhdl-insert-keyword (concat string " ")))
-    (message prompt)
+    (message (and prompt "%s") prompt)
     (let ((char (read-char)))
       (delete-region start (point))
       (if (and optional (eq char ?\r))
diff --git a/lisp/replace.el b/lisp/replace.el
index 34fdd5f..d290275 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1405,19 +1405,29 @@ with the `noescape' argument set.
   "Like `match-data', but markers in REUSE get invalidated.
 If NEW is non-nil, it is set and returned instead of fresh data,
 but coerced to the correct value of INTEGERS."
-  (or (and new
+  (if (and new
             (set-match-data new)
-            (and (eq new reuse)
-                 (eq (null integers) (markerp (car reuse)))
-                 new)))
-      (match-data integers reuse t)))
-(defun replace-match-maybe-edit (newtext fixedcase literal noedit match-data)
+            (eq new reuse))
+          (cond
+           ((markerp (car new)) (null integers))
+           ((bufferp (car (last new))) integers)
+           (t)))
+      new
+    (match-data integers reuse t)))
+(defun replace-match-maybe-edit (newtext fixedcase literal noedit match-data
+                                        &optional string)
   "Make a replacement with `replace-match', editing `\\?'.
-NEWTEXT, FIXEDCASE, LITERAL are just passed on.  If NOEDIT is true, no
-check for `\\?' is made to save time.  MATCH-DATA is used for the
-replacement.  In case editing is done, it is changed to use markers.
+NEWTEXT, FIXEDCASE, LITERAL are just passed on.  If NOEDIT is
+true, no check for `\\?' is made to save time.  MATCH-DATA is
+used for the replacement.  Optional STRING indicates a source
+string to perform the modification in, if nil, the current bugger
+is used.
+In case replacement string editing is offered, buffer-based
+match-data is changed to use markers since one can temporarily
+visit the buffer for edits while editing the replacement string.
 The return value is non-nil if there has been no `\\?' or NOEDIT was
 passed in.  If LITERAL is set, no checking is done, anyway."
@@ -1436,7 +1446,7 @@ passed in.  If LITERAL is set, no checking is done, 
                                   nil match-data match-data))))
            noedit nil)))
   (set-match-data match-data)
-  (replace-match newtext fixedcase literal)
+  (replace-match newtext fixedcase literal string)
 (defun perform-replace (from-string replacements
diff --git a/lisp/startup.el b/lisp/startup.el
index 366491f..0f0bfd9 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1537,7 +1537,7 @@ splash screen in another window."
          (apply #'fancy-splash-insert text)
          (insert "\n"))
        (unless (current-message)
-         (message fancy-splash-help-echo))
+         (message (and fancy-splash-help-echo "%s") fancy-splash-help-echo))
        (set-buffer-modified-p nil)
        (goto-char (point-min))
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 1f00939..b6db7a2 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -2178,7 +2178,7 @@ either in the current buffer or in the echo area."
     (if (not buffer-read-only)
        (insert text)
       (kill-new text)
-      (message
+      (message "%s"
        "The text from the Services menu can be accessed with \\[yank]")))))
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index f044290..12c4d6f 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -1151,14 +1151,14 @@ PREV-OP-ARG are used when invoked recursively during 
the build-up."
   (let ((next-op (cdr (cdr (assoc artist-curr-go artist-prev-next-op-alist)))))
     (artist-select-operation next-op)
-    (message next-op)))
+    (message (and next-op "%s") next-op)))
 (defun artist-select-prev-op-in-list ()
   "Cyclically select previous drawing mode operation."
   (let ((prev-op (car (cdr (assoc artist-curr-go artist-prev-next-op-alist)))))
     (artist-select-operation prev-op)
-    (message prev-op)))
+    (message (and prev-op "%s") prev-op)))
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 0535f67..124f6c4 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -7487,7 +7487,7 @@ When TAG is non-nil, don't move trees, but mark them with 
the ARCHIVE tag."
        (org-hide-archived-subtrees beg end)
        (goto-char beg)
        (if (looking-at (concat ".*:" org-archive-tag ":"))
-           (message (substitute-command-keys
+           (message "%s" (substitute-command-keys
                      "Subtree is archived and stays closed.  Use 
\\[org-force-cycle-archived] to cycle it anyway.")))))))
 (defun org-force-cycle-archived ()
@@ -9366,7 +9366,9 @@ of the new mark."
          (goto-line l1)))
     (if (not (= epos (point-at-eol))) (org-table-align))
     (goto-line l)
-    (and (interactive-p) (message (cdr (assoc new org-recalc-marks))))))
+    (when (interactive-p)
+      (setq new (cdr (assoc new org-recalc-marks)))
+      (message (and new "%s") new))))
 (defun org-table-maybe-recalculate-line ()
   "Recompute the current line if marked for it, and if we haven't just done 
@@ -12347,7 +12349,7 @@ to read."
   (move-marker (car org-mark-ring)
               (or pos (point))
               (or buffer (current-buffer)))
-  (message
+  (message "%s"
     "Position saved to mark ring, go back with \\[org-mark-ring-goto].")))
@@ -12429,7 +12431,7 @@ onto the ring."
         (if (match-string 2 name) ; If there isn't a node, choose "Top"
             (Info-find-node (match-string 1 name) (match-string 2 name))
           (Info-find-node (match-string 1 name) "Top")))
-    (message (concat "Could not open: " name))))
+    (message "Could not open: %s" name)))
 (defun org-follow-gnus-link (&optional group article)
   "Follow a Gnus link to GROUP and ARTICLE."
@@ -12553,7 +12555,7 @@ sequences, it will now work."
     (re-search-forward "^\\(+.*\\)$" nil t)
-    (message (match-string 1))))
+    (message "%s" (match-string 1))))
 (defun org-mhe-get-message-folder ()
   "Return the name of the current message folder.  Be careful if you
@@ -13759,7 +13761,7 @@ This function should be run in the 
          (org-timestamp-change n (cdr (assoc what whata))))
        (setq msg (concat msg type org-last-changed-timestamp " ")))
       (setq org-log-post-message msg)
-      (message msg))))
+      (message "%s" msg))))
 (defun org-show-todo-tree (arg)
   "Make a compact tree which shows all headlines marked with TODO.
@@ -13978,7 +13980,7 @@ The auto-repeater uses this.")
   (with-current-buffer (marker-buffer org-log-note-return-to)
     (goto-char org-log-note-return-to))
   (move-marker org-log-note-return-to nil)
-  (and org-log-post-message (message org-log-post-message)))
+  (and org-log-post-message (message "%s" org-log-post-message)))
 ;; FIXME: what else would be useful?
 ;; - priority
@@ -15216,10 +15218,10 @@ in the current file."
    (let* ((prop (completing-read
                 "Property: " (org-entry-properties nil 'standard))))
      (list prop)))
-  (message (concat "Property " property
-                  (if (org-entry-delete nil property)
-                      " deleted"
-                    " was not present in the entry"))))
+  (message "Property %s %s" property
+          (if (org-entry-delete nil property)
+              "deleted"
+            "was not present in the entry")))
 (defun org-delete-property-globally (property)
   "Remove PROPERTY globally, from all entries."
@@ -16863,7 +16865,7 @@ days in order to avoid rounding problems."
        d (floor (+ (/ diff ds) 0.5))
        h 0 m 0))
      (if (not to-buffer)
-        (message (org-make-tdiff-string y d h m))
+        (message "%s" (org-make-tdiff-string y d h m))
        (when (org-at-table-p)
         (goto-char match-end)
         (setq align t)
@@ -18806,7 +18808,7 @@ the buffer and restores the previous window 
                        (message "New agenda file list installed"))
                      nil 'local)
-       (message (substitute-command-keys
+       (message "%s" (substitute-command-keys
                  "Edit list and finish with \\[save-buffer]")))
     (customize-variable 'org-agenda-files)))
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 73bcf6d..5b2d62c 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -367,7 +367,7 @@ _ ^        Add/Remove parent key (to make this item a 
             (goto-char (or pos (point-min)))
             (or (looking-at re)
                 (reftex-nearest-match re (length literal))))
-           (t (message reftex-no-follow-message) nil))))
+           (t (message "%s" reftex-no-follow-message) nil))))
     (when match
       (goto-char (match-beginning 0))
       (recenter '(4))
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index d1d979b..e3d8b3e 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -626,7 +626,7 @@ point."
             (message "%d section%s %smoted" 
                      nsec (if (= 1 nsec) "" "s") pro-or-de)
-    (if msg (progn (ding) (message msg)))))
+    (if msg (progn (ding) (message "%s" msg)))))
 (defun reftex-toc-restore-region (point-line &optional mark-line)
@@ -833,7 +833,7 @@ label prefix determines the wording of a reference."
                      (reftex-get-file-buffer-force file nil))
                     (goto-char (if (eq where 'bof) (point-min) (point-max))))
-                (message reftex-no-follow-message) nil))))
+                (message "%s" reftex-no-follow-message) nil))))
      ((stringp (car toc))
       ;; a label
@@ -900,7 +900,7 @@ label prefix determines the wording of a reference."
                        (reftex-make-regexp-allow-for-ctrl-m literal) len)
                        (reftex-make-desperate-section-regexp literal) len)))))
-           (t (message reftex-no-follow-message) nil))))
+           (t (message "%s" reftex-no-follow-message) nil))))
     (when match
       (goto-char (match-beginning 0))
       (if (not (= (point) (point-max))) (recenter 1))
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 5383d88..d6ec294 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1978,7 +1978,7 @@ Works on both Emacs and XEmacs."
   (let ((char ?\?))
       (catch 'exit
-        (message (concat prompt "   (?=Help)"))
+        (message "%s   (?=Help)" prompt)
         (when (or (sit-for (or delay-time 0))
                   (= ?\? (setq char (read-char-exclusive))))
           (reftex-kill-buffer "*RefTeX Select*")
@@ -1994,17 +1994,17 @@ Works on both Emacs and XEmacs."
                  (pos-visible-in-window-p (point-max)))
           (setq prompt (concat prompt (if scroll "   (SPC/DEL=Scroll)" ""))))
-        (message prompt)
+        (message "%s" prompt)
         (and (equal char ?\?) (setq char (read-char-exclusive)))
         (while t
           (cond ((equal char ?\C-g) (keyboard-quit))
                 ((equal char ?\?))
                 ((and scroll (equal char ?\ ))
                  (condition-case nil (scroll-up) (error nil))
-                 (message prompt))
+                 (message "%s" prompt))
                 ((and scroll (equal char ?\C-? ))
                  (condition-case nil (scroll-down) (error nil))
-                 (message prompt))
+                 (message "%s" prompt))
                 (t (message "") 
                    (throw 'exit char)))
           (setq char (read-char-exclusive)))))))

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

[Prev in Thread] Current Thread [Next in Thread]