summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-11-11 00:56:44 +0000
committerMiles Bader <miles@gnu.org>2007-11-11 00:56:44 +0000
commitf23d76bdefbd4c06e14d69e99e50d35ce91c8226 (patch)
treeded28d1da6df2d0135514bac83074f4ca1c9099a /lisp/progmodes/python.el
parente2d092da5980a7d05a5428074f8eb4925fa801e8 (diff)
parenta457417ee5ba797ab1c91d35ee957bb7a7f8d4b6 (diff)
downloademacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.tar.gz
emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.tar.bz2
emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el30
1 files changed, 7 insertions, 23 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index fc28b72bfd1..f54b7c9f928 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2036,10 +2036,11 @@ the if condition."
"Alist of named skeletons for Python mode.
Elements are of the form (NAME . EXPANDER-FUNCTION).")
-(defvar python-mode-abbrev-table nil
+(define-abbrev-table 'python-mode-abbrev-table ()
"Abbrev table for Python mode.
-The default contents correspond to the elements of `python-skeletons'.")
-(define-abbrev-table 'python-mode-abbrev-table ())
+The default contents correspond to the elements of `python-skeletons'."
+ ;; Allow / in abbrevs.
+ :regexp "\\<\\([[:word:]/]+\\)\\W*")
(eval-when-compile
;; Define a user-level skeleton and add it to `python-skeletons' and
@@ -2049,8 +2050,9 @@ The default contents correspond to the elements of `python-skeletons'.")
(function (intern (concat "python-insert-" name))))
`(progn
(add-to-list 'python-skeletons ',(cons name function))
- (if python-use-skeletons
- (define-abbrev python-mode-abbrev-table ,name "" ',function nil t))
+ (define-abbrev python-mode-abbrev-table ,name "" ',function
+ :system t :case-fixed t
+ :enable-function (lambda () python-use-skeletons))
(define-skeleton ,function
,(format "Insert Python \"%s\" template." name)
,@elements)))))
@@ -2205,23 +2207,6 @@ without confirmation."
(defvar outline-heading-end-regexp)
(defvar eldoc-documentation-function)
-
-;; Stuff to allow expanding abbrevs with non-word constituents.
-(defun python-abbrev-pc-hook ()
- "Set the syntax table before possibly expanding abbrevs."
- (remove-hook 'post-command-hook 'python-abbrev-pc-hook t)
- (set-syntax-table python-mode-syntax-table))
-
-(defvar python-abbrev-syntax-table
- (copy-syntax-table python-mode-syntax-table)
- "Syntax table used when expanding abbrevs.")
-
-(defun python-pea-hook ()
- "Reset the syntax table after possibly expanding abbrevs."
- (set-syntax-table python-abbrev-syntax-table)
- (add-hook 'post-command-hook 'python-abbrev-pc-hook nil t))
-(modify-syntax-entry ?/ "w" python-abbrev-syntax-table)
-
(defvar python-mode-running) ;Dynamically scoped var.
;;;###autoload
@@ -2309,7 +2294,6 @@ with skeleton expansions for compound statement templates.
'((< '(backward-delete-char-untabify (min python-indent
(current-column))))
(^ '(- (1+ (current-indentation))))))
- (add-hook 'pre-abbrev-expand-hook 'python-pea-hook nil t)
(if (featurep 'hippie-exp)
(set (make-local-variable 'hippie-expand-try-functions-list)
(cons 'python-try-complete hippie-expand-try-functions-list)))