ocatl-to-hex: site-lisp defun
* convert ocatl escape sequences to hexglyphs Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
13
site-lisp/octal-to-hex.el
Normal file
13
site-lisp/octal-to-hex.el
Normal file
@@ -0,0 +1,13 @@
|
||||
(defun use-hex-not-octal ()
|
||||
"Use hexadecimal escape sequences instead of octal."
|
||||
(interactive)
|
||||
(require 'cl-lib)
|
||||
(unless buffer-display-table
|
||||
(setq buffer-display-table (make-display-table)))
|
||||
(setq unprintable (append (number-sequence 127 255) (number-sequence 0 8) (number-sequence 11 31)))
|
||||
(cl-loop
|
||||
for x in unprintable
|
||||
do (aset buffer-display-table (unibyte-char-to-multibyte x)
|
||||
(cl-map 'vector
|
||||
(lambda (c) (make-glyph-code c 'escape-glyph))
|
||||
(format "\\%02x" x)))))
|
||||
Reference in New Issue
Block a user