GNU bug report logs - #5380
Problem with command sgml-name-8bit-mode in GNU emacs 23.1

Previous Next

Package: emacs;

Reported by: Volker Kiefel <volker.kiefel <at> freenet.de>

Date: Thu, 14 Jan 2010 22:39:01 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 5380 <at> debbugs.gnu.org (full text, mbox):

From: Kenichi Handa <handa <at> m17n.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 5380 <at> debbugs.gnu.org, emacs-devel <at> gnu.org
Subject: Re: bug#5380: Problem with command sgml-name-8bit-mode in GNU emacs
	23.1
Date: Thu, 21 Jan 2010 11:47:46 +0900
In article <87tyugfcfs.fsf <at> stupidchicken.com>, Chong Yidong <cyd <at> stupidchicken.com> writes:

> Could someone with a non-English keyboard please try to debug Bug#5380?
> > I encountered a problem with the function ``sgml-name-8bit-mode'',
> > (menu option (SGML/Toggle 8 bit insertion)...  After switching on the
> > ``sgml name entity mode'' typing an umlaut character like รค (a umlaut)
> > now no more (as in previous emacs versions and as expected) produces
> > ``&auml;'' but ``\344''.

> In sgml-mode-map, we do the following:

>     (let ((c 127)
>           (map (nth 1 map)))
>       (while (< (setq c (1+ c)) 256)
>         (aset map c 'sgml-maybe-name-self)))

> where

> (defun sgml-maybe-name-self ()
>   "Insert a symbolic character name according to `sgml-char-names'."
>   (interactive "*")
>   (if sgml-name-8bit-mode
>       (let ((mc last-command-event))
> 	(if (< mc 256)
> 	    (setq mc (unibyte-char-to-multibyte mc)))
> 	(or mc (setq mc last-command-event))
> 	(sgml-name-char mc))
>     (self-insert-command 1)))

> This must have broken with the switch to unicode, 

As Emacs receives already decoded character event now,
defining sgml-maybe-name-self simply as below will work.

(defun sgml-maybe-name-self ()
  "Insert a symbolic character name according to `sgml-char-names'."
  (interactive "*")
  (if sgml-name-8bit-mode
      (sgml-name-char last-command-event)
    (self-insert-command 1)))

> but it's inconvenient for me to debug without a keyboard
> that can produce these characters.

You can test it as below:

(let ((sgml-name-8bit-mode t)
      (last-command-event #xC0))
  (call-interactively 'sgml-maybe-name-self))

---
Kenichi Handa
handa <at> m17n.org




This bug report was last modified 15 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.