aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorMiles Bader2007-08-03 05:27:43 +0000
committerMiles Bader2007-08-03 05:27:43 +0000
commit49b23c2a404cf31fb1aeecc7932a7304aaf16a67 (patch)
tree259f81c54acb77cd4aeb47ce88e5e56ff7141a99 /lisp/progmodes/python.el
parent9899d01a0ccec166e04caa60657a44e614be50cd (diff)
parent4211679b08d6a9c369cb22f085b9bb61d5d4eeda (diff)
downloademacs-49b23c2a404cf31fb1aeecc7932a7304aaf16a67.tar.gz
emacs-49b23c2a404cf31fb1aeecc7932a7304aaf16a67.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 839-842) - Update from CVS - Change capitalization of VC backend names for new backends Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-29
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el34
1 files changed, 19 insertions, 15 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index c3caa7e397c..9bef41a0878 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1005,7 +1005,7 @@ don't move and return nil. Otherwise return t."
1005 (set-text-properties 0 (length function-name) nil function-name) 1005 (set-text-properties 0 (length function-name) nil function-name)
1006 function-name)) 1006 function-name))
1007 1007
1008 1008
1009;;;; Imenu. 1009;;;; Imenu.
1010 1010
1011(defvar python-recursing) 1011(defvar python-recursing)
@@ -1828,21 +1828,25 @@ of current line."
1828 (save-excursion 1828 (save-excursion
1829 ;; Move up the tree of nested `class' and `def' blocks until we 1829 ;; Move up the tree of nested `class' and `def' blocks until we
1830 ;; get to zero indentation, accumulating the defined names. 1830 ;; get to zero indentation, accumulating the defined names.
1831 (let ((start t) 1831 (let ((accum)
1832 (accum)
1833 (length -1)) 1832 (length -1))
1834 (while (and (or start (> (current-indentation) 0)) 1833 (catch 'done
1835 (or (null length-limit) 1834 (while (or (null length-limit)
1836 (null (cdr accum)) 1835 (null (cdr accum))
1837 (< length length-limit))) 1836 (< length length-limit))
1838 (setq start nil) 1837 (setq start nil)
1839 (python-beginning-of-block) 1838 (let ((started-from (point)))
1840 (end-of-line) 1839 (python-beginning-of-block)
1841 (beginning-of-defun) 1840 (end-of-line)
1842 (when (looking-at (rx (0+ space) (or "def" "class") (1+ space) 1841 (beginning-of-defun)
1843 (group (1+ (or word (syntax symbol)))))) 1842 (when (= (point) started-from)
1844 (push (match-string 1) accum) 1843 (throw 'done nil)))
1845 (setq length (+ length 1 (length (car accum)))))) 1844 (when (looking-at (rx (0+ space) (or "def" "class") (1+ space)
1845 (group (1+ (or word (syntax symbol))))))
1846 (push (match-string 1) accum)
1847 (setq length (+ length 1 (length (car accum)))))
1848 (when (= (current-indentation) 0)
1849 (throw 'done nil))))
1846 (when accum 1850 (when accum
1847 (when (and length-limit (> length length-limit)) 1851 (when (and length-limit (> length length-limit))
1848 (setcar accum "..")) 1852 (setcar accum ".."))