GNU bug report logs - #37673
[PATCH] Simplify the search of the default tags file in, `visit-tags-table'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Hong Xu <hong@HIDDEN>; Keywords: patch; dated Wed, 9 Oct 2019 05:01:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Oct 2019 05:04:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 09 01:04:16 2019
Received: from localhost ([127.0.0.1]:51881 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iI491-00041J-3U
	for submit <at> debbugs.gnu.org; Wed, 09 Oct 2019 01:04:16 -0400
Received: from lists.gnu.org ([209.51.188.17]:40416)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1iI48z-00041C-7s
 for submit <at> debbugs.gnu.org; Wed, 09 Oct 2019 01:04:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56637)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <larsi@HIDDEN>) id 1iI48y-000228-2Q
 for bug-gnu-emacs@HIDDEN; Wed, 09 Oct 2019 01:04:13 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <larsi@HIDDEN>) id 1iI48w-0001U0-Eu
 for bug-gnu-emacs@HIDDEN; Wed, 09 Oct 2019 01:04:11 -0400
Received: from quimby.gnus.org ([80.91.231.51]:47986)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <larsi@HIDDEN>)
 id 1iI48u-0001Ss-R3; Wed, 09 Oct 2019 01:04:09 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie)
 by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <larsi@HIDDEN>)
 id 1iI48q-0002zP-IS; Wed, 09 Oct 2019 07:04:06 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Hong Xu <hong@HIDDEN>
Subject: Re: [PATCH] Simplify the search of the default tags file in,
 `visit-tags-table'
References: <775105d3-261b-fe70-ddd9-e5d7db78706f@HIDDEN>
Date: Wed, 09 Oct 2019 07:04:04 +0200
In-Reply-To: <775105d3-261b-fe70-ddd9-e5d7db78706f@HIDDEN> (Hong Xu's
 message of "Tue, 8 Oct 2019 21:59:40 -0700")
Message-ID: <87eezmtsqj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 80.91.231.51
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: Phil Sainty <psainty@HIDDEN>, bug-gnu-emacs <bug-gnu-emacs@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hong Xu <hong@HIDDEN> writes:

> * lisp/progmodes/etags.el (visit-tags-table): Reimplement
> `tags--find-default-tags-dir-recursively' using the much simpler
> `locate-dominating-file'. Following up bug#37518.

Looks good to me; applied to Emacs 27 now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37673; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Oct 2019 05:00:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 09 01:00:02 2019
Received: from localhost ([127.0.0.1]:51862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iI44v-0003rc-64
	for submit <at> debbugs.gnu.org; Wed, 09 Oct 2019 01:00:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:45215)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hong@HIDDEN>) id 1iI44s-0003rS-Da
 for submit <at> debbugs.gnu.org; Wed, 09 Oct 2019 00:59:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56126)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <hong@HIDDEN>) id 1iI44r-0001SX-63
 for bug-gnu-emacs@HIDDEN; Wed, 09 Oct 2019 00:59:58 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <hong@HIDDEN>) id 1iI44p-0007EW-BJ
 for bug-gnu-emacs@HIDDEN; Wed, 09 Oct 2019 00:59:57 -0400
Received: from sender4-of-o54.zoho.com ([136.143.188.54]:21453)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <hong@HIDDEN>)
 id 1iI44j-00078t-Vu; Wed, 09 Oct 2019 00:59:50 -0400
