all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: How switch from escaped octal character code to escaped HEX?
Date: Sun, 02 Jan 2011 23:23:38 -0500	[thread overview]
Message-ID: <jwvipy6fwnt.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.6.1293551515.18545.help-gnu-emacs@gnu.org

>> 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


  parent reply	other threads:[~2011-01-03  4:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-28 15:39 How switch from escaped octal character code to escaped HEX? Oleksandr Gavenko
2010-12-28 15:51 ` Oleksandr Gavenko
     [not found] ` <mailman.6.1293551515.18545.help-gnu-emacs@gnu.org>
2011-01-03  4:23   ` Stefan Monnier [this message]
2011-01-03  7:14     ` Deniz Dogan
2011-01-03 10:13       ` Deniz Dogan
2011-01-03 14:37         ` Peter Dyballa
2011-01-04  4:03       ` Stefan Monnier
     [not found]     ` <mailman.8.1294038895.27854.help-gnu-emacs@gnu.org>
2011-01-03 13:42       ` Barry Margolin
2011-01-11 10:23     ` Oleksandr Gavenko
     [not found]     ` <mailman.0.1294741438.20926.help-gnu-emacs@gnu.org>
2011-01-11 17:34       ` Stefan Monnier
2011-01-12  9:22         ` Oleksandr Gavenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvipy6fwnt.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.