From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.60; Cannot isearch for non-ascii chars with emacs -nw -Q Date: Thu, 28 Feb 2008 11:02:56 +0900 Message-ID: References: <87oda4d6h8.fsf@fastmail.fm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1204164220 6401 80.91.229.12 (28 Feb 2008 02:03:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2008 02:03:40 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, thorn+news@fastmail.fm To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 28 03:04:06 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JUY7w-0002CO-WB for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 03:04:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUY7Q-0006Hj-Ss for ged-emacs-devel@m.gmane.org; Wed, 27 Feb 2008 21:03:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUY7M-0006Dr-3C for emacs-devel@gnu.org; Wed, 27 Feb 2008 21:03:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUY7L-0006Bb-5L for emacs-devel@gnu.org; Wed, 27 Feb 2008 21:03:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUY7K-0006BS-V3 for emacs-devel@gnu.org; Wed, 27 Feb 2008 21:03:27 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JUY7K-0006P9-HE for emacs-devel@gnu.org; Wed, 27 Feb 2008 21:03:26 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JUY7K-0003TJ-8E for emacs-pretest-bug@gnu.org; Wed, 27 Feb 2008 21:03:26 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JUY7G-0006Oh-Ke for emacs-pretest-bug@gnu.org; Wed, 27 Feb 2008 21:03:25 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JUY7G-0006OF-0E for emacs-pretest-bug@gnu.org; Wed, 27 Feb 2008 21:03:22 -0500 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id m1S239VG008551; Thu, 28 Feb 2008 11:03:09 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id m1S239BE011830; Thu, 28 Feb 2008 11:03:09 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id m1S22uvu007243; Thu, 28 Feb 2008 11:02:56 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1JUY6q-0007y7-Rd; Thu, 28 Feb 2008 11:02:56 +0900 In-reply-to: (message from Stefan Monnier on Wed, 27 Feb 2008 11:13:18 -0500) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90683 gmane.emacs.pretest.bugs:21328 Archived-At: In article , Stefan Monnier writes: > > It seems that something is broken in isearch-x.el (although > > unicode merge didn't change it). I'm now investigating. I found that when isearch-printing-char is called, last-command-char is already what decoded by encoded-kbd-mode. But, when I wrote isearch-x.el, last-command-char was the first byte of utf-8 sequence. So, isearch-x.el pushed back that byte in unread-command-events and re-read the whole utf-8 sequence. It seems that something in handling keyboard input has been changed. I've just installed the attached change. Tassilo, could you please try again with the latest code? > > But, perhaps, it's time to implement the decoding of > > keyboard input by C. After multi-tty merge, we have the > > function tty_read_avail_input. I think that is the right > > place to do that decoding. > Now that we've moved the keyboard decoding to input-event-map, Ah! Is that the change I wrote above? > I'm not sure what would be the benefit. Of course, if we > can just reuse C code and get rid of the encoded-kbd code, > that's good. Yes. I think it can be done by adding less than 100 lines of C code (mostly for handling meta-key) in tty_read_avail_input and removing most of encoded-kb.el (we still need the code of calling set-input-mode property). --- Kenichi Handa handa@ni.aist.go.jp 2008-02-28 Kenichi Handa * isearch.el (isearch-printing-char): Don't check keyboard-coding-system. Call isearch-process-search-multibyte-characters only when current-input-method is non-nil. Index: isearch.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v retrieving revision 1.312 retrieving revision 1.313 diff -u -r1.312 -r1.313 --- isearch.el 25 Feb 2008 00:01:41 -0000 1.312 +++ isearch.el 28 Feb 2008 01:57:42 -0000 1.313 @@ -1842,15 +1842,9 @@ (let ((char last-command-char)) (if (= char ?\S-\ ) (setq char ?\s)) - (if (and enable-multibyte-characters - (>= char ?\200) - (<= char ?\377)) - (if (keyboard-coding-system) - (isearch-process-search-multibyte-characters char) - (isearch-process-search-char (unibyte-char-to-multibyte char))) - (if current-input-method - (isearch-process-search-multibyte-characters char) - (isearch-process-search-char char))))) + (if current-input-method + (isearch-process-search-multibyte-characters char) + (isearch-process-search-char char)))) (defun isearch-process-search-char (char) ;; * and ? are special in regexps when not preceded by \.