From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: thing-at-point: inconsistent behaviour? Date: Thu, 16 Aug 2012 18:24:01 +0200 Message-ID: <502D1EA1.8070803@easy-emacs.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1345134273 26545 80.91.229.3 (16 Aug 2012 16:24:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2012 16:24:33 +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 18:24:33 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 1T22s0-0007yi-Uk for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 18:24:29 +0200 Original-Received: from localhost ([::1]:44602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T22rz-0008QM-3l for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 12:24:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T22rt-0008Q9-W3 for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 12:24:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T22rj-0000ji-3A for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 12:24:21 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:50034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T22ri-0000jU-Pw for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 12:24:11 -0400 Original-Received: from [192.168.178.27] (brln-4db9ce5f.pool.mediaWays.net [77.185.206.95]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0Mddoi-1TKmbl07cC-00PNB0; Thu, 16 Aug 2012 18:24:09 +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:s0ec4TECmPw0toSH/J8nhrlNpEEtU8pRP1pwZO4QYNu CHrKSlV5mS2qPK39Fi4OWuzzJ5FoBRZHIo0JVIcBVFsWnk1+iz tr5ZsCFRTri6GhFAdrQm2yG5KbvtZ6PkP2A6mwb1BiTu2tR+uk O0T+SpGiz9hZbJMtwFwlgXsavYTsTzCi5D9M1QLNbms9MwPglB +g4mOQu8qA9oYy8+XkZbEiNwBSnJzTsm+hwo6JHrshk2hd2usS 8K4lR63CVZZb4p4SZoGZXJiN+D+U0bNoUxL4NNatH8hJ7TnJNa K31y+e4JwWQtpO0XXeyuJL6IYY0Y627wib5sVCXfYKxv1eQ5L+ OjVsqXz0EJJ1SFeORtxQx866zv9PXrVbwe0uVtMAP 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:86371 Am 16.08.2012 17:48, schrieb Barry Margolin: > In article , > Andreas Röhler wrote: > >> 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. > > 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. > okay, as it happens it's for years in my mind: that symbol-at-point breaks consistency. Another approach to give the reasons: IMO basically two ways of returns are feasible by such a thing-at-point library - deliver objects from editing perspective, i.e as buffer-substrings - deliver objects for use in programs The latter seems the focus so far. Not to expect is changing the computers internal state already when picking an object by thing-at-point. That's what is done by "intern" however.