From unknown Fri Jun 13 11:46:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37611: [PATCH] Default FILE to the current buffer for list-tags Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Oct 2019 02:06:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 37611@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs Received: via spool by submit@debbugs.gnu.org id=B.15701547288406 (code B ref -1); Fri, 04 Oct 2019 02:06:03 +0000 Received: (at submit) by debbugs.gnu.org; 4 Oct 2019 02:05:28 +0000 Received: from localhost ([127.0.0.1]:41508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGCyF-0002BU-OM for submit@debbugs.gnu.org; Thu, 03 Oct 2019 22:05:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:43709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGCyD-0002BJ-6O for submit@debbugs.gnu.org; Thu, 03 Oct 2019 22:05:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGCyC-0002bY-2d for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2019 22:05:25 -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.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGCyA-0005hp-LP for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2019 22:05:23 -0400 Received: from sender4-of-o54.zoho.com ([136.143.188.54]:21415) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iGCyA-0005dW-An for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2019 22:05:22 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1570154711; cv=none; d=zoho.com; s=zohoarc; b=aXqO4O5Pj3Nz/1rKgPpB7N84kvS4NUEzk6E739+yKWSOrslUzt5pY2/9tlxtok77c7pB75YfYi5NGWRnXNx9txFtvZ39aO311dXM6+qIebjyLsnpV0mF5IDWun+u42sjPyzDiE2mbiwfbyU2Xd6454xsLSG+8aLS1utuIh5oQT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570154711; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=fyJN0D+6rwjn6wqF9mc5jZfUoCbmXbzpkkTqY8ezKZA=; b=jOgeFGf9cpHC2k+3ht0C5+3lZfXkb98L0Dlz2+Ir7wPILrc2ka/S2PReB7jAeIjcWbe3t5BBkfvVKVMwGaBqO2p3Pf+aoBfWfuoSnsPY24FzitubIyanGMbFbVkQ+7TdZdnydfWlM29Nb82iD0ZqF66+Etbi4sl/YkBwnLB8O7k= 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=1570154711; s=zoho; d=topbug.net; i=hong@topbug.net; h=To:From:Subject:Message-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; l=1685; bh=fyJN0D+6rwjn6wqF9mc5jZfUoCbmXbzpkkTqY8ezKZA=; b=EjHpiuRZs+m0AfjOltYYz8CA9l1SC3u7ubPVX6rKjmNIqUf7jWtuMhAMzoYZbR9z H6umPKozITUla2wS7tJ0lq3708Tx6PxLhzNj0TfUDncGcJPoFewowBtw8Gj8Olvp4dd ACqoJeuYC+9tYaFVn8/6e67wXepXZiSQucHS5Ctc= 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 157015470915531.406218531986497; Thu, 3 Oct 2019 19:05:09 -0700 (PDT) From: Hong Xu Openpgp: preference=signencrypt Message-ID: Date: Thu, 3 Oct 2019 19:05:08 -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 (list-tags) (tags--get-current-buffer-name-in-tags-file): Default FILE to the current buffer for list-tags. --- lisp/progmodes/etags.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index a03516100087..23acffcac299 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1852,15 +1852,27 @@ tags-complete-tags-table-file (all-completions string (tags-table-files) predicate) (try-completion string (tags-table-files) predicate)))) +(defun tags--get-current-buffer-name-in-tags-file () + "Get the file name that the current buffer corresponds in the tags file." + (let ((tag-dir + (save-excursion + (visit-tags-table-buffer) + (file-name-directory (buffer-file-name))))) + (when (string-prefix-p tag-dir (buffer-file-name)) + (substring (buffer-file-name) (length tag-dir) nil)))) + ;;;###autoload (defun list-tags (file &optional _next-match) "Display list of tags in file FILE. This searches only the first table in the list, and no included tables. FILE should be as it appeared in the `etags' command, usually without a directory specification." - (interactive (list (completing-read "List tags in file: " - 'tags-complete-tags-table-file - nil t nil))) + (interactive (list (completing-read + "List tags in file: " + 'tags-complete-tags-table-file + nil t + ;; Default FILE to the current buffer. + (tags--get-current-buffer-name-in-tags-file)))) (with-output-to-temp-buffer "*Tags List*" (princ (substitute-command-keys "Tags in file `")) (tags-with-face 'highlight (princ file)) -- 2.18.1 From unknown Fri Jun 13 11:46:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37611: [PATCH] Default FILE to the current buffer for list-tags Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Oct 2019 08:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Hong Xu Cc: 37611@debbugs.gnu.org Received: via spool by 37611-submit@debbugs.gnu.org id=B37611.15701759639108 (code B ref 37611); Fri, 04 Oct 2019 08:00:05 +0000 Received: (at 37611) by debbugs.gnu.org; 4 Oct 2019 07:59:23 +0000 Received: from localhost ([127.0.0.1]:41677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGIUl-0002Mp-47 for submit@debbugs.gnu.org; Fri, 04 Oct 2019 03:59:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGIUj-0002Md-Qt for 37611@debbugs.gnu.org; Fri, 04 Oct 2019 03:59:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iGIUe-0001FZ-DB; Fri, 04 Oct 2019 03:59:16 -0400 Received: from [176.228.60.248] (port=1059 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iGIUd-0006Bt-1W; Fri, 04 Oct 2019 03:59:15 -0400 Date: Fri, 04 Oct 2019 10:59:02 +0300 Message-Id: <83v9t554c9.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Hong Xu on Thu, 3 Oct 2019 19:05:08 -0700) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 (---) > From: Hong Xu > Date: Thu, 3 Oct 2019 19:05:08 -0700 > > * lisp/progmodes/etags.el (list-tags) > (tags--get-current-buffer-name-in-tags-file): Default FILE to the > current buffer for list-tags. > --- > lisp/progmodes/etags.el | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el > index a03516100087..23acffcac299 100644 > --- a/lisp/progmodes/etags.el > +++ b/lisp/progmodes/etags.el > @@ -1852,15 +1852,27 @@ tags-complete-tags-table-file > (all-completions string (tags-table-files) predicate) > (try-completion string (tags-table-files) predicate)))) > > +(defun tags--get-current-buffer-name-in-tags-file () > + "Get the file name that the current buffer corresponds in the tags file." Thanks. The doc string of list-tags needs an update as result of this, and also its documentation in the user manual. Did you try this in the Emacs source tree? We use the TAGS 'include' facility to include various TAGS files in a single master file. This seems to get in the way when you invoke this command from a Lisp file, because list-tags only recognizes one of the C source files as completion candidates. What does this do with your changes? From unknown Fri Jun 13 11:46:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37611: [PATCH] Default FILE to the current buffer for list-tags Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Oct 2019 19:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 37611@debbugs.gnu.org Received: via spool by 37611-submit@debbugs.gnu.org id=B37611.157021685332353 (code B ref 37611); Fri, 04 Oct 2019 19:21:02 +0000 Received: (at 37611) by debbugs.gnu.org; 4 Oct 2019 19:20:53 +0000 Received: from localhost ([127.0.0.1]:43475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGT8H-0008Pl-1L for submit@debbugs.gnu.org; Fri, 04 Oct 2019 15:20:53 -0400 Received: from sender4-of-o55.zoho.com ([136.143.188.55]:21551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGT8F-0008PZ-8o for 37611@debbugs.gnu.org; Fri, 04 Oct 2019 15:20:51 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1570216848; cv=none; d=zoho.com; s=zohoarc; b=Shnfb/y8wPCsdzt1Ok/m3oyk0w9kuzLW0wB1Ov62YRNJkHFdV/49eShLgSiGZ/2KeVUHidPevzJH3ni5ZwcGxQaz6vgFkNUUtY7Grk8fVe72MN3IO3R3M2db4xO0yPPVbyek1z61fsNEqcsgDNOKXsb5tkszWJN6u5J0oboAwBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570216848; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=K7bBa+xCRYizE/s1sI/xBDg/Iy3wye/gTyhDcmun9Cs=; b=BUGfIjVhFyKPYWLnkyPvudOCemLh3JCDq+f4TQaSo45Qqk3koJAfQaApYrpN0eQ6VV1HQu1pmQmgTZ7Dw1w4J67JpIocyeefkdQBH7KHRTf50/33HrJON7OipxLUHYxi1q2uvvXNIgxKdqXVyMNLbCSD7T2m9S6wh5T+6rzJjlM= 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=1570216848; 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=757; bh=K7bBa+xCRYizE/s1sI/xBDg/Iy3wye/gTyhDcmun9Cs=; b=g0O/FcHanPd9a1SYrA29o+9us2HFN3+C2LSaZJyx9i5izzCsBeEbsdYxSA9L0xcn PNg5mN7dOkdIO1/5O/tezX1ly0UlrQusgj5B8hWpPqpo0ZuO9orxRA4uWL2/Am4LDOm M26wBCf1ylmgAhs0ebgL/3lEaMKrw4Ms8sjRwkCo= 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 1570216847243310.04790289607; Fri, 4 Oct 2019 12:20:47 -0700 (PDT) References: <83v9t554c9.fsf@gnu.org> From: Hong Xu Openpgp: preference=signencrypt Message-ID: <831d1916-8c3b-70e2-3a94-3259a911e5e8@topbug.net> Date: Fri, 4 Oct 2019 12:20:46 -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: <83v9t554c9.fsf@gnu.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-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/4/19 12:59 AM, Eli Zaretskii wrote: > Thanks. The doc string of list-tags needs an update as result of > this, and also its documentation in the user manual. I will update the doc. > > Did you try this in the Emacs source tree? We use the TAGS 'include' > facility to include various TAGS files in a single master file. This > seems to get in the way when you invoke this command from a Lisp file, > because list-tags only recognizes one of the C source files as > completion candidates. What does this do with your changes? > I tried in the Emacs source tree without problem (I ran universal ctags, "ctags -R -e ." from root of the source tree). How do you generate the TAGS file? Is there any instruction? I can take a look at it. From unknown Fri Jun 13 11:46:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37611: [PATCH] Default FILE to the current buffer for list-tags Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Oct 2019 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Hong Xu Cc: 37611@debbugs.gnu.org Received: via spool by 37611-submit@debbugs.gnu.org id=B37611.15702181312006 (code B ref 37611); Fri, 04 Oct 2019 19:43:02 +0000 Received: (at 37611) by debbugs.gnu.org; 4 Oct 2019 19:42:11 +0000 Received: from localhost ([127.0.0.1]:43498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGTSs-0000WI-Vy for submit@debbugs.gnu.org; Fri, 04 Oct 2019 15:42:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGTSr-0000W4-GG for 37611@debbugs.gnu.org; Fri, 04 Oct 2019 15:42:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iGTSm-00052l-76; Fri, 04 Oct 2019 15:42:04 -0400 Received: from [176.228.60.248] (port=4385 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iGTSl-0000cd-I0; Fri, 04 Oct 2019 15:42:04 -0400 Date: Fri, 04 Oct 2019 22:41:51 +0300 Message-Id: <83bluw5mdc.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <831d1916-8c3b-70e2-3a94-3259a911e5e8@topbug.net> (message from Hong Xu on Fri, 4 Oct 2019 12:20:46 -0700) References: <83v9t554c9.fsf@gnu.org> <831d1916-8c3b-70e2-3a94-3259a911e5e8@topbug.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 (---) > Cc: 37611@debbugs.gnu.org > From: Hong Xu > Date: Fri, 4 Oct 2019 12:20:46 -0700 > > > Did you try this in the Emacs source tree? We use the TAGS 'include' > > facility to include various TAGS files in a single master file. This > > seems to get in the way when you invoke this command from a Lisp file, > > because list-tags only recognizes one of the C source files as > > completion candidates. What does this do with your changes? > > > > I tried in the Emacs source tree without problem (I ran universal ctags, "ctags -R -e ." from root of the source tree). How do you generate the TAGS file? Is there any instruction? I can take a look at it. I use "make TAGS", of course. From unknown Fri Jun 13 11:46:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37611: [PATCH] Default FILE to the current buffer for list-tags Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Oct 2019 00:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 37611@debbugs.gnu.org Received: via spool by 37611-submit@debbugs.gnu.org id=B37611.157023591331179 (code B ref 37611); Sat, 05 Oct 2019 00:39:02 +0000 Received: (at 37611) by debbugs.gnu.org; 5 Oct 2019 00:38:33 +0000 Received: from localhost ([127.0.0.1]:43590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGY5h-00086o-9F for submit@debbugs.gnu.org; Fri, 04 Oct 2019 20:38:33 -0400 Received: from sender4-of-o55.zoho.com ([136.143.188.55]:21522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGY5f-00086g-AT for 37611@debbugs.gnu.org; Fri, 04 Oct 2019 20:38:31 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1570235903; cv=none; d=zoho.com; s=zohoarc; b=DIZ8b3uT9YptNcEi4lAbSg4EfrgXmZE0A+XDE6p4aW66V9Cy0l8DGl/KC8dDMa7herJG38XzO1yLHdk/oX11aSw1Pvp8STBDK8HGKWGKOnIY/OjXl8IerihHgArcVh46SmD4visxxK8ghLFyANAoLfjPaKRdiyP7v7Zcoz1u4Bw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570235903; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=JxJQkqRdxjJt+8stryOwaMrTxrDjDjU4E9BbR9QYtE8=; b=eqXO42tE0o0H2qJUFg/4lO2UkuEeshpzq756aEJFaQunehZUqGKTHYmQ5hlDg0e9NhtVNCMV66H8X9E69p11QzYRt+/3YGYD2M1rbItoUrMJA+ZGas5GUgvkD5srh4YxCnPz2ON8+QfAq/Ase+9U6CONGorKcPqccOnMCfJ3Gko= 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=1570235903; 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; l=4435; bh=JxJQkqRdxjJt+8stryOwaMrTxrDjDjU4E9BbR9QYtE8=; b=KTrs6prI0gkSz8idtnPi9IuyZhIZtbo5jm6gl5E+erIoqx9dO0HQalNrZVM9HDA+ sTIidZSu8O/IT9RBlZVvQAruEwuWcIqp6cNUsS1oWfk7D30gu2+vKHttZHgNWirH8t4 tmkPQCBHoK5ckoZMvnANctnxXx0l1deS9ErNCpFg= 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 157023590278347.69453543965062; Fri, 4 Oct 2019 17:38:22 -0700 (PDT) References: <83v9t554c9.fsf@gnu.org> <831d1916-8c3b-70e2-3a94-3259a911e5e8@topbug.net> <83bluw5mdc.fsf@gnu.org> From: Hong Xu Openpgp: preference=signencrypt Message-ID: <6014109a-f6ac-f0de-1a46-c0e420e313d5@topbug.net> Date: Fri, 4 Oct 2019 17:38:22 -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: <83bluw5mdc.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------581AE9C6C77B98C1B6AF1BAD" Content-Language: en-US X-Zoho-Virus-Status: 1 X-ZohoMailClient: External X-Spam-Score: 0.0 (/) 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 (-) This is a multi-part message in MIME format. --------------581AE9C6C77B98C1B6AF1BAD Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 10/4/19 12:41 PM, Eli Zaretskii wrote: >> Cc: 37611@debbugs.gnu.org >> From: Hong Xu >> Date: Fri, 4 Oct 2019 12:20:46 -0700 >> >>> Did you try this in the Emacs source tree? We use the TAGS 'include' >>> facility to include various TAGS files in a single master file. This >>> seems to get in the way when you invoke this command from a Lisp file, >>> because list-tags only recognizes one of the C source files as >>> completion candidates. What does this do with your changes? >>> >> >> I tried in the Emacs source tree without problem (I ran universal ctags, "ctags -R -e ." from root of the source tree). How do you generate the TAGS file? Is there any instruction? I can take a look at it. > > I use "make TAGS", of course. > I updated the patch (as attached) so that it now works with the TAGS generated using `make TAGS` and also includes missing updates to docstring and info nodes. --------------581AE9C6C77B98C1B6AF1BAD Content-Type: text/x-patch; name="0001-Default-FILE-to-the-current-buffer-for-list-tags.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Default-FILE-to-the-current-buffer-for-list-tags.patch" >From a806553186635aeb0e7763490e41b0ac68e602c4 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Thu, 3 Oct 2019 16:36:54 -0700 Subject: [PATCH] Default FILE to the current buffer for list-tags * lisp/progmodes/etags.el (list-tags) (tags--get-current-buffer-name-in-tags-file): Default FILE to the current buffer for list-tags. * doc/emacs/maintaining.texi (List Identifiers): Update `list-tags' doc. --- doc/emacs/maintaining.texi | 4 +++- lisp/progmodes/etags.el | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 9a9957069fd6..519667dfbe92 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2124,7 +2124,9 @@ List Identifiers file. Do not include a directory as part of the file name unless the file name recorded in the tags table includes a directory. This command works only with the etags backend, and requires a tags table -for the project to be available. @xref{Tags Tables}. +for the project to be available. @xref{Tags Tables}. If used +interactively, the default tag is file name of the current buffer if +used interactively. @c Sadly, the new-and-improved Xref feature doesn't provide anything @c close to the described below features of the now-obsoleted diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index a03516100087..5edced5080e2 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1852,15 +1852,28 @@ tags-complete-tags-table-file (all-completions string (tags-table-files) predicate) (try-completion string (tags-table-files) predicate)))) +(defun tags--get-current-buffer-name-in-tags-file () + "Get the file name that the current buffer corresponds in the tags file." + (let ((tag-dir + (save-excursion + (visit-tags-table-buffer) + (file-name-directory (buffer-file-name))))) + (file-relative-name (buffer-file-name) tag-dir))) + ;;;###autoload (defun list-tags (file &optional _next-match) "Display list of tags in file FILE. -This searches only the first table in the list, and no included tables. -FILE should be as it appeared in the `etags' command, usually without a -directory specification." - (interactive (list (completing-read "List tags in file: " - 'tags-complete-tags-table-file - nil t nil))) +This searches only the first table in the list, and no included +tables. FILE should be as it appeared in the `etags' command, +usually without a directory specification. If called +interactively, FILE defaults to the file name of the current +buffer." + (interactive (list (completing-read + "List tags in file: " + 'tags-complete-tags-table-file + nil t + ;; Default FILE to the current buffer. + (tags--get-current-buffer-name-in-tags-file)))) (with-output-to-temp-buffer "*Tags List*" (princ (substitute-command-keys "Tags in file `")) (tags-with-face 'highlight (princ file)) -- 2.20.1 --------------581AE9C6C77B98C1B6AF1BAD-- From unknown Fri Jun 13 11:46:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#37611: [PATCH] Default FILE to the current buffer for list-tags Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Oct 2019 04:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Hong Xu Cc: 37611@debbugs.gnu.org, Eli Zaretskii Received: via spool by 37611-submit@debbugs.gnu.org id=B37611.157042104714731 (code B ref 37611); Mon, 07 Oct 2019 04:05:02 +0000 Received: (at 37611) by debbugs.gnu.org; 7 Oct 2019 04:04:07 +0000 Received: from localhost ([127.0.0.1]:47141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHKFi-0003pX-Sz for submit@debbugs.gnu.org; Mon, 07 Oct 2019 00:04:07 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHKFf-0003pL-E2 for 37611@debbugs.gnu.org; Mon, 07 Oct 2019 00:04:05 -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 1iHKFc-0005OM-7I; Mon, 07 Oct 2019 06:04:02 +0200 From: Lars Ingebrigtsen References: <83v9t554c9.fsf@gnu.org> <831d1916-8c3b-70e2-3a94-3259a911e5e8@topbug.net> <83bluw5mdc.fsf@gnu.org> <6014109a-f6ac-f0de-1a46-c0e420e313d5@topbug.net> Date: Mon, 07 Oct 2019 06:03:59 +0200 In-Reply-To: <6014109a-f6ac-f0de-1a46-c0e420e313d5@topbug.net> (Hong Xu's message of "Fri, 4 Oct 2019 17:38:22 -0700") Message-ID: <8736g5b3rk.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-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Hong Xu writes: > I updated the patch (as attached) so that it now works with the TAGS > generated using `make TAGS` and also includes missing updates to > docstring and info nodes. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) 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 (-) Hong Xu writes: > I updated the patch (as attached) so that it now works with the TAGS > generated using `make TAGS` and also includes missing updates to > docstring and info nodes. Looks good to me, so I've now applied it to Emacs 27. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 07 00:04:15 2019 Received: (at control) by debbugs.gnu.org; 7 Oct 2019 04:04:15 +0000 Received: from localhost ([127.0.0.1]:47144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHKFr-0003px-5i for submit@debbugs.gnu.org; Mon, 07 Oct 2019 00:04:15 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iHKFp-0003pq-Qk for control@debbugs.gnu.org; Mon, 07 Oct 2019 00:04:14 -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 1iHKFn-0005Oa-5M for control@debbugs.gnu.org; Mon, 07 Oct 2019 06:04:13 +0200 Date: Mon, 07 Oct 2019 06:04:10 +0200 Message-Id: <871rvpb3r9.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #37611 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 37611 fixed close 37611 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 37611 fixed close 37611 27.1 quit