ARC-Seal: i=1; a=rsa-sha256; t=1570597182; cv=none; d=zoho.com; s=zohoarc; 
 b=nbNpJib/ERDLLO5pjdsEE2LKBm8F+jcUtIv8+o3fbkK19G6yaM64/wCWu2JQ/TgpCKX3ieKT51xvDIiGgRCsOIWW6O0x73t/11hPlUvH0tv2JaiF1sBTbJQvhGvUrV+JJAw4RCL1+8YJ/Ei5CpstyuEk5GboOeeMd15BL1pqWMI=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com;
 s=zohoarc; t=1570597182;
 h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To;
 bh=V3wxziOdLpMzGpLTywuZp6J2Afl4t9fNF3egtrqCOh8=; 
 b=flPqmE0IDsPMidmT9usRPUsAp84kStw0Bu4/T9ih1h3Fkmrq0e01/9KEK1uccpgCd0YBr3mgMT+yhBpQnBKf/iGdZ2XmfCqNbxKOl+6fDkmRQS8CsBvzcz+oG9cCafHLcf3zqDkaXWb3Tdw0fTM3mDZD946ilbVknTsLG7d38r0=
ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass  header.i=topbug.net;
 spf=pass  smtp.mailfrom=hong@HIDDEN;
 dmarc=pass header.from=<hong@HIDDEN> header.from=<hong@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1570597182; 
 s=zoho; d=topbug.net; i=hong@HIDDEN;
 h=To:Cc:From:Subject:Message-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding;
 l=1567; bh=V3wxziOdLpMzGpLTywuZp6J2Afl4t9fNF3egtrqCOh8=;
 b=ZFeABkW65kIKg7fZsUfc8lkL01P7pTL7CtuvvU3ueXxPe7NjwDNyQL0R/92tBp3V
 6yAqrmCEH8e6z0ydyKVMj8WaCrsON3O66tclrym11SKwn6SR9Ek798ShOJsW+sxToNx
 lYE/63N3VaRKGyhJUIqgH/z8A7w9Ubg+eoHir7U0=
Received: from [192.168.88.88] (69-215-149-151.lightspeed.sntcca.sbcglobal.net
 [69.215.149.151]) by mx.zohomail.com
 with SMTPS id 1570597181389387.9664870520551;
 Tue, 8 Oct 2019 21:59:41 -0700 (PDT)
To: bug-gnu-emacs <bug-gnu-emacs@HIDDEN>
From: Hong Xu <hong@HIDDEN>
Subject: [PATCH] Simplify the search of the default tags file in,
 `visit-tags-table'
Openpgp: preference=signencrypt
Message-ID: <775105d3-261b-fe70-ddd9-e5d7db78706f@HIDDEN>
Date: Tue, 8 Oct 2019 21:59:40 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-ZohoMailClient: External
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 136.143.188.54
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Phil Sainty <psainty@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

* lisp/progmodes/etags.el (visit-tags-table): Reimplement
`tags--find-default-tags-dir-recursively' using the much simpler
`locate-dominating-file'. Following up bug#37518.
---
  lisp/progmodes/etags.el | 15 +--------------
  1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 906ab37c6b9f..6784894ba87e 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -274,19 +274,6 @@ tags-table-mode
    (setq buffer-undo-list t)
    (initialize-new-tags-table))

-(defun tags--find-default-tags-dir-recursively (current-dir)
-  "Find the directory in which the default TAGS file lives.
-It is the first directory that contains a file named TAGS
-encountered when recursively searching upward from CURRENT-DIR."
-  (let ((tag-filename (expand-file-name "TAGS" current-dir)))
-    (if (file-exists-p tag-filename)
-        current-dir
-      (let ((parent-dir
-             (file-name-directory (directory-file-name current-dir))))
-        (if (string= parent-dir current-dir)  ;; root dir is reached
-            nil
-          (tags--find-default-tags-dir-recursively parent-dir))))))
-
  ;;;###autoload
  (defun visit-tags-table (file &optional local)
    "Tell tags commands to use tags table file FILE.
@@ -301,7 +288,7 @@ visit-tags-table
  file the tag was in."
    (interactive
     (let ((default-tag-dir
-           (or (tags--find-default-tags-dir-recursively default-directory)
+           (or (locate-dominating-file default-directory "TAGS")
                 default-directory)))
       (list (read-file-name
              "Visit tags table (default TAGS): "
--
2.20.1





Acknowledgement sent to Hong Xu <hong@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#37673; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 9 Oct 2019 05:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.