From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: help-gnu-emacs@gnu.org
Subject: Re: How do I "duplicate" a keybinding?
Date: Fri, 17 Aug 2007 12:37:18 +0200 [thread overview]
Message-ID: <yoijeji2jvkx.fsf@gamma02.me.chalmers.se> (raw)
In-Reply-To: mailman.4899.1187343204.32220.help-gnu-emacs@gnu.org
Alan Mackenzie <acm@muc.de> writes:
> So I want to use an unused binding C-S-' in place of C-c @, so that I
> could do the above command with the more convenient
>
> C-S-' C-c
>
> . I know that I could bind C-S-' to hs-minor-mode-map, but this wouldn't
> be right, since C-S-' would continue to point to this keymap even when
> hideshow mode was disabled.
[...]
> Am I missing something obvious here?
Yes. The way to make a binding not have an effect when a mode is
disabled is to bind it in the mode's map! (And you don't want to bind
C-S-' to hs-minor-mode-map but to the submap that C-c @ is bound to.)
;; C-S-' is C-" (on my keyboard).
(define-key hs-minor-mode-map
[?\C-\"]
(lookup-key hs-minor-mode-map [?\C-c ?@]))
--
Johan Bockgård
next parent reply other threads:[~2007-08-17 10:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.4899.1187343204.32220.help-gnu-emacs@gnu.org>
2007-08-17 10:37 ` Johan Bockgård [this message]
2007-08-18 13:59 ` How do I "duplicate" a keybinding? Alan Mackenzie
2007-08-17 9:35 Alan Mackenzie
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=yoijeji2jvkx.fsf@gamma02.me.chalmers.se \
--to=bojohan+news@dd.chalmers.se \
--cc=help-gnu-emacs@gnu.org \
/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.