From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: weird bug with `Russian-computer'? Date: Mon, 04 Jul 2005 03:44:33 +0300 Organization: JURTA Message-ID: <87fyuvtgox.fsf@jurta.org> References: <200507040027.59478.pogonyshev@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1120451461 21258 80.91.229.2 (4 Jul 2005 04:31:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2005 04:31:01 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 04 06:30:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DpIbU-0007Tr-Br for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2005 06:30:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpIcf-0006OX-UQ for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2005 00:31:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DpIZY-00056L-74 for emacs-devel@gnu.org; Mon, 04 Jul 2005 00:28:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DpIZL-0004wm-8j for emacs-devel@gnu.org; Mon, 04 Jul 2005 00:28:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpIZI-0004ra-Ix for emacs-devel@gnu.org; Mon, 04 Jul 2005 00:28:28 -0400 Original-Received: from [194.126.101.123] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DpIYn-0000B1-Lm for emacs-devel@gnu.org; Mon, 04 Jul 2005 00:27:58 -0400 Original-Received: from mail.neti.ee (80-235-34-48-dsl.mus.estpak.ee [80.235.34.48]) by Relayhost1.neti.ee (Postfix) with ESMTP id A74952F36; Mon, 4 Jul 2005 07:22:05 +0300 (EEST) Original-To: Paul Pogonyshev In-Reply-To: <200507040027.59478.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Mon, 4 Jul 2005 00:27:59 +0300") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:40305 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40305 > With the `Russian-computer' input method, S-/ combination produces a comma > (instead of a question mark with standard English.) That is OK and the > way it should be. Perhaps you have a US keyboard layout with `?' on the same key as `/'. Finnish keyboards have quite a different layout where `?' is on the same key as `+', and it is produced by `S-+'. Other keyboards have other layouts, but anyhow I understand how to reproduce the problem. What is essential here is to press shift with the `?' key, because the `russian-computer' input method maps `?' to `,'. > However, when I start incremental search, the key works as in > English, while the rest of the keyboard keeps producing Russian > letters etc. The root of the problem is in `isearch-mode-map' which binds `?' to `isearch-*-char'. When you type a key corresponding to `?' with the input method, `isearch-*-char' intercepts it and interprets as the regexp special character `?'. The following patch fixes this problem by sending the input character to `isearch-process-search-char' which takes care of processing the character according to the current input method. Also a new condition was added before processing a regexp character. If an input method is active, it processes a regexp character only if a typed character is the same with and without an input method, so that all input methods that don't redefine regexp characters won't be affected. Index: lisp/isearch.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v retrieving revision 1.263 diff -c -r1.263 isearch.el *** lisp/isearch.el 23 Apr 2005 15:38:07 -0000 1.263 --- lisp/isearch.el 4 Jul 2005 00:35:07 -0000 *************** *** 1413,1420 **** If optional TO-BARRIER non-nil, ignore previous matches and go exactly to the barrier." ;; (eq (not a) (not b)) makes all non-nil values equivalent ! (when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) ! (not want-backslash)) ;; We have to check 2 stack frames because the last might be ;; invalid just because of a backslash. (or (not isearch-error) --- 1423,1435 ---- If optional TO-BARRIER non-nil, ignore previous matches and go exactly to the barrier." ;; (eq (not a) (not b)) makes all non-nil values equivalent ! (when (and isearch-regexp ! (or (not current-input-method) ! (let ((qchar (quail-find-key last-command-char))) ! (or (eq qchar t) ! (equal (car-safe qchar) (string last-command-char))))) ! (eq (not (isearch-backslash isearch-string)) ! (not want-backslash)) ;; We have to check 2 stack frames because the last might be ;; invalid just because of a backslash. (or (not isearch-error) *************** *** 1458,1464 **** (max last-other-end isearch-barrier) (min last-other-end isearch-barrier))) (setq isearch-adjusted t)))))) ! (isearch-process-search-char last-command-char)) ;; * and ? are special when not preceded by \. (defun isearch-*-char () --- 1473,1479 ---- (max last-other-end isearch-barrier) (min last-other-end isearch-barrier))) (setq isearch-adjusted t)))))) ! (isearch-printing-char)) ;; * and ? are special when not preceded by \. (defun isearch-*-char () Index: lisp/international/isearch-x.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/international/isearch-x.el,v retrieving revision 1.19 diff -c -r1.19 isearch-x.el *** lisp/international/isearch-x.el 13 May 2005 06:03:45 -0000 1.19 --- lisp/international/isearch-x.el 4 Jul 2005 00:35:19 -0000 *************** *** 96,104 **** ;;;###autoload (defun isearch-process-search-multibyte-characters (last-char) ! (if (eq this-command 'isearch-printing-char) (let ((overriding-terminal-local-map nil) ! (prompt (concat (isearch-message-prefix))) (minibuffer-local-map isearch-minibuffer-local-map) str) (if isearch-input-method-function --- 96,105 ---- ;;;###autoload (defun isearch-process-search-multibyte-characters (last-char) ! (if (memq this-command '(isearch-printing-char ! isearch-*-char isearch-}-char isearch-|-char)) (let ((overriding-terminal-local-map nil) ! (prompt (isearch-message-prefix)) (minibuffer-local-map isearch-minibuffer-local-map) str) (if isearch-input-method-function -- Juri Linkov http://www.jurta.org/emacs/