From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: Inputting characters with specialist diacritic marks in emacs Date: Thu, 21 Jan 2016 18:49:38 -0600 Organization: NewsGuy - Unlimited Usenet $23.95 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; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1453423820 23506 80.91.229.3 (22 Jan 2016 00:50:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Jan 2016 00:50:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 22 01:50:20 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 1aMPvf-0007vD-DB for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Jan 2016 01:50:19 +0100 Original-Received: from localhost ([::1]:50207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMPve-0006qG-DM for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jan 2016 19:50:18 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news6 Original-Newsgroups: gnu.emacs.help Original-Lines: 121 Original-NNTP-Posting-Host: pb077e5bb1b775aa739c42e9e3a59ea391bc5b70c6891945a.newsdawg.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: X-Received-Bytes: 5057 X-Received-Body-CRC: 2648433137 Original-Xref: usenet.stanford.edu gnu.emacs.help:216525 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:108816 Archived-At: By far the easiest and mnemonically most intuitive way of inserting exotic glyphs is with an input method. If you put this line: (fset 'im-lat [?\C-x return ?\C-\\ ?l ?a ?t ?i ?n ?- ?p ?o ?s ?t ?f ?i ?x return]) into your .emacs you can invoke the latin-postfix method with M - im-lat and have access to å ä ö Å Ä Ö plus about 180 other diacritic combinations from all the languages of Europe that use the Latin alphabet, and including £ ¥ € then you can toggle back and forth to and from your previous input method with C-\ If you need something really exotic, you can accomplish that with e. g.: (global-set-key "\C-cI" (lambda () (interactive) (insert ?‽))) ;;;; interrobang Ed P.S. When will Emacs support a ring or stack of input method invocations by the C-\ keychord? On 1/19/2016 1:45 PM, Emanuel Berg wrote: > mikew2801@gmail.com writes: > >> (global-set-key (kbd "C-c y") (lambda () (interactive) >> (insert "ñ"))) ... >> >> This is not ideal since it's quite difficult to type >> these bindings. > > Do you mean it is difficult/tedious to hit those > keystrokes or do you mean it is a lot of work setting > them up? > > If it is difficult/tedious, come up with better > shortcuts! (But `C-c y' is fine in that sense what > I can see.) > > If it is a lot of work setting it up, either use > kill/yank, or write a script to automatize it if you > have several hundred such chars - but if you do, > you'll have to come up with a more refined keyboard > scheme as well otherwise the shortcuts will be > depleted before long... > >> In Linux I use Ibus mappings which involve >> double-tapping a similar key (e.g., when I type >> "a-a" I get "ā", when I type "i-i" I get "ī" and >> so on. > > Yes, this is the best solution, to have a > *compose key* which works in Linux in general and in > Emacs the exact same way (with Emacs running on Linux, > of course). > > For example, I, as a programmer, am so used to coding > and writing (in English). So I want the Anglo-American > keyboard layout for both purposes. But when I write in > Swedish, which I do say once a day - even tho it is > a 100th or so of all my writing - it is a small part > but not small enough to be neglected, *then*, I still > cannot use the Swedish layout, as that would bring > havoc to my brain as so many chars would change place > on the keyboard. Still (again) I need the å, ä, and > ö chars which are in the Swedish alphabet but not > the English. > > The solution is the compose key, which in the > Linux VTs (the ttys, or "the console") are setup like > I show soon. But, you probably don't use the ttys, so > I show this just to illustrate the principle. In X, > you can do the same, of course, just not the same way. > > Good luck! > > Relevant part from: /etc/console-setup/remap.inc > > Whole file: http://user.it.uu.se/~embe8573/conf/remap.inc > > ### compose key > ## > ## To make the compose key work, > ## see the setting in /etc/default/keyboard > ## if that doesn't work, use showkey(1) > ## to get the desired keycode, and: > > keycode 125 = Compose > > ## setup the combinations one by one; > ## output current state with 'dumpkeys --compose-only' [1] > > ## [1] for these to work in a tmux session, use: > ## $ sudo chmod +s /usr/bin/showkey # ditto /bin/dumpkeys > > compose '"' 'A' to U+00C4 # Ä > compose '"' 'a' to U+00E4 # ä > compose '"' 'O' to U+00D6 # Ö > compose '"' 'o' to U+00F6 # ö > compose '"' 'U' to U+00DC # Ü > compose '"' 'u' to U+00FC # ü > compose '/' 'A' to U+00C1 # Á > compose '/' 'a' to U+00E1 # á > compose '/' 'E' to U+00C9 # É > compose '/' 'e' to U+00E9 # é > compose '/' 'I' to U+00CD # Í > compose '/' 'i' to U+00ED # í > compose '/' 'O' to U+00D3 # Ó > compose '/' 'o' to U+00F3 # ó > compose '/' 'U' to U+00DA # Ú > compose '/' 'u' to U+00FA # ú > compose '0' 'A' to U+00C5 # Å > compose '0' 'a' to U+00E5 # å > compose '\\' 'A' to U+00C0 # À > compose '\\' 'a' to U+00E0 # à > compose 'o' 'A' to U+00C5 # Å > compose 'o' 'a' to U+00E5 # å >