[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Short-circuiting keybindings?
From: |
Stefan Monnier |
Subject: |
Re: Short-circuiting keybindings? |
Date: |
Wed, 08 Dec 2010 15:35:36 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> Thank you for your suggestion. I don't undestand the code, so I'm
> asking you to edit an example skeleton. Let's suppose we want to
> emulate CUA mode's behavior on "C-c": if region is active, then copy
> it, otherwise keep collecting keystrokes (for instance: "C-c C-c" for
> SLIME's compile functions). According to your suggestion, a skeleton
> could be:
> (define-key map [?\C-c] '(menu-item "dummy" 'copy-region-as-kill
> :filter (lambda (binding)
> (unless (region-active-p)
> binding))))
> How would you correct it? Thanks.
You should not quote `copy-region-as-kill' because you're already within
quoted data (the quote placed right before the `menu-item').
Other than that, it looks correct.
Stefan