APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1489049551 0
# Thu Mar 09 08:52:31 2017 +0000
# Node ID 1fd2ad984351828b216d1d6c5c83831c5ac62f67
# Parent 46c42be3543e897e4a9cf66084dbd732f16052a1
Replace (char-to-string X) with (list X) where appropriate, core code.
2017-03-09 Aidan Kehoe <kehoea(a)parhasard.net>
* disp-table.el (standard-display-g1):
* disp-table.el (standard-display-graphic):
* disp-table.el (standard-display-underline):
* files.el (make-backup-file-name-1):
* files.el (wildcard-to-regexp):
* gtk-file-dialog.el (gtk-file-dialog-update-dropdown):
* info.el (Info-all-case-regexp):
* info.el (Info-scroll-next):
* map-ynp.el (map-y-or-n-p):
* menubar.el (menu-item-generate-accelerator-spec):
* menubar.el (menu-max-items):
* minibuf.el (get-user-response):
* package-admin.el (package-admin-check-manifest):
In contexts like (concat ... (char-to-string x) ...), (list x) is
a more idiomatic and faster way to construct a sequence. Use it.
* autoload.el (autoload-featurep-protect-autoloads):
The fixnum-char mapping for values less than #x100 is stable, no
need to construct the string "\x00-\xff" at runtime.
diff -r 46c42be3543e -r 1fd2ad984351 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/ChangeLog Thu Mar 09 08:52:31 2017 +0000
@@ -1,3 +1,26 @@
+2017-03-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+
+ * disp-table.el (standard-display-g1):
+ * disp-table.el (standard-display-graphic):
+ * disp-table.el (standard-display-underline):
+ * files.el (make-backup-file-name-1):
+ * files.el (wildcard-to-regexp):
+ * gtk-file-dialog.el (gtk-file-dialog-update-dropdown):
+ * info.el (Info-all-case-regexp):
+ * info.el (Info-scroll-next):
+ * map-ynp.el (map-y-or-n-p):
+ * menubar.el (menu-item-generate-accelerator-spec):
+ * menubar.el (menu-max-items):
+ * minibuf.el (get-user-response):
+ * package-admin.el (package-admin-check-manifest):
+ In contexts like (concat ... (char-to-string x) ...), (list x) is
+ a more idiomatic and faster way to construct a sequence. Use it.
+
+ * autoload.el (autoload-featurep-protect-autoloads):
+ The fixnum-char mapping for values less than #x100 is stable, no
+ need to construct the string "\x00-\xff" at runtime.
+
2017-03-04 Aidan Kehoe <kehoea(a)parhasard.net>
* startup.el (normal-top-level):
diff -r 46c42be3543e -r 1fd2ad984351 lisp/auto-save.el
--- a/lisp/auto-save.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/auto-save.el Thu Mar 09 08:52:31 2017 +0000
@@ -409,7 +409,7 @@
(if (< char 16)
(upcase (format "=0%x" char))
(upcase (format "=%x" char)))
- (char-to-string char))))
+ (list char))))
str ""))
(defun auto-save-unescape-name (str)
@@ -423,7 +423,7 @@
(code (parse-integer str :start (match-beginning 1)
:end (match-end 2) :radix 16)))
(setq tmp (concat tmp (substring str 0 start)
- (char-to-string code))
+ (list code))
str (substring str (match-end 0)))))
(setq tmp (concat tmp str))
tmp))
diff -r 46c42be3543e -r 1fd2ad984351 lisp/autoload.el
--- a/lisp/autoload.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/autoload.el Thu Mar 09 08:52:31 2017 +0000
@@ -1078,8 +1078,7 @@
(progn
(goto-char (point-min))
;; mrb- There must be a better way than skip-chars-forward
- (skip-chars-forward (concat (char-to-string 0) "-"
- (char-to-string 255)))
+ (skip-chars-forward "\x00-\xff")
(eq (point) (point-max))))
(setq buffer-file-coding-system 'raw-text-unix)
(setq buffer-file-coding-system 'escape-quoted))
diff -r 46c42be3543e -r 1fd2ad984351 lisp/disp-table.el
--- a/lisp/disp-table.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/disp-table.el Thu Mar 09 08:52:31 2017 +0000
@@ -192,7 +192,7 @@
the SO/SI characters."
(frob-display-table
(lambda (x)
- (put-char-table c (concat "\016" (char-to-string sc) "\017")
x))
+ (put-char-table c (concat "\016" (list sc) "\017") x))
locale '(tty)))
;;;###autoload
@@ -201,7 +201,7 @@
This only has an effect on TTY devices and assumes VT100-compatible escapes."
(frob-display-table
(lambda (x)
- (put-char-table c (concat "\e(0" (char-to-string gc) "\e(B")
x))
+ (put-char-table c (concat "\e(0" (list gc) "\e(B") x))
locale '(tty)))
;;;###autoload
diff -r 46c42be3543e -r 1fd2ad984351 lisp/files.el
--- a/lisp/files.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/files.el Thu Mar 09 08:52:31 2017 +0000
@@ -2542,7 +2542,7 @@
(defun make-backup-file-name-1 (file)
"Subroutine of `make-backup-file-name' and `find-backup-file-name'."
(let ((alist backup-directory-alist)
- elt backup-directory dir-sep-string)
+ elt backup-directory)
(while alist
(setq elt (pop alist))
(if (string-match (car elt) file)
@@ -2565,14 +2565,13 @@
;; Replace any invalid file-name characters (for the
;; case of backing up remote files).
(setq file (expand-file-name (convert-standard-filename file)))
- (setq dir-sep-string (char-to-string directory-sep-char))
(if (eq (aref file 1) ?:)
- (setq file (concat dir-sep-string
+ (setq file (concat (list directory-sep-char)
"drive_"
- (char-to-string (downcase (aref file 0)))
+ (list (downcase (aref file 0)))
(if (eq (aref file 2) directory-sep-char)
""
- dir-sep-string)
+ (list directory-sep-char))
(substring file 2)))))
;; Make the name unique by substituting directory
;; separators. It may not really be worth bothering about
@@ -3991,7 +3990,7 @@
((eq ch ?$) "\\$")
((eq ch ?\\) "\\\\") ; probably cannot happen...
((eq ch ??) "[^\000]")
- (t (char-to-string ch)))))
+ (t (list ch)))))
(setq i (1+ i)))))
;; Shell wildcards should match the entire filename,
;; not its part. Make the regexp say so.
diff -r 46c42be3543e -r 1fd2ad984351 lisp/gtk-file-dialog.el
--- a/lisp/gtk-file-dialog.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/gtk-file-dialog.el Thu Mar 09 08:52:31 2017 +0000
@@ -108,7 +108,7 @@
(entries nil))
(while components
(push (concat "/" (mapconcat 'identity (reverse components)
- (char-to-string directory-sep-char)))
+ (list directory-sep-char)))
entries)
(pop components))
(push (expand-file-name "." "~/") entries)
diff -r 46c42be3543e -r 1fd2ad984351 lisp/info.el
--- a/lisp/info.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/info.el Thu Mar 09 08:52:31 2017 +0000
@@ -1453,12 +1453,12 @@
(and (>= c ?a) (<= c ?z)))
(setq regexp (concat regexp
"["
- (char-to-string (downcase c))
+ (list (downcase c))
"\\|"
- (char-to-string (upcase c))
+ (list (upcase c))
"]")))
(t
- (setq regexp (concat regexp (char-to-string c)))))
+ (setq regexp (concat regexp (list c)))))
(setq i (1+ i)))
regexp))
@@ -2225,7 +2225,7 @@
(message "Hit %s again to go to next node"
(if (= last-command-char 0)
"mouse button"
- (key-description (char-to-string last-command-char))))
+ (key-description (list last-command-char))))
(Info-page-next)
(setq this-command 'Info))
(scroll-up arg)))
diff -r 46c42be3543e -r 1fd2ad984351 lisp/map-ynp.el
--- a/lisp/map-ynp.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/map-ynp.el Thu Mar 09 08:52:31 2017 +0000
@@ -130,7 +130,7 @@
(key-description
(if (characterp (car elt))
;; XEmacs
- (char-to-string (car elt))
+ (list (car elt))
(car elt))))
action-alist ", ")
" ")
diff -r 46c42be3543e -r 1fd2ad984351 lisp/menubar.el
--- a/lisp/menubar.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/menubar.el Thu Mar 09 08:52:31 2017 +0000
@@ -522,7 +522,7 @@
(setq n (1- n)))
(setq m n))
(if (<= m 26)
- (concat "%_" (char-to-string (+ m (- ?a 1))) " ")
+ (concat "%_" (list (+ m (- ?a 1))) " ")
"")))
(t "")))
diff -r 46c42be3543e -r 1fd2ad984351 lisp/minibuf.el
--- a/lisp/minibuf.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/minibuf.el Thu Mar 09 08:52:31 2017 +0000
@@ -2204,12 +2204,12 @@
(let* ((answers (remove-if-not #'consp answers))
(possible
(gettext
- (labels ((car-to-string-if (x)
+ (labels ((car-to-sequence-if (x)
(setq x (car x))
- (if (stringp x) x (char-to-string x))))
- (concat (mapconcat #'car-to-string-if
+ (if (stringp x) x (list x))))
+ (concat (mapconcat #'car-to-sequence-if
(butlast answers) ", ") " or "
- (car-to-string-if (car (last answers)))))))
+ (car-to-sequence-if (car (last answers)))))))
(question (gettext question))
(p (format "%s(%s) " question possible)))
(block nil
diff -r 46c42be3543e -r 1fd2ad984351 lisp/mule/ethio-util.el
--- a/lisp/mule/ethio-util.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/mule/ethio-util.el Thu Mar 09 08:52:31 2017 +0000
@@ -1498,7 +1498,7 @@
(delete-char 1)
(insert
(compose-string
- (concat (char-to-string (ethio-ethiocode-to-char newch)) "$(3%s(B"))))
+ (concat (list (ethio-ethiocode-to-char newch)) "$(3%s(B"))))
;; simple vowel modification
(t
diff -r 46c42be3543e -r 1fd2ad984351 lisp/package-admin.el
--- a/lisp/package-admin.el Sat Mar 04 00:07:32 2017 +0000
+++ b/lisp/package-admin.el Thu Mar 09 08:52:31 2017 +0000
@@ -282,8 +282,7 @@
(save-excursion ;; Probably redundant.
(set-buffer (get-buffer pkg-outbuf)) ;; Probably already the current buffer.
(goto-char (point-min))
- (setq regexp (concat "\\bpkginfo"
- (char-to-string directory-sep-char)
+ (setq regexp (concat "\\bpkginfo" (list directory-sep-char)
"MANIFEST\\...*"))
;; Look for the manifest.
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)