summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ravi-init-cpp.el49
1 files changed, 17 insertions, 32 deletions
diff --git a/lisp/ravi-init-cpp.el b/lisp/ravi-init-cpp.el
index 58e8eb9..e30c38a 100644
--- a/lisp/ravi-init-cpp.el
+++ b/lisp/ravi-init-cpp.el
@@ -168,7 +168,8 @@
" *" > n
" * " (doxymacs-doxygen-command-char) "brief "
(p "Brief description of this file: ") > n
- " */" > n)
+ " */" > n
+ "" > n)
)
(setq doxymacs-external-xml-parser-executable
(ravi/emacs-file "site-lisp/doxymacs/c/doxymacs_parser"))
@@ -311,50 +312,34 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
(goto-char (point-min))
(insert "#pragma once\n\n")))
+ (defun ravi-license-insert ()
+ "Insert license header from `ravi-license-header'"
+ (let ((start (point-min))
+ (comment-style 'box)
+ (license-header (ravi-license-header))
+ (end))
+ (when license-header
+ (goto-char start)
+ (insert license-header)
+ (setq end (point))
+ (comment-region start end)
+ (insert ?\n))))
+
(defun ravi-start-c++-header ()
"Start a new C++ header by inserting include guards ( see \
header-protection function ), inserting a license statement \
and putting (point) at the correct position"
(interactive)
(header-protection)
- (insert "\n")
- (beginning-of-buffer)
-
- (save-excursion
- (let ((start (point-min))
- (comment-style 'box)
- (license-header (ravi-license-header))
- (end)
- )
- (when license-header
- (goto-char start)
- (insert license-header)
- (setq end (point))
- (comment-region start end))))
-
+ (save-excursion (ravi-license-insert))
(end-of-buffer)
- (next-line -1)
- (insert "\n")
- (doxymacs-insert-file-comment)
- )
+ (doxymacs-insert-file-comment))
(setq auto-insert-query nil)
(define-auto-insert "\\.\\([Cc]\\|cc\\|cpp\\|cxx\\|tcc\\)\\'"
'ravi-auto-insert-cpp)
(define-auto-insert "\\.\\([Hh]\\|hh\\|hpp\\)\\'" 'ravi-start-c++-header)
- (defun ravi-license-insert ()
- (progn
- (let ((start (point-min))
- (comment-style 'box)
- (end)
- )
- (goto-char start)
- (insert (ravi-license-header))
- (insert "\n")
- (setq end (point))
- (comment-region start end))))
-
(defun ravi-auto-insert-cpp ()
(progn
(ravi-license-insert)