diff options
| author | Fabián Ezequiel Gallina | 2013-12-26 13:45:19 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2013-12-26 13:45:19 -0300 |
| commit | fbcc63a3176389f39cb06f5a56f2abb29b06eaab (patch) | |
| tree | 4c9b7d4be4f924bc0352741b7c06d33369d94b9e | |
| parent | 0cbab19e6e5147fda4c89dcadd2826a35857b5ce (diff) | |
| download | emacs-fbcc63a3176389f39cb06f5a56f2abb29b06eaab.tar.gz emacs-fbcc63a3176389f39cb06f5a56f2abb29b06eaab.zip | |
* lisp/progmodes/python.el: Use lexical-binding.
(python-nav-beginning-of-defun): Stop searching ASAP.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76e175919e4..972106bd26f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-12-26 Fabián Ezequiel Gallina <fgallina@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/python.el: Use lexical-binding. | ||
| 4 | (python-nav-beginning-of-defun): Stop searching ASAP. | ||
| 5 | |||
| 1 | 2013-12-25 Xue Fuqiao <xfq.free@gmail.com> | 6 | 2013-12-25 Xue Fuqiao <xfq.free@gmail.com> |
| 2 | 7 | ||
| 3 | * vc/vc.el (vc-ignore): Use `vc-responsible-backend'. | 8 | * vc/vc.el (vc-ignore): Use `vc-responsible-backend'. |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0646eade780..688d2cb1d96 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; python.el --- Python's flying circus support for Emacs | 1 | ;;; python.el --- Python's flying circus support for Emacs -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2003-2013 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2003-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -180,7 +180,7 @@ | |||
| 180 | ;; Imenu: There are two index building functions to be used as | 180 | ;; Imenu: There are two index building functions to be used as |
| 181 | ;; `imenu-create-index-function': `python-imenu-create-index' (the | 181 | ;; `imenu-create-index-function': `python-imenu-create-index' (the |
| 182 | ;; default one, builds the alist in form of a tree) and | 182 | ;; default one, builds the alist in form of a tree) and |
| 183 | ;; `python-imenu-create-flat-index'. See also | 183 | ;; `python-imenu-create-flat-index'. See also |
| 184 | ;; `python-imenu-format-item-label-function', | 184 | ;; `python-imenu-format-item-label-function', |
| 185 | ;; `python-imenu-format-parent-item-label-function', | 185 | ;; `python-imenu-format-parent-item-label-function', |
| 186 | ;; `python-imenu-format-parent-item-jump-label-function' variables for | 186 | ;; `python-imenu-format-parent-item-jump-label-function' variables for |
| @@ -1183,13 +1183,13 @@ position. Return non-nil if point is moved to | |||
| 1183 | `beginning-of-defun'." | 1183 | `beginning-of-defun'." |
| 1184 | (when (or (null arg) (= arg 0)) (setq arg 1)) | 1184 | (when (or (null arg) (= arg 0)) (setq arg 1)) |
| 1185 | (let ((found)) | 1185 | (let ((found)) |
| 1186 | (cond ((and (eq this-command 'mark-defun) | 1186 | (while (and (not (= arg 0)) |
| 1187 | (python-info-looking-at-beginning-of-defun))) | 1187 | (let ((keep-searching-p |
| 1188 | (t | 1188 | (python-nav--beginning-of-defun arg))) |
| 1189 | (dotimes (i (if (> arg 0) arg (- arg))) | 1189 | (when (and keep-searching-p (null found)) |
| 1190 | (when (and (python-nav--beginning-of-defun arg) | 1190 | (setq found t)) |
| 1191 | (not found)) | 1191 | keep-searching-p)) |
| 1192 | (setq found t))))) | 1192 | (setq arg (if (> arg 0) (1- arg) (1+ arg)))) |
| 1193 | found)) | 1193 | found)) |
| 1194 | 1194 | ||
| 1195 | (defun python-nav-end-of-defun () | 1195 | (defun python-nav-end-of-defun () |