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

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

Re: html-mode: C-c 8 doesn't work properly


From: Eli Zaretskii
Subject: Re: html-mode: C-c 8 doesn't work properly
Date: Wed, 13 Feb 2002 08:20:29 +0200 (IST)

On 12 Feb 2002, Felix Natter wrote:

> > Does it help to say "C-x RET k latin-1 RET"?
> 
> yes, that fixes it.

Thanks for testing; that confirms my guess that what you reported was a 
known problem, which is fixed in the development sources.

> >       (define-key map (vector (make-char 'latin-iso8859-1))
> >         'sgml-maybe-name-self)
> 
> > +     (let ((c 127)
> > +     (map (nth 1 map)))
> > +       (while (< (setq c (1+ c)) 256)
> > +   (aset map c 'sgml-maybe-name-self)))
> 
> Aren't these two ways of doing the same thing (make-char and aset in
> a loop) ?

No, these two do two very different (but related) things.  To see why, 
try this:

        M-: (make-char 'latin-iso8859-1)

You will see that this produces a number that is nowehere near the range 
128..255.  So the first method sets up the keymap for multibyte Latin-1 
characters, the second one does that for unibyte characters.  When your 
keyboard-coding-system is nil, Emacs key-mapping routines see unibyte 
characters, which is why sgml-mode didn't work for you.

> Emacs 20 used the second form. In 21.1.1 this has been changed
> to the first form and with this patch you do both.

The right way is to do both, because each one of them is correct for some 
situations, but not for others.

> Since the first form looks cleaner, shouldn't we try to make
> it work without the user having to change the coding system for keyboard
> input

The first form won't work if you use an input method for Latin-1 
characters (as opposed to the case like yours, where the keyboard 
produces 8-bit iso8859-1 codes directly).

> (or else tell the user to do C-x RET k TAB ...) ?

It is _always_ advisable to use C-x k RET to inform Emacs about your 
keyboard encoding.  But Emacs should also work reasonably well when the 
user didn't do that.



reply via email to

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