diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f641880428c..fbf944f9c68 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -284,6 +284,7 @@ | |||
| 284 | (define-key map [remap backward-sentence] 'python-nav-backward-block) | 284 | (define-key map [remap backward-sentence] 'python-nav-backward-block) |
| 285 | (define-key map [remap forward-sentence] 'python-nav-forward-block) | 285 | (define-key map [remap forward-sentence] 'python-nav-forward-block) |
| 286 | (define-key map [remap backward-up-list] 'python-nav-backward-up-list) | 286 | (define-key map [remap backward-up-list] 'python-nav-backward-up-list) |
| 287 | (define-key map [remap mark-defun] 'python-mark-defun) | ||
| 287 | (define-key map "\C-c\C-j" 'imenu) | 288 | (define-key map "\C-c\C-j" 'imenu) |
| 288 | ;; Indent specific | 289 | ;; Indent specific |
| 289 | (define-key map "\177" 'python-indent-dedent-line-backspace) | 290 | (define-key map "\177" 'python-indent-dedent-line-backspace) |
| @@ -1251,6 +1252,21 @@ the line will be re-indented automatically if needed." | |||
| 1251 | (python-indent-region dedenter-pos current-pos))))))))) | 1252 | (python-indent-region dedenter-pos current-pos))))))))) |
| 1252 | 1253 | ||
| 1253 | 1254 | ||
| 1255 | ;;; Mark | ||
| 1256 | |||
| 1257 | (defun python-mark-defun (&optional allow-extend) | ||
| 1258 | "Put mark at end of this defun, point at beginning. | ||
| 1259 | The defun marked is the one that contains point or follows point. | ||
| 1260 | |||
| 1261 | Interactively (or with ALLOW-EXTEND non-nil), if this command is | ||
| 1262 | repeated or (in Transient Mark mode) if the mark is active, it | ||
| 1263 | marks the next defun after the ones already marked." | ||
| 1264 | (interactive "p") | ||
| 1265 | (when (python-info-looking-at-beginning-of-defun) | ||
| 1266 | (end-of-line 1)) | ||
| 1267 | (mark-defun allow-extend)) | ||
| 1268 | |||
| 1269 | |||
| 1254 | ;;; Navigation | 1270 | ;;; Navigation |
| 1255 | 1271 | ||
| 1256 | (defvar python-nav-beginning-of-defun-regexp | 1272 | (defvar python-nav-beginning-of-defun-regexp |