From: wdr1@pobox.com
To: help-gnu-emacs@gnu.org
Subject: Re: Unable to Rebind Tab Key in cperl-mode
Date: 7 May 2007 15:30:43 -0700 [thread overview]
Message-ID: <1178577043.049816.253460@n59g2000hsh.googlegroups.com> (raw)
In-Reply-To: <mailman.372.1178559647.32220.help-gnu-emacs@gnu.org>
On May 7, 10:33 am, "Drew Adams" <drew.ad...@oracle.com> 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?
Thanks,
-Bill
next parent reply other threads:[~2007-05-07 22:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1178517106.678877.221100@p77g2000hsh.googlegroups.com>
[not found] ` <mailman.372.1178559647.32220.help-gnu-emacs@gnu.org>
2007-05-07 22:30 ` wdr1 [this message]
2007-05-09 15:02 ` Unable to Rebind Tab Key in cperl-mode Stefan Monnier
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=1178577043.049816.253460@n59g2000hsh.googlegroups.com \
--to=wdr1@pobox.com \
--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.