From 55cd00c8f958ff627521c73113a5ea66fe4e4a57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Thu, 11 Oct 2012 21:07:25 -0300 Subject: [PATCH] * 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. --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/python.el | 14 ++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 534d0ad2dcd..19e51cc603a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-10-12 Fabián Ezequiel Gallina + + * 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. + 2012-10-11 Stefan Monnier * help-fns.el (describe-function-1): Handle autoloads w/o docstrings. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5bf64c18f99..ff805d64024 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -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)))) -- 2.11.4.GIT