help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Writing source code with Unicode characters


From: Drew Adams
Subject: RE: Writing source code with Unicode characters
Date: Thu, 6 Feb 2014 14:59:56 -0800 (PST)

> Drew:
> Thanks but that's not quite the thing I'm looking for. It is good
> when you need to write a few unicode chars

Why a few?  It's precisely when you want to define *lots* of such
chars that the macro is the most helpful.

> and wish to save a few keystrokes by not invoking C-x 8 RET
> <name>, but not so convenient when you are interested on quickly
> typing unicode chars on a similar way you type ordinary text,
> which would require setting quite a few keybindings

Suit yourself.  But your "quickly typing unicode chars on a
similar way you type ordinary text" sounds to me a *lot* like
having keys that insert the chars you want - in effect, another
(soft) keyboard or keyboard range.

And that essentially means "setting quite a few keybindings".
But you define those keys only once.  And you can do it in a
systematic way.

You use the Shift key now to reach certain chars using your
keyboard.  You could just as easily use another key (as a prefix
key) to "shift" any of your keys so they directly type Greek
chars or math symbols.

Why wouldn't you want a `lambda' key on your keyboard?
And `alpha' ... `omega' keys if you use Greek letters a lot, as
you say.  

E.g., you now have `l' and `Shift l' (for `L').  Why not also,
say, `<lwindow> l' for lowercase lambda and `Shift <lwindow> l'
for uppercase lambda?  Likewise for other Greek letters you use.

And for any such commands (e.g. some of the math symbols)
that you do *not* want to bind to keys, it is trivial to use
*completion* against the command name - which is also the
Unicode char name.

If by "quickly typing unicode chars on a similar way you type
ordinary text" you really meant (as per Eli's suggestion) typing
not a single key for the char but a bunch of keys that spell out
the *name* of the char (e.g. `l a m b d a'), then that is what
you already get with completion - except that you need not type
the whole name.

So in that sense too of "quickly typing...ordinary text",
I would think that macro `ucsc-make-commands' would help you.

> and it would not be an advantage over binding the key
> sequences to (insert-char <the-char-itself>).

Sure, you could write your own:

(defun my-THE-CHAR-command ()
  (interactive)
  (insert-char <the-char-itself>))

But I suspect maybe you are missing the point.  You would need
to create such code (including the inserted <the-char-itself>)
for *each character* you  use - either by hand or by program.

Writing such code is exactly what macro `ucsc-make-commands'
does for you.  And it does it in one fell swoop for a whole
range of chars.

But again, suit yourself, of course.  Just thought perhaps
it was not clear what I was suggesting for your use case.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]