unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Problem with command sgml-name-8bit-mode in GNU emacs 23.1
@ 2010-01-21  1:56 ` Chong Yidong
  2010-01-21  2:47   ` bug#5380: " Kenichi Handa
  0 siblings, 1 reply; 3+ messages in thread
From: Chong Yidong @ 2010-01-21  1:56 UTC (permalink / raw)
  To: emacs-devel; +Cc: 5380

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
> ``ä'' 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, but it's inconvenient
for me to debug without a keyboard that can produce these characters.




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

* Re: bug#5380: Problem with command sgml-name-8bit-mode in GNU emacs 23.1
  2010-01-21  1:56 ` Problem with command sgml-name-8bit-mode in GNU emacs 23.1 Chong Yidong
@ 2010-01-21  2:47   ` Kenichi Handa
  2010-01-21 14:02     ` Chong Yidong
  0 siblings, 1 reply; 3+ messages in thread
From: Kenichi Handa @ 2010-01-21  2:47 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 5380, emacs-devel

In article <87tyugfcfs.fsf@stupidchicken.com>, Chong Yidong <cyd@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@m17n.org




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

* Re: bug#5380: Problem with command sgml-name-8bit-mode in GNU emacs 23.1
  2010-01-21  2:47   ` bug#5380: " Kenichi Handa
@ 2010-01-21 14:02     ` Chong Yidong
  0 siblings, 0 replies; 3+ messages in thread
From: Chong Yidong @ 2010-01-21 14:02 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: 5380, emacs-devel

Kenichi Handa <handa@m17n.org> writes:

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

Ah, that seems to work.  Thanks very much.




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

end of thread, other threads:[~2010-01-21 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4B4F97A9.1080506@freenet.de>
2010-01-21  1:56 ` Problem with command sgml-name-8bit-mode in GNU emacs 23.1 Chong Yidong
2010-01-21  2:47   ` bug#5380: " Kenichi Handa
2010-01-21 14:02     ` Chong Yidong

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