]> code.delx.au - gnu-emacs/commitdiff
* progmodes/python.el (python-mode-map): Replace
authorFabián Ezequiel Gallina <fgallina@gnu.org>
Fri, 12 Oct 2012 00:07:25 +0000 (21:07 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Fri, 12 Oct 2012 00:07:25 +0000 (21:07 -0300)
subtitute-key-definition with proper command remapping.
(python-nav--up-list): Fix behavior for blocks on the same level.

lisp/ChangeLog
lisp/progmodes/python.el

index 534d0ad2dcd8f5af645773f99267d7741038f91e..19e51cc603a980817069cd8bc12be898c56481f7 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-12  Fabián Ezequiel Gallina  <fgallina@cuca>
+
+       * 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  <monnier@iro.umontreal.ca>
 
        * help-fns.el (describe-function-1): Handle autoloads w/o docstrings.
index 5bf64c18f993576f8939a60eaaeb1cc0f45f992c..ff805d640240debaf58d467fd0e2a9285f1230e6 100644 (file)
 (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))))