all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ucs method on non-supported unicode chars
@ 2006-12-18 11:21 Juanma Barranquero
  2007-01-03  0:07 ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2006-12-18 11:21 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

With function `ucs-insert' (from lisp/international/ucs-tables.el):

  M-x ucs-insert RET 4DF9 RET => "Character U+4DF9 is not yet
supported" (an error message).

With ucs input method:

  U4DF9 => "ä·¹" (in the buffer).

Why does the ucs input method try to insert what it knows is an
unsupported character? In which way it is better to get "ä·¹" than a
helpful error message?

I ask because the behavior is clearly intentional. `utf-8-ccl-encode'
is defined in leim/quail/uni-input.el, and `ucs-input-method' includes
this error handling:

 (if c
    (list c)
  (aset status 0 n)
  (string-to-list (ccl-execute-on-string
                   'utf-8-ccl-encode status "")))

                    /L/e/k/t/u

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: ucs method on non-supported unicode chars
  2006-12-18 11:21 ucs method on non-supported unicode chars Juanma Barranquero
@ 2007-01-03  0:07 ` Juanma Barranquero
  2007-01-04  1:27   ` Kenichi Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2007-01-03  0:07 UTC (permalink / raw)
  Cc: Dave Love, Kenichi Handa

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

I didn't receive any answer to this question.  I'd say the current
behavior of the ucs input method could be considered a bug.

              /L/e/k/t/u


On 12/18/06, Juanma Barranquero <lekktu@gmail.com> wrote:

> With function `ucs-insert' (from lisp/international/ucs-tables.el):
>
>   M-x ucs-insert RET 4DF9 RET => "Character U+4DF9 is not yet
> supported" (an error message).
>
> With ucs input method:
>
>   U4DF9 => "ä·¹" (in the buffer).
>
> Why does the ucs input method try to insert what it knows is an
> unsupported character? In which way it is better to get "ä·¹" than a
> helpful error message?
>
> I ask because the behavior is clearly intentional. `utf-8-ccl-encode'
> is defined in leim/quail/uni-input.el, and `ucs-input-method' includes
> this error handling:
>
>  (if c
>     (list c)
>   (aset status 0 n)
>   (string-to-list (ccl-execute-on-string
>                    'utf-8-ccl-encode status "")))
>

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: ucs method on non-supported unicode chars
  2007-01-03  0:07 ` Juanma Barranquero
@ 2007-01-04  1:27   ` Kenichi Handa
  2007-01-08  0:41     ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Kenichi Handa @ 2007-01-04  1:27 UTC (permalink / raw)
  Cc: fx, emacs-devel

> On 12/18/06, Juanma Barranquero <lekktu@gmail.com> wrote:

> > With function `ucs-insert' (from lisp/international/ucs-tables.el):
> >
> >   M-x ucs-insert RET 4DF9 RET => "Character U+4DF9 is not yet
> > supported" (an error message).
> >
> > With ucs input method:
> >
> >   U4DF9 => "ä·¹" (in the buffer).
> >
> > Why does the ucs input method try to insert what it knows is an
> > unsupported character? In which way it is better to get "ä·¹" than a
> > helpful error message?
> >
> > I ask because the behavior is clearly intentional. `utf-8-ccl-encode'
> > is defined in leim/quail/uni-input.el, and `ucs-input-method' includes
> > this error handling:
> >
> >  (if c
> >     (list c)
> >   (aset status 0 n)
> >   (string-to-list (ccl-execute-on-string
> >                    'utf-8-ccl-encode status "")))

I have no idea about the intention of the code.  If Dave
doesn't respond, I suggest to install the attached patch.

---
Kenichi Handa
handa@m17n.org


2007-01-04  Kenichi Handa  <handa@m17n.org>

	* quail/uni-input.el (ucs-input-method): Signal an error on
	unsupported Unicode character.

*** uni-input.el	13 Dec 2006 10:08:30 +0900	1.14
--- uni-input.el	04 Jan 2007 10:22:51 +0900	
***************
*** 107,119 ****
  	      (let* ((n (string-to-number (apply 'string
  						 (cdr (nreverse events)))
  					  16))
! 		     (c (decode-char 'ucs n))
! 		     (status (make-vector 9 nil)))
  		(if c
  		    (list c)
! 		  (aset status 0 n)
! 		  (string-to-list (ccl-execute-on-string
! 				   'utf-8-ccl-encode status ""))))))
  	(quail-delete-overlays)
  	(set-buffer-modified-p modified-p)
  	(run-hooks 'input-method-after-insert-chunk-hook)))))
--- 107,116 ----
  	      (let* ((n (string-to-number (apply 'string
  						 (cdr (nreverse events)))
  					  16))
! 		     (c (decode-char 'ucs n)))
  		(if c
  		    (list c)
! 		  (error "Character U+%04X is not yet supported" n)))))
  	(quail-delete-overlays)
  	(set-buffer-modified-p modified-p)
  	(run-hooks 'input-method-after-insert-chunk-hook)))))

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

* Re: ucs method on non-supported unicode chars
  2007-01-04  1:27   ` Kenichi Handa
@ 2007-01-08  0:41     ` Juanma Barranquero
  2007-01-12  4:26       ` Kenichi Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2007-01-08  0:41 UTC (permalink / raw)
  Cc: fx, emacs-devel

On 1/4/07, Kenichi Handa <handa@m17n.org> wrote:

> If Dave doesn't respond

Still no answer from him.

> I suggest to install the attached patch.

But after your code, the whole uft-8-ccl-encode ccl-program is unused.
Before removing that I'd really like why was implemented...

                    /L/e/k/t/u

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

* Re: ucs method on non-supported unicode chars
  2007-01-08  0:41     ` Juanma Barranquero
@ 2007-01-12  4:26       ` Kenichi Handa
  2007-01-12  8:56         ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Kenichi Handa @ 2007-01-12  4:26 UTC (permalink / raw)
  Cc: fx, emacs-devel

In article <f7ccd24b0701071641y3e4dc1fcq51578106864cda1d@mail.gmail.com>, "Juanma Barranquero" <lekktu@gmail.com> writes:

> On 1/4/07, Kenichi Handa <handa@m17n.org> wrote:
> > If Dave doesn't respond

> Still no answer from him.

> > I suggest to install the attached patch.

> But after your code, the whole uft-8-ccl-encode ccl-program is unused.
> Before removing that I'd really like why was implemented...

It seems that the original intention is to insert a correct
UTF-8 sequence by raw-bytes.  But, what returned by a quail
input method is treated as an event sequence (not a sequence
of characters to be inserted).  So, for instance, what does
the event ?\240 do depends on one's environment.  There's no
safe way to insert a specific raw byte.

But, as it is possible to implement a facility of inserting
a raw byte in quail (after the release), I'd like to keep
utf-8-ccl-encode for a while.

---
Kenichi Handa
handa@m17n.org

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

* Re: ucs method on non-supported unicode chars
  2007-01-12  4:26       ` Kenichi Handa
@ 2007-01-12  8:56         ` Juanma Barranquero
  2007-01-12 11:36           ` Kenichi Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2007-01-12  8:56 UTC (permalink / raw)
  Cc: fx, emacs-devel

On 1/12/07, Kenichi Handa <handa@m17n.org> wrote:

> There's no
> safe way to insert a specific raw byte.

Then I suggest committing your patch to fix the current problem, and
coming back to the issue after the release.

                    /L/e/k/t/u

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

* Re: ucs method on non-supported unicode chars
  2007-01-12  8:56         ` Juanma Barranquero
@ 2007-01-12 11:36           ` Kenichi Handa
  0 siblings, 0 replies; 7+ messages in thread
From: Kenichi Handa @ 2007-01-12 11:36 UTC (permalink / raw)
  Cc: fx, emacs-devel

In article <f7ccd24b0701120056w78247d41s5e78cd59c2f162fa@mail.gmail.com>, "Juanma Barranquero" <lekktu@gmail.com> writes:

> On 1/12/07, Kenichi Handa <handa@m17n.org> wrote:
> > There's no
> > safe way to insert a specific raw byte.

> Then I suggest committing your patch to fix the current problem, and
> coming back to the issue after the release.

Ok, done.

---
Kenichi Handa
handa@m17n.org

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

end of thread, other threads:[~2007-01-12 11:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-18 11:21 ucs method on non-supported unicode chars Juanma Barranquero
2007-01-03  0:07 ` Juanma Barranquero
2007-01-04  1:27   ` Kenichi Handa
2007-01-08  0:41     ` Juanma Barranquero
2007-01-12  4:26       ` Kenichi Handa
2007-01-12  8:56         ` Juanma Barranquero
2007-01-12 11:36           ` Kenichi Handa

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.