unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* displaying octal sequences in emacs 21.3.1
@ 2004-10-08 19:32 Roland Winkler
  2004-10-09 10:48 ` Oliver Scholz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Roland Winkler @ 2004-10-08 19:32 UTC (permalink / raw)


Eli Zaretskii <eliz@is.elta.co.il> writes:

> On 2 Jul 1999, Roland Winkler wrote:
> 
> > My default setting for editing files is unibyte with
> > iso-latin-1. What should I do if in certain buffers I want
> > everything beyond 7bit asci to be displayed with the
> > corresponding octal number?
> 
> Try this:
> 
>  M-: (standard-display-default 128 255) RET

The above is from five years ago. It worked fine up to emacs 21.2.1
(as far as I can go back). Now I am using emacs 21.3.1 or CVS emacs.
What should I do to get the same result?

Thanks a lot,

Roland

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

* Re: displaying octal sequences in emacs 21.3.1
  2004-10-08 19:32 displaying octal sequences in emacs 21.3.1 Roland Winkler
@ 2004-10-09 10:48 ` Oliver Scholz
  2004-10-09 10:56 ` Eli Zaretskii
       [not found] ` <mailman.2245.1097320047.2017.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Oliver Scholz @ 2004-10-09 10:48 UTC (permalink / raw)


Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> writes:

> Eli Zaretskii <eliz@is.elta.co.il> writes:
>
>> On 2 Jul 1999, Roland Winkler wrote:
>> 
>> > My default setting for editing files is unibyte with
>> > iso-latin-1. What should I do if in certain buffers I want
>> > everything beyond 7bit asci to be displayed with the
>> > corresponding octal number?
[...]

I use this:

;; -------------------------------------------------------------------
;;; `eight-bit-graphic' and `eight-bit-control'

;; Display characters from the charsets `eight-bit-control' and
;; `eight-bit-graphic' as octal numbers in a different face.

(defface egoge-8bit-char-face
  '((t
     (:weight bold :inherit font-lock-warning-face)))
  "Face used to display characters from the charsets
`eight-bit-graphic' and `eight-bit-control'.")

(defun egoge-display-eight-bit-as-octal (&optional face)
  (let ((face-offset (if face
			 (* (face-id face)
			    (expt 2 19))
		       0))
	char)
    (dotimes (i 128)
      (setq char (+ i 128))
      (aset standard-display-table char
	    (vconcat (mapcar (lambda (c)
			       (+ face-offset c))
			     (format "\\%o" char)))))))

(unless (> emacs-major-version 21)
  (egoge-display-eight-bit-as-octal 'egoge-8bit-char-face))


It works in multibyte buffers, too.  And it works for all buffers.
IMO this is the right thing.  If you want to edit Latin-1, use a
multibyte buffer; if you want to see the octal sequences for
non-ascii, use a unibyte buffer.

[And actually I think something like this should be the default in
Emacs.]

    Oliver
-- 
18 Vendémiaire an 213 de la Révolution
Liberté, Egalité, Fraternité!

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

* Re: displaying octal sequences in emacs 21.3.1
  2004-10-08 19:32 displaying octal sequences in emacs 21.3.1 Roland Winkler
  2004-10-09 10:48 ` Oliver Scholz
@ 2004-10-09 10:56 ` Eli Zaretskii
       [not found] ` <mailman.2245.1097320047.2017.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2004-10-09 10:56 UTC (permalink / raw)


> From: Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
> Date: Fri, 08 Oct 2004 21:32:02 +0200
> 
> > Try this:
> > 
> >  M-: (standard-display-default 128 255) RET
> 
> The above is from five years ago. It worked fine up to emacs 21.2.1
> (as far as I can go back). Now I am using emacs 21.3.1 or CVS emacs.
> What should I do to get the same result?

Does the above fail to produce the same effect as 5 years ago?

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

* Re: displaying octal sequences in emacs 21.3.1
       [not found] ` <mailman.2245.1097320047.2017.help-gnu-emacs@gnu.org>
@ 2004-10-09 23:35   ` Roland Winkler
  2004-10-10  4:47     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Winkler @ 2004-10-09 23:35 UTC (permalink / raw)


"Eli Zaretskii" <eliz@gnu.org> writes:

>> From: Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
>> Date: Fri, 08 Oct 2004 21:32:02 +0200
>> 
>> > Try this:
>> > 
>> >  M-: (standard-display-default 128 255) RET
>> 
>> The above is from five years ago. It worked fine up to emacs 21.2.1
>> (as far as I can go back). Now I am using emacs 21.3.1 or CVS emacs.
>> What should I do to get the same result?
>
> Does the above fail to produce the same effect as 5 years ago?

That's exactly my problem. Say, I start a fresh emacs --no-init-file.
Then I load a file that contains some german umlaute (iso-8859-1).
Then I do
 M-: (standard-display-default 128 255) RET

When I do all this with emacs 21.2.1 I see the octal sequences as
expected. When I do all this with emacs 21.3.1 or CVS emacs, the
umlaute are still displayed as umlaute.

Roland

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

* Re: displaying octal sequences in emacs 21.3.1
  2004-10-09 23:35   ` Roland Winkler
@ 2004-10-10  4:47     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2004-10-10  4:47 UTC (permalink / raw)


> From: Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
> Date: Sun, 10 Oct 2004 01:35:12 +0200
> 
> >> >  M-: (standard-display-default 128 255) RET
> >> 
> >> The above is from five years ago. It worked fine up to emacs 21.2.1
> >> (as far as I can go back). Now I am using emacs 21.3.1 or CVS emacs.
> >> What should I do to get the same result?
> >
> > Does the above fail to produce the same effect as 5 years ago?
> 
> That's exactly my problem. Say, I start a fresh emacs --no-init-file.
> Then I load a file that contains some german umlaute (iso-8859-1).
> Then I do
>  M-: (standard-display-default 128 255) RET
> 
> When I do all this with emacs 21.2.1 I see the octal sequences as
> expected. When I do all this with emacs 21.3.1 or CVS emacs, the
> umlaute are still displayed as umlaute.

Then please post your question to emacs-devel@gnu.org, as that's where
questions about the CVS version of Emacs should be sent.

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

end of thread, other threads:[~2004-10-10  4:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-08 19:32 displaying octal sequences in emacs 21.3.1 Roland Winkler
2004-10-09 10:48 ` Oliver Scholz
2004-10-09 10:56 ` Eli Zaretskii
     [not found] ` <mailman.2245.1097320047.2017.help-gnu-emacs@gnu.org>
2004-10-09 23:35   ` Roland Winkler
2004-10-10  4:47     ` Eli Zaretskii

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