From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: symbol-at-point Date: Fri, 27 Jul 2007 16:22:07 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1185578582 21048 80.91.229.12 (27 Jul 2007 23:23:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 Jul 2007 23:23:02 +0000 (UTC) Cc: Andreas Rohler , emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 28 01:22:56 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IEZ94-00085N-SY for ged-emacs-devel@m.gmane.org; Sat, 28 Jul 2007 01:22:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEZ94-0006zM-43 for ged-emacs-devel@m.gmane.org; Fri, 27 Jul 2007 19:22:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IEZ90-0006yy-GJ for emacs-devel@gnu.org; Fri, 27 Jul 2007 19:22:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IEZ8y-0006yi-Fp for emacs-devel@gnu.org; Fri, 27 Jul 2007 19:22:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IEZ8y-0006yd-8S for emacs-devel@gnu.org; Fri, 27 Jul 2007 19:22:48 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IEZ8x-0004ao-TZ for emacs-devel@gnu.org; Fri, 27 Jul 2007 19:22:48 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l6RNMisf028982; Fri, 27 Jul 2007 18:22:44 -0500 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l6RLhMhN000660; Fri, 27 Jul 2007 17:22:43 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-74-162.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3076007841185578533; Fri, 27 Jul 2007 16:22:13 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:75730 Archived-At: Stefan, rather than reply to everything you said in detail, I'll just say this - I think Emacs commands would do well to more often (a) use completion and (b) give users a reasonable default value (whether or not completion is available). In many cases, an appropriate default value would be some text that is at or near point. That that does not happen much today might be partly due to `interactive' not supporting it for its built-in strings (e.g. "C..."). It might also be partly due to the fact that the `*-at-point' functions look only directly under the cursor, no further. There is only one call to `symbol-at-point' in the distributed files today. Perhaps there were more uses of it in the past; I don't recall. There are a few calls to `thing-at-point'. And there are some calls to more specific functions, such as `variable-at-point', `find-tag-default', and `function-called-at-point', which are similar but which don't bother to use `thingatpt.el'. But, generally, default values from the current buffer are not offered much to users. There is no reason that Emacs can't provide a reasonable default value most of the time, that is, a value other than just the first history value (which is available anyway). I would hope that thingatpt.el might encourage the use of buffer text at point as a default value, but it apparently has not, so far. It's my hope that the restriction to point has itself held back the use of thingatpt functions, and that offering the "near" functions might help users get better default values. I use such default values in my own code, and I miss them whenever I use vanilla Emacs. I use text at point for `grep' and `query-replace' as often as I start isearch with `C-s C-w', for instance, which is quite often. Beyond the question of providing default values, which can nearly always be strings, I do think there is some value in providing functions that provide other Lisp objects (lists, numbers, etc.) at or near point. But that, to me, is secondary. In particular, losing `symbol-at-point' would be no great loss, I agree. (FWIW, the danger you see from a nil return value for `symbol-at-point' is exaggerated, I think, since a non-nil symbol would generally be what is sought. nil can always be interpreted as "no, there is no non-nil symbol at point". Yes, the name of the function does not make this clear.)