diff options
| author | Fabián Ezequiel Gallina | 2012-05-17 00:03:19 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2012-05-17 00:03:19 -0300 |
| commit | 0b7b2e512dcad0b81d284414856bb9cb5da5f434 (patch) | |
| tree | defad7260111c32f0885c185c190aeb01e81c0b9 | |
| parent | b7f1355986c21123901e2b8039d2a85dca3e0673 (diff) | |
| download | emacs-0b7b2e512dcad0b81d284414856bb9cb5da5f434.tar.gz emacs-0b7b2e512dcad0b81d284414856bb9cb5da5f434.zip | |
python-info-current-defun: fixed cornercase that caused imenu to break
| -rw-r--r-- | lisp/progmodes/python.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5262fa160f9..949c112ee75 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -2149,7 +2149,8 @@ This function is compatible to be used as | |||
| 2149 | `add-log-current-defun-function' since it returns nil if point is | 2149 | `add-log-current-defun-function' since it returns nil if point is |
| 2150 | not inside a defun." | 2150 | not inside a defun." |
| 2151 | (let ((names '()) | 2151 | (let ((names '()) |
| 2152 | (min-indent)) | 2152 | (min-indent) |
| 2153 | (first-run t)) | ||
| 2153 | (save-restriction | 2154 | (save-restriction |
| 2154 | (widen) | 2155 | (widen) |
| 2155 | (save-excursion | 2156 | (save-excursion |
| @@ -2157,7 +2158,9 @@ not inside a defun." | |||
| 2157 | (forward-comment -9999) | 2158 | (forward-comment -9999) |
| 2158 | (setq min-indent (current-indentation)) | 2159 | (setq min-indent (current-indentation)) |
| 2159 | (while (python-beginning-of-defun-function 1 t) | 2160 | (while (python-beginning-of-defun-function 1 t) |
| 2160 | (when (< (current-indentation) min-indent) | 2161 | (when (or (< (current-indentation) min-indent) |
| 2162 | first-run) | ||
| 2163 | (setq first-run nil) | ||
| 2161 | (setq min-indent (current-indentation)) | 2164 | (setq min-indent (current-indentation)) |
| 2162 | (looking-at python-nav-beginning-of-defun-regexp) | 2165 | (looking-at python-nav-beginning-of-defun-regexp) |
| 2163 | (setq names (cons | 2166 | (setq names (cons |