[Top][All Lists]

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

Re: Unable to Rebind Tab Key in cperl-mode

From: wdr1
Subject: Re: Unable to Rebind Tab Key in cperl-mode
Date: 7 May 2007 15:30:43 -0700
User-agent: G2/1.0

On May 7, 10:33 am, "Drew Adams" <address@hidden> wrote:
> > Any ideas why none of these work:
> > (add-hook 'cperl-mode-hook
> >           (function (lambda ()
> >                       (local-set-key (kbd "<tab>") 'indent-or-
> > complete)
> >                       (local-set-key [tab] 'indent-or-complete)
> >                       (local-set-key (kbd "TAB") 'indent-or-complete)
> >                       )))
> > I'm using emacs 21.2.1.
> You should provide more information. What do you mean by not work? What
> happens in each case? Have you first tried that key-binding code in a
> cperl-mode buffer, without the code being on a hook? Try to narrow down the
> problem and clarify the problem description.
> As a wild guess, you might check that your keyboard actually uses the <tab>
> key. It might, instead, use something like <iso-lefttab>.

Trying it without being on a hook was a good idea.  I found this was
the appropriate syntax:

(local-set-key (kbd "TAB") 'indent-or-complete)

Instead of doing it manually each time I edit something in cperl-mode,
I'd like it to be done automatically.

Based on my understanding, I should do something like this, right?

(add-hook 'cperl-mode-hook
          (function (lambda ()
                      (local-set-key (kbd "TAB") 'indent-or-complete)

Yet, when I do describe-key & hit tab, this is what I get:

TAB runs the command cperl-indent-command
   which is an interactive compiled Lisp function in `cperl-mode'.
(cperl-indent-command &optional WHOLE-EXP)

Any advice on things to try next?


reply via email to

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