From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Inputting characters with specialist diacritic marks in emacs Date: Tue, 19 Jan 2016 07:25:11 -0800 (PST) Message-ID: References: <571eb6f1-614e-4ec0-9c55-bbe1fbfb9ddc@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1453217158 21751 80.91.229.3 (19 Jan 2016 15:25:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Jan 2016 15:25:58 +0000 (UTC) To: mikew2801@gmail.com, help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 19 16:25:45 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1aLYAB-0001Ds-Uy for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 16:25:44 +0100 Original-Received: from localhost ([::1]:37509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLYAB-0003I1-5e for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 10:25:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLY9u-00038J-EK for help-gnu-emacs@gnu.org; Tue, 19 Jan 2016 10:25:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLY9p-0007u1-By for help-gnu-emacs@gnu.org; Tue, 19 Jan 2016 10:25:26 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:33774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLY9p-0007tU-6H for help-gnu-emacs@gnu.org; Tue, 19 Jan 2016 10:25:21 -0500 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u0JFPDe9012203 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 19 Jan 2016 15:25:14 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u0JFPDFh011389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 19 Jan 2016 15:25:13 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.13.8) with ESMTP id u0JFPD9l019007; Tue, 19 Jan 2016 15:25:13 GMT In-Reply-To: <571eb6f1-614e-4ec0-9c55-bbe1fbfb9ddc@googlegroups.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108778 Archived-At: > My makeshift solution is to use the "global-set-key" function to bind > individual characters to keys, e.g., >=20 > (global-set-key (kbd "C-c y") (lambda () (interactive) (insert "=C3=B1"))= ) > (global-set-key (kbd "C-c t") (lambda () (interactive) (insert "=E1=B9=AD= "))) > (global-set-key (kbd "C-c d") (lambda () (interactive) (insert "=E1=B8=8D= "))) >=20 > This is not ideal since it's quite difficult to type these bindings. In > Linux I use Ibus mappings which involve double-tapping a similar key (e.g= ., > when I type "a-a" I get "=C4=81", when I type "i-i" I get "=C4=AB" and so= on. >=20 > The question is - is there a way to make similar key-bindings in Emacs? > Sublime facilitates this, but I'd rather stay in emacs and emacs 24 refus= es > to work with Ibus (I've tried other help forums on Ibus/emacs to no avail= ). If the characters or their code points are related in a way that can be simply ordered, then you can iterate over char/code point in some range(s), invoking `global-set-key' for each in turn. Or even if you can just list them: (defvar cks `((,(kbd "C-c y") "=C3=B1") (,(kbd "C-c t") "=E1=B9=AD") (,(kbd= "C-c d") "=E1=B8=8D")) "...") (dolist (c+k cks) (global-set-key (car c+k) (lambda () (interactive) (insert (cadr c+k))))) And perhaps you can codify the relation between, say, (C-c) d and "=E1=B8= =8D". Admittedly, this just uses a different form, and doesn't really save you any typing. But if the main difficulty is entering the characters, then know that Emacs makes it pretty easy to enter any Unicode characters, if you know either their Unicode names or their Unicode code points. Hit `C-x 8 RET' (RET is the Enter key), and you are prompted for the character name. You can use completion to enter it. Or you can just enter the code point as a hexadecimal number. Then hit RET again. ---- FWIW, though it likely won't help with creating the keybindings, library `ucs-cmds.el' might help a little here. Its macro `ucsc-make-commands' lets you create sets of commands that insert individual characters, by giving it a regexp that is matched against the Unicode character names. For example: (ucsc-make-commands "^greek [a-z]+ letter") ; Commands for Greek letters. (ucsc-make-commands "arabic") ; Commands for Arabic characters. The resulting commands have the same names as the characters they insert. You can then bind those commands to keys. (Perhaps this will help you create the keybindings, if the names of your chars follow some pattern.) = =20 Library: http://www.emacswiki.org/emacs/download/ucs-cmds.el