.emacs-my
changeset 1612 1bf9e4f1d289
parent 1611 0e2a32718f00
child 1613 61ea45815411
equal deleted inserted replaced
1611:0e2a32718f00 1612:1bf9e4f1d289
   714 ;;   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287261
   714 ;;   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287261
   715 ;; (setq view-read-only t)
   715 ;; (setq view-read-only t)
   716 
   716 
   717 (setq read-quoted-char-radix 16)
   717 (setq read-quoted-char-radix 16)
   718 
   718 
       
   719 ;; https://emacs.stackexchange.com/questions/33117/showing-bytes-as-hexadecimal-escapes-rather-than-octal-escapes
   719 (when (and (>= emacs-major-version 22) (not (eq system-type 'darwin)))
   720 (when (and (>= emacs-major-version 22) (not (eq system-type 'darwin)))
   720   (setq standard-display-table (make-display-table))
   721   (setq standard-display-table (make-display-table))
   721   (let ( (i ?\x80) hex hi low )
   722   (let ( (i ?\x80) hex hi low )
   722     (while (<= i ?\xff)
   723     (while (<= i ?\xff)
   723       (setq hex (format "%x" i))
       
   724       (setq hi (elt hex 0))
       
   725       (setq low (elt hex 1))
       
   726       (aset standard-display-table (unibyte-char-to-multibyte i)
   724       (aset standard-display-table (unibyte-char-to-multibyte i)
   727             (vector (make-glyph-code ?\\ 'escape-glyph)
   725             (cl-map 'vector
   728                     (make-glyph-code ?x 'escape-glyph)
   726                     (lambda (c) (make-glyph-code c 'escape-glyph))
   729                     (make-glyph-code hi 'escape-glyph)
   727                     (format "\\%02x" i)))
   730                     (make-glyph-code low 'escape-glyph)))
       
   731       (setq i (1+ i)))))
   728       (setq i (1+ i)))))
   732 
   729 
   733 (defun my--get-char (name)
   730 (defun my--get-char (name)
   734   "Get character by Unicode `name'."
   731   "Get character by Unicode `name'."
   735   (cond
   732   (cond