diff options
author | Richard M. Stallman <[email protected]> | 1992-10-06 05:12:54 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1992-10-06 05:12:54 +0000 |
commit | 90e2359039d97550ac72b2804580d448964b98cc (patch) | |
tree | cff260fb86cec031a9e853014cf1270023a22fa5 | |
parent | 19a36ec6dcfbb35734f4f048afdaba3cff94356d (diff) |
(add-log-current-defun): Catch errors checking for DEFUN.
-rw-r--r-- | lisp/add-log.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el index c0f0bf8d38..3400d93d98 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el @@ -273,13 +273,15 @@ Has a preference of looking backwards." (forward-line -1)) ;; See if this is using the DEFUN macro used in Emacs, ;; or the DEFUN macro used by the C library. - (if (and (save-excursion - (forward-line 1) - (backward-sexp 1) - (beginning-of-line) - (setq tem (point)) - (looking-at "DEFUN\\b")) - (>= location tem)) + (if (condition-case nil + (and (save-excursion + (forward-line 1) + (backward-sexp 1) + (beginning-of-line) + (setq tem (point)) + (looking-at "DEFUN\\b")) + (>= location tem)) + (error nil)) (progn (goto-char tem) (down-list 1) |