[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/python.el,v
From: |
Vinicius Jose Latorre |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/python.el,v |
Date: |
Wed, 01 Aug 2007 00:47:27 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Vinicius Jose Latorre <viniciusjl> 07/08/01 00:47:26
Index: progmodes/python.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/python.el,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- progmodes/python.el 31 Jul 2007 05:02:51 -0000 1.65
+++ progmodes/python.el 1 Aug 2007 00:47:25 -0000 1.66
@@ -1828,21 +1828,25 @@
(save-excursion
;; Move up the tree of nested `class' and `def' blocks until we
;; get to zero indentation, accumulating the defined names.
- (let ((start t)
- (accum)
+ (let ((accum)
(length -1))
- (while (and (or start (> (current-indentation) 0))
- (or (null length-limit)
+ (catch 'done
+ (while (or (null length-limit)
(null (cdr accum))
- (< length length-limit)))
+ (< length length-limit))
(setq start nil)
+ (let ((started-from (point)))
(python-beginning-of-block)
(end-of-line)
(beginning-of-defun)
+ (when (= (point) started-from)
+ (throw 'done nil)))
(when (looking-at (rx (0+ space) (or "def" "class") (1+ space)
(group (1+ (or word (syntax symbol))))))
(push (match-string 1) accum)
- (setq length (+ length 1 (length (car accum))))))
+ (setq length (+ length 1 (length (car accum)))))
+ (when (= (current-indentation) 0)
+ (throw 'done nil))))
(when accum
(when (and length-limit (> length length-limit))
(setcar accum ".."))