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: wish: right alt/meta to switch keyboard layout while pressed Date: Wed, 23 Nov 2005 08:07:14 +0200 Organization: JURTA Message-ID: <87hda47x3i.fsf@jurta.org> References: <200511222150.54248.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 1132727861 28090 80.91.229.2 (23 Nov 2005 06:37:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2005 06:37:41 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 23 07:37:21 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EensL-00070C-6M for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2005 07:13:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EensJ-0002We-Ia for ged-emacs-devel@m.gmane.org; Wed, 23 Nov 2005 01:12:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eens4-0002WL-4E for emacs-devel@gnu.org; Wed, 23 Nov 2005 01:12:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eens3-0002W9-KE for emacs-devel@gnu.org; Wed, 23 Nov 2005 01:12:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eens3-0002W6-HU for emacs-devel@gnu.org; Wed, 23 Nov 2005 01:12:43 -0500 Original-Received: from [194.126.101.98] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Eens3-0007bF-BE for emacs-devel@gnu.org; Wed, 23 Nov 2005 01:12:43 -0500 Original-Received: from mail.neti.ee (80-235-32-206-dsl.mus.estpak.ee [80.235.32.206]) by Relayhost1.neti.ee (Postfix) with ESMTP id 621903675; Wed, 23 Nov 2005 08:12:57 +0200 (EET) Original-To: Paul Pogonyshev In-Reply-To: <200511222150.54248.pogonyshev@gmx.net> (Paul Pogonyshev's message of "Tue, 22 Nov 2005 21:50:54 +0200") 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:46468 Archived-At: > So, if I want to type an apostrophe from Russian keyboard layout, I > have to type `C-\ ' C-\'. If, however, the temporary-switching was > implemented, I could do with `press-right-alt ' release-right-alt', > which is obviously much easier. > > As far as I can tell, Emacs currently just ignores the right Alt. > > Can this be implemented easily? I think the most natural way to do this in Emacs is to use C-q. So to quote ' in an input method and not to translate it, you could use C-q '. However, this currently doesn't work. C-q inserts a translated character, and while C-q together with an input method read an input sequence, the intermediate display in the echo area is quite messy. It seems `quoted-insert' (C-q) attempts to do something with this situation, and it let-binds `translation-table-for-input' to nil before reading a quoted character, but this doesn't work for quoting characters in input methods. I propose the following patch to let-bind `input-method-function' to nil as well. Index: lisp/simple.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v retrieving revision 1.769 diff -c -r1.769 simple.el *** lisp/simple.el 20 Nov 2005 18:08:55 -0000 1.769 --- lisp/simple.el 23 Nov 2005 06:04:04 -0000 *************** *** 609,615 **** digits are interpreted as a character code. This is intended to be useful for editing binary files." (interactive "*p") ! (let* ((char (let (translation-table-for-input) (if (or (not overwrite-mode) (eq overwrite-mode 'overwrite-mode-binary)) (read-quoted-char) --- 610,616 ---- digits are interpreted as a character code. This is intended to be useful for editing binary files." (interactive "*p") ! (let* ((char (let (translation-table-for-input input-method-function) (if (or (not overwrite-mode) (eq overwrite-mode 'overwrite-mode-binary)) (read-quoted-char) -- Juri Linkov http://www.jurta.org/emacs/