aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index d1009534e49..fde7fadd061 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2654,8 +2654,8 @@ the if condition."
2654(defvar python-skeleton-available '() 2654(defvar python-skeleton-available '()
2655 "Internal list of available skeletons.") 2655 "Internal list of available skeletons.")
2656 2656
2657(define-abbrev-table 'python-mode-abbrev-table () 2657(define-abbrev-table 'python-mode-skeleton-abbrev-table ()
2658 "Abbrev table for Python mode." 2658 "Abbrev table for Python mode skeletons."
2659 :case-fixed t 2659 :case-fixed t
2660 ;; Allow / inside abbrevs. 2660 ;; Allow / inside abbrevs.
2661 :regexp "\\(?:^\\|[^/]\\)\\<\\([[:word:]/]+\\)\\W*" 2661 :regexp "\\(?:^\\|[^/]\\)\\<\\([[:word:]/]+\\)\\W*"
@@ -2668,13 +2668,13 @@ the if condition."
2668(defmacro python-skeleton-define (name doc &rest skel) 2668(defmacro python-skeleton-define (name doc &rest skel)
2669 "Define a `python-mode' skeleton using NAME DOC and SKEL. 2669 "Define a `python-mode' skeleton using NAME DOC and SKEL.
2670The skeleton will be bound to python-skeleton-NAME and will 2670The skeleton will be bound to python-skeleton-NAME and will
2671be added to `python-mode-abbrev-table'." 2671be added to `python-mode-skeleton-abbrev-table'."
2672 (declare (indent 2)) 2672 (declare (indent 2))
2673 (let* ((name (symbol-name name)) 2673 (let* ((name (symbol-name name))
2674 (function-name (intern (concat "python-skeleton-" name)))) 2674 (function-name (intern (concat "python-skeleton-" name))))
2675 `(progn 2675 `(progn
2676 (define-abbrev python-mode-abbrev-table ,name "" ',function-name 2676 (define-abbrev python-mode-skeleton-abbrev-table
2677 :system t) 2677 ,name "" ',function-name :system t)
2678 (setq python-skeleton-available 2678 (setq python-skeleton-available
2679 (cons ',function-name python-skeleton-available)) 2679 (cons ',function-name python-skeleton-available))
2680 (define-skeleton ,function-name 2680 (define-skeleton ,function-name
@@ -2682,6 +2682,10 @@ be added to `python-mode-abbrev-table'."
2682 (format "Insert %s statement." name)) 2682 (format "Insert %s statement." name))
2683 ,@skel)))) 2683 ,@skel))))
2684 2684
2685(define-abbrev-table 'python-mode-abbrev-table ()
2686 "Abbrev table for Python mode."
2687 :parents (list python-mode-skeleton-abbrev-table))
2688
2685(defmacro python-define-auxiliary-skeleton (name doc &optional &rest skel) 2689(defmacro python-define-auxiliary-skeleton (name doc &optional &rest skel)
2686 "Define a `python-mode' auxiliary skeleton using NAME DOC and SKEL. 2690 "Define a `python-mode' auxiliary skeleton using NAME DOC and SKEL.
2687The skeleton will be bound to python-skeleton-NAME." 2691The skeleton will be bound to python-skeleton-NAME."