GNU bug report logs -
#9300
24.0.50; `bounds-of-thing-at-point' does not return nil when just after THING
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Sun, 14 Aug 2011 22:39:03 UTC
Severity: minor
Found in version 24.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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
This bug report was last modified 3 years and 30 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.