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

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

Re: thing-at-point: inconsistent behaviour?


From: Barry Margolin
Subject: Re: thing-at-point: inconsistent behaviour?
Date: Thu, 16 Aug 2012 11:48:16 -0400
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <mailman.7107.1345117968.855.help-gnu-emacs@gnu.org>,
 Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:

> Am 15.08.2012 21:00, schrieb Raffaele Ricciardi:
> > On 08/15/2012 07:34 PM, Barry Margolin wrote:
> >  > In article <a926tjFeslU1@mid.individual.net>,
> >  >   Raffaele Ricciardi <rfflrccrd@gmail.com> wrote:
> >  >
> >  >> Hello there,
> >  >>
> >  >> the documentation of `thing-at-point' states that such function returns 
> >  >> "the
> >  >> thing around or next to point".  This is not the case with either
> >  >> (thing-at-point
> >  >> 'symbol) or (thing-at-point 'sexp), for they both may return the thing
> >  >> before
> >  >> point.  Try it with the following snippet (! symbolizes the point):
> >  >
> >  > Doesn't "next to" include both immediately before and immediately after?
> >
> > I stand corrected after having consulted a dictionary.  Then it is
> > (thing-at-point 'list) that is misbehaving.
> >
> 
> 
> hmm, IMHO you was right. Here is the code
> 
> (defun symbol-at-point ()
>    "Return the symbol at point, or nil if none is found."
>    (let ((thing (thing-at-point 'symbol)))
>      (if thing (intern thing))))
> 
> last line don't return the thing as delivered by thing-at-point but the 
> result of (intern thing)
> 
> that way breaking consistency.

That function has nothing to do with the problem he's reporting. It's 
just an extra utility function that makes use of thing-at-point to 
return something that may be useful in certain situations.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


reply via email to

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