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

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

Re: show binary in hexidecimal not octal


From: Kevin Rodgers
Subject: Re: show binary in hexidecimal not octal
Date: Wed, 27 Dec 2006 10:45:13 -0700
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

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





reply via email to

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