1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00

* progmodes/python.el (python-mode-map): Replace

subtitute-key-definition with proper command remapping.
(python-nav--up-list): Fix behavior for blocks on the same level.
This commit is contained in:
Fabián Ezequiel Gallina 2012-10-11 21:07:25 -03:00
parent 9f1a4aa505
commit 55cd00c8f9
2 changed files with 10 additions and 10 deletions

View file

@ -229,15 +229,9 @@
(defvar python-mode-map
(let ((map (make-sparse-keymap)))
;; Movement
(substitute-key-definition 'backward-sentence
'python-nav-backward-block
map global-map)
(substitute-key-definition 'forward-sentence
'python-nav-forward-block
map global-map)
(substitute-key-definition 'backward-up-list
'python-nav-backward-up-list
map global-map)
(define-key map [remap backward-sentence] 'python-nav-backward-block)
(define-key map [remap forward-sentence] 'python-nav-forward-block)
(define-key map [remap backward-up-list] 'python-nav-backward-up-list)
(define-key map "\C-c\C-j" 'imenu)
;; Indent specific
(define-key map "\177" 'python-indent-dedent-line-backspace)
@ -1444,7 +1438,7 @@ DIR is always 1 or -1 and comes sanitized from
(save-excursion
(let ((indentation (current-indentation)))
(while (and (python-nav-backward-block)
(> (current-indentation) indentation))))
(>= (current-indentation) indentation))))
(point))))
(and (> (point) prev-block-pos)
(goto-char prev-block-pos))))