got)
(dolist (sym configvar-value)
(if (not (boundp sym))
- (if (yes-or-no-p (format "%s entry `%s' is unbound -- remove it? "
- configvar-name sym))
+ (if (yes-or-no-p (format-message
+ "%s entry `%s' is unbound -- remove it? "
+ configvar-name sym))
(delq sym (symbol-value configvar-name)))
(push (symbol-value sym) got)))
(reverse got)))
(let ((alias (get symbol 'face-alias)))
(if alias
(if (facep alias)
- (format "%slias for the face `%s'."
- (if (get symbol 'obsolete-face)
- "Obsolete a"
- "A")
- alias)
+ (format-message
+ "%slias for the face `%s'."
+ (if (get symbol 'obsolete-face) "Obsolete a" "A")
+ alias)
;; Never happens in practice because fails
;; (facep symbol) test.
"(alias for undefined face)")
(defcustom custom-raised-buttons (not (equal (face-valid-attribute-values :box)
'(("unspecified" . unspecified))))
- "If non-nil, indicate active buttons in a `raised-button' style.
+ "If non-nil, indicate active buttons in a raised-button style.
Otherwise use brackets."
:type 'boolean
:version "21.1"
on a button to invoke its action.
Invoke [+] to expand a group, and [-] to collapse an expanded group.\n"
(if custom-raised-buttons
- "`Raised' text indicates"
+ "Raised text indicates"
"Square brackets indicate")))
(insert "\n " (car elt) ":"
(propertize " " 'display '(space :align-to 4))
(or (cdr elt) "-- not encodable --"))))
- (insert "\nSee the variable `reference-point-alist' for "
+ (insert (substitute-command-keys
+ "\nSee the variable `reference-point-alist' for ")
"the meaning of the rule.\n")))
(unless eight-bit-p
(if (cond ((not (or on-each no-subst))
(error "You can not combine `*' and `?' substitution marks"))
((and star on-each)
- (y-or-n-p "Confirm--do you mean to use `*' as a wildcard? "))
+ (y-or-n-p (format-message
+ "Confirm--do you mean to use `*' as a wildcard? ")))
((and qmark no-subst)
- (y-or-n-p "Confirm--do you mean to use `?' as a wildcard? "))
+ (y-or-n-p (format-message
+ "Confirm--do you mean to use `?' as a wildcard? ")))
(t))
(if on-each
(dired-bunch-files
(let* ((overwrite (file-exists-p to))
(dired-overwrite-confirmed ; for dired-handle-overwrite
(and overwrite
- (let ((help-form '(format "\
+ (let ((help-form '(format-message "\
Type SPC or `y' to overwrite file `%s',
DEL or `n' to skip to next,
ESC or `q' to not overwrite any of the remaining files,
;; Optional arg MARKER-CHAR as in dired-create-files.
(let* ((fn-list (dired-get-marked-files nil arg))
(operation-prompt (concat operation " `%s' to `%s'?"))
- (rename-regexp-help-form (format "\
+ (rename-regexp-help-form (format-message "\
Type SPC or `y' to %s one match, DEL or `n' to skip to next,
`!' to %s all remaining matches with no more questions."
- (downcase operation)
- (downcase operation)))
+ (downcase operation)
+ (downcase operation)))
(regexp-name-constructor
;; Function to construct new filename using REGEXP and NEWNAME:
(if whole-name ; easy (but rare) case
(let ((to (concat (file-name-directory from)
(funcall basename-constructor
(file-name-nondirectory from)))))
- (and (let ((help-form (format "\
+ (and (let ((help-form (format-message "\
Type SPC or `y' to %s one file, DEL or `n' to skip to next,
`!' to %s all remaining matches with no more questions."
- (downcase operation)
- (downcase operation))))
+ (downcase operation)
+ (downcase operation))))
(dired-query 'rename-non-directory-query
(concat operation " `%s' to `%s'")
(dired-make-relative from)
(interactive)
(let ((file (dired-get-filename t)))
(if dired-bind-vm
- (if (y-or-n-p (concat "Visit `" file
- "' as a mail folder with VM?"))
+ (if (y-or-n-p (format-message
+ "Visit ‘%s’ as a mail folder with VM?" file))
(dired-vm))
;; Read mail folder using rmail.
- (if (y-or-n-p (concat "Visit `" file
- "' as a mailbox with RMAIL?"))
+ (if (y-or-n-p (format-message
+ "Visit ‘%s’ as a mailbox with RMAIL?" file))
(dired-rmail)))))
\f
(let ((inhibit-read-only t))
(cond ((stringp log)
(insert (if args
- (apply (function format) log args)
+ (apply #'format-message log args)
log)))
((bufferp log)
(insert-buffer-substring log))
((memq action '(copy private move link))
(let ((overwrite (and (file-exists-p to)
(y-or-n-p
- (format "Overwrite existing file `%s'? " to))))
+ (format-message
+ "Overwrite existing file `%s'? " to))))
;; Binding dired-overwrite-confirmed to nil makes
;; dired-handle-overwrite a no-op. We instead use
;; y-or-n-p, which pops a graphical menu.
(car (find-backup-file-name to)))
(or (eq dired-backup-overwrite 'always)
(y-or-n-p
- (format
+ (format-message
"Make backup for existing file `%s'? " to))))
(rename-file to backup-file 0)
(dired-relist-entry backup-file))
(when dirtrack-debug-mode
(with-current-buffer (get-buffer-create dirtrack-debug-buffer)
(goto-char (point-max))
- (insert msg1 msg2 "\n"))))
+ (insert (substitute-command-keys msg1) msg2 "\n"))))
(declare-function shell-prefixed-directory-name "shell" (dir))
(declare-function shell-process-cd "shell" (arg))
(set-terminal-coding-system nil))))
(display-warning 'i18n
- "`standard-display-european' is semi-obsolete; see its doc string for details"
+ (format-message
+ "`standard-display-european' is semi-obsolete; see its doc string for details")
:warning)
;; Switch to Latin-1 language environment
(let ((find (get-buffer-process (current-buffer))))
(when find
(if (or (not (eq (process-status find) 'run))
- (yes-or-no-p "A `find' process is running; kill it? "))
+ (yes-or-no-p
+ (format-message "A `find' process is running; kill it? ")))
(condition-case nil
(progn
(interrupt-process find)
(insert
"GNU Emacs Forms Mode\n\n"
(if (file-exists-p forms-file)
- (concat "No records available in file `" forms-file "'\n\n")
- (format "Creating new file `%s'\nwith %d field%s per record\n\n"
- forms-file forms-number-of-fields
- (if (= 1 forms-number-of-fields) "" "s")))
+ (format-message
+ "No records available in file `%s'\n\n" forms-file)
+ (format-message
+ "Creating new file `%s'\nwith %d field%s per record\n\n"
+ forms-file forms-number-of-fields
+ (if (= 1 forms-number-of-fields) "" "s")))
"Use " (substitute-command-keys "\\[forms-insert-record]")
" to create new records.\n")
(setq forms--current-record 1)
ch internal-hex))
(setq encoded internal)
(error
- "Can't encode `0x%x' with this buffer's coding system; try \\[hexl-insert-hex-string]"
- ch)))
+ "Can't encode `0x%x' with this buffer's coding system; %s"
+ ch
+ (substitute-command-keys "try \\[hexl-insert-hex-string]"))))
(while (> num 0)
(mapc
(function (lambda (c) (hexl-insert-char c 1))) encoded)
((and (eq ido-create-new-buffer 'prompt)
(null require-match)
- (not (y-or-n-p (format "No buffer matching `%s', create one? " buf))))
+ (not (y-or-n-p (format-message
+ "No buffer matching `%s', create one? " buf))))
nil)
;; buffer doesn't exist
((and (eq ido-create-new-buffer 'prompt)
(null require-match)
- (not (y-or-n-p (format "No buffer matching `%s', create one? " buf))))
+ (not (y-or-n-p (format-message
+ "No buffer matching `%s', create one? " buf))))
nil)
;; create a new buffer
(car (car Info-index-alternatives))
(nth 2 (car Info-index-alternatives))
(if (cdr Info-index-alternatives)
- (format "(%s total; use `%s' for next)"
- (length Info-index-alternatives)
- (key-description (where-is-internal
- 'Info-index-next overriding-local-map
- t)))
+ (format-message
+ "(%s total; use `%s' for next)"
+ (length Info-index-alternatives)
+ (key-description (where-is-internal
+ 'Info-index-next overriding-local-map t)))
"(Only match)")))
(defun Info-find-index-name (name)
;; Why bother checking that it is indeed higher/lower level ?
new-head
;; Didn't work, so ask what to do.
- (read-string (format "%s heading for `%s': "
- (if up "Parent" "Demoted") head)
+ (read-string (format-message "%s heading for `%s': "
+ (if up "Parent" "Demoted") head)
head nil nil t)))))
(defun outline-promote (&optional which)
((file-exists-p res)
(ding)
(setq prompt "exists")
- (not (y-or-n-p (format "File `%s' exists; overwrite? "
- res))))
+ (not (y-or-n-p (format-message
+ "File `%s' exists; overwrite? " res))))
(t nil))
(setq res (read-file-name
(format "File %s; PostScript file: " prompt)
((or (not (file-exists-p pr-i-out-file))
pr-i-answer-yes
(setq pr-i-answer-yes
- (y-or-n-p (format "File `%s' exists; overwrite? "
- pr-i-out-file))))
+ (y-or-n-p (format-message "File `%s' exists; overwrite? "
+ pr-i-out-file))))
pr-i-out-file)
(t
(error "File already exists"))))
(unless (bolp)
(insert "\n"))
(insert (current-time-string)
- "\tBuffer `" (buffer-name obuf) "', "
- (format "signal `%s'\n" (car args)))
+ (format-message "\tBuffer ‘%s’, signal ‘%s’\n"
+ (buffer-name obuf) (car args)))
(goto-char (point-max))
(insert "\f\n")))))))
(setq prompt "File is unwritable"))
((file-exists-p res)
(setq prompt "File exists")
- (not (y-or-n-p (format "File `%s' exists; overwrite? "
- res))))
+ (not (y-or-n-p (format-message
+ "File `%s' exists; overwrite? " res))))
(t nil))
(setq res (read-file-name
(format "%s; save PostScript to file: " prompt)
(error "Invalid %s `%S'%s"
mess size
(if arg
- (format " for `%S'" arg)
+ (format-message " for `%S'" arg)
"")))
siz))
", or type the corresponding digit key,"
"")
" to open it.\n"
- "Click on Cancel or type `q' to cancel.\n")
+ (format-message "Click on Cancel or type ‘q’ to cancel.\n"))
;; Use a L&F that looks like the recentf menu.
(tree-widget-set-theme "folder")
(apply 'widget-create
(with-temp-buffer
(erase-buffer)
(set-buffer-file-coding-system recentf-save-file-coding-system)
- (insert (format recentf-save-file-header (current-time-string)))
+ (insert (format-message recentf-save-file-header
+ (current-time-string)))
(recentf-dump-variable 'recentf-list recentf-max-saved-items)
(recentf-dump-variable 'recentf-filter-changer-current)
(insert "\n\f\n;; Local Variables:\n"
(interactive)
(with-temp-buffer
(insert
- (format ";; -*- mode: emacs-lisp; coding: %s -*-\n" savehist-coding-system)
- ";; Minibuffer history file, automatically generated by `savehist'.\n\n")
+ (format-message
+ (concat
+ ";; -*- mode: emacs-lisp; coding: %s -*-\n"
+ ";; Minibuffer history file, automatically generated by `savehist'.\n"
+ "\n")
+ savehist-coding-system))
(run-hooks 'savehist-save-hook)
(let ((print-length nil)
(print-string-length nil)
((and w32 (zerop uid)) ; on FAT32?
(display-warning
'server
- (format "Using `%s' to store Emacs-server authentication files.
+ (format-message "\
+Using `%s' to store Emacs-server authentication files.
Directories on FAT32 filesystems are NOT secure against tampering.
See variable `server-auth-dir' for details."
(file-name-as-directory dir))
(ses-is-cell-sym-p new-name)
(error "Already a cell name"))
(and (boundp new-name)
- (null (yes-or-no-p (format "`%S' is already bound outside this buffer, continue? "
- new-name)))
+ (null (yes-or-no-p
+ (format-message
+ "`%S' is already bound outside this buffer, continue? "
+ new-name)))
(error "Already a bound cell name")))
(let* (curcell
(sym (if (ses-cell-p cell)
(buf-label (if (buffer-live-p buf)
`(,(buffer-name buf)
face link
- help-echo ,(concat "Visit buffer `"
- (buffer-name buf) "'")
+ help-echo ,(format-message
+ "Visit buffer ‘%s’"
+ (buffer-name buf))
follow-link t
process-buffer ,buf
action process-menu-visit-buffer)
"~/.emacs")
((directory-files "~" nil "^_emacs\\(\\.elc?\\)?$")
;; Also support _emacs for compatibility, but warn about it.
- (push '(initialization
- "`_emacs' init file is deprecated, please use `.emacs'")
+ (push `(initialization
+ ,(format-message
+ "`_emacs' init file is deprecated, please use `.emacs'"))
delayed-warnings-list)
"~/_emacs")
(t ;; But default to .emacs if _emacs does not exist.
(interactive)
(let ((command (cdar strokes-global-map)))
(if (y-or-n-p
- (format "Really delete last stroke definition, defined to `%s'? "
- command))
+ (format-message
+ "Really delete last stroke definition, defined to `%s'? "
+ command))
(progn
(setq strokes-global-map (cdr strokes-global-map))
(message "That stroke has been deleted"))
((null strokes-global-map)
(if (file-exists-p strokes-file)
(and (y-or-n-p
- (format "No strokes loaded. Load `%s'? "
- strokes-file))
+ (format-message "No strokes loaded. Load `%s'? "
+ strokes-file))
(strokes-load-user-strokes))
(error "No strokes defined; use `strokes-global-set-stroke'")))
(t
overwrite))
(error
(setq errors (1+ errors))
- (dired-log (concat "Rename `" file-ori "' to `"
- file-new "' failed:\n%s\n")
+ (dired-log "Rename ‘%s’ to ‘%s’ failed:\n%s\n"
+ file-ori file-new
err)))))))))
errors))
(substitute-in-file-name link-to-new) link-from))
(error
(setq errors (1+ errors))
- (dired-log (concat "Link `" link-from "' to `"
- link-to-new "' failed:\n%s\n")
+ (dired-log "Link ‘%s’ to ‘%s’ failed:\n%s\n"
+ link-from link-to-new
err)))))
(cons changes errors)))
(unless (equal 0 (process-file dired-chmod-program
nil nil nil perm-tmp filename))
(setq errors (1+ errors))
- (dired-log (concat dired-chmod-program " " perm-tmp
- " `" filename "' failed\n\n"))))
+ (dired-log "%s %s ‘%s’ failed\n\n"
+ dired-chmod-program perm-tmp filename)))
(setq errors (1+ errors))
- (dired-log (concat "Cannot parse permission `" perms-new
- "' for file `" filename "'\n\n"))))
+ (dired-log "Cannot parse permission ‘%s’ for file ‘%s’\n\n"
+ perms-new filename)))
(goto-char (next-single-property-change (1+ (point)) prop-wanted
nil (point-max))))
(cons changes errors)))