首先下载doxymacs
网上说要下载W3、tempo和libxml2,不过我没有下载,最后也成功了
把下载的doxymacs 直接./configure ,make 不用make install 然后找到文件夹中有个lisp文件夹,这个文件夹中就是要用的.el 文件
配置如下
(add-to-list 'load-path
"~/.emacs.d/conf/doxymacs");
(require 'doxymacs) ;; 启动doxymacs
;;注释高亮,针对C和C++程序
(defun my-doxymacs-font-lock-hook ()
(if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
(doxymacs-font-lock)))
(add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
(doxymacs-mode);doxymacs-mode常true
(add-hook 'c-mode-common-hook 'doxymacs-mode) ;; 启动doxymacs-mode
(add-hook 'c++-mode-common-hook 'doxymacs-mode) ;; 启动doxymacs-mode
;;---C-c d i
自定义模板如下:在doxymacs.el 中修改JavaDoc-file-comment-template ,因为我发现在C++模式里面用的是这个函数
所以我在这个函数里修改如下:
(defconst doxymacs-JavaDoc-file-comment-template
'(
"/********************************************************************" > n
"** " (doxymacs-doxygen-command-char) "file "
(if (buffer-file-name)
(file-name-nondirectory (buffer-file-name))
"") > n
"** " (doxymacs-doxygen-command-char) "author " (user-full-name) > n
"** " (doxymacs-doxygen-command-char)"date " (current-time-string) > n
"** " (doxymacs-doxygen-command-char)"brief " > n
"**" " "> n
"** " " "> n
"**" (doxymacs-doxygen-command-char) "version"
" " "Copyright (c) 2011,河南理工大学-信管08-三班."> n
"********************************************************************/"> n)
"Default JavaDoc-style template for file documentation.")