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

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

Re: Bind RET to command


From: Tassilo Horn
Subject: Re: Bind RET to command
Date: Thu, 21 Feb 2008 12:31:21 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

Florian Lindner <Florian.Lindner@xgm.de> writes:

Hi Florian,

> How can I bind this to return but only in LaTeX mode (Auctex) and
> python-mode.

One way to do it is that:

(add-hook 'LaTeX-mode-hook
          (lambda ()
            (local-set-key (kbd "RET") 'newline-and-indent)))

(add-hook 'python-mode-hook
          (lambda ()
            (local-set-key (kbd "RET") 'newline-and-indent)))

(Or add the local-set-key expression to a function you already add to
those hooks.)

Bye,
Tassilo
-- 
People sometimes  ask me if it  is a sin in  the Church of  Emacs to use
vi. Using a free  version of vi is not a sin; it  is a penance. So happy
hacking. (Richard M. Stallman)





reply via email to

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