[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why is this-command-keys missing?
From: |
Lennart Borgman |
Subject: |
Re: Why is this-command-keys missing? |
Date: |
Sun, 2 Jan 2011 03:38:51 +0100 |
On Sun, Jan 2, 2011 at 2:57 AM, Stefan Monnier <address@hidden> wrote:
>> (define-key map "\t" 'compilation-next-error)
>> However if you hit TAB then this-command-keys will contain (something
>> similar to) TAB and not "\t".
>
> For me it does return "\t".
>
>> (key-binding (this-command-keys) t)
>> to get back the binding that is really active, i.e. compilation-next-error.
>
> It does sound like you're trying to do something that's
> fundamentally unreliable. Can you explain in more detail why you want
> to know "the binding that is really active"?
I am trying to use orgstruct-mode for a compilation output buffer.
orgstruct-mode binds keys like this:
;; Special treatment needed for TAB and RET
(org-defkey orgstruct-mode-map [(tab)]
(orgstruct-make-binding 'org-cycle 102 [(tab)] "\C-i"))
(org-defkey orgstruct-mode-map "\C-i"
(orgstruct-make-binding 'org-cycle 103 "\C-i" [(tab)]))
This is to make it possible to use TAB for cycling the outlines when
on outline headings.
However I would like to get back the normal TAB handling in the
compilaiton output buffer when not on an outline heading.
However it is a little bit more complicated than that. I bind the key
C-i in an emulation mode map. This now gets called when TAB is hit. I
am trying to find out what was really hit.