summaryrefslogtreecommitdiff
path: root/.emacs.d/snippets/python-mode
diff options
context:
space:
mode:
authorSimeon Simeonov2016-06-16 09:07:53 +0200
committerSimeon Simeonov2016-06-16 09:07:53 +0200
commit991f8ff925f51fd5598db72885f8cca1a1a79bed (patch)
treef55c97c928d5e7f408ee459f713b2c57af34afdd /.emacs.d/snippets/python-mode
parent29f6287f356ef9fc016e2f26861ff9a14443f3ea (diff)
Upgrade all modes, include snippets/html-mode, snippets/nxml-mode and snippets/prog-mode
Diffstat (limited to '.emacs.d/snippets/python-mode')
-rw-r--r--.emacs.d/snippets/python-mode/.yas-setup.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/.emacs.d/snippets/python-mode/.yas-setup.el b/.emacs.d/snippets/python-mode/.yas-setup.el
index 864cbce..3f57d15 100644
--- a/.emacs.d/snippets/python-mode/.yas-setup.el
+++ b/.emacs.d/snippets/python-mode/.yas-setup.el
@@ -1,3 +1,5 @@
1(defvar yas-text)
2
1(defun python-split-args (arg-string) 3(defun python-split-args (arg-string)
2 "Split a python argument string into ((name, default)..) tuples" 4 "Split a python argument string into ((name, default)..) tuples"
3 (mapcar (lambda (x) 5 (mapcar (lambda (x)
@@ -11,12 +13,12 @@
11 (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0)) 13 (max-len (if args (apply 'max (mapcar (lambda (x) (length (nth 0 x))) args)) 0))
12 (formatted-args (mapconcat 14 (formatted-args (mapconcat
13 (lambda (x) 15 (lambda (x)
14 (concat ":param " (nth 0 x) (make-string (- max-len (length (nth 0 x))) ? ) ": " 16 (concat (nth 0 x) (make-string (- max-len (length (nth 0 x))) ? ) " -- "
15 (if (nth 1 x) (concat "\(default " (nth 1 x) "\)")))) 17 (if (nth 1 x) (concat "\(default " (nth 1 x) "\)"))))
16 args 18 args
17 indent))) 19 indent)))
18 (unless (string= formatted-args "") 20 (unless (string= formatted-args "")
19 (mapconcat 'identity (list "Keyword arguments:" formatted-args) indent)))) 21 (mapconcat 'identity (list "Keyword Arguments:" formatted-args) indent))))
20 22
21(add-hook 'python-mode-hook 23(add-hook 'python-mode-hook
22 '(lambda () (set (make-local-variable 'yas-indent-line) 'fixed))) 24 '(lambda () (set (make-local-variable 'yas-indent-line) 'fixed)))