Expression was simplified.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 12 Mar 2020 12:32:22 +0200
changeset 1612 1bf9e4f1d289
parent 1611 0e2a32718f00
child 1613 61ea45815411
Expression was simplified.
.emacs-my
--- a/.emacs-my	Thu Mar 12 12:27:12 2020 +0200
+++ b/.emacs-my	Thu Mar 12 12:32:22 2020 +0200
@@ -716,18 +716,15 @@
 
 (setq read-quoted-char-radix 16)
 
+;; https://emacs.stackexchange.com/questions/33117/showing-bytes-as-hexadecimal-escapes-rather-than-octal-escapes
 (when (and (>= emacs-major-version 22) (not (eq system-type 'darwin)))
   (setq standard-display-table (make-display-table))
   (let ( (i ?\x80) hex hi low )
     (while (<= i ?\xff)
-      (setq hex (format "%x" i))
-      (setq hi (elt hex 0))
-      (setq low (elt hex 1))
       (aset standard-display-table (unibyte-char-to-multibyte i)
-            (vector (make-glyph-code ?\\ 'escape-glyph)
-                    (make-glyph-code ?x 'escape-glyph)
-                    (make-glyph-code hi 'escape-glyph)
-                    (make-glyph-code low 'escape-glyph)))
+            (cl-map 'vector
+                    (lambda (c) (make-glyph-code c 'escape-glyph))
+                    (format "\\%02x" i)))
       (setq i (1+ i)))))
 
 (defun my--get-char (name)