unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* show binary in hexidecimal not octal
@ 2006-12-25 20:25 Dan Jacobson
  2006-12-27 17:45 ` Kevin Rodgers
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Jacobson @ 2006-12-25 20:25 UTC (permalink / raw)


In emacs binary content is shown in octal notation.
There is no way to make it shown in hexidecimal notation.
No I'm not talking about hexl mode or whatever.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: show binary in hexidecimal not octal
  2006-12-25 20:25 show binary in hexidecimal not octal Dan Jacobson
@ 2006-12-27 17:45 ` Kevin Rodgers
  2007-01-03 18:32   ` Dan Jacobson
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Rodgers @ 2006-12-27 17:45 UTC (permalink / raw)


Dan Jacobson wrote:
> In emacs binary content is shown in octal notation.
> There is no way to make it shown in hexidecimal notation.

Sure there is:

(defvar hex-display-table-prefix "\\")
(defvar hex-display-table-suffix nil)

(defvar hex-display-table
   (let ((table (make-display-table))
	(char ?\x00))
     (while (<= char ?\xFF)
       (unless (equal char ?\n)
	(aset table char (vconcat hex-display-table-prefix
				  (format "%02X" char)
				  hex-display-table-suffix)))
       (setq char (1+ char)))
     table))

(setq buffer-display-table hex-display-table)

> No I'm not talking about hexl mode or whatever.

-- 
Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: show binary in hexidecimal not octal
  2006-12-27 17:45 ` Kevin Rodgers
@ 2007-01-03 18:32   ` Dan Jacobson
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Jacobson @ 2007-01-03 18:32 UTC (permalink / raw)


Do (compile "perl -e 'for(0..99999){print chr}' 2>&-" nil)

I see ^@^A^B...^Z^[^\^]^^^_ !"#$%&'()*+,-./01...wxyz{|}~^?
\200\201\202\203\204...\374\375\376\377 then Unicode etc.

I am happy with what I see, except that I want the octal shown in hex
instead. I.e. I am only unhappy about \200...\377.

Kevin> (setq buffer-display-table ...

I believe the solution instead lies in a new variable that controls a
deeper down C code item, without the user needing to fiddle with
buffer-display-table nor standard-display-table etc.

No need to target any specific characters, all I am saying is deep
down when emacs feels the urge to send a octal representation to the
screen, it sends instead a hex representation.

I am saying "emacs old buddy, you are doing a perfect job at selecting
what bytes or characters or whatever to send to the screen as (the
four byte) \222, etc. Now just allow the user the choice of how he
wants them shown: hex, octal (current), binary, decimal, etc."

Also there should be a way to paste the e.g., \222 that we see into another
buffer as the four bytes, not one, without having to resort to emacs
-nw and the mouse.

(By the way (compile "perl -e 'for(0..99999){print chr}' 2>&-" nil)
causes error in process filter: font-lock-fontify-keywords-region:
Stack overflow in regexp matcher. Probably for good reason. But that
is not what I'm worried about here.)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-03 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-25 20:25 show binary in hexidecimal not octal Dan Jacobson
2006-12-27 17:45 ` Kevin Rodgers
2007-01-03 18:32   ` Dan Jacobson

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).