diff options
| author | Fabián Ezequiel Gallina | 2012-05-17 00:03:02 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2012-05-17 00:03:02 -0300 |
| commit | 57808175eb11ac0cdcdeb9a545c7707da433c827 (patch) | |
| tree | 8f2a6f37988e2a4e6bf43343556b22740ddd323c /lisp | |
| parent | d818ffa8705888ee614de67e0e15f9576c3ef577 (diff) | |
| download | emacs-57808175eb11ac0cdcdeb9a545c7707da433c827.tar.gz emacs-57808175eb11ac0cdcdeb9a545c7707da433c827.zip | |
Added commentary about auto-indentation on newlines for python-mode.el users
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/python.el | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index aef559f8b74..a243f6cbe25 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -54,7 +54,7 @@ | |||
| 54 | ;; word. Shell completion is implemented in a manner that if you | 54 | ;; word. Shell completion is implemented in a manner that if you |
| 55 | ;; change the `python-shell-interpreter' to any other (for example | 55 | ;; change the `python-shell-interpreter' to any other (for example |
| 56 | ;; IPython) it should be easy to integrate another way to calculate | 56 | ;; IPython) it should be easy to integrate another way to calculate |
| 57 | ;; completions. You just need to especify your custom | 57 | ;; completions. You just need to specify your custom |
| 58 | ;; `python-shell-completion-setup-code' and | 58 | ;; `python-shell-completion-setup-code' and |
| 59 | ;; `python-shell-completion-strings-code' | 59 | ;; `python-shell-completion-strings-code' |
| 60 | 60 | ||
| @@ -78,6 +78,21 @@ | |||
| 78 | ;; might guessed you should run `python-shell-send-buffer' from time | 78 | ;; might guessed you should run `python-shell-send-buffer' from time |
| 79 | ;; to time to get better results too. | 79 | ;; to time to get better results too. |
| 80 | 80 | ||
| 81 | ;; If you used python-mode.el you probably will miss auto-indentation | ||
| 82 | ;; when inserting newlines. To achieve the same behavior you have | ||
| 83 | ;; two options: | ||
| 84 | |||
| 85 | ;; 1) Use GNU/Emacs' standard binding for `newline-and-indent': C-j. | ||
| 86 | |||
| 87 | ;; 2) Add the following hook in your .emacs: | ||
| 88 | |||
| 89 | ;; (add-hook 'python-mode-hook | ||
| 90 | ;; #'(lambda () | ||
| 91 | ;; (define-key python-mode-map "\C-m" 'newline-and-indent))) | ||
| 92 | |||
| 93 | ;; I'd recommend the first one since you'll get the same behavior for | ||
| 94 | ;; all modes out-of-the-box. | ||
| 95 | |||
| 81 | ;;; Installation: | 96 | ;;; Installation: |
| 82 | 97 | ||
| 83 | ;; Add this to your .emacs: | 98 | ;; Add this to your .emacs: |