From unknown Sun Jun 22 13:37:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37673: [PATCH] Simplify the search of the default tags file in, `visit-tags-table' Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2019 05:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37673 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 37673@debbugs.gnu.org Cc: Phil Sainty , Lars Ingebrigtsen , Eli Zaretskii X-Debbugs-Original-To: bug-gnu-emacs Received: via spool by submit@debbugs.gnu.org id=B.157059720214888 (code B ref -1); Wed, 09 Oct 2019 05:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Oct 2019 05:00:02 +0000 Received: from localhost ([127.0.0.1]:51862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI44v-0003rc-64 for submit@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 ) id 1iI44s-0003rS-Da for submit@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 ) id 1iI44r-0001SX-63 for bug-gnu-emacs@gnu.org; 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 ) id 1iI44p-0007EW-BJ for bug-gnu-emacs@gnu.org; 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 ) 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@topbug.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1570597182; s=zoho; d=topbug.net; i=hong@topbug.net; 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) From: Hong Xu Openpgp: preference=signencrypt Message-ID: <775105d3-261b-fe70-ddd9-e5d7db78706f@topbug.net> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 From unknown Sun Jun 22 13:37:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37673: [PATCH] Simplify the search of the default tags file in, `visit-tags-table' Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2019 05:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37673 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Hong Xu Cc: psainty@orcon.net.nz, 37673@debbugs.gnu.org, eliz@gnu.org X-Debbugs-Original-Cc: Phil Sainty , bug-gnu-emacs , Eli Zaretskii Received: via spool by submit@debbugs.gnu.org id=B.157059745615463 (code B ref -1); Wed, 09 Oct 2019 05:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Oct 2019 05:04:16 +0000 Received: from localhost ([127.0.0.1]:51881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI491-00041J-3U for submit@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 ) id 1iI48z-00041C-7s for submit@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 ) id 1iI48y-000228-2Q for bug-gnu-emacs@gnu.org; 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 ) id 1iI48w-0001U0-Eu for bug-gnu-emacs@gnu.org; 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 ) 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 ) id 1iI48q-0002zP-IS; Wed, 09 Oct 2019 07:04:06 +0200 From: Lars Ingebrigtsen References: <775105d3-261b-fe70-ddd9-e5d7db78706f@topbug.net> Date: Wed, 09 Oct 2019 07:04:04 +0200 In-Reply-To: <775105d3-261b-fe70-ddd9-e5d7db78706f@topbug.net> (Hong Xu's message of "Tue, 8 Oct 2019 21:59:40 -0700") Message-ID: <87eezmtsqj.fsf@gnus.org> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hong Xu 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 From unknown Sun Jun 22 13:37:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Hong Xu Subject: bug#37673: closed (Re: [PATCH] Simplify the search of the default tags file in, `visit-tags-table') Message-ID: References: <775105d3-261b-fe70-ddd9-e5d7db78706f@topbug.net> X-Gnu-PR-Message: they-closed 37673 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 37673@debbugs.gnu.org Date: Sat, 12 Oct 2019 18:56:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1570906562-13059-1" This is a multi-part message in MIME format... ------------=_1570906562-13059-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #37673: [PATCH] Simplify the search of the default tags file in, `visit-tag= s-table' which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 37673@debbugs.gnu.org. --=20 37673: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D37673 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1570906562-13059-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 37673-done) by debbugs.gnu.org; 12 Oct 2019 18:55:37 +0000 Received: from localhost ([127.0.0.1]:34127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJMYD-0003O1-8N for submit@debbugs.gnu.org; Sat, 12 Oct 2019 14:55:37 -0400 Received: from sender4-of-o54.zoho.com ([136.143.188.54]:21491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJMYB-0003Nt-Hs for 37673-done@debbugs.gnu.org; Sat, 12 Oct 2019 14:55:36 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1570906530; cv=none; d=zoho.com; s=zohoarc; b=VJr7JqbnmdFHcRhL3kVvvHa2/O0772b3U58MylKifds2QPYnbkpA3Mp4B0g8FRR3OuIQWxLsJT+5wUR7sGXCjreDL55xS2T9jd4yndjpiw/GkwaIrsa4GuqGWbs/PZv+jZyK5VthzOSB1ZcQf0gULm2bv1oesjefoKksXFDGUqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570906530; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=PK9Gf2+dRY3Qi4imfKDpmRWkEWDj0z5d5Zp54zDmgjA=; b=ea7qS+LH/cVUZ9R4oYeqL2a5U1IMMvbMAhLwuDaeg87OUcHt5Ia5LU4n+0iAuikSQA9gcikHadP2wAN0oRoI1NGwvIvi7URZC8BXfu9Rzx599PEDj4nN6Ol7cKjzangJVK4PnRHlpsRnT63UKe5ZqL68CPhFqA+x1du899fEhJo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=topbug.net; spf=pass smtp.mailfrom=hong@topbug.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1570906530; s=zoho; d=topbug.net; i=hong@topbug.net; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; l=124; bh=PK9Gf2+dRY3Qi4imfKDpmRWkEWDj0z5d5Zp54zDmgjA=; b=jZGqg2NbM9XP4uJN1BOJWSSfloJrw2A1z8BC1CIj8GimbwOH/OeYljh5YddoMUAT XBRO8NDUGWKqH31ousxyF2QFoA+P1R2giyYSrHojTHtGCJeYdSUkyjnwkEy/ph7VEp7 S43O1Im+Y1Y+OPCBGvYT1EZPWGDp0bjUAd+plvBk= 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 1570906530416821.9973940168471; Sat, 12 Oct 2019 11:55:30 -0700 (PDT) Subject: Re: [PATCH] Simplify the search of the default tags file in, `visit-tags-table' To: Lars Ingebrigtsen References: <775105d3-261b-fe70-ddd9-e5d7db78706f@topbug.net> <87eezmtsqj.fsf@gnus.org> From: Hong Xu Openpgp: preference=signencrypt Message-ID: Date: Sat, 12 Oct 2019 11:55:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <87eezmtsqj.fsf@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 37673-done Cc: Phil Sainty , Eli Zaretskii , 37673-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10/8/19 10:04 PM, Lars Ingebrigtsen wrote: > Looks good to me; applied to Emacs 27 now. > Shall we close this one? ------------=_1570906562-13059-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Oct 2019 05:00:02 +0000 Received: from localhost ([127.0.0.1]:51862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI44v-0003rc-64 for submit@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 ) id 1iI44s-0003rS-Da for submit@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 ) id 1iI44r-0001SX-63 for bug-gnu-emacs@gnu.org; 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 ) id 1iI44p-0007EW-BJ for bug-gnu-emacs@gnu.org; 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 ) 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@topbug.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1570597182; s=zoho; d=topbug.net; i=hong@topbug.net; 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 From: Hong Xu Subject: [PATCH] Simplify the search of the default tags file in, `visit-tags-table' Openpgp: preference=signencrypt Message-ID: <775105d3-261b-fe70-ddd9-e5d7db78706f@topbug.net> 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 , Lars Ingebrigtsen , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 ------------=_1570906562-13059-1--