From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: function-called-at-point: ignore-errors around find-tag-default Date: Thu, 17 Feb 2005 08:14:45 -0500 Message-ID: <87ekff9vri.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1108646286 6867 80.91.229.2 (17 Feb 2005 13:18:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 Feb 2005 13:18:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 17 14:18:06 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D1lW3-0001nP-JZ for ged-emacs-devel@m.gmane.org; Thu, 17 Feb 2005 14:16:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D1lmC-0004yB-9K for ged-emacs-devel@m.gmane.org; Thu, 17 Feb 2005 08:33:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D1lkG-0004Os-DT for emacs-devel@gnu.org; Thu, 17 Feb 2005 08:31:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D1lkB-0004NQ-5r for emacs-devel@gnu.org; Thu, 17 Feb 2005 08:31:01 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D1lkB-0004Mu-1N for emacs-devel@gnu.org; Thu, 17 Feb 2005 08:30:59 -0500 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D1lUY-00017L-IW for emacs-devel@gnu.org; Thu, 17 Feb 2005 08:14:50 -0500 Original-Received: from alfajor ([67.68.217.32]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050217131444.RFFF1694.tomts36-srv.bellnexxia.net@alfajor>; Thu, 17 Feb 2005 08:14:44 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 0CC2CD7374; Thu, 17 Feb 2005 08:14:45 -0500 (EST) Original-To: quarl+dated+1109044350.69077d@nospam.quarl.org In-Reply-To: (Karl Chen's message of "Wed, 16 Feb 2005 19:56:00 -0800") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33580 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33580 > --- /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)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (line-end-position) > 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))) I recommend to only catch "scan-error" so as not to hide other potential bugs. But maybe a better fix is to let-bind forward-sexp-function to nil around the call to forward-sexp. After all, we're using here forward-sexp to skip over a symbol, not just any a sexp. Or maybe even replace forward-sexp with (skip-syntax-backward "w_"), although it seems so obvious that maybe there's a reason why it's not done: better check the file's log to seen if it wasn't (skip-syntax-backward "w_") already in the past. Stefan