From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: thing-at-point: inconsistent behaviour? Date: Thu, 16 Aug 2012 13:52:38 +0200 Message-ID: <502CDF06.3020405@easy-emacs.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345117977 11843 80.91.229.3 (16 Aug 2012 11:52:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2012 11:52:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 16 13:52:57 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T1ydB-0000yB-5k for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 13:52:53 +0200 Original-Received: from localhost ([::1]:59013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ydA-0006I6-7B for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 07:52:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1yd5-0006I1-0W for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 07:52:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1yd3-000179-KZ for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 07:52:46 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:58353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1yd1-00016P-8H for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 07:52:45 -0400 Original-Received: from [192.168.178.27] (brln-4db9ce5f.pool.mediaWays.net [77.185.206.95]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M9LFi-1SqRmQ2rIE-00CCgq; Thu, 16 Aug 2012 13:52:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: X-Provags-ID: V02:K0:PD3x5Izp0QzqJmuQMMtltk0s37PltKjgVyamK5pEYKD nDiwddaG6dVHocJp3VpHdAYFUqB0ouO7yEIF+hQLRjCdGSuGEe N9dQi5WGd0nDt+NVyjftX2/EKMFB+3KvekPkCY7YucC6Itkw/f fhfi6bra070HtE6a1NG15dATpT3oy98pbdvHKws6KTPYF5X9pp KC1cFuNZcM8aL1F07ZDPcTcu7pGVJ1dwt0FOmUg0SBHsHQpdSu G5QZ6+I4JnGRRTirX04nm/1zsHoSkK9Gtx3Z4u7nKB1Q2s9Wae LV+mi1F6hh6Y2+sTD5Wfl1/GjI3chocUazbDS2RotnCgOL0/n4 5lzfoBTYiGmdKzsnRfNGyrjYaQYQ2cE1ztsldbIAB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.171 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86367 Am 15.08.2012 21:00, schrieb Raffaele Ricciardi: > On 08/15/2012 07:34 PM, Barry Margolin wrote: > > In article , > > Raffaele Ricciardi 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. BTW built a library at top of thing-at-point rationale, which aims to avoid that https://launchpad.net/s-x-emacs-werkstatt/trunk/1.3/+download/S-X-Emacs-Werkstatt-1.3.tar.gz > > > >> > >> A! > >> (A)! > >> > >> On the contrary, (bounds-of-thing-at-point 'list) returns nil as > >> expected in this > >> snippet: > >> > >> (A)! > >> > >> Is this inconsistent behaviour or am I missing something? > >> > >> Tested on GNU Emacs 24.1 started with "emacs -Q". > >> > >> Thank you. > > > > I think this is a problem with the thing-at-point handler for 'list. > > It's doing some weird stuff, that I think is intended to distinguide > > lists from sexps. > > Aren't lists sexps as well? >