From: MON KEY <monkey@sandpframing.com>
To: juri@jurta.org
Cc: emacs-devel@gnu.org
Subject: Re: Fwd: Alt+numpad to write special symbols
Date: Tue, 29 Sep 2009 21:40:41 -0400 [thread overview]
Message-ID: <d2afcfda0909291840o5a61f90epd8cb2cab543f7875@mail.gmail.com> (raw)
> Like in GTK+ `Ctrl+Shift+U hex RET' http://en.wikipedia.org/wiki/Unicode_input
> we could finish entering the number with RET, e.g. `M-2 M-7 M-0 M-f RET'.
> Or expect a fixed-length four-digit number `M-2 M-7 M-0 M-f' where the last
> fourth digit finishes the sequence. In any case, your up/down events code
> would be useful for other purposes as well.
If I understand correctly what the goal is re: hex input and Unicode,
following was written to accomplish just such task:
(defun mon-test-keypresses (&optional first second third)
"Used to test if additional optional args have been passed to interactive.\n
EXAMPLE:\nM-34 M-x mon-test-keypresses\n
=> \(\(meta . 51\) \(meta . 52\) \(meta . 120\) mon-test-keypresses\)\n►►►"
(interactive "P\nP\np")
(let ((accum-string '())
(accum-event '())
(self 'mon-test-keypresses))
(mapc (lambda (x)
(cond ((= x 13) nil)
((or (eql (car (event-modifiers x)) 'meta)
(eql (car (event-modifiers x)) 'control))
(setq accum-event (cons (cons (car (event-modifiers
x)) (event-basic-type x)) accum-event)))
(t (setq accum-string (cons (char-to-string
(event-basic-type x)) accum-string)))))
(this-command-keys-vector))
(setq accum-event (reverse accum-event))
(setq accum-string (reverse accum-string))
(setq accum-string (apply 'concat accum-string))
(setq accum-string `(,@accum-event ,(if (string= accum-string
self) self accum-string)))
(prin1 accum-string)))
s_P
next reply other threads:[~2009-09-30 1:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-30 1:40 MON KEY [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-09-29 0:49 Alt+numpad to write special symbols David Capello
2009-09-29 0:57 ` Juanma Barranquero
[not found] ` <77b6ce390909281815j1600f85by5837ca2bb4b1f7d@mail.gmail.com>
2009-09-29 1:27 ` Fwd: " David Capello
2009-09-29 3:13 ` Stefan Monnier
2009-09-29 23:12 ` Juri Linkov
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=d2afcfda0909291840o5a61f90epd8cb2cab543f7875@mail.gmail.com \
--to=monkey@sandpframing.com \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.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.