diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 12 |
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 | |||
| 292 | comments and strings, or that the bracket/paren nesting depth is nonzero." | 292 | comments and strings, or that the bracket/paren nesting depth is nonzero." |
| 293 | (or (and (eq ?\\ (char-before (line-end-position 0))) | 293 | (or (and (eq ?\\ (char-before (line-end-position 0))) |
| 294 | (not (syntax-ppss-context (syntax-ppss)))) | 294 | (not (syntax-ppss-context (syntax-ppss)))) |
| 295 | (/= 0 (syntax-ppss-depth | 295 | (< 0 (syntax-ppss-depth |
| 296 | (save-excursion ; syntax-ppss with arg changes point | 296 | (save-excursion ; syntax-ppss with arg changes point |
| 297 | (syntax-ppss (line-beginning-position))))))) | 297 | (syntax-ppss (line-beginning-position))))))) |
| 298 | 298 | ||
| 299 | (defun python-comment-line-p () | 299 | (defun python-comment-line-p () |
| 300 | "Return non-nil iff current line has only a comment." | 300 | "Return non-nil iff current line has only a comment." |
| @@ -719,7 +719,10 @@ expressions." | |||
| 719 | (python-beginning-of-string) | 719 | (python-beginning-of-string) |
| 720 | ;; Skip forward out of nested brackets. | 720 | ;; Skip forward out of nested brackets. |
| 721 | (condition-case () ; beware invalid syntax | 721 | (condition-case () ; beware invalid syntax |
| 722 | (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t) | 722 | (let ((depth (syntax-ppss-depth (syntax-ppss)))) |
| 723 | ;; Beware negative depths. | ||
| 724 | (if (> depth 0) (backward-up-list depth)) | ||
| 725 | t) | ||
| 723 | (error (throw 'foo nil)))))) | 726 | (error (throw 'foo nil)))))) |
| 724 | (back-to-indentation)) | 727 | (back-to-indentation)) |
| 725 | 728 | ||
| @@ -1755,7 +1758,6 @@ lines count as headers. | |||
| 1755 | (if (featurep 'hippie-exp) | 1758 | (if (featurep 'hippie-exp) |
| 1756 | (set (make-local-variable 'hippie-expand-try-functions-list) | 1759 | (set (make-local-variable 'hippie-expand-try-functions-list) |
| 1757 | (cons 'python-try-complete hippie-expand-try-functions-list))) | 1760 | (cons 'python-try-complete hippie-expand-try-functions-list))) |
| 1758 | (unless font-lock-mode (font-lock-mode 1)) | ||
| 1759 | (when python-guess-indent (python-guess-indent)) | 1761 | (when python-guess-indent (python-guess-indent)) |
| 1760 | (set (make-local-variable 'python-command) python-python-command) | 1762 | (set (make-local-variable 'python-command) python-python-command) |
| 1761 | (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode | 1763 | (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode |