doom, with fewer submodules

This commit is contained in:
2024-03-24 15:45:25 -04:00
committed by Alice Huston
parent 5a3e0909a0
commit 2f91681ce4
8 changed files with 502 additions and 0 deletions

View File

@ -0,0 +1,12 @@
# cc-doxy
A short emacs yasnippet for automatic doxygen function comment generation
Requirements: Emacs, Yasnippet, Semantic-mode.
Simply place in "~/.emacs.d/el-get/yasnippet/snippets/cc-mode/" or your system equivalent, then "M-x yas-reload-all", and you're all set!
This implementation was taken from here:
https://emacs.stackexchange.com/questions/8006/is-there-a-yasnippet-producing-a-prepopulated-doxygen-comment
and modified further to fix bugs I encountered and fit the output to my particular style.

View File

@ -0,0 +1,36 @@
# -*- mode: snippet -*-
# name: cc-doxy
# key: cc-doxy
# type: command
# contributors: Alex Murray <github.com/alexmurray>, Thomas Cushman <tcushman369@gmail.com>
# --
(unless (and (fboundp 'semantic-current-tag)
semantic-mode)
(error "Semantic required to use dox snippet"))
(let ((tag (senator-next-tag)))
(while (or (null tag)
(not (semantic-tag-of-class-p tag 'function)))
(setq tag (senator-next-tag)))
(let* ((name (semantic-tag-name tag))
(attrs (semantic-tag-attributes tag))
(args (plist-get attrs :arguments))
(return-name (plist-get attrs :type))
(idx 1))
(if (listp return-name)
(setq return-name (car return-name)))
(yas/expand-snippet
(format
"/**
* @brief %s - $1%s%s
**/
"
name
(mapconcat
(lambda (x)
(format "\n* @param %s - ${%d:Description of %s}"
(car x) (incf idx) (car x)))
args
"\n")
(if (and return-name (not (string-equal "void" return-name)))
(format "\n* @return ${%d:%s}" (incf idx) return-name)
"")))))