all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Drew Adams <drew.adams@oracle.com>, 9300@debbugs.gnu.org
Subject: bug#9300: 24.0.50; `bounds-of-thing-at-point' does not return nil when just after THING
Date: Fri, 26 Feb 2016 12:15:45 +0200	[thread overview]
Message-ID: <503db28a-d430-8a5d-a26d-e95890da58b9@yandex.ru> (raw)
In-Reply-To: <05f0b24b-1a52-4fa4-9f22-f34f5ed33556@default>

On 02/26/2016 03:44 AM, Drew Adams wrote:

> But the proper fix for 3rd-party code, mentioned above, does not
> have any such problem.  It should look for a thing at (1- (point))
> if it wants to get a thing that might be just before point but not
> at point.

If the thing _begins_ at point, and the third-party code in question 
calls (save-excursion (forward-char -1) (thing-at-point 'foo)), they 
will get nil.

>> Maybe there aren't too many. Will you do the research on this?
>
> Does anyone need to?

I imagine so.

> You're the one who
> mentioned that your code depends on checking for a thing at the
> wrong position in order to get a thing at point-minus-one.  And
> you mentioned an Eclipse function that acts similarly.  That's two.

I never mentioned anything Eclipse-related in this bug.

>>> if they really want the bugged behavior.  Better: tell them
>>> to use the fixed `bounds-of-thing-at-point' after backing up
>>> so point is actually on the THING instead of after it.
>>
>> Any such client would be forced to call bounds-of-thing-at-point-
>> strict twice. Which is not particularly ideal.
>
> Not at all.  Why do you say that?

See above.

>> Think of the semantics of `match-end', or the last argument of
>> `substring'.
>
> Think of all the other uses of thing-at-point, and the other THINGs
> it finds and where it finds them.
>
> Type (foo bar) at top level, and put point after the ).
> M-: (thing-at-point 'list)
> What do you get?  id it give you "(foo bar)"?  Or did it give
> you nil?  There is no list at point.  Is this a bug?  No; it's TRT.

If the list is at the end of the buffer, it gives me an empty string, or 
a string of spaces. So yeah, this particular "thing" seems bugged.

> Why don't you present a valid (in your sense) configuration
>> that a bounds-of-thing-at-point implementation without the "else"
>> branch will return nil in?
>
> OK, I give up.

Because there is no such example.

> It's clearly not about your being unconvinced that the fix is correct.
> It's about your not wanting to give up your ingrained expectations
> of the incorrect behavior.

Not just mine. I believe I have demonstrated that the code has been 
written with exactly this expectation in mind. And stayed like that for 
decades.





  reply	other threads:[~2016-02-26 10:15 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<B1052724B2D446C59E233FC1BD437723@us.oracle.com>
2015-07-29  1:44 ` bug#9300: 24.0.50; `bounds-of-thing-at-point' does not return nil when just after THING Drew Adams
2016-01-15 13:33   ` Drew Adams
2016-02-23  1:01     ` Dmitry Gutov
2016-02-23  6:37       ` Drew Adams
2016-02-23  7:59         ` Andreas Röhler
2016-02-23 10:22         ` Dmitry Gutov
2016-02-23 16:15           ` Drew Adams
2016-02-24  0:52             ` Dmitry Gutov
2016-02-24  1:31               ` Drew Adams
2016-02-26  1:03                 ` Dmitry Gutov
2016-02-26  1:44                   ` Drew Adams
2016-02-26 10:15                     ` Dmitry Gutov [this message]
2016-02-26 14:39                       ` Drew Adams
2016-02-26 15:25                         ` Dmitry Gutov
2016-02-26 17:00                           ` Drew Adams
2022-04-28 11:24       ` Lars Ingebrigtsen
2022-04-28 15:49         ` Drew Adams
2011-08-14 22:36 Drew Adams
2016-06-20  9:21 ` Tino Calancha
2016-06-20 12:53   ` Dmitry Gutov
2016-06-20 13:11     ` Tino Calancha
2016-06-20 14:48   ` Eli Zaretskii
2016-06-21  3:01     ` Tino Calancha
     [not found]   ` <<8337o79arh.fsf@gnu.org>
2016-06-20 17:50     ` Drew Adams
2016-06-20 18:38       ` Andreas Röhler
2016-06-20 20:04       ` Eli Zaretskii
2016-06-21  6:14         ` Andreas Röhler
2016-06-21 12:50           ` Eli Zaretskii
2016-06-21 13:07             ` Andreas Röhler
2016-06-21 15:13               ` Eli Zaretskii
2016-06-21 13:31             ` Drew Adams
2016-06-21 15:16               ` Eli Zaretskii
2016-06-22  5:23             ` Fwd: " Andreas Röhler
2016-07-06 21:21               ` John Wiegley
2016-07-06 21:51                 ` Dmitry Gutov
2016-07-06 23:31                   ` Drew Adams
2016-07-07  8:00                     ` Andreas Röhler
2016-06-21 13:25           ` Drew Adams
     [not found]   ` <<<8337o79arh.fsf@gnu.org>
     [not found]     ` <<0e2c9c67-12a2-4712-92d2-e3c204f46838@default>
     [not found]       ` <<83twgn7hjx.fsf@gnu.org>
2016-06-20 23:34         ` Drew Adams
2016-06-20 23:59           ` Noam Postavsky
2016-06-21  0:47             ` 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

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

  git send-email \
    --in-reply-to=503db28a-d430-8a5d-a26d-e95890da58b9@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=9300@debbugs.gnu.org \
    --cc=drew.adams@oracle.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 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.