From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: thing-at-point: inconsistent behaviour? Date: Thu, 16 Aug 2012 17:46:18 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345164397 795 80.91.229.3 (17 Aug 2012 00:46:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Aug 2012 00:46:37 +0000 (UTC) To: "'Raffaele Ricciardi'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 17 02:46:35 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 1T2Ahu-0005AD-EF for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Aug 2012 02:46:34 +0200 Original-Received: from localhost ([::1]:46878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2Aht-0000mi-4y for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 20:46:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2Aho-0000md-7x for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 20:46:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2Ahn-00087C-6L for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 20:46:28 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:44703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2Ahn-000878-0B for help-gnu-emacs@gnu.org; Thu, 16 Aug 2012 20:46:27 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q7H0kMAI020033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Aug 2012 00:46:24 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q7H0kMgX015049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Aug 2012 00:46:22 GMT Original-Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q7H0kMPO003969; Thu, 16 Aug 2012 19:46:22 -0500 Original-Received: from dradamslap1 (/10.159.221.217) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Aug 2012 17:46:21 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac170rHNyZVoQ2b4STqAURKI8POVtQAPBHzA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 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:86385 > When you are looking for a buffer substring, you call > `bounds-of-thing-at-point'; when you are looking for a string > result, you call `thing-at-point'; when you want the result > as a sexp, you call the specialized function. There is even another complication/confusion. "Symbol" in Emacs can refer to two different things, especially as regards text that might represent a name. * It can refer to a string of chars that have symbol syntax (or symbol-or-word syntax) in a given mode - any mode, not just Lisp. * It can refer to a Lisp symbol, i.e., a specific kind of Lisp object (with the possibility of a non-nil `symbol-value' and `symbol-function, for instance). IMO, most Elisp programs use thing-at-point functions to grab a string representing the name of something or representing a sexp or other object (URL, file name, etc.). In the case of a symbol, IMO most programs really want/need to grab a symbol _name_, often for use as the default value in an interactive spec. Most do not really want/need a Lisp symbol. And even when they do, they can call `intern' or `intern-soft' or `make-symbol' themselves. In `thingatpt+.el' there are separate functions that return a Lisp symbol (i.e., interned in the standard `obarray'), and there are other functions that return a symbol name. The symbol-name functions are used more often, IMO. Symbols: `symbol-at-point' `symbol-nearest-point' `non-nil-symbol-nearest-point' Symbol names: `non-nil-symbol-name-at-point' `symbol-name-nearest-point' `non-nil-symbol-name-nearest-point' `region-or-non-nil-symbol-name-nearest-point' (There are also functions that return the symbol or symbol name plus its bounds in the buffer, and so on.)