From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: function-called-at-point: ignore-errors around find-tag-default
Date: Thu, 17 Feb 2005 08:14:45 -0500 [thread overview]
Message-ID: <87ekff9vri.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <quack.20050216T1956.87oeejg7qn@quack.cs.berkeley.edu> (Karl Chen's message of "Wed, 16 Feb 2005 19:56:00 -0800")
> --- /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
next prev parent reply other threads:[~2005-02-17 13:14 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
2005-02-17 13:14 ` Stefan Monnier [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ekff9vri.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.