Juan - 2009-06-13

Hi, I am quite new but anyway started tweaking doxymacs.el to support fortran (mainly for my own use). If there is anybody interesting. May be will be nice if somebody more experienced could improve it but it seems to be working quite satisfactorily.

Here is the patch to the original (at least for gentoo: doxymacs-1.8.0-r3). If interested, use it as:
$>  patch doxymacs.el doxymacs_fortran_01.patch

###### START doxymacs_fortran_01.patch ########################################
--- /usr/share/emacs/site-lisp/doxymacs/doxymacs.el    2009-06-10 12:20:50.000000000 -0300
+++ doxymacs.el    2009-06-13 16:46:05.000000000 -0300
@@ -29,7 +29,7 @@
;; Doxymacs homepage: http://doxymacs.sourceforge.net/
;;
;; $Id: doxymacs.el.in,v 1.26 2007/06/10 13:17:24 ryants Exp $
-

+
;; Commentary:
;;
;; Doxymacs depends on the following packages:
@@ -115,6 +115,7 @@

;; Change log:
;;
+;; 13/06/2009 - Added some support for Fortran (J.F.)
;; 10/06/2007 - version 1.8.0
;; 02/02/2007 - bug #1490021: Allow spaces in @param [in] documentation.
;;              bug #1496399: Allow for different ways of user-mail-address
@@ -1084,6 +1085,10 @@

;; Default templates

+(defconst doxymacs-Fortran-blank-multiline-comment-template
+ '("!>" > n "!! " p > n "!! " > n "!<" > n)
+ "Default Fortran-style template for a blank multiline doxygen comment.")
+
(defconst doxymacs-JavaDoc-blank-multiline-comment-template
  '("/**" > n "* " p > n "* " > n "*/" > n)
  "Default JavaDoc-style template for a blank multiline doxygen comment.")
@@ -1096,6 +1101,10 @@
  '("///" > n "/// " p > n "///" > n)
  "Default C++-style template for a blank multiline doxygen comment.")

+(defconst doxymacs-Fortran-blank-singleline-comment-template
+ '("!> " > p)
+ "Default Fortran-style template for a blank single line doxygen comment.")
+
(defconst doxymacs-JavaDoc-blank-singleline-comment-template
  '("/// " > p)
  "Default JavaDoc-style template for a blank single line doxygen comment.")
@@ -1114,6 +1123,7 @@
    ((string= doxymacs-doxygen-style "JavaDoc") "@")
    ((string= doxymacs-doxygen-style "Qt") "\\&quot;)
    ((string= doxymacs-doxygen-style "C++") "@")
+   ((string= doxymacs-doxygen-style "Fortran") "\\&quot;)
    (t "@")))

(defun doxymacs-user-mail-address ()
@@ -1124,6 +1134,23 @@
    (and (and (boundp 'user-mail-address) user-mail-address)
     (list 'l " <" user-mail-address ">"))))

+(defconst doxymacs-Fortran-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)
+   (doxymacs-user-mail-address)
+   > n
+   " !! " (doxymacs-doxygen-command-char) "date   " (current-time-string) > n
+   " !! " > n
+   " !! " (doxymacs-doxygen-command-char) "brief  " (p "Brief description of this file: ") > n
+   " !! " > n
+   " !! " p > n
+   " !<" > n)
+ "Default Fortran-style template for file documentation.")
+
(defconst doxymacs-JavaDoc-file-comment-template
  '("/**" > n
    " * " (doxymacs-doxygen-command-char) "file   "
@@ -1193,10 +1220,33 @@
       (list 'l "/// " (doxymacs-doxygen-command-char)
         "param " (car parms) " " (list 'p prompt) '> 'n
         (doxymacs-parm-tempo-element (cdr parms))))
+     ((string= doxymacs-doxygen-style "Fortran")
+      (list 'l " !! " (doxymacs-doxygen-command-char)
+        "param " (car parms) " " (list 'p prompt) '> 'n
+        (doxymacs-parm-tempo-element (cdr parms))))
      (t
       (doxymacs-invalid-style))))
     nil))

+(defconst doxymacs-Fortran-function-comment-template
+ '((let ((next-func (doxymacs-find-next-func)))
+     (if next-func
+     (list
+      'l
+      " !> " 'p '> 'n
+      " !! " '> 'n
+      (doxymacs-parm-tempo-element (cdr (assoc 'args next-func)))
+      (unless (string-match
+                   (regexp-quote (cdr (assoc 'return next-func)))
+                   doxymacs-void-types)
+        '(l "!! " > n " !! " (doxymacs-doxygen-command-char)
+        "return " (p "Returns: ") > n))
+      " !<" '>)
+       (progn
+     (error "Can't find next function declaration.")
+     nil))))
+ "Default Fortran-style template for function documentation.")
+

(defconst doxymacs-JavaDoc-function-comment-template
  '((let ((next-func (doxymacs-find-next-func)))
@@ -1263,7 +1313,7 @@
   (error (concat
       "Invalid `doxymacs-doxygen-style': "
       doxymacs-doxygen-style
-      ": must be one of \&quot;JavaDoc\&quot;, \&quot;Qt\&quot; or \&quot;C++\&quot;.")))
+      ": must be one of \&quot;JavaDoc\&quot;, \&quot;Qt\&quot;, \&quot;C++\&quot; or \&quot;Fortran\&quot; .")))

;; This should make it easier to add new templates and cut down
;; on copy-and-paste programming.
@@ -1343,6 +1393,8 @@
             "/*!< ")
                ((string= doxymacs-doxygen-style "C++")
             "///< ")
+               ((string= doxymacs-doxygen-style "Fortran")
+            "!> ")
                (t
             (doxymacs-invalid-style)))))
      (skip (concat (regexp-quote starter) "*"))
@@ -1354,6 +1406,8 @@
             " */")
                ((string= doxymacs-doxygen-style "C++")
             "")
+               ((string= doxymacs-doxygen-style "Fortran")
+            " !<")
                (t
             (doxymacs-invalid-style))))))
     (if empty
@@ -1411,6 +1465,8 @@
             "/*@{*/")
                ((string= doxymacs-doxygen-style "C++")
             "/// @{")
+               ((string= doxymacs-doxygen-style "Fortran")
+            "!> @{")
                (t
             (doxymacs-invalid-style)))))
      (ender (or doxymacs-group-comment-end
@@ -1421,6 +1477,8 @@
             "/*@}*/")
                ((string= doxymacs-doxygen-style "C++")
             "/// @}")
+               ((string= doxymacs-doxygen-style "Fortran")
+            "!> @}")
                (t
             (doxymacs-invalid-style))))))
     (save-excursion

###### END doxymacs_fortran_01.patch ########################################