summaryrefslogtreecommitdiff
path: root/lisp/add-log.el
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1992-08-10 21:24:45 +0000
committerRoland McGrath <roland@gnu.org>1992-08-10 21:24:45 +0000
commit2c6063508ae232d4adf97b1aa699cb8cac77c282 (patch)
treeb24fe9295dc1f74cb728df54dfe7bbcada0387fe /lisp/add-log.el
parent88be6196a4df0927db8a740e5efe519db334e732 (diff)
downloademacs-2c6063508ae232d4adf97b1aa699cb8cac77c282.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/add-log.el')
-rw-r--r--lisp/add-log.el50
1 files changed, 28 insertions, 22 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 0aa2489f6b8..8809010d94d 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -287,28 +287,34 @@ Has a preference of looking backwards."
(progn (forward-sexp 1) (point))))
;; Ordinary C function syntax.
(setq beg (point))
- (down-list 1) ; into arglist
- (backward-up-list 1)
- (skip-chars-backward " \t")
- ;; Verify initial pos was after real start of function.
- (if (and (save-excursion
- (goto-char beg)
- ;; For this purpose, include the line
- ;; that has the decl keywords.
- ;; This may also include some of the comments
- ;; before the function.
- (while (and (not (bobp))
- (save-excursion
- (forward-line -1)
- (looking-at "[^\n\f]")))
- (forward-line -1))
- (>= location (point)))
- ;; Consistency check: going down and up
- ;; shouldn't take us back before BEG.
- (> (point) beg))
- (buffer-substring (point)
- (progn (backward-sexp 1)
- (point)))))))))
+ (if (condition-case nil
+ ;; Protect against "Unbalanced parens" error.
+ (progn
+ (down-list 1) ; into arglist
+ (backward-up-list 1)
+ (skip-chars-backward " \t")
+ t)
+ (error nil))
+ ;; Verify initial pos was after
+ ;; real start of function.
+ (if (and (save-excursion
+ (goto-char beg)
+ ;; For this purpose, include the line
+ ;; that has the decl keywords. This
+ ;; may also include some of the
+ ;; comments before the function.
+ (while (and (not (bobp))
+ (save-excursion
+ (forward-line -1)
+ (looking-at "[^\n\f]")))
+ (forward-line -1))
+ (>= location (point)))
+ ;; Consistency check: going down and up
+ ;; shouldn't take us back before BEG.
+ (> (point) beg))
+ (buffer-substring (point)
+ (progn (backward-sexp 1)
+ (point))))))))))
((memq major-mode
'(TeX-mode plain-TeX-mode LaTeX-mode;; tex-mode.el
plain-tex-mode latex-mode;; cmutex.el