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

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

Re: Indentation in python.el after "Enter"


From: Alexander Tsamutali
Subject: Re: Indentation in python.el after "Enter"
Date: Wed, 11 Jul 2007 14:07:13 +0500

If you press C-j instead of Enter, does python.el do what you want?
If so, all you need to do is bind the command that C-j runs to the
Enter (a.k.a. C-m) key in the python-mode-hook.

Thanks a lot! It works!

I added the following to my .emacs:

(add-hook 'python-mode-hook
         (lambda () (define-key python-mode-map "\C-m" 'newline-and-indent)))

Then i found solution to my problem on EmacsWiki
(http://www.emacswiki.org/cgi-bin/wiki/PythonMode)
They recommend to add the following to .emacs:

(define-key python-mode-map "\C-m" 'newline-and-indent)

I can guess that first variant modifies key bindings only in python
mode and second modifies key bindings globally. Am i right?

--
Alexander Tsamutali




reply via email to

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