diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 17 | ||||
-rw-r--r-- | lisp/emacs-lisp/cconv.el | 11 | ||||
-rw-r--r-- | lisp/emacs-lisp/check-declare.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 12 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/edebug.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/eldoc.el | 4 | ||||
-rw-r--r-- | lisp/emacs-lisp/elint.el | 8 | ||||
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 9 | ||||
-rw-r--r-- | lisp/emacs-lisp/macroexp.el | 11 | ||||
-rw-r--r-- | lisp/emacs-lisp/map-ynp.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/nadvice.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 23 | ||||
-rw-r--r-- | lisp/emacs-lisp/timer.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/warnings.el | 8 |
17 files changed, 66 insertions, 59 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 490d9a8b52c..716e1c69c7b 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -192,7 +192,7 @@ ;; (if (aref byte-code-vector 0) ;; (error "The old version of the disassembler is loaded. Reload new-bytecomp as well")) (byte-compile-log-1 - (apply 'format format + (apply #'format-message format (let (c a) (mapcar (lambda (arg) (if (not (consp arg)) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 0ae7824de1e..2ac926f1879 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -973,7 +973,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (print-level 4) (print-length 4)) (byte-compile-log-1 - (format + (format-message ,format-string ,@(mapcar (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x)) @@ -1120,7 +1120,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." pt) (when dir (unless was-same - (insert (format "Leaving directory ‘%s’\n" default-directory)))) + (insert (format-message "Leaving directory ‘%s’\n" + default-directory)))) (unless (bolp) (insert "\n")) (setq pt (point-marker)) @@ -1135,8 +1136,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (when dir (setq default-directory dir) (unless was-same - (insert (format "Entering directory ‘%s’\n" - default-directory)))) + (insert (format-message "Entering directory ‘%s’\n" + default-directory)))) (setq byte-compile-last-logged-file byte-compile-current-file byte-compile-last-warned-form nil) ;; Do this after setting default-directory. @@ -1154,7 +1155,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (defun byte-compile-warn (format &rest args) "Issue a byte compiler warning; use (format FORMAT ARGS...) for message." - (setq format (apply 'format format args)) + (setq format (apply #'format-message format args)) (if byte-compile-error-on-warn (error "%s" format) ; byte-compile-file catches and logs it (byte-compile-log-warning format t :warning))) @@ -2979,7 +2980,7 @@ for symbols generated by the byte compiler itself." (`(',var . ,_) (when (assq var byte-compile-lexical-variables) (byte-compile-log-warning - (format "%s cannot use lexical var ‘%s’" fn var) + (format-message "%s cannot use lexical var ‘%s’" fn var) nil :error))))) (when (macroexp--const-symbol-p fn) (byte-compile-warn "‘%s’ called as a function" fn)) @@ -2991,8 +2992,8 @@ for symbols generated by the byte compiler itself." (format "; %s" interactive-only)) ((and (symbolp 'interactive-only) (not (eq interactive-only t))) - (format "; use ‘%s’ instead." - interactive-only)) + (format-message "; use ‘%s’ instead." + interactive-only)) (t ".")))) (if (eq (car-safe (symbol-function (car form))) 'macro) (byte-compile-log-warning diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index ac5144c4be0..a20e201add6 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -300,7 +300,8 @@ places where they originally did not directly appear." (prog1 binder (setq binder (list binder))) (when (cddr binder) (byte-compile-log-warning - (format "Malformed ‘%S’ binding: %S" letsym binder))) + (format-message "Malformed ‘%S’ binding: %S" + letsym binder))) (setq value (cadr binder)) (car binder))) (new-val @@ -545,7 +546,7 @@ FORM is the parent form that binds this var." (`((,(and var (guard (eq ?_ (aref (symbol-name var) 0)))) . ,_) ,_ ,_ ,_ ,_) (byte-compile-log-warning - (format "%s ‘%S’ not left unused" varkind var)))) + (format-message "%s ‘%S’ not left unused" varkind var)))) (pcase vardata (`((,var . ,_) nil ,_ ,_ nil) ;; FIXME: This gives warnings in the wrong order, with imprecise line @@ -557,8 +558,8 @@ FORM is the parent form that binds this var." (eq ?_ (aref (symbol-name var) 0)) ;; As a special exception, ignore "ignore". (eq var 'ignored)) - (byte-compile-log-warning (format "Unused lexical %s ‘%S’" - varkind var)))) + (byte-compile-log-warning (format-message "Unused lexical %s ‘%S’" + varkind var)))) ;; If it's unused, there's no point converting it into a cons-cell, even if ;; it's captured and mutated. (`(,binder ,_ t t ,_) @@ -678,7 +679,7 @@ and updates the data stored in ENV." ;; ((and `(quote ,v . ,_) (guard (assq v env))) ;; (byte-compile-log-warning - ;; (format "Possible confusion variable/symbol for ‘%S’" v))) + ;; (format-message "Possible confusion variable/symbol for ‘%S’" v))) (`(quote . ,_) nil) ; quote form (`(function . ,_) nil) ; same as quote diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index 2c2f68482a9..bdcb4ec00a2 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -279,8 +279,8 @@ TYPE is a string giving the nature of the error. Warning is displayed in entry)) (warning-fill-prefix " ")) (display-warning 'check-declare - (format "said ‘%s’ was defined in %s: %s" - fn (file-name-nondirectory fnfile) type) + (format-message "said ‘%s’ was defined in %s: %s" + fn (file-name-nondirectory fnfile) type) nil check-declare-warning-buffer))) (declare-function compilation-forget-errors "compile" ()) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 14c2a1b872e..ebe21d06b8d 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1714,7 +1714,7 @@ function,command,variable,option or symbol." ms1)))))) e t)) (if (checkdoc-autofix-ask-replace (match-beginning 1) (match-end 1) - (format + (format-message "If this is the argument ‘%s’, it should appear as %s. Fix? " (car args) (upcase (car args))) (upcase (car args)) t) @@ -1740,7 +1740,7 @@ function,command,variable,option or symbol." ms1)))))) (insert ".")) nil) (checkdoc-create-error - (format + (format-message "Argument ‘%s’ should appear (as %s) in the doc string" (car args) (upcase (car args))) s (marker-position e))) @@ -1824,16 +1824,16 @@ Replace with \"%s\"? " original replace) (setq found (intern-soft ms)) (or (boundp found) (fboundp found))) (progn - (setq msg (format "Add quotes around Lisp symbol ‘%s’? " - ms)) + (setq msg (format-message + "Add quotes around Lisp symbol ‘%s’? " ms)) (if (checkdoc-autofix-ask-replace (match-beginning 1) (+ (match-beginning 1) (length ms)) msg (concat "‘" ms "’") t) (setq msg nil) (setq msg - (format "Lisp symbol ‘%s’ should appear in quotes" - ms)))))) + (format-message + "Lisp symbol ‘%s’ should appear in quotes" ms)))))) (if msg (checkdoc-create-error msg (match-beginning 1) (+ (match-beginning 1) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index ea77c92737d..06e75b36670 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2101,8 +2101,8 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). macroexpand-all-environment)))) (if (or (null (cdar bindings)) (cl-cddar bindings)) (macroexp--warn-and-return - (format "Malformed ‘cl-symbol-macrolet’ binding: %S" - (car bindings)) + (format-message "Malformed ‘cl-symbol-macrolet’ binding: %S" + (car bindings)) expansion) expansion))) (fset 'macroexpand previous-macroexpand)))))) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index d7e390359a8..7cc789f7129 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3373,7 +3373,7 @@ Return the result of the last expression." (defalias 'edebug-prin1 'prin1) (defalias 'edebug-print 'print) (defalias 'edebug-prin1-to-string 'prin1-to-string) -(defalias 'edebug-format 'format) +(defalias 'edebug-format 'format-message) (defalias 'edebug-message 'message) (defun edebug-eval-expression (expr) diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 2ecf4129008..3b07c5dec4b 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -733,7 +733,7 @@ Argument FN is the function calling this verifier." ((and (or `',name (and name (pred keywordp))) (guard (not (memq name eieio--known-slot-names)))) (macroexp--warn-and-return - (format "Unknown slot ‘%S’" name) exp 'compile-only)) + (format-message "Unknown slot ‘%S’" name) exp 'compile-only)) (_ exp))))) (cl-check-type slot symbol) (cl-check-type obj (or eieio-object class)) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 032cdec066d..feffd5470c4 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -261,7 +261,7 @@ Otherwise work like `message'." mode-line-format))) (setq eldoc-mode-line-string (when (stringp format-string) - (apply 'format format-string args))) + (apply #'format-message format-string args))) (force-mode-line-update))) (apply 'message format-string args))) @@ -274,7 +274,7 @@ Otherwise work like `message'." ;; eldoc-last-message so eq test above might succeed on ;; subsequent calls. ((null (cdr args)) (car args)) - (t (apply 'format args)))) + (t (apply #'format-message args)))) ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages ;; are recorded in a log. Do not put eldoc messages in that log since ;; they are Legion. diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index 3365a852570..8c67d8cd791 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -249,9 +249,9 @@ This environment can be passed to `macroexpand'." (elint-set-mode-line t) (with-current-buffer elint-log-buffer (unless (string-equal default-directory dir) - (elint-log-message (format "\nLeaving directory ‘%s’" - default-directory) t) - (elint-log-message (format "Entering directory ‘%s’" dir) t) + (elint-log-message (format-message "\nLeaving directory ‘%s’" + default-directory) t) + (elint-log-message (format-message "Entering directory ‘%s’" dir) t) (setq default-directory dir)))) (let ((str (format "Linting file %s" file))) (message "%s..." str) @@ -982,7 +982,7 @@ Does basic handling of `featurep' tests." (line-beginning-position)))) 0) ; unknown position type - (apply 'format string args)))) + (apply #'format-message string args)))) (defun elint-error (string &rest args) "Report a linting error. diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 3b103e09bca..86a1f283238 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -367,10 +367,11 @@ message about the whole chain of aliases." (not verbose) (setq aliases (if aliases (concat aliases - (format ", which is an alias for ‘%s’" - (symbol-name def))) - (format "‘%s’ is an alias for ‘%s’" - function (symbol-name def))))) + (format-message + ", which is an alias for ‘%s’" + (symbol-name def))) + (format-message "‘%s’ is an alias for ‘%s’" + function (symbol-name def))))) (setq function (find-function-advised-original function) def (find-function-advised-original function))) (if aliases diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index cc461c81cdd..ff359e6096e 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -146,11 +146,12 @@ and also to avoid outputting the warning during normal execution." (defun macroexp--obsolete-warning (fun obsolescence-data type) (let ((instead (car obsolescence-data)) (asof (nth 2 obsolescence-data))) - (format "‘%s’ is an obsolete %s%s%s" fun type - (if asof (concat " (as of " asof ")") "") - (cond ((stringp instead) (concat "; " instead)) - (instead (format "; use ‘%s’ instead." instead)) - (t "."))))) + (format-message + "‘%s’ is an obsolete %s%s%s" fun type + (if asof (concat " (as of " asof ")") "") + (cond ((stringp instead) (concat "; " instead)) + (instead (format-message "; use ‘%s’ instead." instead)) + (t "."))))) (defun macroexpand-1 (form &optional environment) "Perform (at most) one step of macroexpansion." diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index ceae99b4209..3ac7094990d 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -198,7 +198,8 @@ Returns the number of actions taken." (objects (if help (nth 1 help) "objects")) (action (if help (nth 2 help) "act on"))) (concat - (format "Type SPC or ‘y’ to %s the current %s; + (format-message "\ +Type SPC or ‘y’ to %s the current %s; DEL or ‘n’ to skip the current %s; RET or ‘q’ to give up on the %s (skip all remaining %s); C-g to quit (cancel the whole command); diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 4d5b0c78cc3..7eebb5ebaf8 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -95,7 +95,7 @@ Each element has the form (WHERE BYTECODE STACK) where: (propertize (format "%s advice: " where) 'face 'warning) (let ((fun (advice--car flist))) - (if (symbolp fun) (format "‘%S’" fun) + (if (symbolp fun) (format-message "‘%S’" fun) (let* ((name (cdr (assq 'name (advice--props flist)))) (doc (documentation fun t)) (usage (help-split-fundoc doc function))) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 3d2dbdf8712..7c4f21f603b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1592,11 +1592,12 @@ SEEN is used internally to detect infinite recursion." (unless problem (setq problem (if (stringp disabled) - (format "Package ‘%s’ held at version %s, but version %s required" - next-pkg disabled - (package-version-join next-version)) - (format "Required package ‘%s’ is disabled" - next-pkg))))) + (format-message + "Package ‘%s’ held at version %s, but version %s required" + next-pkg disabled + (package-version-join next-version)) + (format-message "Required package ‘%s’ is disabled" + next-pkg))))) (t (setq found pkg-desc))))) (unless found (cond @@ -2365,16 +2366,16 @@ Otherwise no newline is inserted." (defun package-install-button-action (button) (let ((pkg-desc (button-get button 'package-desc))) - (when (y-or-n-p (format "Install package ‘%s’? " - (package-desc-full-name pkg-desc))) + (when (y-or-n-p (format-message "Install package ‘%s’? " + (package-desc-full-name pkg-desc))) (package-install pkg-desc nil) (revert-buffer nil t) (goto-char (point-min))))) (defun package-delete-button-action (button) (let ((pkg-desc (button-get button 'package-desc))) - (when (y-or-n-p (format "Delete package ‘%s’? " - (package-desc-full-name pkg-desc))) + (when (y-or-n-p (format-message "Delete package ‘%s’? " + (package-desc-full-name pkg-desc))) (package-delete pkg-desc) (revert-buffer nil t) (goto-char (point-min))))) @@ -3077,8 +3078,8 @@ prompt (see `package-menu--prompt-transaction-p')." (length packages) (mapconcat #'package-desc-full-name packages ", "))) ;; Exactly 1 - (t (format "package ‘%s’" - (package-desc-full-name (car packages)))))) + (t (format-message "package ‘%s’" + (package-desc-full-name (car packages)))))) (defun package-menu--prompt-transaction-p (delete install upgrade) "Prompt the user about DELETE, INSTALL, and UPGRADE. diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index dadbe5f7b67..0a0296fc9fb 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -324,7 +324,8 @@ This function is called, by name, directly by the C code." (apply (timer--function timer) (timer--args timer))) (error (message "Error running timer%s: %S" (if (symbolp (timer--function timer)) - (format " ‘%s’" (timer--function timer)) "") + (format-message " ‘%s’" (timer--function timer)) + "") err))) (when (and retrigger ;; If the timer's been canceled, don't "retrigger" it diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 44a9876a078..d729a9a9563 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -316,7 +316,7 @@ See also `warning-series', `warning-prefix-function' and (defun lwarn (type level message &rest args) "Display a warning message made from (format MESSAGE ARGS...). \\<special-mode-map> -Aside from generating the message with `format', +Aside from generating the message with `format-message', this is equivalent to `display-warning'. TYPE is the warning type: either a custom group name (a symbol), @@ -332,15 +332,15 @@ LEVEL should be either :debug, :warning, :error, or :emergency :error -- invalid data or circumstances. :warning -- suspicious data or circumstances. :debug -- info for debugging only." - (display-warning type (apply 'format message args) level)) + (display-warning type (apply #'format-message message args) level)) ;;;###autoload (defun warn (message &rest args) "Display a warning message made from (format MESSAGE ARGS...). -Aside from generating the message with `format', +Aside from generating the message with `format-message', this is equivalent to `display-warning', using `emacs' as the type and `:warning' as the level." - (display-warning 'emacs (apply 'format message args))) + (display-warning 'emacs (apply #'format-message message args))) (provide 'warnings) |