unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Chong Yidong'" <cyd@stupidchicken.com>
Cc: 8628@debbugs.gnu.org
Subject: bug#8628: 24.0.50; `thing-at-point-bounds-of-list-at-point' - no good
Date: Thu, 7 Jul 2011 14:27:17 -0700	[thread overview]
Message-ID: <EC2228A74B30441C9CD458E1A2B9ADA8@us.oracle.com> (raw)
In-Reply-To: <87sjqiexsy.fsf@stupidchicken.com>

> This is incorrect; thing-at-point-bounds-of-list-at-point is a helper
> function that is called by `bounds-of-thing-at-point'.  If removed,
> (bounds-of-thing-at-point 'list) no longer works.

You're dreaming.  Did you actually try the bug recipe?  Did you then try it
again without `t-a-p-b-o-l-a-p' and its associated `put'?  Which one DTRT?

> I've marked thing-at-point-bounds-of-list-at-point explicitly as an
> internal function,

Irrelevant.  That has nothing to do with this bug.

> and will close this bug.

Wrong.  `thing-at-point-bounds-of-list-at-point' does NOT DTRT - at all.  And
that _causes_ (bounds-of-thing-at-point 'list) to not DTRT.  That is what this
bug report is about: (bounds-of-thing-at-point 'list).

But ordinary (bounds-of-thing-at-point 'list) WILL work, if you just get rid of
`thing-at-point-bounds-of-list-at-point' and its associated `put':

(put 'list 'bounds-of-thing-at-point
     'thing-at-point-bounds-of-list-at-point)

IOW, let `bounds-of-thing-at-point' do its normal thing for `list'.

Please read the bug thread.  Do I really need to repeat it?

Follow the recipe, at least - it's quite clear.  Regardless of whether you like
the fix I suggested, you should at least be able to confirm that the bug exists.

To make things clearer for you, substitute (bounds-of-thing-at-point 'list) for
(thing-at-point-bounds-of-list-at-point) in the recipe.  The former just uses
the latter, so they are the same thing, but apparently you've gotten confused
because I mentioned t-o-p-b-o-l-a-p.

You can see for yourself that (bounds-of-thing-at-point 'list) returns erroneous
results instead of nil when point is not on a list.  Try it.

And no, there is no need for such a "helper" function in the general case and,
as it turns out, in the case of `list' as well.  The idea is that
`bounds-of-thing-at-point' should just work for most THINGs.  And it DOES work
for `list' AFAICT.

More importantly, the helper function `thing-at-point-bounds-of-list-at-point'
does NOT work.  (bounds-of-thing-at-point 'list) should not return non-nil if
point is not on a list.  And `bounds-of-thing-at-point' should never, ever
return an empty thing (equal bounds), as it does here at eol per the recipe.

I just repeated the recipe in the latest Windows build of Emacs 24 - same
problem.

I get the impression that you have not really read this bug report at all.  Your
responses so far have been:

1. "Nobody should care about t-a-p-b-o-l-a-p because it's an internal function."

I do not care about t-a-p-b-o-l-a-p.  I care about the behavior of
`bounds-of-thing-at-point'.  The former is breaking the latter.

2. Just repeating that t-a-p-b-o-l-a-p is an internal function.

This was after I underlined the fact that it is the _behavior_ of
`bounds-of-thing-at-point' that is erroneous, _because of_ t-a-p-b-o-l-a-p.

3. Assignment to the wish list!

Even though I already provided the fix.

4. And now, what you write above, and closing the bug.  Sheesh.


You (pl.) apparently just don't get it.

a. The _behavior_ of `bounds-of-thing-at-point' is erroneous for THING = `list'.
It returns non-nil when point is not on a list in at least two cases, and it
returns an empty thing (empty bounds), which it should _never_ do.

b. It is this _behavior_ that needs to be fixed, however you might like to do
it.  It does not matter whether you choose to use an internal function such as
t-a-p-b-o-l-a-p or not, provided you do _fix the behavior_.

c. The simplest way to fix the behavior, IMHO - but you need not listen to it if
you prefer some other way - is to just get rid of the erroneous
`t-a-p-b-o-l-a-p' (and its associated `put') and let `bound-of-thing-at-point'
do its normal thing.  _That works_ for the cases cited.


Please read the bug report.  Try the recipe.  Fix the problem any way you like,
but please fix it.  This is NOT about internal vs external functions.  This is
about bugged _BEHAVIOR_.

Forget about `t-a-p-b-o-l-a-p'.  This is about the behavior of
`bounds-of-thing-at-point'.  The only reason I mentioned `t-a-p-b-o-l-a-p' is
that that is what screws up the behavior of `bounds-of-thing-at-point'.  Get rid
of the latter and its associated `put' and the former will DTRT for `list'.

Try it.






  reply	other threads:[~2011-07-07 21:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06  0:29 bug#8628: 24.0.50; `thing-at-point-bounds-of-list-at-point' - no good Drew Adams
2011-05-06  0:41 ` Drew Adams
2011-05-13 19:34   ` Stefan Monnier
2011-05-13 20:06     ` Drew Adams
2011-05-13 22:49       ` Juanma Barranquero
2011-05-13 23:11         ` Drew Adams
2011-07-07 18:43   ` Chong Yidong
2011-07-07 21:27     ` Drew Adams [this message]
2011-07-07 22:28       ` Chong Yidong
2011-07-07 23:39         ` Drew Adams
2011-07-09  0:10           ` Drew Adams

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=EC2228A74B30441C9CD458E1A2B9ADA8@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=8628@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    /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).