[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function-called-at-point: ignore-errors around find-tag-default
From: |
Karl Chen |
Subject: |
Re: function-called-at-point: ignore-errors around find-tag-default |
Date: |
Wed, 16 Feb 2005 19:56:00 -0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>>>>> On 2005-02-14 22:15 PST, Richard Stallman writes:
rms> It should never get an error--if it can't find a suitable
rms> recommendation, it should return nil.
rms> But an alternative would be to wrap
rms> `find-tag-default' itself in a condition-case.)
rms> Before we do that, we should debug it and try fixing the
rms> bug that makes it get an error. Would you like to debug
rms> it?
I already debugged it as in my other post in this thread:
(forward-sexp -1) errors when it is in the middle of a sexp.
Since `forward-sexp' calls a user-defined function which can
behave unpredictably, I think the best thing is to wrap something
(i.e. `find-tag-default' or all its callers) in condition-case.
--- /usr/local/stow/emacs-cvs/share/emacs/22.0.50/lisp/.backup/subr.el.~1~
2005-02-09 07:50:41.000000000 -0800
+++ /usr/local/stow/emacs-cvs/share/emacs/22.0.50/lisp/subr.el 2005-02-16
19:50:57.000000000 -0800
@@ -1969,13 +1969,15 @@
(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))))
+ (condition-case nil
+ (progn (goto-char (match-end 0))
+ (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)
--
Karl 2005-02-16 19:52