help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How switch from escaped octal character code to escaped HEX?


From: Stefan Monnier
Subject: Re: How switch from escaped octal character code to escaped HEX?
Date: Sun, 02 Jan 2011 23:23:38 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> When Emacs find that byte that does
>> not correspond to any specific displayable character it display
>> octal codes instead, like: \276 (and with different color).
>> 
>> This is useful, but I prefer HEX base instead octal.

There is no direct/easy way to do it.
But you can do it by adding the corresponding 128 entries to the
standard-display-table.

E.g.

   (setq standard-display-table (make-display-table))
   (aset standard-display-table (unibyte-char-to-multibyte 131)
                                [?\\ ?x ?8 ?3])
   (aset standard-display-table (unibyte-char-to-multibyte 132)
                                [?\\ ?x ?8 ?4])

Should make the bytes 131 and 132 be displayed as \x83 and \x84 rather
than \203 and \204.


        Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]