diff options
Diffstat (limited to '.emacs.d/mysnippets/text-mode/python-mode/def')
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/python-mode/def | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/.emacs.d/mysnippets/text-mode/python-mode/def b/.emacs.d/mysnippets/text-mode/python-mode/def new file mode 100644 index 0000000..f82f791 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/python-mode/def | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | # name: def | ||
| 3 | # contributor: Orestis Markou | ||
| 4 | # contributor: Yasser González Fernández <yglez@uh.cu> | ||
| 5 | # -- | ||
| 6 | def ${1:name}($2): | ||
| 7 | """$3 | ||
| 8 | ${2:$ | ||
| 9 | (let* | ||
| 10 | ((indent | ||
| 11 | (concat "\n" (make-string (current-column) 32))) | ||
| 12 | (args | ||
| 13 | (mapconcat | ||
| 14 | '(lambda (x) | ||
| 15 | (if (not (string= (nth 0 x) "")) | ||
| 16 | (concat "- " (char-to-string 96) (nth 0 x) | ||
| 17 | (char-to-string 96) ":"))) | ||
| 18 | (mapcar | ||
| 19 | '(lambda (x) | ||
| 20 | (mapcar | ||
| 21 | '(lambda (x) | ||
| 22 | (replace-regexp-in-string "[[:blank:]]*$" "" | ||
| 23 | (replace-regexp-in-string "^[[:blank:]]*" "" x))) | ||
| 24 | x)) | ||
| 25 | (mapcar '(lambda (x) (split-string x "=")) | ||
| 26 | (split-string text ","))) | ||
| 27 | indent))) | ||
| 28 | (if (string= args "") | ||
| 29 | (make-string 3 34) | ||
| 30 | (mapconcat | ||
| 31 | 'identity | ||
| 32 | (list "" "Arguments:" args (make-string 3 34)) | ||
| 33 | indent))) | ||
| 34 | } | ||
| 35 | $0 | ||
