Mercurial > emacs
changeset 1369:e5cb5060bb51
(add-log-current-defun): In normal C case,
start with beginning-of-line.
In last (fallback) case, start with end-of-line.
(add-log-current-defun-header-regexp): In first alternative
within the parens, don't allow space as last character.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 08 Oct 1992 08:35:26 +0000 |
parents | 35a17cd4ae62 |
children | c017b62c8073 |
files | lisp/add-log.el |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/add-log.el Thu Oct 08 06:44:58 1992 +0000 +++ b/lisp/add-log.el Thu Oct 08 08:35:26 1992 +0000 @@ -203,7 +203,7 @@ (run-hooks 'change-log-mode-hook)) (defvar add-log-current-defun-header-regexp - "^\\([A-Z][A-Z_ ]+\\|[a-z_---A-Z]+\\)[ \t]*[:=]" + "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[a-z_---A-Z]+\\)[ \t]*[:=]" "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.") (defun add-log-current-defun () @@ -253,6 +253,7 @@ (buffer-substring (point) (progn (forward-sexp 1) (point)))) ((memq major-mode '(c-mode 'c++-mode)) + (beginning-of-line) ;; See if we are in the beginning part of a function, ;; before the open brace. If so, advance forward. (while (not (looking-at "{\\|\\(\\s *$\\)")) @@ -340,6 +341,7 @@ (t ;; If all else fails, try heuristics (let (case-fold-search) + (end-of-line) (if (re-search-backward add-log-current-defun-header-regexp (- (point) 10000) t)