unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "B. T. Raven" <btraven@nihilo.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Inputting characters with specialist diacritic marks in emacs
Date: Thu, 21 Jan 2016 18:49:38 -0600	[thread overview]
Message-ID: <n7rues018dp@news6.newsguy.com> (raw)
In-Reply-To: <mailman.2611.1453232746.843.help-gnu-emacs@gnu.org>

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 # å
>



  parent reply	other threads:[~2016-01-22  0:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 13:30 Inputting characters with specialist diacritic marks in emacs mikew2801
2016-01-19 15:00 ` Haines Brown
2016-01-19 15:25 ` Drew Adams
2016-01-19 15:26 ` patrick mc allister
2016-01-19 15:35   ` Stefan Monnier
2016-01-19 16:03 ` Teemu Likonen
2016-01-19 16:20 ` Stefan Monnier
2016-01-19 19:45 ` Emanuel Berg
2016-01-19 20:49   ` Nick Dokos
2016-01-19 20:58     ` Emanuel Berg
2016-01-19 21:05     ` Emanuel Berg
2016-01-19 22:46       ` Robert Thorpe
2016-01-20  8:25 ` mikew2801
2016-01-21  0:43   ` Emanuel Berg
2016-01-21 20:31 ` Sven Bretfeld
     [not found] ` <mailman.2611.1453232746.843.help-gnu-emacs@gnu.org>
2016-01-22  0:49   ` B. T. Raven [this message]
2016-01-22  1:24     ` Emanuel Berg
2016-01-22  1:27     ` Joost Kremers
     [not found]     ` <mailman.2729.1453425895.843.help-gnu-emacs@gnu.org>
2016-01-22  1:31       ` Joost Kremers
2016-01-22  2:30         ` Emanuel Berg
2016-01-27  8:52 ` Alan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=n7rues018dp@news6.newsguy.com \
    --to=btraven@nihilo.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).