Mercurial > emacs
comparison lisp/progmodes/python.el @ 91367:c70e45a7acfd
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 30 Jan 2008 07:57:28 +0000 |
parents | 606f2d163a64 6f654ccab302 |
children |
comparison
equal
deleted
inserted
replaced
91366:86f3a8f0a3a6 | 91367:c70e45a7acfd |
---|---|
1887 ;; definition (separate from BicycleRepairMan). Complicated by | 1887 ;; definition (separate from BicycleRepairMan). Complicated by |
1888 ;; finding the right qualified name. | 1888 ;; finding the right qualified name. |
1889 | 1889 |
1890 ;;;; Completion. | 1890 ;;;; Completion. |
1891 | 1891 |
1892 (defvar python-imports nil | 1892 ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-01/msg00076.html |
1893 (defvar python-imports "None" | |
1893 "String of top-level import statements updated by `python-find-imports'.") | 1894 "String of top-level import statements updated by `python-find-imports'.") |
1894 (make-variable-buffer-local 'python-imports) | 1895 (make-variable-buffer-local 'python-imports) |
1895 | 1896 |
1896 ;; Fixme: Should font-lock try to run this when it deals with an import? | 1897 ;; Fixme: Should font-lock try to run this when it deals with an import? |
1897 ;; Maybe not a good idea if it gets run multiple times when the | 1898 ;; Maybe not a good idea if it gets run multiple times when the |
2074 > _ \n | 2075 > _ \n |
2075 ("other condition, %s: " | 2076 ("other condition, %s: " |
2076 < ; Avoid wrong indentation after block opening. | 2077 < ; Avoid wrong indentation after block opening. |
2077 "elif " str ":" \n | 2078 "elif " str ":" \n |
2078 > _ \n nil) | 2079 > _ \n nil) |
2079 (python-else) | ^) | 2080 '(python-else) | ^) |
2080 | 2081 |
2081 (define-skeleton python-else | 2082 (define-skeleton python-else |
2082 "Auxiliary skeleton." | 2083 "Auxiliary skeleton." |
2083 nil | 2084 nil |
2084 (unless (eq ?y (read-char "Add `else' clause? (y for yes or RET for no) ")) | 2085 (unless (eq ?y (read-char "Add `else' clause? (y for yes or RET for no) ")) |
2088 | 2089 |
2089 (def-python-skeleton while | 2090 (def-python-skeleton while |
2090 "Condition: " | 2091 "Condition: " |
2091 "while " str ":" \n | 2092 "while " str ":" \n |
2092 > _ \n | 2093 > _ \n |
2093 (python-else) | ^) | 2094 '(python-else) | ^) |
2094 | 2095 |
2095 (def-python-skeleton for | 2096 (def-python-skeleton for |
2096 "Target, %s: " | 2097 "Target, %s: " |
2097 "for " str " in " (skeleton-read "Expression, %s: ") ":" \n | 2098 "for " str " in " (skeleton-read "Expression, %s: ") ":" \n |
2098 > _ \n | 2099 > _ \n |
2099 (python-else) | ^) | 2100 '(python-else) | ^) |
2100 | 2101 |
2101 (def-python-skeleton try/except | 2102 (def-python-skeleton try/except |
2102 nil | 2103 nil |
2103 "try:" \n | 2104 "try:" \n |
2104 > _ \n | 2105 > _ \n |
2105 ("Exception, %s: " | 2106 ("Exception, %s: " |
2106 < "except " str (python-target) ":" \n | 2107 < "except " str '(python-target) ":" \n |
2107 > _ \n nil) | 2108 > _ \n nil) |
2108 < "except:" \n | 2109 < "except:" \n |
2109 > _ \n | 2110 > _ \n |
2110 (python-else) | ^) | 2111 '(python-else) | ^) |
2111 | 2112 |
2112 (define-skeleton python-target | 2113 (define-skeleton python-target |
2113 "Auxiliary skeleton." | 2114 "Auxiliary skeleton." |
2114 "Target, %s: " ", " str | -2) | 2115 "Target, %s: " ", " str | -2) |
2115 | 2116 |