diff options
| -rw-r--r-- | lisp/add-log.el | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el index 6305de92392..1b16295c0eb 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -333,7 +333,7 @@ Has a preference of looking backwards." | |||
| 333 | (skip-chars-forward " ") | 333 | (skip-chars-forward " ") |
| 334 | (buffer-substring (point) | 334 | (buffer-substring (point) |
| 335 | (progn (forward-sexp 1) (point)))))) | 335 | (progn (forward-sexp 1) (point)))))) |
| 336 | ((and (memq major-mode '(c-mode c++-mode c++-c-mode)) | 336 | ((and (memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) |
| 337 | (save-excursion (beginning-of-line) | 337 | (save-excursion (beginning-of-line) |
| 338 | ;; Use eq instead of = here to avoid | 338 | ;; Use eq instead of = here to avoid |
| 339 | ;; error when at bob and char-after | 339 | ;; error when at bob and char-after |
| @@ -349,9 +349,7 @@ Has a preference of looking backwards." | |||
| 349 | (skip-chars-forward " \t") | 349 | (skip-chars-forward " \t") |
| 350 | (buffer-substring (point) | 350 | (buffer-substring (point) |
| 351 | (progn (forward-sexp 1) (point)))) | 351 | (progn (forward-sexp 1) (point)))) |
| 352 | ((and (eq major-mode 'objc-mode) | 352 | ((memq major-mode '(c-mode c++-mode c++-c-mode objc-mode)) |
| 353 | (get-method-definition))) | ||
| 354 | ((memq major-mode '(c-mode c++-mode c++-c-mode)) | ||
| 355 | (beginning-of-line) | 353 | (beginning-of-line) |
| 356 | ;; See if we are in the beginning part of a function, | 354 | ;; See if we are in the beginning part of a function, |
| 357 | ;; before the open brace. If so, advance forward. | 355 | ;; before the open brace. If so, advance forward. |
| @@ -393,36 +391,38 @@ Has a preference of looking backwards." | |||
| 393 | (skip-chars-forward " ,"))) | 391 | (skip-chars-forward " ,"))) |
| 394 | (buffer-substring (point) | 392 | (buffer-substring (point) |
| 395 | (progn (forward-sexp 1) (point)))) | 393 | (progn (forward-sexp 1) (point)))) |
| 396 | ;; Ordinary C function syntax. | 394 | (if (looking-at "^[+-]") |
| 397 | (setq beg (point)) | 395 | (get-method-definition) |
| 398 | (if (condition-case nil | 396 | ;; Ordinary C function syntax. |
| 399 | ;; Protect against "Unbalanced parens" error. | 397 | (setq beg (point)) |
| 400 | (progn | 398 | (if (condition-case nil |
| 401 | (down-list 1) ; into arglist | 399 | ;; Protect against "Unbalanced parens" error. |
| 402 | (backward-up-list 1) | 400 | (progn |
| 403 | (skip-chars-backward " \t") | 401 | (down-list 1) ; into arglist |
| 404 | t) | 402 | (backward-up-list 1) |
| 405 | (error nil)) | 403 | (skip-chars-backward " \t") |
| 406 | ;; Verify initial pos was after | 404 | t) |
| 407 | ;; real start of function. | 405 | (error nil)) |
| 408 | (if (and (save-excursion | 406 | ;; Verify initial pos was after |
| 409 | (goto-char beg) | 407 | ;; real start of function. |
| 410 | ;; For this purpose, include the line | 408 | (if (and (save-excursion |
| 411 | ;; that has the decl keywords. This | 409 | (goto-char beg) |
| 412 | ;; may also include some of the | 410 | ;; For this purpose, include the line |
| 413 | ;; comments before the function. | 411 | ;; that has the decl keywords. This |
| 414 | (while (and (not (bobp)) | 412 | ;; may also include some of the |
| 415 | (save-excursion | 413 | ;; comments before the function. |
| 416 | (forward-line -1) | 414 | (while (and (not (bobp)) |
| 417 | (looking-at "[^\n\f]"))) | 415 | (save-excursion |
| 418 | (forward-line -1)) | 416 | (forward-line -1) |
| 419 | (>= location (point))) | 417 | (looking-at "[^\n\f]"))) |
| 420 | ;; Consistency check: going down and up | 418 | (forward-line -1)) |
| 421 | ;; shouldn't take us back before BEG. | 419 | (>= location (point))) |
| 422 | (> (point) beg)) | 420 | ;; Consistency check: going down and up |
| 423 | (buffer-substring (point) | 421 | ;; shouldn't take us back before BEG. |
| 424 | (progn (backward-sexp 1) | 422 | (> (point) beg)) |
| 425 | (point)))))))))) | 423 | (buffer-substring (point) |
| 424 | (progn (backward-sexp 1) | ||
| 425 | (point))))))))))) | ||
| 426 | ((memq major-mode | 426 | ((memq major-mode |
| 427 | '(TeX-mode plain-TeX-mode LaTeX-mode;; tex-mode.el | 427 | '(TeX-mode plain-TeX-mode LaTeX-mode;; tex-mode.el |
| 428 | plain-tex-mode latex-mode;; cmutex.el | 428 | plain-tex-mode latex-mode;; cmutex.el |