From: Richard M. Stallman Date: Wed, 23 Feb 2005 21:04:14 +0000 (+0000) Subject: (find-tag-default): Catch errors in forward-sexp. X-Git-Tag: ttn-vms-21-2-B4~2144 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3e9f9352d44da8942e8ee4d726812bc2dd9528cf;p=emacs.git (find-tag-default): Catch errors in forward-sexp. --- diff --git a/lisp/subr.el b/lisp/subr.el index 252154c7b0f..4046b915368 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1969,13 +1969,16 @@ If there is no plausible default, return nil." (re-search-forward "\\(\\sw\\|\\s_\\)+" (save-excursion (end-of-line) (point)) t)) - (progn (goto-char (match-end 0)) - (buffer-substring-no-properties - (point) - (progn (forward-sexp -1) - (while (looking-at "\\s'") - (forward-char 1)) - (point)))) + (progn + (goto-char (match-end 0)) + (condition-case nil + (buffer-substring-no-properties + (point) + (progn (forward-sexp -1) + (while (looking-at "\\s'") + (forward-char 1)) + (point))) + (error nil))) nil))) (defmacro with-syntax-table (table &rest body)