From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: find-tag-default Date: Thu, 20 May 2004 11:09:48 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87pt8z1pv6.fsf@mail.jurta.org> References: <874qqkq1by.fsf@mail.jurta.org> <87n044dc27.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085042161 23957 80.91.224.253 (20 May 2004 08:36:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 May 2004 08:36:01 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 20 10:35:56 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 1BQj1w-0007lj-00 for ; Thu, 20 May 2004 10:35:56 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQj1w-00087Q-00 for ; Thu, 20 May 2004 10:35:56 +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 1BQirX-0005Yl-6E for emacs-devel@quimby.gnus.org; Thu, 20 May 2004 04:25:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BQiqg-000519-5K for emacs-devel@gnu.org; Thu, 20 May 2004 04:24:18 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BQipm-0003Ry-Mu for emacs-devel@gnu.org; Thu, 20 May 2004 04:23:55 -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 1BQipk-0003Nu-ES; Thu, 20 May 2004 04:23:20 -0400 Original-Received: from [66.33.219.19] (helo=spoon.dreamhost.com) by mx20.gnu.org with esmtp (Exim 4.34) id 1BQioJ-0005iq-Do; Thu, 20 May 2004 04:21:52 -0400 Original-Received: from mail.jurta.org (80-235-32-209-dsl.mus.estpak.ee [80.235.32.209]) by spoon.dreamhost.com (Postfix) with ESMTP id 47D7413D88D; Thu, 20 May 2004 01:21:19 -0700 (PDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Wed, 19 May 2004 15:01:18 -0400") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) 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:23766 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23766 I have a better idea: to left the function `find-tag-default' alone in its etags.el, and to add a new function (which is slightly extended version of `find-tag-default') to simple.el: (defun identifier-at-point () "Return a default identifier based on the text at point." (or (and (boundp 'find-tag-default-function) find-tag-default-function (funcall find-tag-default-function)) (and (get major-mode 'find-tag-default-function) (funcall (get major-mode 'find-tag-default-function))) (save-excursion (while (looking-at "\\sw\\|\\s_") (forward-char 1)) (when (or (re-search-backward "\\sw\\|\\s_" (save-excursion (beginning-of-line) (point)) t) (re-search-forward "\\(\\sw\\|\\s_\\)+" (save-excursion (end-of-line) (point)) t)) (goto-char (match-end 0)) (buffer-substring-no-properties (point) (progn (forward-sexp -1) (while (looking-at "\\s'") (forward-char 1)) (point))))))) There are several benefits: 1. no need to load etags.el; 2. a complicated construct (funcall (or find-tag-default-function (get major-mode 'find-tag-default-function) 'find-tag-default)) is replaced by a simple function call `(identifier-at-point)'. -- Juri Linkov http://www.jurta.org/emacs/