From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: find-tag-default Date: Mon, 24 May 2004 09:49:57 -0700 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1085442993 14771 80.91.224.253 (24 May 2004 23:56:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 May 2004 23:56:33 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 25 01:56:25 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BSPIv-00011D-00 for ; Tue, 25 May 2004 01:56:25 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BSPIu-0008Ep-00 for ; Tue, 25 May 2004 01:56:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BSP0b-0004vU-BT for emacs-devel@quimby.gnus.org; Mon, 24 May 2004 19:37:29 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BSNic-0007Ht-Q9 for emacs-devel@gnu.org; Mon, 24 May 2004 18:14:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BSN4R-0007IZ-PL for emacs-devel@gnu.org; Mon, 24 May 2004 17:33:56 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BSImo-00014U-Bz; Mon, 24 May 2004 12:58:50 -0400 Original-Received: from [148.87.2.204] (helo=inet-mail4.oracle.com) by mx20.gnu.org with esmtp (Exim 4.34) id 1BSIek-0000Y6-NZ; Mon, 24 May 2004 12:50:31 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.191.11]) by inet-mail4.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i4OGl5VC006625; Mon, 24 May 2004 09:47:05 -0700 (PDT) Original-Received: from rgmgw2.us.oracle.com (localhost [127.0.0.1]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i4OGnwSv011223; Mon, 24 May 2004 10:49:58 -0600 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id i4OGnwq1011210; Mon, 24 May 2004 10:49:58 -0600 Original-To: , "Juri Linkov" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23907 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23907 Belated, and possibly irrelevant, but FYI - Library thingatpt+.el provides additions and enhancements to thingatpt.el: 1) An optional syntax-table argument is used to determine the bounds. 2) New functions (e.g. symbol-nearest-point) don't require point to be on the name you want. Here's how "nearest" is defined: The nearest symbol on the same line is returned, if there is any. Between two symbols equidistant from point on the same line, the leftmost is considered nearer. Otherwise, neighboring lines are tried in sequence: previous, next, 2nd previous, 2nd next, 3rd previous, 3rd next, etc. This means that between two symbols equidistant from point in lines above and below it, the symbol in the line above point (previous Nth) is considered nearer to it. The code is here: http://www.emacswiki.org/elisp/thingatpt-plus.el. You might consider using a similar "nearest" functionality in Emacs. In my own code, I use it in commands like describe-variable. I prefer to have a default value in the minibuffer for such commands (I use backward-kill-sexp, bound to C-M-backspace, to remove it if it's inappropriate). I find that "nearest" usually DTRT. - Drew -----Original Message----- From: Richard Stallman Currently there are different methods for obtaining an identifier at point: - `find-tag-default' and `find-tag-default-function' from etags.el - `symbol-at-point' from thingatpt.el - info-look.el which has the most advanced implementation since it defines regular expressions and parsing rules for guessing the default identifier for 20 major modes (and one special function `info-lookup-guess-c-symbol' for C mode). So to create right contents of `identifier-at-point' these packages could be generalized. Is it clear that using the info-look code would be best for everything that uses the other two functions? If so, let's do that.