* Avoiding CLI-emacs character suckage on OS X?
@ 2007-11-21 0:09 Moira
0 siblings, 0 replies; 3+ messages in thread
From: Moira @ 2007-11-21 0:09 UTC (permalink / raw)
To: help-gnu-emacs
Hi.
One thing with the countless emacs options is really bugging me. In
the OS X Terminal I can either choose to use Alt as the Meta key and
shed the means to insert such things as "\", "@", "€" and so forth
(German KB), or I can choose to leave it and then have to use Esc
whenever I do a single Meta action, which really sucks when scrolling
or doing other M intensive stuff.
Is there any more or less standard/default way I can insert special
characters such as backslash, @. € and others or should I build my
own lisp-script for that?
Any input is welcome.
Phillip
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Avoiding CLI-emacs character suckage on OS X?
[not found] <mailman.3862.1195603755.18990.help-gnu-emacs@gnu.org>
@ 2007-11-23 8:40 ` Xah Lee
2007-11-23 10:05 ` David Reitter
1 sibling, 0 replies; 3+ messages in thread
From: Xah Lee @ 2007-11-23 8:40 UTC (permalink / raw)
To: help-gnu-emacs
Moira (Phillip) wrote:
> One thing with the countless emacs options is really bugging me. In
> the OS X Terminal I can either choose to use Alt as the Meta key and
> shed the means to insert such things as "\", "@", "€" and so forth
> (German KB), or I can choose to leave it and then have to use Esc
> whenever I do a single Meta action, which really sucks when scrolling
> or doing other M intensive stuff.
>
> Is there any more or less standard/default way I can insert special
> characters such as backslash, @. € and others or should I build my
> own lisp-script for that?
not quite sure precisely what's the prob....
i'd recommend that you use PC keyboard's Alt (or Apple keyboard's Cmd)
as emacs's Meta, then define
(global-set-key (kbd "M-i a") (lambda () (interactive) (insert "α")))
enter any special char you need to type.
Here's more detail
Q: How to type this character é ?
To type characters such as é à ü î ñ, type:
character key press
------------------------------
é Ctrl+x 8 ' e
à Ctrl+x 8 ` a
ü Ctrl+x 8 " u
î Ctrl+x 8 ^ i
ñ Ctrl+x 8 ~ n
To see all the non-ascii characters you can type with Ctrl+x 8 prefix,
type Ctrl+x 8 Ctrl+h.
Here is a sample of characters you can type by the Ctrl+x 8 scheme: ¡ç
£¢¥ ©®™ •º†‡ “”‘’«» ±π∞.
(If you are on a Mac, these characters can be typed by holding the
option key in most applications. To see what characters are available,
you can pull the Keyboard Viewer. To start Keyboard Viewer, go to
System Preferences→International→Input Menu tab, the click at the
bottom «Show input menu in menu bar». Then, on the input menu on top
right, there's a Show Keyboard Viewer menu.)
Q: How to use abbrev to type unicode chars?
A: Suppose you type a lot math and need math symbols such as: alpha α,
beta β, gamma γ, theta θ, Infinity ∞ etc. You can set up a abbrev-
mode, so that, when you type “alpha”, it automatically becomes “α”.
Here's what to do. Put the following in your emacs init file:
(define-abbrev-table 'global-abbrev-table '(
("alpha" "α" nil 0)
("beta" "β" nil 0)
("gamma" "γ" nil 0)
("theta" "θ" nil 0)
("Infinity" "∞" nil 0)
("ar1" "→" nil 0)
("ar2" "⇒" nil 0)
))
Then, turn on the abbrev-mode by “Alt+x abbrev-mode”. Then, when you
type alpha, it will become α.
Reference: (info "(emacs)Abbrevs").
Q: How to set a keystroke to type a unicode char?
If you have some characters that you use often, you can make emacs
inserting them with a single keypress. For example, put the following
code in your ~/.emacs, then, each time you press the 6 key on the
number pad, a arrow will be inserted.
(global-set-key [kp-6] (lambda () (interactive) (insert "→")) )
You can also set shortcut by key sequence. In the following, typing
“Alt+i a” will insert α.
(global-set-key (kbd "M-i a") (lambda () (interactive) (insert "α")))
(global-set-key (kbd "M-i b") (lambda () (interactive) (insert "β")))
(global-set-key (kbd "M-i t") (lambda () (interactive) (insert "θ")))
above from
Emacs and Unicode Tips
http://xahlee.org/emacs/emacs_n_unicode.html
Xah
xah@xahlee.org
∑ http://xahlee.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Avoiding CLI-emacs character suckage on OS X?
[not found] <mailman.3862.1195603755.18990.help-gnu-emacs@gnu.org>
2007-11-23 8:40 ` Avoiding CLI-emacs character suckage on OS X? Xah Lee
@ 2007-11-23 10:05 ` David Reitter
1 sibling, 0 replies; 3+ messages in thread
From: David Reitter @ 2007-11-23 10:05 UTC (permalink / raw)
To: help-gnu-emacs
On Nov 21, 12:09 am, Moira <mo...@demetria.de> wrote:
> In
> the OS X Terminal I can either choose to use Alt as the Meta key and
> shed the means to insert such things as "\", "@", "EURO" and so forth
> (German KB), or I can choose to leave it and then have to use Esc
> whenever I do a single Meta action, which really sucks when scrolling
> or doing other M intensive stuff.
This is a known problem. Similar to what Xah Lee suggested in his
parallel response, I have put together a mode that binds common
characters to M- keys, so that you can continue to use Option for Meta
and insert common characters at the same time.
The mode is actually a series of modes (one for each keyboard layout):
`emulate-mac-german-keyboard-mode', for instance.
This is available from the Options -> "Option Key" menu in Aquamacs
(which can be run from the command line, too), but I'm sure you can
take the source file for that mode and use it with any distribution.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-23 10:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.3862.1195603755.18990.help-gnu-emacs@gnu.org>
2007-11-23 8:40 ` Avoiding CLI-emacs character suckage on OS X? Xah Lee
2007-11-23 10:05 ` David Reitter
2007-11-21 0:09 Moira
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).