* Inputting characters with specialist diacritic marks in emacs
@ 2016-01-19 13:30 mikew2801
2016-01-19 15:00 ` Haines Brown
` (9 more replies)
0 siblings, 10 replies; 21+ messages in thread
From: mikew2801 @ 2016-01-19 13:30 UTC (permalink / raw
To: help-gnu-emacs
Hello,
I am a linguist who works particularly with Indic languages. I am trying to do most of my work in emacs, but I am having problems using characters with diacritic marks (for instance ā, ī and so on) which are commonly used to transliterate old Indic languages such as Sanskrit and Pali.
My makeshift solution is to use the "global-set-key" function to bind individual characters to keys, e.g.,
(global-set-key (kbd "C-c y") (lambda () (interactive) (insert "ñ")))
(global-set-key (kbd "C-c t") (lambda () (interactive) (insert "ṭ")))
(global-set-key (kbd "C-c d") (lambda () (interactive) (insert "ḍ")))
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 "ā", when I type "i-i" I get "ī" and so on.
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 refuses to work with Ibus (I've tried other help forums on Ibus/emacs to no avail).
Any ideas/comments would most appreciated! As you can tell I'm very new to emacs.
Mike
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
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
` (8 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Haines Brown @ 2016-01-19 15:00 UTC (permalink / raw
To: help-gnu-emacs
On Tue, Jan 19, 2016 at 05:30:00AM -0800, mikew2801@gmail.com wrote:
> Hello,
>
> I am a linguist who works particularly with Indic languages. I am
> trying to do most of my work in emacs, but I am having problems using
> characters with diacritic marks (for instance ā, ī and so on) which
> are commonly used to transliterate old Indic languages such as
> Sanskrit and Pali.
Might not be helpful because I don't know if you prepare documents with
LaTeX. But when I put N\={a}g\={a}rjuna into a TeX document and process
it with pdfLaTeX, it shows up as Nāgārjuna.
For scripts such as Tamil அய்யா வணக்கம், I suspect you have to use XeLaTeX
rather than pdfLaTeX with a supporting font.
LaTeX-Indic is a Omega package that will enable the use of Indic
languages LaTeX documents without any preprocessing.
If you don't use LaTeX, you might do as I did for an array of even more
obscure characters. Rather than look up the Unicode each time, I have a
crib sheet with lists of caron, breve and macron and other characters
and simply yank/past from it as needed.
Another path is to use a Unicode editor such as Yudit, but I've no
experience with it.
Haines Brown
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: Inputting characters with specialist diacritic marks in emacs
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
` (7 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Drew Adams @ 2016-01-19 15:25 UTC (permalink / raw
To: mikew2801, help-gnu-emacs
> My makeshift solution is to use the "global-set-key" function to bind
> individual characters to keys, e.g.,
>
> (global-set-key (kbd "C-c y") (lambda () (interactive) (insert "ñ")))
> (global-set-key (kbd "C-c t") (lambda () (interactive) (insert "ṭ")))
> (global-set-key (kbd "C-c d") (lambda () (interactive) (insert "ḍ")))
>
> 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 "ā", when I type "i-i" I get "ī" and so on.
>
> 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 refuses
> 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") "ñ") (,(kbd "C-c t") "ṭ") (,(kbd "C-c d") "ḍ"))
"...")
(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 "ḍ".
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.)
Library: http://www.emacswiki.org/emacs/download/ucs-cmds.el
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
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
` (6 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: patrick mc allister @ 2016-01-19 15:26 UTC (permalink / raw
To: mikew2801; +Cc: help-gnu-emacs
On Tue, Jan 19, 2016 at 05:30:00AM -0800, mikew2801@gmail.com wrote:
> Hello,
>
> I am a linguist who works particularly with Indic languages. I am
> trying to do most of my work in emacs, but I am having problems
> using characters with diacritic marks (for instance ā, ī and so on)
> which are commonly used to transliterate old Indic languages such as
> Sanskrit and Pali.
Stefan Baums wrote an input method: http://stefanbaums.com/unicode/sanskrit.el
Save this somewhere (in your ~/.emacs.d/ is a good idea), and then
call ~M-x load-file sanskrit.el~ when you need it. Or put this in
your .emacs file:
(load "~/.emacs.d/sanskrit.el")
You can then enable it with ~M-x set-input-method sanskrit~. Then,
typing "=a" should give you "ā". See ~M-x describe-input-method~ for
more info.
If you prefer the "aa" -> "ā" conversion, you'll have to add "("aa"
?ā)" etc. to sanskrit.el.
Most alternatives built in to emacs have only partial support for all
the characters you'll need, AFAIK: TeX or latin-postfix/prefix input
methods.
Best regards,
--
patrick
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 15:26 ` patrick mc allister
@ 2016-01-19 15:35 ` Stefan Monnier
0 siblings, 0 replies; 21+ messages in thread
From: Stefan Monnier @ 2016-01-19 15:35 UTC (permalink / raw
To: help-gnu-emacs
> Most alternatives built in to Emacs have only partial support for all
> the characters you'll need, AFAIK: TeX or latin-postfix/prefix input
> methods.
The TeX input methods aims to provide good coverage, so feel free to
M-x report-emacs-bug when you need something added to it.
Stefan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 13:30 Inputting characters with specialist diacritic marks in emacs mikew2801
` (2 preceding siblings ...)
2016-01-19 15:26 ` patrick mc allister
@ 2016-01-19 16:03 ` Teemu Likonen
2016-01-19 16:20 ` Stefan Monnier
` (5 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Teemu Likonen @ 2016-01-19 16:03 UTC (permalink / raw
To: mikew; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 680 bytes --]
mikew [2016-01-19 05:30:00-08] wrote:
> I am a linguist who works particularly with Indic languages. I am
> trying to do most of my work in emacs, but I am having problems using
> characters with diacritic marks (for instance ā, ī and so on) which
> are commonly used to transliterate old Indic languages such as
> Sanskrit and Pali.
Input method "rfc1345" may be a good choice.
M-x set-input-method RET rfc1345 RET
Key chords start with &, for example &a- makes ā. See
M-x describe-input-method RET rfc1345 RET
--
/// Teemu Likonen - .-.. <https://github.com/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 13:30 Inputting characters with specialist diacritic marks in emacs mikew2801
` (3 preceding siblings ...)
2016-01-19 16:03 ` Teemu Likonen
@ 2016-01-19 16:20 ` Stefan Monnier
2016-01-19 19:45 ` Emanuel Berg
` (4 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Stefan Monnier @ 2016-01-19 16:20 UTC (permalink / raw
To: help-gnu-emacs
> 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 "ā", when I type "i-i" I get "ī" and so on.
You want to use a proper input method, yes.
AFAIK it should be possible to use your OS's input method (e.g. Ibus
under GNU/Linux), but you can also use one of Emacs's own input methods.
I'm not sure what's the best input method for your use-case, but at
least you can start with the TeX input method, which tends to be a bit
verbose but has the advantage of offering a reasonably good coverage.
C-u C-\ TeX RET
after which you can type "\=a" to input an "ā" or "\~n" to input an "ñ",
"\d{d}" to input a "ḍ" (not sure why the method does not allow the use
of something shorter like \dd here).
You can use M-x describe-input-method RET TeX RET to see a complete
description. And C-u C-x = on a character will tell you things like «to
input: type "\d{t}" with TeX input method» if the TeX input method
is enabled.
Stefan
PS: Personally, I most often use my OS's input method, where I rely on
the "compose" key for most things. See also
https://github.com/kragen/xcompose for an example of what you can do on
that front.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 13:30 Inputting characters with specialist diacritic marks in emacs mikew2801
` (4 preceding siblings ...)
2016-01-19 16:20 ` Stefan Monnier
@ 2016-01-19 19:45 ` Emanuel Berg
2016-01-19 20:49 ` Nick Dokos
2016-01-20 8:25 ` mikew2801
` (3 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Emanuel Berg @ 2016-01-19 19:45 UTC (permalink / raw
To: help-gnu-emacs
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 # å
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
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
0 siblings, 2 replies; 21+ messages in thread
From: Nick Dokos @ 2016-01-19 20:49 UTC (permalink / raw
To: help-gnu-emacs
Emanuel Berg <embe8573@student.uu.se> writes:
> ....
> 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.
>
setxkbmap can be used for that:
setxkbmap -query
shows me
,----
| rules: evdev
| model: pc105+inet
| layout: us,us,us,us
| variant: ,colemak,dvorak,
| options: ctrl:nocaps,compose:ralt
`----
I do the ctrl:nocaps thing and the variants, but everything else is
preset for me somehow. If you don't have a compose key, then
I presume
setxkbmap -option compose:ralt
will make Right-Alt be the compose key. The key combinations are slightly
different from your settings below:
compose+a " -> ä
compose+a ' -> á
compose+a ` -> à
compose+a ^ -> â
compose+a * -> å
compose+a , -> ą
compose+o / -> ø
compose+l / -> ł
compose+? ? -> ¿
compose+! ! -> ¡
I'm not sure who does all this - all I'm sure about is that it's not me!
>
> 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 # å
--
Nick
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 20:49 ` Nick Dokos
@ 2016-01-19 20:58 ` Emanuel Berg
2016-01-19 21:05 ` Emanuel Berg
1 sibling, 0 replies; 21+ messages in thread
From: Emanuel Berg @ 2016-01-19 20:58 UTC (permalink / raw
To: help-gnu-emacs
Nick Dokos <ndokos@gmail.com> writes:
> I'm not sure who does all this - all I'm sure about
> is that it's not me!
The compose key is good, at least when the goofy chars
are but a few. In my case they are three, or six if
you count the lower- and uppercase versions as
distinct - even so, they share they same compose key
and prefix so it is just the actual key that has to
have a specific case which is the "case" anyway!
The shortcuts seem/are bulky at first but soon enough
will enter the muscle memory/finger habits.
The advantage with the compose key solution is that
there is no switching between layouts - there is one
layout that works for everything normal, and one
compose key that works (always) for everything beyond
that. So there is no getting all confused and
frustrated switching the layout back and forth.
It is actually pretty good :)
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
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
1 sibling, 1 reply; 21+ messages in thread
From: Emanuel Berg @ 2016-01-19 21:05 UTC (permalink / raw
To: help-gnu-emacs
Nick Dokos <ndokos@gmail.com> writes:
>> The solution is the compose key, which in the Linux
>> VTs (the ttys, or "the console") is 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.
>
> setxkbmap can be used for that:
>
> setxkbmap -query
>
> shows me
>
> I do the ctrl:nocaps thing and the variants, but
> everything else is preset for me somehow. If you
> don't have a compose key, then I presume
>
> setxkbmap -option compose:ralt
>
> will make Right-Alt be the compose key.
Good!
Probably some thought should be put into what the
compose key should be. I have it, according to
showkey(1), at keycode 125 which is between the
control key and the alt key on the left side of space
on my Sun keyboard.
I suppose the important thing is that you have the
compose key on one side, and the prefixes on the
other, so you can use the left hand to do one thing,
and the right hand to do the other!
> compose+a " -> ä
> compose+a ' -> á
> compose+a ` -> à
> [...]
Yes, as you see that all make sense! That's cool.
But it doesn't have to as, again, it'll enter the
muscle memory/finger habits soon enough. But why not
make it mnemonic as well when it is so easy to do?
It is not like mnemonic shortcuts DON'T enter the
muscle memory/finger habits just as well!
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 21:05 ` Emanuel Berg
@ 2016-01-19 22:46 ` Robert Thorpe
0 siblings, 0 replies; 21+ messages in thread
From: Robert Thorpe @ 2016-01-19 22:46 UTC (permalink / raw
To: help-gnu-emacs
Emanuel Berg <embe8573@student.uu.se> writes:
> Probably some thought should be put into what the
> compose key should be. I have it, according to
> showkey(1), at keycode 125 which is between the
> control key and the alt key on the left side of space
> on my Sun keyboard.
I agree. It's very useful to have both right and left alt available
when using Emacs for a long time.
On modern keyboards there are often "Windows" and "Mark" keys. I find
that the mark key isn't used very often. If you're not running MS
Windows then the Windows key isn't either. You may want to use one of
those two as the compose key.
BR,
Robert Thorpe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 13:30 Inputting characters with specialist diacritic marks in emacs mikew2801
` (5 preceding siblings ...)
2016-01-19 19:45 ` Emanuel Berg
@ 2016-01-20 8:25 ` mikew2801
2016-01-21 0:43 ` Emanuel Berg
2016-01-21 20:31 ` Sven Bretfeld
` (2 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: mikew2801 @ 2016-01-20 8:25 UTC (permalink / raw
To: help-gnu-emacs
Thanks to everyone for solutions / observations.
I've installed the Sanskrit input method and it seems to work really well. With a little effort it's now exactly like my Ibus input method. A few asked why I didn't like the key bindings I was using (e.g., C-c a, C-c i) and so on. It's because it's difficult to type and leads after some time I find my hand cramps. The "double-tapping" solution involves less awkward hand postures.
Does anyone here know why the Ibus input method doesn't work with Emacs? I used Emacs for a period a few years back and I remember that it did work at that point. I've tried various fixes (e.g., using the Ibus input method) but I couldn't get it to work. I know that neither 23 nor 24 work with Ibus by default. I asked the question on another emacs forum but got no responses.
Mike
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-20 8:25 ` mikew2801
@ 2016-01-21 0:43 ` Emanuel Berg
0 siblings, 0 replies; 21+ messages in thread
From: Emanuel Berg @ 2016-01-21 0:43 UTC (permalink / raw
To: help-gnu-emacs
mikew2801@gmail.com writes:
> I've installed the Sanskrit input method and it
> seems to work really well. With a little effort it's
> now exactly like my Ibus input method. A few asked
> why I didn't like the key bindings I was using
> (e.g., C-c a, C-c i) and so on. It's because it's
> difficult to type and leads after some time I find
> my hand cramps.
OK, that is a good reason not to do it. Ergonomics!
The most bodily comfortable hackers are the best for
several reasons. To mechanics, arborists and so on it
is obvious so they put their minds to it day one.
To computer users and professionals (paycheck or not)
it isn't as obvious. How many books on programming
don't mention it with one word? But it is
equally important.
> Does anyone here know why the Ibus input method
> doesn't work with Emacs? I used Emacs for a period
> a few years back and I remember that it did work at
> that point. I've tried various fixes (e.g., using
> the Ibus input method) but I couldn't get it to
> work. I know that neither 23 nor 24 work with Ibus
> by default. I asked the question on another emacs
> forum but got no responses.
I'm unfamiliar with Ibus but it makes sense to have
the same input for all applications. You can either
try to synch them all into the same with a jungle of
config files, *or* just bring it all into Emacs. It is
50/50 what transition will bring success the fastest.
I know what I would do... :)
I suppose you could ask the Ibus people if they have
a mailing list. There is no mention of "Ibus" on the
Gmane server (NNTP, news.gmane.org) - that isn't
a good sign, but who knows?
If you do find them and do ask them, it would be
humorous if they told you to ask the Emacs people :)
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 13:30 Inputting characters with specialist diacritic marks in emacs mikew2801
` (6 preceding siblings ...)
2016-01-20 8:25 ` mikew2801
@ 2016-01-21 20:31 ` Sven Bretfeld
[not found] ` <mailman.2611.1453232746.843.help-gnu-emacs@gnu.org>
2016-01-27 8:52 ` Alan
9 siblings, 0 replies; 21+ messages in thread
From: Sven Bretfeld @ 2016-01-21 20:31 UTC (permalink / raw
To: mikew2801; +Cc: help-gnu-emacs
mikew2801@gmail.com writes:
> My makeshift solution is to use the "global-set-key" function to bind individual characters to keys, e.g.,
>
> (global-set-key (kbd "C-c y") (lambda () (interactive) (insert "ñ")))
> (global-set-key (kbd "C-c t") (lambda () (interactive) (insert "ṭ")))
> (global-set-key (kbd "C-c d") (lambda () (interactive) (insert "ḍ")))
Hi
Here is what I've been using for years to type Sanskrit, Pali and
Tibetan. The M-a prefix feels quite natural after short. I just hit it
with thumb and middle finger of the left hand. Stefan's sanskrit.el
package is brilliant but might be overkill. Too many different prefixes
to remember for my taste. Using one easy-to-reach prefix for everything
and adding an intuitive follow-up key (i for ī, I for Ī) seems more easy
to me.
Sven
-----
(define-key global-map [(meta a)] nil) ;;Alt-a als Präfix freigeben
(define-key org-mode-map [(meta a)] nil) ;; auch für orgmode
(defun insert-lang-a ()
(interactive)
(ucs-insert #x0101))
(global-set-key "\M-aa" 'insert-lang-a)
(defun insert-lang-i ()
(interactive)
(ucs-insert #x012B))
(global-set-key "\M-ai" 'insert-lang-i)
(defun insert-lang-u ()
(interactive)
(ucs-insert #x016B))
(global-set-key "\M-au" 'insert-lang-u)
(defun insert-punkt-r ()
(interactive)
(ucs-insert #x1E5B))
(global-set-key "\M-ar" 'insert-punkt-r)
(defun insert-punkt-l ()
(interactive)
(ucs-insert #x1E37))
(global-set-key "\M-al" 'insert-punkt-l)
(defun insert-lang-e ()
(interactive)
(ucs-insert #x0113))
(global-set-key "\M-ae" 'insert-lang-e)
(defun insert-lang-o ()
(interactive)
(ucs-insert #x014D))
(global-set-key "\M-ao" 'insert-lang-o)
(defun insert-nga ()
(interactive)
(ucs-insert #x1E45))
(global-set-key "\M-ag" 'insert-nga)
(defun insert-nya ()
(interactive)
(ucs-insert #x00F1))
(global-set-key "\M-ac" 'insert-nya)
(defun insert-punkt-t ()
(interactive)
(ucs-insert #x1E6D))
(global-set-key "\M-at" 'insert-punkt-t)
(defun insert-punkt-d ()
(interactive)
(ucs-insert #x1E0D))
(global-set-key "\M-ad" 'insert-punkt-d)
(defun insert-punkt-n ()
(interactive)
(ucs-insert #x1E47))
(global-set-key "\M-an" 'insert-punkt-n)
(defun insert-sha ()
(interactive)
(ucs-insert #x015B))
(global-set-key "\M-ax" 'insert-sha)
(defun insert-punkt-s ()
(interactive)
(ucs-insert #x1E63))
(global-set-key "\M-as" 'insert-punkt-s)
(defun insert-zha ()
(interactive)
(ucs-insert #x017A))
(global-set-key "\M-az" 'insert-zha)
(defun insert-punkt-m ()
(interactive)
(ucs-insert #x1E43))
(global-set-key "\M-am" 'insert-punkt-m)
(defun insert-punkt-h ()
(interactive)
(ucs-insert #x1E25))
(global-set-key "\M-ah" 'insert-punkt-h)
(defun insert-lang-a-gr ()
(interactive)
(ucs-insert #x0100))
(global-set-key "\M-aA" 'insert-lang-a-gr)
(defun insert-lang-i-gr ()
(interactive)
(ucs-insert #x012A))
(global-set-key "\M-aI" 'insert-lang-i-gr)
(defun insert-lang-u-gr ()
(interactive)
(ucs-insert #x016A))
(global-set-key "\M-aU" 'insert-lang-u-gr)
(defun insert-punkt-r-gr ()
(interactive)
(ucs-insert #x1E5A))
(global-set-key "\M-aR" 'insert-punkt-r-gr)
(defun insert-lang-e-gr ()
(interactive)
(ucs-insert #x0112))
(global-set-key "\M-aE" 'insert-lang-e-gr)
(defun insert-lang-o-gr ()
(interactive)
(ucs-insert #x014C))
(global-set-key "\M-aO" 'insert-lang-o-gr)
(defun insert-nga-gr ()
(interactive)
(ucs-insert #x1E44))
(global-set-key "\M-aG" 'insert-nga-gr)
(defun insert-nya-gr ()
(interactive)
(ucs-insert #x00D1))
(global-set-key "\M-aC" 'insert-nya-gr)
(defun insert-punkt-t-gr ()
(interactive)
(ucs-insert #x1E6C))
(global-set-key "\M-aT" 'insert-punkt-t-gr)
(defun insert-punkt-d-gr ()
(interactive)
(ucs-insert #x1E0C))
(global-set-key "\M-aD" 'insert-punkt-d-gr)
(defun insert-punkt-n-gr ()
(interactive)
(ucs-insert #x1E46))
(global-set-key "\M-aN" 'insert-punkt-n-gr)
(defun insert-sha-gr ()
(interactive)
(ucs-insert #x015A))
(global-set-key "\M-aX" 'insert-sha-gr)
(defun insert-punkt-s-gr ()
(interactive)
(ucs-insert #x1E62))
(global-set-key "\M-aS" 'insert-punkt-s-gr)
(defun insert-zha-gr ()
(interactive)
(ucs-insert #x0179))
(global-set-key "\M-aZ" 'insert-zha-gr)
(defun insert-punkt-m-gr ()
(interactive)
(ucs-insert #x1E42))
(global-set-key "\M-aM" 'insert-punkt-m-gr)
(defun insert-punkt-h-gr ()
(interactive)
(ucs-insert #x1E24))
(global-set-key "\M-aH" 'insert-punkt-h-gr)
(defun insert-lang-ae-gr ()
(interactive)
(ucs-insert #x01DF))
(global-set-key "\M-ap" 'insert-lang-ae-gr)
(defun insert-degree ()
(interactive)
(ucs-insert #xB0))
(global-set-key "\M-a|" 'insert-degree)
----
--
Sven Bretfeld
Department of Philosophy and Religious Studies
NTNU Trondheim
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
[not found] ` <mailman.2611.1453232746.843.help-gnu-emacs@gnu.org>
@ 2016-01-22 0:49 ` B. T. Raven
2016-01-22 1:24 ` Emanuel Berg
` (2 more replies)
0 siblings, 3 replies; 21+ messages in thread
From: B. T. Raven @ 2016-01-22 0:49 UTC (permalink / raw
To: help-gnu-emacs
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 # å
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-22 0:49 ` B. T. Raven
@ 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>
2 siblings, 0 replies; 21+ messages in thread
From: Emanuel Berg @ 2016-01-22 1:24 UTC (permalink / raw
To: help-gnu-emacs
"B. T. Raven" <btraven@nihilo.net> writes:
> 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-\
That may be a good idea if you have the need for 180+
"diacritic combinations" but if you only need å, ä, ö,
which are *not* exotic in Swedish but common vowels
like any other, this is far too slow and to change
input method at that - no good.
For but a few chars that are used all the time the
compose key is the best solution: fast, no toggling,
and every (other) char remain the same - no blocking
or interfering with whatever else you use.
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-22 0:49 ` B. T. Raven
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>
2 siblings, 0 replies; 21+ messages in thread
From: Joost Kremers @ 2016-01-22 1:27 UTC (permalink / raw
To: help-gnu-emacs
B. T. Raven wrote:
> P.S. When will Emacs support a ring or stack of input method
> invocations by the C-\ keychord?
Not really a ring or stack, and not stock Emacs, as it requires the
hydra package, but the following works nicely:
```
(defhydra jk-hydra-input-method (:exit t :hint nil :idle 1)
"
Current input method: %s(or current-input-method \"none\")
_l_: latin-9-prefix _t_: TeX _s_: set input method
_i_: IPA _x_: X-SAMPA
"
("s" set-input-method)
("i" (set-input-method "ipa"))
("x" (set-input-method "ipa-x-sampa"))
("t" (set-input-method "TeX"))
("l" (set-input-method "latin-9-prefix"))
("C-\\" (toggle-input-method)))
(bind-key "C-\\" #'jk-hydra-input-method/body)
```
--
Joost Kremers joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
[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
0 siblings, 1 reply; 21+ messages in thread
From: Joost Kremers @ 2016-01-22 1:31 UTC (permalink / raw
To: help-gnu-emacs
Emanuel Berg wrote:
> "B. T. Raven" <btraven@nihilo.net> writes:
>
>> 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-\
>
> That may be a good idea if you have the need for 180+
> "diacritic combinations" but if you only need å, ä, ö,
> which are *not* exotic in Swedish but common vowels
> like any other, this is far too slow and to change
> input method at that - no good.
>
> For but a few chars that are used all the time the
> compose key is the best solution: fast, no toggling,
> and every (other) char remain the same - no blocking
> or interfering with whatever else you use.
Actually, Latin-n input methods generally don't intefere with anything.
I generally turn on latin-9-prefix when I type Dutch or German and keep
it on. There's no need to turn it off, unless for some reason I need
another input method. (IPA, X-SAMPA and TeX are ones I use from time to
time. They are more intrusive, esp. the first two: it's not possible to
have them on while typing normal text.)
--
Joost Kremers joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-22 1:31 ` Joost Kremers
@ 2016-01-22 2:30 ` Emanuel Berg
0 siblings, 0 replies; 21+ messages in thread
From: Emanuel Berg @ 2016-01-22 2:30 UTC (permalink / raw
To: help-gnu-emacs
Joost Kremers <joost.m.kremers@gmail.com> writes:
> Actually, Latin-n input methods generally don't
> intefere with anything. I generally turn on
> latin-9-prefix when I type Dutch or German and keep
> it on. There's no need to turn it off, unless for
> some reason I need another input method. (IPA,
> X-SAMPA and TeX are ones I use from time to time.
> They are more intrusive, esp. the first two: it's
> not possible to have them on while typing
> normal text.)
- Do you always try to see both sides of an issue?
- Well, yes and no...
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Inputting characters with specialist diacritic marks in emacs
2016-01-19 13:30 Inputting characters with specialist diacritic marks in emacs mikew2801
` (8 preceding siblings ...)
[not found] ` <mailman.2611.1453232746.843.help-gnu-emacs@gnu.org>
@ 2016-01-27 8:52 ` Alan
9 siblings, 0 replies; 21+ messages in thread
From: Alan @ 2016-01-27 8:52 UTC (permalink / raw
To: help-gnu-emacs
I originally started using Emacs over 25 years ago, for precisely the reason that it was easy to find documentation on how to type diacritical marks.
I no longer have the older .emacs files, but I used single character abbreviations. It was very fast to type, even faster than the \C-x8... method. I now use the latter, because it's easier to remember. In my .emacs file was a list of abbrevs.
If I had a specific set of characters that I needed often today, I would think again about using abbrevs. I'm sorry I cannot provide more specific information.
Alan Davis
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2016-01-27 8:52 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.