Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
funptr
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
funptr
16y ago
Not offhand, but I looked it up and I think what you want is `key-description'. It prints key sequences, so e.g. (key-description "\370") evals to "M-x".
2.
▲
by
funptr
16y ago
That seems to work also, what's the problem?
3.
▲
by
funptr
16y ago
It's not part of emacs, I just wrote it as an example.
4.
▲
by
funptr
16y ago
This one prompts you to type a literal key sequence (exactly like with `describe-key', C-h k) and inserts it at the point in a representation that the *-set-key functions can use. As written it's bound to to C-c k, and only in the scope of
5.
▲
by
funptr
16y ago
> Is there a C macro that can do this? No, of course. C macros only see strings; you need to parse a syntax tree to do your reverse example (like lisp macros). No argument from me. > Lisp's macro system allows you to create new syn
6.
▲
by
funptr
16y ago
You're right, it's not even valid C99. My mistake.
7.
▲
by
funptr
16y ago
C99 + GCC extensions + POSIX: #define for_duration(seconds, body) \ { \ pthread_t tid_task, tid_watcher; \