all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivanov Dmitry <usr345@gmail.com>
To: Magnar Sveen <magnar@kodemaker.no>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs attach an action to any key pressed
Date: Wed, 5 Jun 2013 11:56:19 +0400	[thread overview]
Message-ID: <CAHyAE11SOq8h_m1WLvTtRHAfJJgd3qjWZ0WBk+PcozFL1x6dXg@mail.gmail.com> (raw)
In-Reply-To: <CALVcYyCNzkEoF+QP5jzXGFSqVUyuFdvr5sF5bHUG-vf=339zGg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

I tried this:

(defun dummy ()
      (interactive)
      (message "aaa")
      (remove-hook 'post-command-hook 'dummy))

(add-hook 'post-command-hook 'dummy)

It prints "aaa" exactly after I press C-x e on add-hook command. But I want
it to print only when I press any key afterwards. What should I do?

[-- Attachment #2: Type: text/html, Size: 458 bytes --]

  reply	other threads:[~2013-06-05  7:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05  5:26 Emacs attach an action to any key pressed Ivanov Dmitry
2013-06-05  6:44 ` Magnar Sveen
2013-06-05  7:56   ` Ivanov Dmitry [this message]
2013-06-05 13:24     ` Kevin Rodgers
2013-06-05 13:02 ` Stefan Monnier
2013-06-05 13:48   ` Ivanov Dmitry

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=CAHyAE11SOq8h_m1WLvTtRHAfJJgd3qjWZ0WBk+PcozFL1x6dXg@mail.gmail.com \
    --to=usr345@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=magnar@kodemaker.no \
    /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.