summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-05-02 05:51:52 +0000
committerMiles Bader <miles@gnu.org>2006-05-02 05:51:52 +0000
commitfe682fb2f05fcbd9fcd2d12c2110719adcfcb58a (patch)
tree2a89d2d9ea2689cfe80a7618885cdd9f449761dd /lisp/progmodes/python.el
parent7e635d0ed3c42e6e779821f5c0c1c62289f4c1ee (diff)
parent6cf93749317c2e18f850cd0f47f905895e850bfc (diff)
downloademacs-fe682fb2f05fcbd9fcd2d12c2110719adcfcb58a.tar.gz
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-58
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 239-258) - Update from CVS - (Ffield_beginning, find_field): Undo change of 2006-04-23. - Rcirc patch from Ryan Yeske - Merge from gnus--rel--5.10 - Clean up lisp/gnus/ChangeLog a bit * gnus--rel--5.10 (patch 91-98) - Merge from emacs--devo--0 - Update from CVS
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 5e645535a23..9636f7eaeae 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -292,9 +292,9 @@ The criteria are that the previous line ends in a backslash outside
comments and strings, or that the bracket/paren nesting depth is nonzero."
(or (and (eq ?\\ (char-before (line-end-position 0)))
(not (syntax-ppss-context (syntax-ppss))))
- (/= 0 (syntax-ppss-depth
- (save-excursion ; syntax-ppss with arg changes point
- (syntax-ppss (line-beginning-position)))))))
+ (< 0 (syntax-ppss-depth
+ (save-excursion ; syntax-ppss with arg changes point
+ (syntax-ppss (line-beginning-position)))))))
(defun python-comment-line-p ()
"Return non-nil iff current line has only a comment."
@@ -719,7 +719,10 @@ expressions."
(python-beginning-of-string)
;; Skip forward out of nested brackets.
(condition-case () ; beware invalid syntax
- (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
+ (let ((depth (syntax-ppss-depth (syntax-ppss))))
+ ;; Beware negative depths.
+ (if (> depth 0) (backward-up-list depth))
+ t)
(error (throw 'foo nil))))))
(back-to-indentation))
@@ -1755,7 +1758,6 @@ lines count as headers.
(if (featurep 'hippie-exp)
(set (make-local-variable 'hippie-expand-try-functions-list)
(cons 'python-try-complete hippie-expand-try-functions-list)))
- (unless font-lock-mode (font-lock-mode 1))
(when python-guess-indent (python-guess-indent))
(set (make-local-variable 'python-command) python-python-command)
(unless (boundp 'python-mode-running) ; kill the recursion from jython-mode