help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Re: (bounds-of-thing-at-point 'number) ⇒ nil


From: Drew Adams
Subject: RE: [External] : Re: (bounds-of-thing-at-point 'number) ⇒ nil
Date: Sun, 6 Feb 2022 08:44:21 +0000

> What was the reason why the library is not included,
> or was it maybe rejected, to improve the built-in 
> thingatpt.el?

It wasn't wanted.  And in particular the fix to
return nil when there's no such thing at point
but there is such a thing at (1- point) wasn't
wanted.

The bug for that is bug #9300:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9300

If someone uses thing-at-point only to get a
default value then they might not  care that
it's bugged, and they might insist that it's
good that it returns a thing when there's no
thing at point - more chance to get a default
value.

But the bug of returning non-nil when there's no
thing at point makes other uses of thing-at-point
impossible.  With that bug you have only the
forward/backward commands, but no way to define
zones of text that correspond to the presence
of things.  With that bug you can't have a
workable notion of next- or previous-thing.

With Isearch+ you can search the text of things
(sexps, lists, defuns, lines, pages, sentences,
file names, strings, comments, xml/html elements,
symbols,...)

This means search within THING search contexts.
Search through the zones of text that correspond
to a given kind of thing.  Or the complement:
search the contexts outside the things.

As mentioned in bug #9300, for that Isearch+
code to work also for vanilla thingatpt.el, it
needs a tweak to compensate for the off-by-one
bug that returns the thing at (1- point) when
there's no thing at point. 

I put it this way in bug #21391:

  I really disagree with what seems to be your view of 
  thingatpt.el functionality.

  I disagreed with it strongly in the context of bug
  #9300, where you were the lone voice proclaiming it.
  You apparently view the only use of this functionality
  as returning a string near (not at) point that can be
  used as an input default value.  thingatpt.el is much
  more than that.  It is very important that it be able
  to be used to test whether there (really) is a given
  THING _at_ point (not just somewhere near point).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]