help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: key binding only for minor mode


From: Ryo Furue
Subject: Re: key binding only for minor mode
Date: Fri, 28 Aug 2009 17:05:26 -0700 (PDT)
User-agent: G2/1.0

Thank you, Teemu and Ivan.  Your solutions work.  Except . . .

On Aug 27, 7:37 pm, Ivan Kanis <expire-by-2009-09...@kanis.fr> wrote:
> > So, my question is how to solve this problem?  What's the standard
> > procedure to disable keys for a minor mode?
>
> Find the keymap for view-mode and set the key to nil.
>
> (add-hook 'view-mode-hook
>    (lambda () (define-key view-mode-map (kbd "C-x C-q") nil)))

This one doesn't appear to have any effect.  I guess: This one removes
the key C-x C-q from the  local keymap (view-mode-map).  Therefore,
when you pressthe key combination, the global binding is invoked which
is toggle-read-only.  So, I guess we have to bind C-x C-q to something
rather than to undefine it, as in Teemu's example.

By the way, I'm wondering what #' is.  I vaguely know what a single
quote means (quote or don't evaluate it now) but I don't remember
seeing #' .  I tried the official emacs lisp reference manual, but
unless I read it from the top, I wouldn't find it.  (Google isn't of
much use when you want to search for something like '#  . . . ).

Anyway, I'm completely happy with the solution you showed.

Thanks again,
Ryo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]