diff options
| author | benj <benj@rse8.com> | 2023-11-25 10:02:42 -0800 |
|---|---|---|
| committer | benj <benj@rse8.com> | 2023-11-25 10:02:42 -0800 |
| commit | 4cfa8246ea7eec4139ba6c34d3fb3a4545956824 (patch) | |
| tree | 450ba709847d3740eef79753c428095bdb08fe62 /templates/snippets/doxygen/doxycomments | |
| parent | 4f78ee33bfc828707a79cd79d296bf4a9c25b5b9 (diff) | |
| download | emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.gz emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.bz2 emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.lz emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.xz emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.zst emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.zip | |
rewrite emacs init.el and go back to basics
This is a complete rewrite leveraging the very popular use-package to
see how I like it. We reduce init.el to a bare minimum configuration
and remove the previous homebrew organizational scheme. A number of
packages have yet to be setup, but we'll wait and do in JIT.
Diffstat (limited to '')
| -rw-r--r-- | templates/snippets/doxygen/doxycomments | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/templates/snippets/doxygen/doxycomments b/templates/snippets/doxygen/doxycomments deleted file mode 100644 index 94209bc..0000000 --- a/templates/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"))) |
