unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Chen <quarl@NOSPAM.quarl.org>
Subject: Re: function-called-at-point: ignore-errors around find-tag-default
Date: Wed, 16 Feb 2005 19:56:00 -0800	[thread overview]
Message-ID: <quack.20050216T1956.87oeejg7qn@quack.cs.berkeley.edu> (raw)
In-Reply-To: E1D0w06-0002Pg-Gm@fencepost.gnu.org

>>>>> 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

  reply	other threads:[~2005-02-17  3:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-14  4:31 function-called-at-point: ignore-errors around find-tag-default Karl Chen
2005-02-14 13:40 ` Stefan Monnier
2005-02-14 19:06   ` Karl Chen
2005-02-15  6:15 ` Richard Stallman
2005-02-17  3:56   ` Karl Chen [this message]
2005-02-17 13:14     ` Stefan Monnier
2005-02-17 23:09     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=quack.20050216T1956.87oeejg7qn@quack.cs.berkeley.edu \
    --to=quarl@nospam.quarl.org \
    --cc=quarl+dated+1109044350.69077d@nospam.quarl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).