diff options
| author | John Wiegley | 2006-10-22 20:39:36 +0000 |
|---|---|---|
| committer | John Wiegley | 2006-10-22 20:39:36 +0000 |
| commit | 7a338befad5fe10f592c0e432e7112dec8dd3d4c (patch) | |
| tree | 0822ca2076b4835d5bc4ed5004dfdd47de46577f /lisp/progmodes/python.el | |
| parent | 2967b4c9d788a3b240bd90c4aa8f8f3ff48209e4 (diff) | |
| download | emacs-7a338befad5fe10f592c0e432e7112dec8dd3d4c.tar.gz emacs-7a338befad5fe10f592c0e432e7112dec8dd3d4c.zip | |
2006-10-22 John Wiegley <johnw@newartisans.com>
* progmodes/python.el (python-use-skeletons): python-mode was
auto-inserting templates (for those with abbrev-mode on), not only
by default -- *but without a configuration variable to disable
it*. This rendered python-mode completely useless for me, so I
have added `python-use-skeletons', which is now off by default.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0387c05134e..4d9a49a6b8d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1969,6 +1969,13 @@ Repeating the command scrolls the completion window." | |||
| 1969 | 1969 | ||
| 1970 | ;;;; Skeletons | 1970 | ;;;; Skeletons |
| 1971 | 1971 | ||
| 1972 | (defcustom python-use-skeletons nil | ||
| 1973 | "Non-nil means template skeletons will be automagically inserted. | ||
| 1974 | This happens when pressing \"if<SPACE>\", for example, to prompt for | ||
| 1975 | the if condition." | ||
| 1976 | :type 'boolean | ||
| 1977 | :group 'python) | ||
| 1978 | |||
| 1972 | (defvar python-skeletons nil | 1979 | (defvar python-skeletons nil |
| 1973 | "Alist of named skeletons for Python mode. | 1980 | "Alist of named skeletons for Python mode. |
| 1974 | Elements are of the form (NAME . EXPANDER-FUNCTION).") | 1981 | Elements are of the form (NAME . EXPANDER-FUNCTION).") |
| @@ -1986,7 +1993,8 @@ The default contents correspond to the elements of `python-skeletons'.") | |||
| 1986 | (function (intern (concat "python-insert-" name)))) | 1993 | (function (intern (concat "python-insert-" name)))) |
| 1987 | `(progn | 1994 | `(progn |
| 1988 | (add-to-list 'python-skeletons ',(cons name function)) | 1995 | (add-to-list 'python-skeletons ',(cons name function)) |
| 1989 | (define-abbrev python-mode-abbrev-table ,name "" ',function nil t) | 1996 | (if python-use-skeletons |
| 1997 | (define-abbrev python-mode-abbrev-table ,name "" ',function nil t)) | ||
| 1990 | (define-skeleton ,function | 1998 | (define-skeleton ,function |
| 1991 | ,(format "Insert Python \"%s\" template." name) | 1999 | ,(format "Insert Python \"%s\" template." name) |
| 1992 | ,@elements))))) | 2000 | ,@elements))))) |