all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mihai Bazon <mihai@bazon.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 4093@emacsbugs.donarmstrong.com
Subject: bug#4093: Overlay keymap and timers
Date: Mon, 10 Aug 2009 21:26:23 +0300	[thread overview]
Message-ID: <5f77467962473de6f883e85a8259fed2@bazon.net> (raw)
In-Reply-To: <jwv8whr1wxp.fsf-monnier+emacsbugreports@gnu.org>

Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
> Basically the problem in the case of changing the keymap from a timer
> comes down to:
> 
>   what happens if the use presses C-c, then your code runs then the user
>   presses C-d:  should the C-c C-d be looked up in the original keymaps
>   or in the new keymaps?

That's a good question.  As an user, if I start typing a combined key
binding then I would expect it to work regardless of whatever happened
in a timer in between.  So indeed, it can be a problem to allow a timer
to set a new keymap in this case.

But if there's no prefix key already typed, it would be great if
use-local-map actually did what it's supposed to do, even when ran with
a timer.

Perhaps the proper solution would involve saving the current keymap when
a prefix key has been pressed, and use that keymap until it results in a
command or it's canceled.  If a timer changes the keymap in between, the
new keymap should apply only after any pending key binding has been
finished.  Not sure if this is doable...

I'm sorry I don't have any knowledge of Emacs internals, and only
limited Lisp knowledge anyway, but I'd love to see a decent work-around
for this...

Cheers,
-Mihai




  parent reply	other threads:[~2009-08-10 18:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-09 13:49 bug#4093: Overlay keymap and timers Mihai Bazon
2009-08-09 20:56 ` Lennart Borgman
2009-08-09 21:23   ` Mihai Bazon
2009-08-10  4:06   ` Stefan Monnier
2009-08-10  6:55     ` Mihai Bazon
2009-08-10 16:25       ` Stefan Monnier
2009-08-10 16:30         ` Lennart Borgman
2009-08-10 17:38           ` Stefan Monnier
2009-08-10 17:42             ` Lennart Borgman
2009-08-10 18:17               ` Stefan Monnier
2009-08-10 18:32                 ` Lennart Borgman
2009-08-10 18:26         ` Mihai Bazon [this message]
2009-08-11 16:49         ` Mihai Bazon
2009-08-13 17:33           ` Stefan Monnier
2009-08-13 17:49             ` Mihai Bazon

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=5f77467962473de6f883e85a8259fed2@bazon.net \
    --to=mihai@bazon.net \
    --cc=4093@emacsbugs.donarmstrong.com \
    --cc=monnier@iro.umontreal.ca \
    /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.