emacs-diffs
[Top][All Lists]
Advanced

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

master 43c1ee9 3/3: Don't use `format' on strings without % format direc


From: Lars Ingebrigtsen
Subject: master 43c1ee9 3/3: Don't use `format' on strings without % format directives
Date: Tue, 21 Sep 2021 11:53:04 -0400 (EDT)

branch: master
commit 43c1ee90cb3333dc2643e58cf607399b0abebf43
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Don't use `format' on strings without % format directives
    
    * lisp/vc/ediff-init.el (ediff-BAD-INFO):
    * lisp/url/url-ldap.el (url-ldap):
    * lisp/url/url-http.el (url-http--user-agent-default-string):
    * lisp/textmodes/reftex.el (reftex-access-parse-file):
    * lisp/textmodes/reftex-index.el (reftex-index-phrases-info):
    * lisp/textmodes/ispell.el (ispell-create-debug-buffer):
    * lisp/term.el (serial-read-speed):
    * lisp/progmodes/verilog-mode.el (verilog-scan-debug):
    * lisp/progmodes/idlwave.el (idlwave-find-module):
    * lisp/progmodes/compile.el (compilation-revert-buffer):
    * lisp/org/org-agenda.el (org-search-view):
    * lisp/net/telnet.el (telnet-revert-buffer):
    * lisp/net/soap-inspect.el (soap-sample-value-for-xs-simple-type):
    * lisp/net/newst-backend.el (newsticker--cache-read):
    * lisp/mh-e/mh-seq.el (mh-msg-is-in-seq):
    * lisp/mail/smtpmail.el (smtpmail-via-smtp):
    * lisp/mail/emacsbug.el (report-emacs-bug):
    * lisp/jsonrpc.el (jsonrpc-error):
    * lisp/help-fns.el (describe-variable):
    * lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt):
    * lisp/gnus/gnus.el (gnus-group-startup-message):
    (gnus-group-startup-message):
    * lisp/gnus/gnus-group.el (gnus-group-restart):
    * lisp/frame.el (make-frame-on-display):
    * lisp/emulation/viper-ex.el (ex-help):
    * lisp/calendar/icalendar.el (icalendar--convert-ical-to-diary):
    (icalendar--add-diary-entry):
    * lisp/calendar/cal-tex.el (cal-tex-end-document):
    * lisp/calc/calcalg3.el (math-ninteg-romberg): Don't use `format'
    on strings that have no % format directives in them.
---
 lisp/calc/calcalg3.el          | 2 +-
 lisp/calendar/cal-tex.el       | 4 ++--
 lisp/calendar/icalendar.el     | 5 ++---
 lisp/emulation/viper-ex.el     | 4 ++--
 lisp/frame.el                  | 5 ++---
 lisp/gnus/gnus-group.el        | 3 +--
 lisp/gnus/gnus.el              | 4 ++--
 lisp/gnus/mm-decode.el         | 3 +--
 lisp/help-fns.el               | 2 +-
 lisp/jsonrpc.el                | 2 +-
 lisp/mail/emacsbug.el          | 2 +-
 lisp/mail/smtpmail.el          | 6 +++---
 lisp/mh-e/mh-seq.el            | 2 +-
 lisp/net/newst-backend.el      | 2 +-
 lisp/net/soap-inspect.el       | 2 +-
 lisp/net/telnet.el             | 2 +-
 lisp/org/org-agenda.el         | 2 +-
 lisp/progmodes/compile.el      | 2 +-
 lisp/progmodes/idlwave.el      | 2 +-
 lisp/progmodes/verilog-mode.el | 2 +-
 lisp/term.el                   | 3 +--
 lisp/textmodes/ispell.el       | 3 +--
 lisp/textmodes/reftex-index.el | 2 +-
 lisp/textmodes/reftex.el       | 2 +-
 lisp/url/url-http.el           | 2 +-
 lisp/url/url-ldap.el           | 2 +-
 lisp/vc/ediff-init.el          | 4 ++--
 27 files changed, 35 insertions(+), 41 deletions(-)

diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el
index 3cb1886..a61cdb5 100644
--- a/lisp/calc/calcalg3.el
+++ b/lisp/calc/calcalg3.el
@@ -1484,7 +1484,7 @@
                      h (cdr h)))
            (setq curh (math-div-float curh '(float 9 0))))
          ss
-         (math-reject-arg nil (format "*Integral failed to converge"))))))
+         (math-reject-arg nil "*Integral failed to converge")))))
 
 
 (defun math-ninteg-evaluate (expr x mode)
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index 75e106c..c5b456c 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -1648,10 +1648,10 @@ informative header, and run HOOK."
   (goto-char (point-min))
   ;; FIXME auctex equivalents?
   (cal-tex-comment
-   (format "\tThis buffer was produced by cal-tex.el.
+   "\tThis buffer was produced by cal-tex.el.
 \tTo print a calendar, type
 \t\tM-x tex-buffer RET
-\t\tM-x tex-print  RET")))
+\t\tM-x tex-print  RET"))
 
 (defun cal-tex-insert-preamble (weeks &optional class-options append)
   "Initialize the output LaTeX calendar buffer, `cal-tex-buffer'.
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 312d5e2..2d31101 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -2182,8 +2182,7 @@ written into the buffer `*icalendar-errors*'."
               (setq diary-string "")
               (mapc (lambda (_datestring)
                      (setq diary-string
-                           (concat diary-string
-                                   (format "......"))))
+                           (concat diary-string "......")))
                    (icalendar--split-value rdate)))
              ;; non-recurring event
              ;; all-day event
@@ -2528,7 +2527,7 @@ the entry."
                                       summary)))
     (when summary
       (setq non-marking
-            (y-or-n-p (format "Make appointment non-marking? "))))
+            (y-or-n-p "Make appointment non-marking? ")))
     (unless diary-filename
       (setq diary-filename
             (read-file-name "Add appointment to this diary file: ")))
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index b1cbcc5..ef15779 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -1876,11 +1876,11 @@ reversed."
        (message "Type `i' to search for a specific topic"))
     (error (beep 1)
           (with-output-to-temp-buffer " *viper-info*"
-            (princ (format "
+            (princ "
 The Info file for Viper does not seem to be installed.
 
 This file is part of the standard distribution of Emacs.
-Please contact your system administrator. "))))))
+Please contact your system administrator. ")))))
 
 ;; Ex source command.
 ;; Loads the file specified as argument or viper-custom-file-name.
diff --git a/lisp/frame.el b/lisp/frame.el
index 60234fc..e97b990 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -701,9 +701,8 @@ Return nil if we don't know how to interpret DISPLAY."
   "Make a frame on display DISPLAY.
 The optional argument PARAMETERS specifies additional frame parameters."
   (interactive (if (fboundp 'x-display-list)
-                   (list (completing-read
-                          (format "Make frame on display: ")
-                          (x-display-list)))
+                   (list (completing-read "Make frame on display: "
+                                          (x-display-list)))
                  (user-error "This Emacs build does not support X displays")))
   (make-frame (cons (cons 'display display) parameters)))
 
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index bedae0f..83c9535 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -4398,8 +4398,7 @@ If FORCE, force saving whether it is necessary or not."
 (defun gnus-group-restart (&optional _arg)
   "Force Gnus to read the .newsrc file."
   (interactive nil gnus-group-mode)
-  (when (gnus-yes-or-no-p
-        (format "Are you sure you want to restart Gnus? "))
+  (when (gnus-yes-or-no-p "Are you sure you want to restart Gnus? ")
     (gnus-save-newsrc-file)
     (gnus-clear-system)
     (gnus)))
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 7c98334..f558360 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -798,7 +798,7 @@ be used directly.")
               (goto-char (point-min))
                t)))
     (insert
-     (format "
+     "
          _    ___ _             _
          _ ___ __ ___  __    _ ___
          __   _     ___    __  ___
@@ -817,7 +817,7 @@ be used directly.")
            _
          __
 
-"))
+")
     ;; And then hack it.
     (gnus-indent-rigidly (point-min) (point-max)
                         (/ (max (- (window-width) (or x 46)) 0) 2))
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 82d1de2..aca4bf2 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1676,8 +1676,7 @@ If RECURSIVE, search recursively."
                    ((eq mm-decrypt-option 'never) nil)
                    ((eq mm-decrypt-option 'always) t)
                    ((eq mm-decrypt-option 'known) t)
-                   (t (y-or-n-p
-                       (format "Decrypt (S/MIME) part? "))))
+                   (t (y-or-n-p "Decrypt (S/MIME) part? ")))
                   (mm-view-pkcs7 parts from))
          (goto-char (point-min))
          ;; The encrypted document is a MIME part, and may use either
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 63d3905..6be5cd4 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1181,7 +1181,7 @@ it is displayed along with the global value."
                 (princ (format "Local in buffer %s; "
                                (buffer-name buffer))))
                ((terminal-live-p locus)
-                (princ (format "It is a terminal-local variable; ")))
+                (princ "It is a terminal-local variable; "))
                (t
                 (princ (format "It is local to %S" locus))))
              (if (not (default-boundp variable))
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 6b5abcb..02db199 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -219,7 +219,7 @@ object, using the keywords `:code', `:message' and `:data'."
                   (jsonrpc-error-message . ,msg))))
     (cl-destructuring-bind (&key code message data) args
       (signal 'jsonrpc-error
-              `(,(format "[jsonrpc] error ")
+              `("[jsonrpc] error "
                 (jsonrpc-error-code . ,code)
                 (jsonrpc-error-message . ,message)
                 (jsonrpc-error-data . ,data))))))
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 14c93f2..3da1e8b 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -340,7 +340,7 @@ usually do not have translators for other languages.\n\n")))
     (insert (format "\nFeatures:\n%s\n" features))
     (fill-region (line-beginning-position 0) (point))
 
-    (insert (format "\nMemory information:\n"))
+    (insert "\nMemory information:\n")
     (pp (garbage-collect) (current-buffer))
 
     ;; This is so the user has to type something in order to send easily.
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index ec9f340..bd8aa61 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -829,15 +829,15 @@ Returns an error if the server cannot be contacted."
 
            (when (or (member 'onex supported-extensions)
                      (member 'xone supported-extensions))
-             (smtpmail-command-or-throw process (format "ONEX")))
+             (smtpmail-command-or-throw process "ONEX"))
 
            (when (and smtpmail-debug-verb
                       (or (member 'verb supported-extensions)
                           (member 'xvrb supported-extensions)))
-             (smtpmail-command-or-throw process (format "VERB")))
+             (smtpmail-command-or-throw process "VERB"))
 
            (when (member 'xusr supported-extensions)
-             (smtpmail-command-or-throw process (format "XUSR")))
+             (smtpmail-command-or-throw process "XUSR"))
 
            ;; MAIL FROM:<sender>
            (let ((size-part
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index 9cdf39f..a50319a 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -187,7 +187,7 @@ MESSAGE appears."
     (message "Message %d%s is in sequences: %s"
              message
              (cond (dest-folder (format " (to be refiled to %s)" dest-folder))
-                   (deleted-flag (format " (to be deleted)"))
+                   (deleted-flag " (to be deleted)")
                    (t ""))
              (mapconcat #'concat
                         (mh-list-to-string (mh-seq-containing-msg message t))
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index dc54194..27ea713 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -2183,7 +2183,7 @@ FEED is a symbol!"
       (progn
         (when (y-or-n-p "Old newsticker cache file exists.  Read it? ")
           (newsticker--cache-read-version1))
-        (when (y-or-n-p (format "Delete old newsticker cache file? "))
+        (when (y-or-n-p "Delete old newsticker cache file? ")
           (delete-file newsticker-cache-filename)))
     (dolist (f (append newsticker-url-list-defaults newsticker-url-list))
       (newsticker--cache-read-feed (car f)))))
diff --git a/lisp/net/soap-inspect.el b/lisp/net/soap-inspect.el
index 2192a68..b994b0e 100644
--- a/lisp/net/soap-inspect.el
+++ b/lisp/net/soap-inspect.el
@@ -124,7 +124,7 @@ This is a specialization of `soap-sample-value' for
          (format "a string between %d and %d chars long" low high))
         (low (format "a string at least %d chars long" low))
         (high (format "a string at most %d chars long" high))
-        (t (format "a string OOPS")))))
+        (t "a string OOPS"))))
     ((soap-xs-simple-type-integer-range type)
      (cl-destructuring-bind (min . max) (soap-xs-simple-type-integer-range 
type)
        (cond
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 1716853..1cf07a5 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -107,7 +107,7 @@ rejecting one login and prompting again for a username and 
password.")
       (let (revert-buffer-function)
         (revert-buffer ignore-auto noconfirm))
     (if (or noconfirm
-            (yes-or-no-p (format "Restart connection? ")))
+            (yes-or-no-p "Restart connection? "))
         (apply telnet-connect-command))))
 
 (defun telnet-c-z ()
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 3acc187..489e6c7 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -4531,7 +4531,7 @@ is active."
                      'org-todo-regexp org-todo-regexp
                      'org-complex-heading-regexp org-complex-heading-regexp
                      'mouse-face 'highlight
-                     'help-echo (format "mouse-2 or RET jump to location")))
+                     'help-echo "mouse-2 or RET jump to location"))
         (full-words org-agenda-search-view-force-full-words)
         (org-agenda-text-search-extra-files org-agenda-text-search-extra-files)
         regexp rtn rtnall files file pos inherited-tags
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 431b01b..6b521e8 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2260,7 +2260,7 @@ by replacing the first word, e.g., 
`compilation-scroll-output' from
   (if buffer-file-name
       (let (revert-buffer-function)
        (revert-buffer ignore-auto noconfirm))
-    (if (or noconfirm (yes-or-no-p (format "Restart compilation? ")))
+    (if (or noconfirm (yes-or-no-p "Restart compilation? "))
        (apply #'compilation-start compilation-arguments))))
 
 (defvar compilation-current-error nil
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index e95abd8..36f8a6d 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -7786,7 +7786,7 @@ force class query for object methods."
                (if (or (not this-buffer)
                        (assoc default list))
                    (format-prompt "Module" default)
-                 (format "Module in this file: "))
+                 "Module in this file: ")
                list))
         type class)
     (if (string-match "\\`\\s-*\\'" name)
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index ef2c21d..75d2ea6 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -3563,7 +3563,7 @@ either is ok to parse as a non-comment, or 
`verilog-insert' was used."
 (defun verilog-scan-debug ()
   "For debugging, show with display face results of `verilog-scan'."
   (font-lock-mode 0)
-  ;;(if dbg (setq dbg (concat dbg (format "verilog-scan-debug\n"))))
+  ;;(if dbg (setq dbg (concat dbg "verilog-scan-debug\n")))
   (save-excursion
     (goto-char (point-min))
     (remove-text-properties (point-min) (point-max) '(face nil))
diff --git a/lisp/term.el b/lisp/term.el
index 42b2e5a..d3d0218 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -4322,8 +4322,7 @@ Try to be nice by providing useful defaults and history."
                     "Speed (default nil = set by port): ")
                    (h
                     (format-prompt "Speed" (format "%s b/s" h)))
-                   (t
-                   (format "Speed (b/s): ")))
+                   (t "Speed (b/s): "))
              nil nil nil '(history . 1) nil nil)))
     (when (or (null x) (and (stringp x) (zerop (length x))))
       (setq x h))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5842bf5..b650ab3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -758,8 +758,7 @@ See `ispell-buffer-with-debug' for an example of use."
   (let ((ispell-debug-buffer (get-buffer-create "*ispell-debug*")))
     (with-current-buffer ispell-debug-buffer
       (if append
-         (insert
-          (format "-----------------------------------------------\n"))
+         (insert "-----------------------------------------------\n")
        (erase-buffer)))
     ispell-debug-buffer))
 
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index a6df4fb..423c539 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -1666,7 +1666,7 @@ this function repeatedly."
          (repeat
           (princ (format "  Index entry:  %s\n" phrase)))
          (t
-          (princ (format "    Index key:  <<Given by the match>>\n"))))
+          (princ "    Index key:  <<Given by the match>>\n")))
         (princ (format "      Example:  %s\n" example))
         (terpri)
         (princ (format "Total matches:  %s in %s\n"
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index c926b05..f7424b6 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1208,7 +1208,7 @@ Valid actions are: readable, restore, read, kill, write."
         (if (file-writable-p file)
             (with-temp-file file
               (message "Writing parse file %s" (abbreviate-file-name file))
-              (insert (format ";; RefTeX parse info file\n"))
+              (insert ";; RefTeX parse info file\n")
               (insert (format ";; File: %s\n" master))
               (insert (format ";; User: %s (%s)\n\n"
                               (user-login-name) (user-full-name)))
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index dbd33fd..44ebede 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -225,7 +225,7 @@ request.")
         (os-info (unless (and (listp url-privacy-level)
                               (memq 'os url-privacy-level))
                    (format "(%s; %s)" url-system-type url-os-type)))
-        (url-info (format "URL/Emacs")))
+        (url-info "URL/Emacs"))
     (string-join (delq nil (list package-info url-info
                                  emacs-info os-info))
                  " ")))
diff --git a/lisp/url/url-ldap.el b/lisp/url/url-ldap.el
index d26562b..5d18f85 100644
--- a/lisp/url/url-ldap.el
+++ b/lisp/url/url-ldap.el
@@ -218,7 +218,7 @@ URL can be a URL string, or a URL record of the type 
returned by
                                    "</td></tr>\n")
                          ;; Multiple matches, slightly uglier
                          (insert "   <tr>\n"
-                                 (format "    <td valign=top>")
+                                 "    <td valign=top>"
                                  (url-ldap-attribute-pretty-name (car attr)) 
"</td><td>"
                                  (mapconcat (lambda (x)
                                               (url-ldap-attribute-pretty-desc 
(car attr) x))
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index 069364f..eaccb7a 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -490,11 +490,11 @@ set local variables that determine how the display looks 
like."
 (defconst ediff-BAD-DIFF-NUMBER
   ;; %S stands for this-command, %d - diff number, %d - max diff
   "%S: Bad diff region number, %d.  Valid numbers are 1 to %d")
-(defconst ediff-BAD-INFO (format "
+(defconst ediff-BAD-INFO "
 *** The Info file for Ediff, a part of the standard distribution
 *** of Emacs, does not seem to be properly installed.
 ***
-*** Please contact your system administrator. "))
+*** Please contact your system administrator. ")
 
 ;; Selective browsing
 



reply via email to

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