Enable auto-indentation in python mode (python.el) in Emacs 24?

I recently filed for bankruptcy emacs and when restoring my configuration, I switched from the old python-mode.elto the built-in python.el.

One thing that I am missing is the old behavior of automatically indenting to the correct level when pressed RET. Is there a way to re-enable this?

+4
source share
2 answers

Try the following:

(add-hook 'python-mode-hook 'my-python-hook)

(defun my-python-hook ()
  (define-key python-mode-map (kbd "RET") 'newline-and-indent))
+4
source

Emacs 24.4 electric-indent-mode. Emacs 24.4 , , .

+4

Source: https://habr.com/ru/post/1530195/


All Articles