aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 745bc57a9b0..20af0aaf96e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1,6 +1,6 @@
1;;; python.el --- silly walks for Python 1;;; python.el --- silly walks for Python
2 2
3;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Dave Love <fx@gnu.org> 5;; Author: Dave Love <fx@gnu.org>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -336,14 +336,14 @@ keyword `raise', `break', `continue' or `pass'."
336 (unless bos (python-beginning-of-statement)) 336 (unless bos (python-beginning-of-statement))
337 (back-to-indentation) 337 (back-to-indentation)
338 (looking-at (rx (and (or "return" "raise" "break" "continue" "pass") 338 (looking-at (rx (and (or "return" "raise" "break" "continue" "pass")
339 word-end))))) 339 symbol-end)))))
340 340
341(defun python-outdent-p () 341(defun python-outdent-p ()
342 "Return non-nil if current line should outdent a level." 342 "Return non-nil if current line should outdent a level."
343 (save-excursion 343 (save-excursion
344 (back-to-indentation) 344 (back-to-indentation)
345 (and (looking-at (rx (and (or (and (or "else" "finally") word-end) 345 (and (looking-at (rx (and (or (and (or "else" "finally") symbol-end)
346 (and (or "except" "elif") word-end 346 (and (or "except" "elif") symbol-end
347 (1+ (not (any ?:))))) 347 (1+ (not (any ?:)))))
348 (optional space) ":" (optional space) 348 (optional space) ":" (optional space)
349 (or (syntax comment-start) line-end)))) 349 (or (syntax comment-start) line-end))))
@@ -355,8 +355,8 @@ keyword `raise', `break', `continue' or `pass'."
355 ;; Fixme: check this 355 ;; Fixme: check this
356 (not (looking-at (rx (and (or (and (or "if" "elif" "except" 356 (not (looking-at (rx (and (or (and (or "if" "elif" "except"
357 "for" "while") 357 "for" "while")
358 word-end (1+ (not (any ?:)))) 358 symbol-end (1+ (not (any ?:))))
359 (and "try" word-end)) 359 (and "try" symbol-end))
360 (optional space) ":" (optional space) 360 (optional space) ":" (optional space)
361 (or (syntax comment-start) line-end))))) 361 (or (syntax comment-start) line-end)))))
362 (progn (end-of-line) 362 (progn (end-of-line)
@@ -1562,7 +1562,8 @@ of current line."
1562 (beginning-of-defun) 1562 (beginning-of-defun)
1563 (if (looking-at (rx (and (0+ space) (or "def" "class") (1+ space) 1563 (if (looking-at (rx (and (0+ space) (or "def" "class") (1+ space)
1564 (group (1+ (or word (syntax symbol)))) 1564 (group (1+ (or word (syntax symbol))))
1565 word-end))) 1565 ;; Greediness makes this unnecessary? --Stef
1566 symbol-end)))
1566 (push (match-string 1) accum))) 1567 (push (match-string 1) accum)))
1567 (if accum (mapconcat 'identity accum "."))))) 1568 (if accum (mapconcat 'identity accum ".")))))
1568 1569
@@ -1702,9 +1703,9 @@ lines count as headers.
1702 '(python-font-lock-keywords nil nil ((?_ . "w")) nil 1703 '(python-font-lock-keywords nil nil ((?_ . "w")) nil
1703 (font-lock-syntactic-keywords 1704 (font-lock-syntactic-keywords
1704 . python-font-lock-syntactic-keywords) 1705 . python-font-lock-syntactic-keywords)
1705;;; This probably isn't worth it. 1706 ;; This probably isn't worth it.
1706;;; (font-lock-syntactic-face-function 1707 ;; (font-lock-syntactic-face-function
1707;;; . python-font-lock-syntactic-face-function) 1708 ;; . python-font-lock-syntactic-face-function)
1708 )) 1709 ))
1709 (set (make-local-variable 'parse-sexp-lookup-properties) t) 1710 (set (make-local-variable 'parse-sexp-lookup-properties) t)
1710 (set (make-local-variable 'comment-start) "# ") 1711 (set (make-local-variable 'comment-start) "# ")