summaryrefslogtreecommitdiff
path: root/lisp/add-log.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-05 02:34:12 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-05 02:34:12 +0000
commit4ee985d140ccd489c62bdb1c9dbac17f2ad9ef98 (patch)
treee7f748d30f2ac9f67d29ce58772b533319b1494f /lisp/add-log.el
parent2a6693fefbe6009a6eeea4b2ae283b1c62b374e7 (diff)
downloademacs-4ee985d140ccd489c62bdb1c9dbac17f2ad9ef98.tar.gz
(add-log-current-defun): Handle Fortran.
Diffstat (limited to 'lisp/add-log.el')
-rw-r--r--lisp/add-log.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 22feb7d2257..9c1be0e4536 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -373,6 +373,25 @@ Has a preference of looking backwards."
(if (re-search-backward "^@node[ \t]+\\([^,]+\\)," nil t)
(buffer-substring (match-beginning 1)
(match-end 1))))
+ ((eq major-mode 'fortran-mode)
+ ;; must be inside function body for this to work
+ (beginning-of-fortran-subprogram)
+ (let ((case-fold-search t)) ; case-insensitive
+ ;; search for fortran subprogram start
+ (if (re-search-forward
+ "^[ \t]*\\(program\\|subroutine\\|function\
+\\|[ \ta-z0-9*]*[ \t]+function\\)"
+ string nil t)
+ (progn
+ ;; move to EOL or before first left paren
+ (if (re-search-forward "[(\n]" nil t)
+ (progn (forward-char -1)
+ (skip-chars-backward " \t"))
+ (end-of-line))
+ ;; Use the name preceding that.
+ (buffer-substring (point)
+ (progn (forward-sexp -1)
+ (point)))))))
(t
;; If all else fails, try heuristics
(let (case-fold-search)