From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Wordingham Newsgroups: gmane.emacs.help Subject: AltGr and Basic Quail Input Method Date: Sat, 30 Dec 2017 16:48:46 +0000 Message-ID: <20171230164846.6f06b7be@JRWUBU2> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1514653476 10937 195.159.176.226 (30 Dec 2017 17:04:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Dec 2017 17:04:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 30 18:04:32 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVKYh-0002Yg-5L for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Dec 2017 18:04:31 +0100 Original-Received: from localhost ([::1]:60915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVKag-0008AC-7Q for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Dec 2017 12:06:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVKJb-00027a-86 for help-gnu-emacs@gnu.org; Sat, 30 Dec 2017 11:48:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVKJY-0002Bg-3G for help-gnu-emacs@gnu.org; Sat, 30 Dec 2017 11:48:55 -0500 Original-Received: from know-smtprelay-omc-2.server.virginmedia.net ([80.0.253.66]:59858) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eVKJX-00023A-KV for help-gnu-emacs@gnu.org; Sat, 30 Dec 2017 11:48:52 -0500 Original-Received: from JRWUBU2 ([82.24.12.78]) by know-smtprelay-2-imp with bizsmtp id sGom1w00K1h26Xm01Gomeq; Sat, 30 Dec 2017 16:48:46 +0000 X-Originating-IP: [82.24.12.78] X-Authenticated-User: X-Spam: 0 X-Authority: v=2.1 cv=C4wUsl7+ c=1 sm=1 tr=0 a=DTgvfmaz/CX51LldqIotvw==:117 a=DTgvfmaz/CX51LldqIotvw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=VNxK_we_RzdpWzzHpIEA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=ppdUoT1T0Wz2nCnp:21 a=NS-nlr96vV27H9WO:21 a=CjuIK1q_8ugA:10 X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; i686-pc-linux-gnu) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1514652526; bh=jHnZD3jqjgGYfr+d1G25iFmdqNv4ukYVp1bNgs957EA=; h=Date:From:To:Subject; b=jIeY0NbDS1Ulm96k4YMHZo1riD29w9IGiD/g16f7tBmEMM71gxnU9lELQP+QoLkIx /HCV+9UWJYRE7zNoFvPG16mQjLOGdFP8n04dTE71YW5+BRUiRsj8+LWebJjZw3n8gq c4O7U/D9MU9uctk2hkkFGPhwq6AK6M3dd4Jg4OvgNgxi7+td7izgZ9/C4wq3VGl8r+ 8sFXCWMiuefFZKDhBszmW8icqWHYeig6LeVgCbm8u807ONw86rPNsN/muc+w3g3Nw4 waENEpoPHyb70WN3mIi9zvoJ9pP7NiTxkadAu7qFmBmD2nrREuLTHD1ECmSzwOeyC6 M6c4e5nBoUIzQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 80.0.253.66 X-Mailman-Approved-At: Sat, 30 Dec 2017 12:06:08 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115508 Archived-At: It has long irked me that the basic quail input methods, the ones defined by maps from 'sequences of keystrokes' to strings introduced by macro quail-define-rules, do not support the 'Alt Gr' modifier key. I am using GNU/Linux, to be precise Ubuntu 16.04.3 with, I believe, the Unity desk top. My locale is en_GB.utf8, The general input method system is fcitx, my default keyboard is the X11 English (US) keyboard, with the additional 4 system-provided X11 keyboards: English (UK); Thai - Thai (TIS-820.2538); Khmer (Cambodia); Lao and two X11 keyboard composed myself: Thai - Tham Kesmanee and Newa (Newa script). Unfortunately, under X11 one can only map keysyms to codepoints, not to user-perceived characters. I also have some M17N keyboards on my pick list that I run from fcitx. (I had to patch fcitx to get it to work with AltGr.) I generally use Emacs 24.4, the version I modified to support stepping into Indic clusters. I have dug deeper, and found that there seem to be two obstacles to using the 'AltGr' modifier key with basic quail input methods. Firstly, the modifier map I get for my selection of input method and reported by xmodmap -pm, is: shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) This results in Emacs seeing only shift, control, meta and super modifiers. The right Alt key is variously engraved as 'Alt' and 'Alt Gr', but the associated keysym is ISO_Level3_Shift. I have not identified the 'Mode_switch' key on my physical keyboards. I have found a solution to the first problem. I launch Emacs from a terminal emulation, and prior to starting it I issue the command: xmodmap -e 'keysym Mode_switch = Mode_switch Alt_R' This then has the effect that Emacs now also sees an alt modifier, which it registers when I use the AltGr key. Is there any reason not to change Emacs to treat the ISO_Level3_Shift if it has rejected the other candidate alt keys? (Alt_L is rejected because it is bound to the same modifier as Meta_L - the left alt key is consequently interpreted by Emacs as a 'meta' key.) Could this change be effected more simply in the user's start-up script? On the quail side, the problem seems to be that input keystrokes are being stored as a string rather than as a vector. Is there any reason not to hope that one can convert the quail input method to deal with full keystrokes rather than just with characters? A more ambitious solution would be to use an input method direct from M17N, but I think that has a high risk of failure. Richard.