unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to write a self-insert-command-like command?
@ 2015-07-31 21:10 Marcin Borkowski
  2015-07-31 22:35 ` Doug Lewan
  2015-08-01 13:28 ` Michael Heerdegen
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Borkowski @ 2015-07-31 21:10 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all,

I want to have a command whose behavior will depend on the key used to
invoke it, much like self-insert-command.  How to do that?  Is
last-command-event the right tool for that, or is there a better one?

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



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

* RE: How to write a self-insert-command-like command?
  2015-07-31 21:10 How to write a self-insert-command-like command? Marcin Borkowski
@ 2015-07-31 22:35 ` Doug Lewan
  2015-08-01 13:28 ` Michael Heerdegen
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Lewan @ 2015-07-31 22:35 UTC (permalink / raw)
  To: Marcin Borkowski, Help Gnu Emacs mailing list

> -----Original Message-----
> On
> Behalf Of Marcin Borkowski
> Subject: How to write a self-insert-command-like command?
> 
> Hi all,
> 
> I want to have a command whose behavior will depend on the key used to
> invoke it, much like self-insert-command.  How to do that?  Is
> last-command-event the right tool for that, or is there a better one?

last-command event is what I have used on the rare occasion 
that I've written such a thing.

-- 
,Doug
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 4335

I once worked in a can recycling facility. It was soda pressing.





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

* Re: How to write a self-insert-command-like command?
  2015-07-31 21:10 How to write a self-insert-command-like command? Marcin Borkowski
  2015-07-31 22:35 ` Doug Lewan
@ 2015-08-01 13:28 ` Michael Heerdegen
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2015-08-01 13:28 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@mbork.pl> writes:

> I want to have a command whose behavior will depend on the key used to
> invoke it, much like self-insert-command.  How to do that?  Is
> last-command-event the right tool for that, or is there a better one?

AFAICT, the (C) source code of `self-insert-command' uses `last-command-event',
too.


Michael.




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

end of thread, other threads:[~2015-08-01 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31 21:10 How to write a self-insert-command-like command? Marcin Borkowski
2015-07-31 22:35 ` Doug Lewan
2015-08-01 13:28 ` Michael Heerdegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).