all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* read-event question
@ 2006-04-14  9:55 Lars Magne Ingebrigtsen
  2006-04-14 10:02 ` Miles Bader
  2006-04-14 11:34 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2006-04-14  9:55 UTC (permalink / raw)


I'm having a really trivial problem, but I haven't been able to find
the answer in the Emacs or Emacs-Lisp manuals.  I'm sure I'm just
looking in the wrong place.

Here's the problem: I'm using `read-event' to, well, read a user
event.  I want to do something when the user enters `M-n', but I just
can't seem to find a way to translate `M-n' into whatever `read-event'
returns (or vice versa).

Using `read-event' and tapping `M-n' returns a large integer:

(read-event) => 134217838

Is there some function I can use to map [(meta n)] or whatever to this
number? 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read-event question
  2006-04-14  9:55 read-event question Lars Magne Ingebrigtsen
@ 2006-04-14 10:02 ` Miles Bader
  2006-04-14 10:10   ` Lars Magne Ingebrigtsen
  2006-04-14 11:34 ` Stefan Monnier
  1 sibling, 1 reply; 6+ messages in thread
From: Miles Bader @ 2006-04-14 10:02 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Using `read-event' and tapping `M-n' returns a large integer:
>
> (read-event) => 134217838
>
> Is there some function I can use to map [(meta n)] or whatever to this
> number? 

   (kbd "M-n")
     => [134217838]

-- 
Saa, shall we dance?  (from a dance-class advertisement)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read-event question
  2006-04-14 10:02 ` Miles Bader
@ 2006-04-14 10:10   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2006-04-14 10:10 UTC (permalink / raw)


Miles Bader <miles.bader@necel.com> writes:

>    (kbd "M-n")
>      => [134217838]

Ah; great.  Thanks.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read-event question
  2006-04-14  9:55 read-event question Lars Magne Ingebrigtsen
  2006-04-14 10:02 ` Miles Bader
@ 2006-04-14 11:34 ` Stefan Monnier
  2006-04-14 11:58   ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2006-04-14 11:34 UTC (permalink / raw)


> Using `read-event' and tapping `M-n' returns a large integer:
> (read-event) => 134217838

?\M-n


        Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read-event question
  2006-04-14 11:34 ` Stefan Monnier
@ 2006-04-14 11:58   ` Lars Magne Ingebrigtsen
  2006-04-14 18:05     ` Kevin Rodgers
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2006-04-14 11:58 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> ?\M-n

Wow.

Anyway, perhaps the documentation to `read-event' should mention this?
Surely I can't be the only one who's wondered about this...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: read-event question
  2006-04-14 11:58   ` Lars Magne Ingebrigtsen
@ 2006-04-14 18:05     ` Kevin Rodgers
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Rodgers @ 2006-04-14 18:05 UTC (permalink / raw)


Lars Magne Ingebrigtsen wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> 
>>?\M-n
> 
> 
> Wow.
> 
> Anyway, perhaps the documentation to `read-event' should mention this?
> Surely I can't be the only one who's wondered about this...

It seems obvious to me at least: the M-n keyboard event is a character,
and characters are represented as integers.  Have you read the Keyboard
Events node of the Emacs Lisp manual?

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-04-14 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-14  9:55 read-event question Lars Magne Ingebrigtsen
2006-04-14 10:02 ` Miles Bader
2006-04-14 10:10   ` Lars Magne Ingebrigtsen
2006-04-14 11:34 ` Stefan Monnier
2006-04-14 11:58   ` Lars Magne Ingebrigtsen
2006-04-14 18:05     ` Kevin Rodgers

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.