Mercurial > emacs
comparison lisp/add-log.el @ 3486:a4b23b25b671
(add-log-current-defun): Handle Fortran.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 05 Jun 1993 02:34:12 +0000 |
parents | 50b8f8d5f932 |
children | 6428162f137c |
comparison
equal
deleted
inserted
replaced
3485:c2dbfca5e1de | 3486:a4b23b25b671 |
---|---|
371 (point)))))) | 371 (point)))))) |
372 ((eq major-mode 'texinfo-mode) | 372 ((eq major-mode 'texinfo-mode) |
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) |
379 (end-of-line) | 398 (end-of-line) |
380 (if (re-search-backward add-log-current-defun-header-regexp | 399 (if (re-search-backward add-log-current-defun-header-regexp |