# HG changeset patch # User Roland McGrath # Date 713481885 0 # Node ID 7c035a87c691e51dea07bb213d98855f8f8a12c8 # Parent ba6a993500d4936f82ab469ad61e458604e86bf0 *** empty log message *** diff -r ba6a993500d4 -r 7c035a87c691 lisp/add-log.el --- a/lisp/add-log.el Sat Aug 08 22:58:39 1992 +0000 +++ b/lisp/add-log.el Mon Aug 10 21:24:45 1992 +0000 @@ -287,28 +287,34 @@ (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