From b2fc283fdd4147208a433125aa616428fee4d420 Mon Sep 17 00:00:00 2001 From: Ralf Zerres Date: Wed, 24 Jun 2020 01:38:51 +0200 Subject: [PATCH] ocatl-to-hex: site-lisp defun * convert ocatl escape sequences to hexglyphs Signed-off-by: Ralf Zerres --- site-lisp/octal-to-hex.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 site-lisp/octal-to-hex.el diff --git a/site-lisp/octal-to-hex.el b/site-lisp/octal-to-hex.el new file mode 100644 index 0000000..d433b43 --- /dev/null +++ b/site-lisp/octal-to-hex.el @@ -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)))))