all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <rms@gnu.org>, "'Eli Zaretskii'" <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: Feature suggestion
Date: Sat, 2 Jun 2012 07:13:29 -0700	[thread overview]
Message-ID: <4474CA1C129E49B097021E28AC0E3222@us.oracle.com> (raw)
In-Reply-To: <28C5EC9D641F4FB69EF781F8ECA1A207@us.oracle.com>

> > I think there is a way to enter characters by their long names, too,
> > but I don't recall what it is.  It would be good to mention that
> > method too.
> 
> `C-x 8 RET' (command `ucs-insert') also lets you complete 
> against the char name.

FWIW - 

1. I use a variant (`ucsc-insert') of `ucs-insert' that has the same behavior
except for a negative prefix arg (`ucs-insert' is anyway a no-op for such an
arg):

* A negative arg is treated as its absolute value, so -3 inserts 3 copies of the
char, just like 3 does.

* A negative arg also automatically creates a command that inserts the same
character (accepting a prefix arg for multiple copies).  The command name is the
same as the char name, except lowercase and with SPC chars replaced by hyphens
(`-').  I bind it to `C-x 8 RET', obviously.

For example, if you use `C-- C-x 8 RET greek capital letter delta' (e.g., using
completion), then it defines a command `greek-capital-letter-delta' that inserts
that char.  Convenient for binding keys to effectively add Unicode chars to your
keyboard.

2. I define a macro, `ucsc-make-commands', that takes a regexp arg and defines
all such insertion commands for chars whose names match the regexp.

Examples:

(ucsc-make-commands "^math") ; Math symbols
(ucsc-make-commands "latin") ; Latin alphabet characters
(ucsc-make-commands "arabic")
(ucsc-make-commands "^cjk")  ; Chinese, Japanese, Korean characters
(ucsc-make-commands "^box drawings ")
(ucsc-make-commands "^greek [a-z]+ letter") ; Greek characters
(ucsc-make-commands
  "\\(^hangul\\|^circled hangul\\|^parenthesized hangul\\)")

Note that a drawback to using `ucs[c]-insert' with completion is that it is slow
- there are *many* Unicode chars.  This lets you use it when you really need it,
but have tailor-made insertion commands for the chars you use often.  And of
course even if you do not bind most such commands, completion against their
names is much quicker, since the domain is smaller (even if you create a lot of
such commands).

The code is here:
http://www.emacswiki.org/emacs/download/ucs-cmds.el
I have no objection to it being added to Emacs (the patch is trivial).




  reply	other threads:[~2012-06-02 14:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-01  2:25 Feature suggestion Richard Stallman
2012-06-01  2:46 ` Miles Bader
2012-06-01  6:07 ` Eli Zaretskii
2012-06-01  8:45   ` Andreas Schwab
2012-06-01 20:33   ` Richard Stallman
2012-06-01 20:41     ` Drew Adams
2012-06-02 14:13       ` Drew Adams [this message]
2012-06-02 19:19       ` Richard Stallman
2012-06-03  3:13         ` Miles Bader
2012-06-03 18:30           ` Richard Stallman
2012-06-03  7:45       ` Andreas Röhler
2012-06-08  8:47     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2012-01-02  2:22 York Zhao
2012-01-02 14:53 ` Bastien
2012-01-02 15:40   ` York Zhao
2012-01-02 18:06     ` Bastien
2011-11-28 14:53 Markus Grebenstein
2011-11-06 11:41 Markus Grebenstein
2011-11-06 22:04 ` Herbert Sitz
2002-04-26 22:37 Marius Nita
2002-04-27 11:23 ` Glenn Morris

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

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

  git send-email \
    --in-reply-to=4474CA1C129E49B097021E28AC0E3222@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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.
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.