diff options
| author | Richard M. Stallman | 1993-06-05 02:34:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-05 02:34:12 +0000 |
| commit | a9e2a7f2b17ac61ebf4c8d1e03e2e4c73807fb81 (patch) | |
| tree | 0ce542e9a9ced98982748dd40c3a4b64bd7337f4 | |
| parent | 9bd67a3716240e0f0151be8a6ce00e1690fb46f5 (diff) | |
| download | emacs-a9e2a7f2b17ac61ebf4c8d1e03e2e4c73807fb81.tar.gz emacs-a9e2a7f2b17ac61ebf4c8d1e03e2e4c73807fb81.zip | |
(add-log-current-defun): Handle Fortran.
| -rw-r--r-- | lisp/add-log.el | 19 |
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." | |||
| 373 | (if (re-search-backward "^@node[ \t]+\\([^,]+\\)," nil t) | 373 | (if (re-search-backward "^@node[ \t]+\\([^,]+\\)," nil t) |
| 374 | (buffer-substring (match-beginning 1) | 374 | (buffer-substring (match-beginning 1) |
| 375 | (match-end 1)))) | 375 | (match-end 1)))) |
| 376 | ((eq major-mode 'fortran-mode) | ||
| 377 | ;; must be inside function body for this to work | ||
| 378 | (beginning-of-fortran-subprogram) | ||
| 379 | (let ((case-fold-search t)) ; case-insensitive | ||
| 380 | ;; search for fortran subprogram start | ||
| 381 | (if (re-search-forward | ||
| 382 | "^[ \t]*\\(program\\|subroutine\\|function\ | ||
| 383 | \\|[ \ta-z0-9*]*[ \t]+function\\)" | ||
| 384 | string nil t) | ||
| 385 | (progn | ||
| 386 | ;; move to EOL or before first left paren | ||
| 387 | (if (re-search-forward "[(\n]" nil t) | ||
| 388 | (progn (forward-char -1) | ||
| 389 | (skip-chars-backward " \t")) | ||
| 390 | (end-of-line)) | ||
| 391 | ;; Use the name preceding that. | ||
| 392 | (buffer-substring (point) | ||
| 393 | (progn (forward-sexp -1) | ||
| 394 | (point))))))) | ||
| 376 | (t | 395 | (t |
| 377 | ;; If all else fails, try heuristics | 396 | ;; If all else fails, try heuristics |
| 378 | (let (case-fold-search) | 397 | (let (case-fold-search) |