From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Perry E. Metzger" Newsgroups: gmane.emacs.devel Subject: Re: Non-ASCII chars in quail rules Date: Wed, 3 Sep 2014 07:43:55 -0400 Message-ID: <20140903074355.2a7cd6e2@jabberwock.cb.piermont.com> References: <20140829101804.4c904346@jabberwock.cb.piermont.com> <20140830184844.797d7340@jabberwock.cb.piermont.com> <20140831100035.6487ff7f@jabberwock.cb.piermont.com> <20140831172949.7ba54d1a@jabberwock.cb.piermont.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1409744668 12148 80.91.229.3 (3 Sep 2014 11:44:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2014 11:44:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 03 13:44:21 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XP8z6-0008Oc-Mt for ged-emacs-devel@m.gmane.org; Wed, 03 Sep 2014 13:44:20 +0200 Original-Received: from localhost ([::1]:44471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP8z6-0007Wf-BH for ged-emacs-devel@m.gmane.org; Wed, 03 Sep 2014 07:44:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP8yq-0007W3-Lb for emacs-devel@gnu.org; Wed, 03 Sep 2014 07:44:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP8ym-0004rs-7f for emacs-devel@gnu.org; Wed, 03 Sep 2014 07:44:04 -0400 Original-Received: from hacklheber.piermont.com ([166.84.7.14]:51882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP8ym-0004rU-4t for emacs-devel@gnu.org; Wed, 03 Sep 2014 07:44:00 -0400 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id B5A4642B; Wed, 3 Sep 2014 07:43:57 -0400 (EDT) Original-Received: from jabberwock.cb.piermont.com (jabberwock.cb.piermont.com [10.160.2.107]) by snark.cb.piermont.com (Postfix) with ESMTP id 7649B2DEC16; Wed, 3 Sep 2014 07:43:57 -0400 (EDT) In-Reply-To: X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; x86_64-apple-darwin13.3.0) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 166.84.7.14 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173977 Archived-At: On Tue, 02 Sep 2014 22:23:54 -0400 Stefan Monnier wrote: > But that's expected because of the restriction documented in the > docstring of input-method-function: > > It's called with one argument, a printing character that was > just read. (That means a character with code 040...0176.) > > The patch below lifts this restriction, after which your code seems > to work. Indeed, that is doubtless the problem! Thank you! One note: CHARACTERP does a bit more than is actually needed here, it may be sufficient to say XINT (c) <= MAX_CHAR or to use the CHAR_VALID_P macro. I am not sure what the intent here of the restriction was, but a more general solution for the entire line of the test might be CHAR_PRINTABLE_P depending on what that intent actually is. (I don't entirely understand the intent, so I can't say.) Perry > > > Stefan > > > === modified file 'src/keyboard.c' > --- src/keyboard.c 2014-08-27 10:51:21 +0000 > +++ src/keyboard.c 2014-09-03 02:20:07 +0000 > @@ -3048,7 +3048,7 @@ > save the echo area contents for it to refer to. */ > if (INTEGERP (c) > && ! NILP (Vinput_method_function) > - && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127) > + && ' ' <= XINT (c) && CHARACTERP (c) && XINT (c) != 127) > { > previous_echo_area_message = Fcurrent_message (); > Vinput_method_previous_message = previous_echo_area_message; > @@ -3078,7 +3078,7 @@ > /* Don't run the input method within a key sequence, > after the first event of the key sequence. */ > && NILP (prev_event) > - && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127) > + && ' ' <= XINT (c) && CHARACTERP (c) && XINT (c) != 127) > { > Lisp_Object keys; > ptrdiff_t key_count; > -- Perry E. Metzger perry@piermont.com