From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: thing-at-point: inconsistent behaviour? Date: Thu, 16 Aug 2012 21:46:26 -0400 Organization: A noiseless patient Spider Message-ID: References: 14343615082012@@ews.eternal-sepppppppppppp NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1345168214 25338 80.91.229.3 (17 Aug 2012 01:50:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Aug 2012 01:50:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 17 03:50:14 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 1T2BhW-0002jj-3J for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Aug 2012 03:50:14 +0200 Original-Received: from localhost ([::1]:50550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2BhU-0006EX-QU for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 21:50:12 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Injection-Info: barmar.motzarella.org; posting-host="78fb7125a45724f15e21604c94a7d968"; logging-data="29715"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/s3zqT3MKYCME0iT0/tMWe" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:Ocvt9gO/SBjHZ7QG+9D/bwWJ+QY= Original-Xref: usenet.stanford.edu gnu.emacs.help:194019 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:86387 In article , "Drew Adams" wrote: > > 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. Then they should call (thing-at-point 'symbol), not (symbol-at-point). It seems like this tangent is because someone thought that the latter should just be a shorthand for the former, but they do different things and are intended for different situations. If symbol-at-point doesn't do what you want (e.g. it interns things when you would prefer it didn't), don't use it. No one's forcing you to. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***