Mercurial > hg > xemacs-beta
comparison lisp/modes/python-mode.el @ 26:441bb1e64a06 r19-15b96
Import from CVS: tag r19-15b96
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:51:32 +0200 |
parents | 8fc7fe29b841 |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
25:383a494979f8 | 26:441bb1e64a06 |
---|---|
4 | 4 |
5 ;; Author: 1995-1997 Barry A. Warsaw | 5 ;; Author: 1995-1997 Barry A. Warsaw |
6 ;; 1992-1994 Tim Peters | 6 ;; 1992-1994 Tim Peters |
7 ;; Maintainer: python-mode@python.org | 7 ;; Maintainer: python-mode@python.org |
8 ;; Created: Feb 1992 | 8 ;; Created: Feb 1992 |
9 ;; Version: 2.89 | 9 ;; Version: 2.90 |
10 ;; Last Modified: 1997/01/30 20:16:18 | 10 ;; Last Modified: 1997/02/24 03:37:22 |
11 ;; Keywords: python languages oop | 11 ;; Keywords: python languages oop |
12 | 12 |
13 ;; This software is provided as-is, without express or implied | 13 ;; This software is provided as-is, without express or implied |
14 ;; warranty. Permission to use, copy, modify, distribute or sell this | 14 ;; warranty. Permission to use, copy, modify, distribute or sell this |
15 ;; software, without fee, for any purpose and by any individual or | 15 ;; software, without fee, for any purpose and by any individual or |
206 current value of (the general Emacs variable) `tab-width' does not | 206 current value of (the general Emacs variable) `tab-width' does not |
207 equal <number>, `tab-width' is set to <number>, a message saying so is | 207 equal <number>, `tab-width' is set to <number>, a message saying so is |
208 displayed in the echo area, and if `py-beep-if-tab-change' is non-nil | 208 displayed in the echo area, and if `py-beep-if-tab-change' is non-nil |
209 the Emacs bell is also rung as a warning.") | 209 the Emacs bell is also rung as a warning.") |
210 | 210 |
211 (defconst python-font-lock-keywords | 211 (defvar python-font-lock-keywords |
212 (let* ((keywords '("and" "break" "class" | 212 (let* ((keywords '("and" "break" "class" |
213 "continue" "def" "del" "elif" | 213 "continue" "def" "del" "elif" |
214 "else:" "except" "except:" "exec" | 214 "else:" "except" "except:" "exec" |
215 "finally:" "for" "from" "global" | 215 "finally:" "for" "from" "global" |
216 "if" "import" "in" "is" | 216 "if" "import" "in" "is" |
232 ;; functions | 232 ;; functions |
233 '("\\bdef[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)" | 233 '("\\bdef[ \t]+\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)" |
234 1 font-lock-function-name-face) | 234 1 font-lock-function-name-face) |
235 )) | 235 )) |
236 "Additional expressions to highlight in Python mode.") | 236 "Additional expressions to highlight in Python mode.") |
237 (put 'python-mode 'font-lock-defaults '(python-font-lock-keywords)) | |
238 | |
237 | 239 |
238 (defvar imenu-example--python-show-method-args-p nil | 240 (defvar imenu-example--python-show-method-args-p nil |
239 "*Controls echoing of arguments of functions & methods in the imenu buffer. | 241 "*Controls echoing of arguments of functions & methods in the imenu buffer. |
240 When non-nil, arguments are printed.") | 242 When non-nil, arguments are printed.") |
241 | 243 |
714 ;; | 716 ;; |
715 (set-syntax-table py-mode-syntax-table) | 717 (set-syntax-table py-mode-syntax-table) |
716 (setq major-mode 'python-mode | 718 (setq major-mode 'python-mode |
717 mode-name "Python" | 719 mode-name "Python" |
718 local-abbrev-table python-mode-abbrev-table | 720 local-abbrev-table python-mode-abbrev-table |
719 font-lock-defaults '(python-font-lock-keywords) | |
720 paragraph-separate "^[ \t]*$" | 721 paragraph-separate "^[ \t]*$" |
721 paragraph-start "^[ \t]*$" | 722 paragraph-start "^[ \t]*$" |
722 require-final-newline t | 723 require-final-newline t |
723 comment-start "# " | 724 comment-start "# " |
724 comment-end "" | 725 comment-end "" |
2409 (concat (match-string 1) "." method) | 2410 (concat (match-string 1) "." method) |
2410 method))) | 2411 method))) |
2411 nil))) | 2412 nil))) |
2412 | 2413 |
2413 | 2414 |
2414 (defconst py-version "2.89" | 2415 (defconst py-version "2.90" |
2415 "`python-mode' version number.") | 2416 "`python-mode' version number.") |
2416 (defconst py-help-address "python-mode@python.org" | 2417 (defconst py-help-address "python-mode@python.org" |
2417 "Address accepting submission of bug reports.") | 2418 "Address accepting submission of bug reports.") |
2418 | 2419 |
2419 (defun py-version () | 2420 (defun py-version () |