Add ruby stuff
[emacs.git] / .emacs.d / elisp / yasnippet / snippets / python-mode / def
1 # -*- coding: utf-8 -*-
2 # name: def
3 # contributor: Orestis Markou
4 # contributor: Yasser González Fernández <yglez@uh.cu>
5 # key: def
6 # --
7 def ${1:name}($2):
8 """$3
9 ${2:$
10 (let*
11 ((indent
12 (concat "\n" (make-string (current-column) 32)))
13 (args
14 (mapconcat
15 '(lambda (x)
16 (if (not (string= (nth 0 x) ""))
17 (concat "- " (char-to-string 96) (nth 0 x)
18 (char-to-string 96) ":")))
19 (mapcar
20 '(lambda (x)
21 (mapcar
22 '(lambda (x)
23 (replace-regexp-in-string "[[:blank:]]*$" ""
24 (replace-regexp-in-string "^[[:blank:]]*" "" x)))
25 x))
26 (mapcar '(lambda (x) (split-string x "="))
27 (split-string text ",")))
28 indent)))
29 (if (string= args "")
30 (make-string 3 34)
31 (mapconcat
32 'identity
33 (list "" "Arguments:" args (make-string 3 34))
34 indent)))
35 }
36 $0