diff options
| author | Richard M. Stallman | 1992-10-08 08:35:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-10-08 08:35:26 +0000 |
| commit | d80788d86d0249afb1c8598ffd458342a76616cb (patch) | |
| tree | 216630c687c9b538dea4a1f0d64bfbe1c7be4447 | |
| parent | 7b02ee3c41fdbf75c122ad96099e7b6407d9c5ff (diff) | |
| download | emacs-d80788d86d0249afb1c8598ffd458342a76616cb.tar.gz emacs-d80788d86d0249afb1c8598ffd458342a76616cb.zip | |
(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.
| -rw-r--r-- | lisp/add-log.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el index 3400d93d985..f7f61b3952f 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -203,7 +203,7 @@ Runs `change-log-mode-hook'." | |||
| 203 | (run-hooks 'change-log-mode-hook)) | 203 | (run-hooks 'change-log-mode-hook)) |
| 204 | 204 | ||
| 205 | (defvar add-log-current-defun-header-regexp | 205 | (defvar add-log-current-defun-header-regexp |
| 206 | "^\\([A-Z][A-Z_ ]+\\|[a-z_---A-Z]+\\)[ \t]*[:=]" | 206 | "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[a-z_---A-Z]+\\)[ \t]*[:=]" |
| 207 | "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.") | 207 | "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.") |
| 208 | 208 | ||
| 209 | (defun add-log-current-defun () | 209 | (defun add-log-current-defun () |
| @@ -253,6 +253,7 @@ Has a preference of looking backwards." | |||
| 253 | (buffer-substring (point) | 253 | (buffer-substring (point) |
| 254 | (progn (forward-sexp 1) (point)))) | 254 | (progn (forward-sexp 1) (point)))) |
| 255 | ((memq major-mode '(c-mode 'c++-mode)) | 255 | ((memq major-mode '(c-mode 'c++-mode)) |
| 256 | (beginning-of-line) | ||
| 256 | ;; See if we are in the beginning part of a function, | 257 | ;; See if we are in the beginning part of a function, |
| 257 | ;; before the open brace. If so, advance forward. | 258 | ;; before the open brace. If so, advance forward. |
| 258 | (while (not (looking-at "{\\|\\(\\s *$\\)")) | 259 | (while (not (looking-at "{\\|\\(\\s *$\\)")) |
| @@ -340,6 +341,7 @@ Has a preference of looking backwards." | |||
| 340 | (t | 341 | (t |
| 341 | ;; If all else fails, try heuristics | 342 | ;; If all else fails, try heuristics |
| 342 | (let (case-fold-search) | 343 | (let (case-fold-search) |
| 344 | (end-of-line) | ||
| 343 | (if (re-search-backward add-log-current-defun-header-regexp | 345 | (if (re-search-backward add-log-current-defun-header-regexp |
| 344 | (- (point) 10000) | 346 | (- (point) 10000) |
| 345 | t) | 347 | t) |