Mercurial > emacs
comparison lisp/add-log.el @ 3499:6428162f137c
(add-log-current-defun): Fix typos in last change.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 05 Jun 1993 17:10:19 +0000 |
parents | a4b23b25b671 |
children | 507f64624555 |
comparison
equal
deleted
inserted
replaced
3498:e34b759a7b77 | 3499:6428162f137c |
---|---|
241 "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.") | 241 "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.") |
242 | 242 |
243 (defun add-log-current-defun () | 243 (defun add-log-current-defun () |
244 "Return name of function definition point is in, or nil. | 244 "Return name of function definition point is in, or nil. |
245 | 245 |
246 Understands Lisp, LaTeX (\"functions\" are chapters, sections, ...), | 246 Understands C, Lisp, LaTeX (\"functions\" are chapters, sections, ...), |
247 Texinfo (@node titles), and C. | 247 Texinfo (@node titles), and Fortran. |
248 | 248 |
249 Other modes are handled by a heuristic that looks in the 10K before | 249 Other modes are handled by a heuristic that looks in the 10K before |
250 point for uppercase headings starting in the first column or | 250 point for uppercase headings starting in the first column or |
251 identifiers followed by `:' or `=', see variable | 251 identifiers followed by `:' or `=', see variable |
252 `add-log-current-defun-header-regexp'. | 252 `add-log-current-defun-header-regexp'. |
379 (let ((case-fold-search t)) ; case-insensitive | 379 (let ((case-fold-search t)) ; case-insensitive |
380 ;; search for fortran subprogram start | 380 ;; search for fortran subprogram start |
381 (if (re-search-forward | 381 (if (re-search-forward |
382 "^[ \t]*\\(program\\|subroutine\\|function\ | 382 "^[ \t]*\\(program\\|subroutine\\|function\ |
383 \\|[ \ta-z0-9*]*[ \t]+function\\)" | 383 \\|[ \ta-z0-9*]*[ \t]+function\\)" |
384 string nil t) | 384 nil t) |
385 (progn | 385 (progn |
386 ;; move to EOL or before first left paren | 386 ;; move to EOL or before first left paren |
387 (if (re-search-forward "[(\n]" nil t) | 387 (if (re-search-forward "[(\n]" nil t) |
388 (progn (forward-char -1) | 388 (progn (forward-char -1) |
389 (skip-chars-backward " \t")) | 389 (skip-chars-backward " \t")) |