Subject: bug#9300: 24.0.50; `bounds-of-thing-at-point' does not return nil when just after THING

From: Tino Calancha <[email-masked]>
Date: Mon, 20 Jun 2016 18:21:09 +0900

Consider following code:

emacs -Q:

C-x b foo RET
M-: (insert "(foo bar)")

I)
M-: (bounds-of-thing-at-point 'sexp) RET
=> (1 . 10)
II)
M-: (bounds-of-thing-at-point 'list) RET
=> (10 . 10)
III)
M-: (thing-at-point 'sexp) RET
=> "(foo bar)"
IV)
M-: (thing-at-point 'list) RET
=> ""

V)
M-: (save-excursion (goto-char 1) (bounds-of-thing-at-point 'list)) RET
=> (1 . 10)
VI)
M-: (save-excursion (goto-char 1) (bounds-of-thing-at-point 'sexp)) RET
=> (1 . 10)

* I agree with Drew that there is neither sexp nor list at point,
   so i would expect I), II), III) and IV) returning nil.

* Both function names, i.e., functions at I) and III), and their doc strings
   looks clear: return THING at point (III) or return the locations
   of THING at point.  If there is no such THING at point i would expect
   both return nil: IMO that would be more consistent/intuitive with the 
func.
   names and doc strings.

* I) and II) agree but III) and IV disagree.
   I would expect III) and IV) returning the same value.

In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
Repository revision: 9341142dc876f4d93c442242206a7d2d40fd03af