-
-
Save kiwanami/787575 to your computer and use it in GitHub Desktop.
yasnippets for emacs lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# name : defvar template | |
# group : defvar | |
# contributor : kiwanami | |
# -- | |
(defvar ${1:`(save-excursion | |
(let ((re "(def\\\\(un\\\\|var\\\\)[ \t\n]*\\\\([a-z0-9]*[:-]\\\\)")) | |
(cond | |
((or | |
(re-search-backward re nil t) | |
(re-search-forward re nil t)) | |
(match-string 2)) | |
(t ""))))`}${2:var-name} ${3:value}$0 | |
"$1$2.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# name : defun template | |
# group : defun | |
# contributor : kiwanami | |
# -- | |
(defun ${1:`(save-excursion | |
(let ((re "(def\\\\(un\\\\|var\\\\)[ \t\n]*\\\\([a-z0-9]*[:-]\\\\)")) | |
(cond | |
((or | |
(re-search-backward re nil t) | |
(re-search-forward re nil t)) | |
(match-string 2)) | |
(t ""))))`}${2:func-name} (${3:args}) | |
"$2 | |
${3:$(mapconcat 'upcase (split-string (replace-regexp-in-string "&[a-z]+" "" yas/text)) " \n")}" | |
$0 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#name : let template | |
# -- | |
(let (($0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#name : lexical-let template | |
# -- | |
(lexical-let (($0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment