unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Miles Bader <miles.bader@necel.com>
Cc: emacs-pretest-bug@gnu.org, emacs-devel@gnu.org, rms@gnu.org,
	Kenichi Handa <handa@m17n.org>
Subject: Re: GNU Emacs 22.0.50 fails to find ä in different ISO Latin encodings
Date: Fri, 22 Sep 2006 20:27:40 +0900	[thread overview]
Message-ID: <buor6y4xhsj.fsf@dhapc248.dev.necel.com> (raw)
In-Reply-To: <35A5EBE2-652D-488C-9CFD-E7B56A8C2D07@web.de> (Peter Dyballa's message of "Fri\, 22 Sep 2006 12\:55\:12 +0200")

Peter Dyballa <Peter_Dyballa@web.de> writes:
> There is also the option to change the 'base' of the character code
> notation from 8 to 16

This feature is supported; see the variable `read-quoted-char-radix'.

> This might be the correct way in a GNU Emacs way, but not in the way  an
> Emacs user would use it. Or can I type C-q 4245 RET to input ¥ in  some
> file? (Well, it actually works ...) Having to use other numbers  than
> the well-known three digits wide ones is not the usual user
> experience.

I suppose that a patch such as the following could be used to support
at least unicode input in `read-quoted-char' (the function underlying C-q).

(set `read-quoted-char-charset' to `ucs' to input unicode-codes)

Whether this is a serious enough problem to consider adding a patch this
latein the release cycle to consider, I don't know.  [I think the
default value of read-quoted-char-charset would probably have to remain
nil though...]

-Miles


2006-09-22  Miles Bader  <miles@gnu.org>

	* subr.el (read-quoted-char-charset): New variable.
	(read-quoted-char): Use it.

--- orig/lisp/subr.el
+++ mod/lisp/subr.el
@@ -1539,6 +1548,17 @@
   :type '(choice (const 8) (const 10) (const 16))
   :group 'editing-basics)
 
+(defvar read-quoted-char-charset nil
+  "*The character-set used for numeric codepoints entered with `read-quoted-char'.
+If nil, Emacs' internal codepoints are used.")
+
+(custom-declare-variable-early
+ 'read-quoted-char-charset nil
+ "*The character-set used for numeric codepoints entered with `read-quoted-char'.
+If nil, Emacs' internal codepoints are used."
+  :type '(choice (const nil) (const ucs))
+  :group 'editing-basics)
+
 (defun read-quoted-char (&optional prompt)
   "Like `read-char', but do not allow quitting.
 Also, if the first character read is an octal digit,
@@ -1595,7 +1615,13 @@
 	    (t (setq code translated
 		     done t)))
       (setq first nil))
-    code))
+    (if (null read-quoted-char-charset)
+	code
+      (let ((decoded (decode-char read-quoted-char-charset code)))
+	(when (null decoded)
+	  (error "Invalid %s character: %d, #o%o, #x%x"
+		 read-quoted-char-charset code code code))
+	decoded))))
 
 (defun read-passwd (prompt &optional confirm default)
   "Read a password, prompting with PROMPT, and return it.


-- 
The secret to creativity is knowing how to hide your sources.
  --Albert Einstein

  reply	other threads:[~2006-09-22 11:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <F021B5CA-A186-4AFB-B650-520DBB6261C4@Web.DE>
2006-09-19  3:58 ` GNU Emacs 22.0.50 fails to find ä in different ISO Latin encodings Kenichi Handa
2006-09-19  6:43   ` David Kastrup
2006-09-19 22:57   ` Richard Stallman
2006-09-20  7:10     ` Kenichi Handa
2006-09-20  7:43       ` Peter Dyballa
2006-09-20  8:05         ` Kenichi Handa
2006-09-20 11:17           ` Peter Dyballa
2006-09-21  2:13             ` Kenichi Handa
2006-09-21  8:09               ` Peter Dyballa
2006-09-21 23:22               ` Peter Dyballa
2006-09-22  0:44                 ` Miles Bader
2006-09-22  9:06                   ` Peter Dyballa
2006-09-22 10:31                     ` Miles Bader
2006-09-22 10:55                       ` Peter Dyballa
2006-09-22 11:27                         ` Miles Bader [this message]
2006-09-22 22:54                           ` Peter Dyballa
2006-09-22 23:25                             ` Miles Bader
2006-09-23  8:45                               ` Peter Dyballa
2006-09-24  1:51                                 ` Miles Bader
2006-09-23  3:34                           ` Richard Stallman
2006-09-23  5:18                             ` Miles Bader
2006-09-24  2:10                               ` Richard Stallman
2006-09-22  1:06                 ` Kenichi Handa
2006-09-22  9:32                   ` Peter Dyballa
2006-09-21 17:20       ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=buor6y4xhsj.fsf@dhapc248.dev.necel.com \
    --to=miles.bader@necel.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=handa@m17n.org \
    --cc=miles@gnu.org \
    --cc=rms@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 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).