[Top][All Lists]

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

Re: F2

From: TheFlyingDutchman
Subject: Re: F2
Date: Wed, 2 Mar 2011 15:51:01 -0800 (PST)
User-agent: G2/1.0

On Mar 2, 2:43 pm, PJ Weisberg <address@hidden> wrote:
> On 3/1/11, TheFlyingDutchman <address@hidden> wrote:
> > On Mar 1, 12:35 pm, PJ Weisberg <address@hidden> wrote:
> >> On 3/1/11, TheFlyingDutchman <address@hidden> wrote:
> >> > Yes, thanks, that appears to be my problem. I am editing an html file
> >> > and I see bindings for F2 as:
> >> In general something like this should get rid of any local binding you
> >> don't want to override your global binding:
> >> (define-key 'foo-mode-map "key" nil)
> >> -PJ
> > How would I determine the value of "foo-mode-map" to use. I tried
> > 'html-mode and 'html-mode-map and 'c2-mode and 'c2-mode-map and define-
> > key puts up a *Backtrace* window -> Debugger entered--Lisp error:
> > (wrong-type-argument keymapp html-mode-map)
> I was hoping someone more knowledgable would pipe up with a better
> answer, but here's my suggestion:  The variable "major-mode" has the
> name of the current major mode, and "minor-mode-list" has all possible
> minor modes.  A minor mode is active if a variable with that name is
> defined and non-nill.  The map name should be the name of one of these
> modes with "-map" at the end of it.  You might have to guess which one
> is binding the key you don't like.

Thanks for the reply.

One thing I just realized that it doesn't seem to want the symbol name
in define-key, but it's value:

(define-key foo-mode-map "key" nil)
instead of
(define-key 'foo-mode-map "key" nil)

When I executed
(define-key 2C-mode-map (kbd "<f2>") nil)
(define-key html-mode-map (kbd "<f2>") nil)
I didn't get an error.

But I don't know how to interactively execute that for the current
buffer (as opposed to doing it the *scratch* buffer). Or how to turn
off 2C mode. I ended up getting out of the html file, and when I
reedited it, the 2C mode was off and my global setting for F2 was
active. Someone posted about hitting F2 twice to turn on 2C mode and
that must have been what I did, which gave it a local value, before I
assigned it a global setting.

reply via email to

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