diff options
| author | Fabián Ezequiel Gallina | 2012-05-17 00:03:05 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2012-05-17 00:03:05 -0300 |
| commit | 73ed683681d2941a1ae6f781f6c3c3f339d42fbd (patch) | |
| tree | b7d0859ad98bc393f36f383fc76a9b82e1a8e7b1 /lisp/progmodes/python.el | |
| parent | e2803784cfbd622a60874f3a1d20a0e0decd7161 (diff) | |
| download | emacs-73ed683681d2941a1ae6f781f6c3c3f339d42fbd.tar.gz emacs-73ed683681d2941a1ae6f781f6c3c3f339d42fbd.zip | |
python.el now bytecompiles without warnings
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index fa00faf1502..c40c2e77d0d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -119,12 +119,15 @@ | |||
| 119 | 119 | ||
| 120 | ;;; Code: | 120 | ;;; Code: |
| 121 | 121 | ||
| 122 | (require 'comint) | ||
| 123 | (require 'ansi-color) | 122 | (require 'ansi-color) |
| 124 | (require 'outline) | 123 | (require 'comint) |
| 125 | 124 | ||
| 126 | (eval-when-compile | 125 | (eval-when-compile |
| 127 | (require 'cl)) | 126 | (require 'cl) |
| 127 | ;; Avoid compiler warnings | ||
| 128 | (defvar view-return-to-alist) | ||
| 129 | (defvar compilation-error-regexp-alist) | ||
| 130 | (defvar outline-heading-end-regexp)) | ||
| 128 | 131 | ||
| 129 | (autoload 'comint-mode "comint") | 132 | (autoload 'comint-mode "comint") |
| 130 | 133 | ||
| @@ -218,22 +221,23 @@ | |||
| 218 | 221 | ||
| 219 | ;;; Python specialized rx | 222 | ;;; Python specialized rx |
| 220 | 223 | ||
| 221 | (defconst python-rx-constituents | 224 | (eval-when-compile |
| 222 | (list | 225 | (defconst python-rx-constituents |
| 223 | `(block-start . ,(rx symbol-start | 226 | (list |
| 224 | (or "def" "class" "if" "elif" "else" "try" | 227 | `(block-start . ,(rx symbol-start |
| 225 | "except" "finally" "for" "while" "with") | 228 | (or "def" "class" "if" "elif" "else" "try" |
| 226 | symbol-end)) | 229 | "except" "finally" "for" "while" "with") |
| 227 | `(defun . ,(rx symbol-start (or "def" "class") symbol-end)) | 230 | symbol-end)) |
| 228 | `(open-paren . ,(rx (or "{" "[" "("))) | 231 | `(defun . ,(rx symbol-start (or "def" "class") symbol-end)) |
| 229 | `(close-paren . ,(rx (or "}" "]" ")"))) | 232 | `(open-paren . ,(rx (or "{" "[" "("))) |
| 230 | `(simple-operator . ,(rx (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%))) | 233 | `(close-paren . ,(rx (or "}" "]" ")"))) |
| 231 | `(not-simple-operator . ,(rx (not (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%)))) | 234 | `(simple-operator . ,(rx (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%))) |
| 232 | `(operator . ,(rx (or "+" "-" "/" "&" "^" "~" "|" "*" "<" ">" | 235 | `(not-simple-operator . ,(rx (not (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%)))) |
| 233 | "=" "%" "**" "//" "<<" ">>" "<=" "!=" | 236 | `(operator . ,(rx (or "+" "-" "/" "&" "^" "~" "|" "*" "<" ">" |
| 234 | "==" ">=" "is" "not"))) | 237 | "=" "%" "**" "//" "<<" ">>" "<=" "!=" |
| 235 | `(assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**=" | 238 | "==" ">=" "is" "not"))) |
| 236 | ">>=" "<<=" "&=" "^=" "|="))))) | 239 | `(assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**=" |
| 240 | ">>=" "<<=" "&=" "^=" "|=")))))) | ||
| 237 | 241 | ||
| 238 | (defmacro python-rx (&rest regexps) | 242 | (defmacro python-rx (&rest regexps) |
| 239 | "Python mode especialized rx macro which supports common python named REGEXPS." | 243 | "Python mode especialized rx macro which supports common python named REGEXPS." |
| @@ -1537,14 +1541,14 @@ The skeleton will be bound to python-skeleton-NAME and will | |||
| 1537 | be added to `python-mode-abbrev-table'." | 1541 | be added to `python-mode-abbrev-table'." |
| 1538 | (let* ((name (symbol-name name)) | 1542 | (let* ((name (symbol-name name)) |
| 1539 | (function-name (intern (concat "python-skeleton-" name)))) | 1543 | (function-name (intern (concat "python-skeleton-" name)))) |
| 1540 | (define-abbrev python-mode-abbrev-table name "" function-name) | 1544 | `(progn |
| 1541 | (setq python-skeleton-available | 1545 | (define-abbrev python-mode-abbrev-table ,name "" ',function-name) |
| 1542 | (cons function-name python-skeleton-available)) | 1546 | (setq python-skeleton-available |
| 1543 | `(define-skeleton ,function-name | 1547 | (cons ',function-name python-skeleton-available)) |
| 1544 | ,(or doc | 1548 | (define-skeleton ,function-name |
| 1545 | (format "Insert %s statement." name)) | 1549 | ,(or doc |
| 1546 | ,@skel))) | 1550 | (format "Insert %s statement." name)) |
| 1547 | 1551 | ,@skel)))) | |
| 1548 | (put 'python-skeleton-define 'lisp-indent-function 2) | 1552 | (put 'python-skeleton-define 'lisp-indent-function 2) |
| 1549 | 1553 | ||
| 1550 | (defmacro python-define-auxiliary-skeleton (name doc &optional &rest skel) | 1554 | (defmacro python-define-auxiliary-skeleton (name doc &optional &rest skel) |