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