/[emacs]/emacs/lisp/progmodes/python.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/python.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by kfstorm, Wed Feb 9 15:50:36 2005 UTC revision 1.25 by monnier, Fri Mar 25 14:36:08 2005 UTC
# Line 1  Line 1 
1  ;;; python.el --- silly walks for Python  ;;; python.el --- silly walks for Python
2    
3  ;; Copyright (C) 2003, 2004  Free Software Foundation, Inc.  ;; Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
4    
5  ;; Author: Dave Love <fx@gnu.org>  ;; Author: Dave Love <fx@gnu.org>
6  ;; Maintainer: FSF  ;; Maintainer: FSF
# Line 336  keyword `raise', `break', `continue' or Line 336  keyword `raise', `break', `continue' or
336      (unless bos (python-beginning-of-statement))      (unless bos (python-beginning-of-statement))
337      (back-to-indentation)      (back-to-indentation)
338      (looking-at (rx (and (or "return" "raise" "break" "continue" "pass")      (looking-at (rx (and (or "return" "raise" "break" "continue" "pass")
339                           word-end)))))                           symbol-end)))))
340    
341  (defun python-outdent-p ()  (defun python-outdent-p ()
342    "Return non-nil if current line should outdent a level."    "Return non-nil if current line should outdent a level."
343    (save-excursion    (save-excursion
344      (back-to-indentation)      (back-to-indentation)
345      (and (looking-at (rx (and (or (and (or "else" "finally") word-end)      (and (looking-at (rx (and (or (and (or "else" "finally") symbol-end)
346                                    (and (or "except" "elif") word-end                                    (and (or "except" "elif") symbol-end
347                                         (1+ (not (any ?:)))))                                         (1+ (not (any ?:)))))
348                                (optional space) ":" (optional space)                                (optional space) ":" (optional space)
349                                (or (syntax comment-start) line-end))))                                (or (syntax comment-start) line-end))))
# Line 355  keyword `raise', `break', `continue' or Line 355  keyword `raise', `break', `continue' or
355           ;; Fixme: check this           ;; Fixme: check this
356           (not (looking-at (rx (and (or (and (or "if" "elif" "except"           (not (looking-at (rx (and (or (and (or "if" "elif" "except"
357                                                  "for" "while")                                                  "for" "while")
358                                              word-end (1+ (not (any ?:))))                                              symbol-end (1+ (not (any ?:))))
359                                         (and "try" word-end))                                         (and "try" symbol-end))
360                                     (optional space) ":" (optional space)                                     (optional space) ":" (optional space)
361                                     (or (syntax comment-start) line-end)))))                                     (or (syntax comment-start) line-end)))))
362           (progn (end-of-line)           (progn (end-of-line)
# Line 1562  of current line." Line 1562  of current line."
1562          (beginning-of-defun)          (beginning-of-defun)
1563          (if (looking-at (rx (and (0+ space) (or "def" "class") (1+ space)          (if (looking-at (rx (and (0+ space) (or "def" "class") (1+ space)
1564                                   (group (1+ (or word (syntax symbol))))                                   (group (1+ (or word (syntax symbol))))
1565                                   word-end)))                                   ;; Greediness makes this unnecessary?  --Stef
1566                                     symbol-end)))
1567              (push (match-string 1) accum)))              (push (match-string 1) accum)))
1568        (if accum (mapconcat 'identity accum ".")))))        (if accum (mapconcat 'identity accum ".")))))
1569    
# Line 1702  lines count as headers. Line 1703  lines count as headers.
1703         '(python-font-lock-keywords nil nil ((?_ . "w")) nil         '(python-font-lock-keywords nil nil ((?_ . "w")) nil
1704                                     (font-lock-syntactic-keywords                                     (font-lock-syntactic-keywords
1705                                      . python-font-lock-syntactic-keywords)                                      . python-font-lock-syntactic-keywords)
1706  ;;; This probably isn't worth it.                                     ;; This probably isn't worth it.
1707  ;;;                                (font-lock-syntactic-face-function                                     ;; (font-lock-syntactic-face-function
1708  ;;;                                 . python-font-lock-syntactic-face-function)                                     ;;  . python-font-lock-syntactic-face-function)
1709                                     ))                                     ))
1710    (set (make-local-variable 'parse-sexp-lookup-properties) t)    (set (make-local-variable 'parse-sexp-lookup-properties) t)
1711    (set (make-local-variable 'comment-start) "# ")    (set (make-local-variable 'comment-start) "# ")

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26