unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Aaron S. Hawley'" <aaron.s.hawley@gmail.com>,
	"'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 13994@debbugs.gnu.org
Subject: bug#13994: End of buffer error for forward-sexp
Date: Wed, 24 Apr 2013 14:22:45 -0700	[thread overview]
Message-ID: <60DF8CA8098A46B1A6B5F6E815AC8CE4@us.oracle.com> (raw)
In-Reply-To: <CAFw1JJ4tek5KXMPRC-ic4a=5f9+aGfoHH-LEdH2HUMhzK1OGDA@mail.gmail.com>

> I by no means use all of Emacs, but haven't run into an issue yet with
> my patch.  I use Emacs with t-d-o-e on.

Pretty small sample.

> Do you have an example of code that you've seen "needs the current
> behavior" at the beginning or end of the buffer....
> 
> So far, I've looked at these functions in Emacs to see if 
> they still work.
> 
> end-of-sexp
> beginning-of-sexp
> thing-at-point-bounds-of-list-at-point
> sort-numeric-fields
> transpose-sexps
> blink-matching-open
> diary-list-sexp-entries
> diary-mark-sexp-entries
> comint-extract-string

Pretty small sample.  There must be thousands of uses of `forward-sexp' in
existing Emacs-Lisp code out there.  How many of them depend (intentionally or
not) on `forward-sexp' returning nil for premature `eobp'?  Who knows.

Now everytime some code does (when (looking-at "\"") (forward-sexp 1)) or
whatever it will need to be fixed to wrap it in `ignore-errors' or otherwise
treat the `eobp' case?

Doesn't sound like a sound approach at this point.
Might have been a reasonable suggestion 30 years ago.

What's the point?  If you have some code that needs to raise an error when
`forward-sexp' reaches eob, that's easy enough to do, no?

Not to mention that the code for `forward-sexp' explicitly takes point to eob
when `scan-sexps' returns nil.  IOW, that behavior is presumably by design.

And not to mention that it calls `forward-sexp-function', if non-nil, to do
everything, in which case (depending on where you would place your call to
`error') you might be changing the meaning/behavior for its code as well, if it
reaches eob.






  reply	other threads:[~2013-04-24 21:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 21:54 bug#13994: End of buffer error for forward-sexp Aaron S. Hawley
2013-03-31 13:36 ` Stefan Monnier
2013-04-24 20:38   ` Aaron S. Hawley
2013-04-24 21:22     ` Drew Adams [this message]
2013-04-24 21:35       ` Aaron S. Hawley
2013-04-25  3:50     ` Stefan Monnier
2013-04-29  7:10 ` Juri Linkov
2013-04-29 12:43 ` Andreas Röhler

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=60DF8CA8098A46B1A6B5F6E815AC8CE4@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=13994@debbugs.gnu.org \
    --cc=aaron.s.hawley@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).