summaryrefslogtreecommitdiff
path: root/snippets
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2018-03-17 20:03:19 -0700
committerbenj <benj@rse8.com>2018-03-17 20:03:19 -0700
commiteb7fa99cc8afbc47306f112eed8f9a68d4cd06ef (patch)
treed52841596ed5bef10366fbb7b8c7bc8417ab5ebe /snippets
parentc38ef385a9af288cf2d2ff0f306b6b2176fcf47d (diff)
downloademacs-eb7fa99cc8afbc47306f112eed8f9a68d4cd06ef.tar
emacs-eb7fa99cc8afbc47306f112eed8f9a68d4cd06ef.tar.gz
emacs-eb7fa99cc8afbc47306f112eed8f9a68d4cd06ef.tar.bz2
emacs-eb7fa99cc8afbc47306f112eed8f9a68d4cd06ef.tar.lz
emacs-eb7fa99cc8afbc47306f112eed8f9a68d4cd06ef.tar.xz
emacs-eb7fa99cc8afbc47306f112eed8f9a68d4cd06ef.tar.zst
emacs-eb7fa99cc8afbc47306f112eed8f9a68d4cd06ef.zip
1. refactored snippets into templates
2. added slime for common lisp 3. created some auto-templates for c
Diffstat (limited to 'snippets')
l---------snippets/c-mode/doxycomments1
-rw-r--r--snippets/c-mode/headerDEF8
-rw-r--r--snippets/clojure-mode/defn8
-rw-r--r--snippets/clojure-mode/let5
-rw-r--r--snippets/doxygen/doxycomments48
-rw-r--r--snippets/python-mode/import_from5
-rw-r--r--snippets/python-mode/lambda5
-rw-r--r--snippets/python-mode/print5
-rw-r--r--snippets/python-mode/print format5
-rw-r--r--snippets/python-mode/script10
10 files changed, 0 insertions, 100 deletions
diff --git a/snippets/c-mode/doxycomments b/snippets/c-mode/doxycomments
deleted file mode 120000
index 62fd598..0000000
--- a/snippets/c-mode/doxycomments
+++ /dev/null
@@ -1 +0,0 @@
-../doxygen/doxycomments \ No newline at end of file
diff --git a/snippets/c-mode/headerDEF b/snippets/c-mode/headerDEF
deleted file mode 100644
index a07587b..0000000
--- a/snippets/c-mode/headerDEF
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# name: headerDEF
-# key: #if
-# --
-#ifndef
-#define
-
-#endif \ No newline at end of file
diff --git a/snippets/clojure-mode/defn b/snippets/clojure-mode/defn
deleted file mode 100644
index 0907e4a..0000000
--- a/snippets/clojure-mode/defn
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- mode: snippet -*-
-# name: defn
-# key: defn
-# --
-defn ${1:name}
- "${2:docstring}"
- [${3:arg-list}]
- $0 \ No newline at end of file
diff --git a/snippets/clojure-mode/let b/snippets/clojure-mode/let
deleted file mode 100644
index 426caa2..0000000
--- a/snippets/clojure-mode/let
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: let
-# key: let
-# --
-let [$0]
diff --git a/snippets/doxygen/doxycomments b/snippets/doxygen/doxycomments
deleted file mode 100644
index 94209bc..0000000
--- a/snippets/doxygen/doxycomments
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- mode: snippet -*-
-# name: doxcomments
-# key: dox
-# type: command
-# --
-;; Command to generate doxygen comments for c functions
-
-(defun flatten (ls)
- "Implements standard flatten function"
- (cond
- ((atom ls) (list ls))
- ((null (cdr ls)) (flatten (car ls)))
- (t (append (flatten (car ls)) (flatten (cdr ls))))))
-
-(defun find-retval ()
- "Returns the return value of the next parsed function"
- (interactive)
- (let ((struct-type "struct"))
- (search-forward "(" nil t)
- (move-beginning-of-line nil)
- (let ((return-type (thing-at-point 'symbol)))
- (if (string= return-type struct-type)
- "NOT_IMPLEMENTED"
- return-type))))
-
-(defun find-args ()
- "Returns a list of function args for the next parsed function"
- (interactive)
- (let* ((struct-type "struct")
- (start (search-forward "(" nil t))
- (end (search-forward ")" nil t))
- (args-string (buffer-substring-no-properties start (1- end)))
- (args (mapcar 'string-trim-left (split-string args-string "," t))))
- (mapcar (lambda (x) (car (reverse x))) (mapcar 'split-string args))))
-
-(let* ((retval (find-retval))
- (args (find-args))
- (args-len (length args))
- (brief "@brief $1\n *")
- (params (mapcar (lambda (x) (format "@param: %s ${%d:}" (cdr x) (car x)))
- (mapcar* 'cons
- (mapcar '1+ (number-sequence 1 args-len))
- args)))
- (retval (format "@return %s $0" retval))
- (snippet-text (mapconcat 'identity (flatten (list "/**" brief params (concat "\n * " retval)))
- "\n * ")))
- (move-beginning-of-line nil)
- (yas-expand-snippet (concat snippet-text "\n*/\n")))
diff --git a/snippets/python-mode/import_from b/snippets/python-mode/import_from
deleted file mode 100644
index 767f344..0000000
--- a/snippets/python-mode/import_from
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: import_from
-# key: from
-# --
-from $1 import $0
diff --git a/snippets/python-mode/lambda b/snippets/python-mode/lambda
deleted file mode 100644
index 08b268b..0000000
--- a/snippets/python-mode/lambda
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: lambda
-# key: lam
-# --
-lambda ${1:x}: $0 \ No newline at end of file
diff --git a/snippets/python-mode/print b/snippets/python-mode/print
deleted file mode 100644
index 2392fbd..0000000
--- a/snippets/python-mode/print
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: print
-# key: print
-# --
-print("$0") \ No newline at end of file
diff --git a/snippets/python-mode/print format b/snippets/python-mode/print format
deleted file mode 100644
index 704cb53..0000000
--- a/snippets/python-mode/print format
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: print format
-# key: printf
-# --
-print("$1".format($0)) \ No newline at end of file
diff --git a/snippets/python-mode/script b/snippets/python-mode/script
deleted file mode 100644
index 3113da9..0000000
--- a/snippets/python-mode/script
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- mode: snippet -*-
-# name: script
-# key: script
-# --
-#!/usr/bin/env python
-def main():
- ${1:pass}
-
-if __name__ == '__main__':
- main() \ No newline at end of file