From: Stefan Monnier Date: Thu, 2 Jan 2025 19:29:49 +0000 (-0500) Subject: Prefer `%S` format over `%s` for non strings X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=354c2e6219a40427a17723039625c34138331612;p=emacs.git Prefer `%S` format over `%s` for non strings * lisp/reveal.el (reveal-open-new-overlays, reveal-close-old-overlays): * lisp/gnus/nnimap.el (nnimap-header-parameters) (nnimap-make-process-buffer): * lisp/gnus/nntp.el (nntp-make-process-buffer): * lisp/progmodes/flymake.el (flymake--disable-backend): * lisp/simple.el (next-error-internal): Prefer `%S` format over `%s` for non strings. (cherry picked from commit fba3c7ff3f68f05d32541440e0a22ec667c0ad66) --- diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 2ad45935b19..b9c6586c03f 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -221,13 +221,13 @@ during splitting, which may be slow." (push "BODYSTRUCTURE" params) (push (format (if (nnimap-ver4-p) - "BODY.PEEK[HEADER.FIELDS %s]" - "RFC822.HEADER.LINES %s") + "BODY.PEEK[HEADER.FIELDS %S]" + "RFC822.HEADER.LINES %S") (append '(Subject From Date Message-Id References In-Reply-To Xref) nnmail-extra-headers)) params) - (format "%s" (nreverse params)))) + (format "(%s)" (mapconcat #'identity (nreverse params) " ")))) (defvar nnimap--max-retrieve-headers 200) @@ -386,7 +386,7 @@ during splitting, which may be slow." (defun nnimap-make-process-buffer (buffer) (with-current-buffer - (generate-new-buffer (format " *nnimap %s %s %s*" + (generate-new-buffer (format " *nnimap %s %s %S*" nnimap-address nnimap-server-port buffer)) (mm-disable-multibyte) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index a086421b049..aaa80e035ea 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1189,7 +1189,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the "Create a new, fresh buffer usable for nntp process connections." (with-current-buffer (generate-new-buffer - (format " *server %s %s %s*" + (format " *server %s %s %S*" nntp-address nntp-port-number buffer)) (gnus-add-buffer) (mm-disable-multibyte) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 1bdeed37574..3ab48b0a542 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1426,7 +1426,7 @@ If MESSAGE-PREFIX, echo a message using that prefix." (defun flymake--disable-backend (backend &optional explanation) "Disable BACKEND because EXPLANATION. If it is running also stop it." - (flymake-log :warning "Disabling backend %s because %s" backend explanation) + (flymake-log :warning "Disabling backend %s because %S" backend explanation) (flymake--with-backend-state backend state (setf (flymake--state-running state) nil (flymake--state-disabled state) explanation diff --git a/lisp/reveal.el b/lisp/reveal.el index 44331c2abcd..46d5c94fd58 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el @@ -145,7 +145,7 @@ Each element has the form (WINDOW . OVERLAY).") (setq repeat t) (condition-case err (funcall open ol nil) - (error (message "!!Reveal-show (funcall %s %s nil): %s !!" + (error (message "!!Reveal-show (funcall %S %S nil): %S !!" open ol err) ;; Let's default to a meaningful behavior to avoid ;; getting stuck in an infinite loop. @@ -189,7 +189,7 @@ Each element has the form (WINDOW . OVERLAY).") open) (condition-case err (funcall open ol t) - (error (message "!!Reveal-hide (funcall %s %s t): %s !!" + (error (message "!!Reveal-hide (funcall %S %S t): %S !!" open ol err))) (overlay-put ol 'invisible inv)) ;; Remove the overlay from the list of open spots. diff --git a/lisp/simple.el b/lisp/simple.el index c717b21a8fb..de89eabbcc9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -409,7 +409,7 @@ To control which errors are matched, customize the variable (next-error-found buffer (current-buffer)) (when (or next-error-verbose (not (eq prev next-error-last-buffer))) - (message "Current locus from %s" next-error-last-buffer))))) + (message "Current locus from %S" next-error-last-buffer))))) (defun next-error-quit-window (from-buffer to-buffer) "Quit window of FROM-BUFFER when the prefix arg is 0.