all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 5380@debbugs.gnu.org, emacs-devel@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	[thread overview]
Message-ID: <tl7tyugxjfx.fsf@m17n.org> (raw)
In-Reply-To: <87tyugfcfs.fsf@stupidchicken.com> (message from Chong Yidong on Wed, 20 Jan 2010 20:56:23 -0500)

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




  parent reply	other threads:[~2010-01-21  2:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14 22:16 bug#5380: Problem with command sgml-name-8bit-mode in GNU emacs 23.1 Volker Kiefel
2010-01-21  1:56 ` Chong Yidong
2010-01-21  2:47   ` bug#5380: " Kenichi Handa
2010-01-21  2:47   ` Kenichi Handa [this message]
2010-01-21 14:02     ` Chong Yidong
2010-01-21 14:02     ` Chong Yidong
2010-01-21  1:56 ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tl7tyugxjfx.fsf@m17n.org \
    --to=handa@m17n.org \
    --cc=5380@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.