From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 22 19:56:10 2024 Received: (at submit) by debbugs.gnu.org; 22 Jun 2024 23:56:11 +0000 Received: from localhost ([127.0.0.1]:36591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLAaY-00016e-I2 for submit@debbugs.gnu.org; Sat, 22 Jun 2024 19:56:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:40000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLAaW-00016T-IU for submit@debbugs.gnu.org; Sat, 22 Jun 2024 19:56:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLAaW-0002Dn-3r for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 19:56:08 -0400 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLAaQ-0006AQ-45 for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 19:56:06 -0400 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-63bb0ff142cso31616757b3.3 for ; Sat, 22 Jun 2024 16:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719100560; x=1719705360; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=XlzbVaYA6Q3jXI2cG8AA0NbMwAYtCuVSPikFMcUtjjA=; b=M3lQmK+AktonqJ+vRGHupALgU/V95/yGIbXfR7etuylUrLmQPG2I0GjdQG0pzdirQA 44LhhYJflN4R1s4mNXqPrp/XPAiyyV0LjhLLAtpX9/FatltABpgAUTCWeMfM1S8qls8k Gqv6SbcwXUbepyXeDk5naVsEo1dn2Q9zWUPJFUZDm6pZ0WOC0cG5tgSD5VpgXGLbq9sB 1K8d45qnoGtseGQNK5sw5WnW/IjFni1em7m+gh+F2/K8yYzsJ/Y/+xiOQ1Ge7qfomYZc /rf2075ElWVEwd63elaHwzxKgOoG1kgDbGJQPzQ5ACdYHFkCO1cJBQaaWON39xsyIMj1 NMDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719100560; x=1719705360; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XlzbVaYA6Q3jXI2cG8AA0NbMwAYtCuVSPikFMcUtjjA=; b=uAGTQV0y4QeHs0wH9dSUIbROQdpr+9mSoCfDbqr/xYXxuaHs4cjvNcLBeLJVfZZ3Qi 654KsOvIe14P1+/IAdTRkOgb8U7pIa2YXDyl3uPcvTcg9MTMrn+NFtlPY7X2rzfM7FkI 4l+jqtOxJci4a4woh7wd2CXtd1BjwO5AiVvibbxd7ob4tM0ve0Uwow+MwCD6Oinb1Di7 RcI21csHmuxcY/Nd0fEni7E/aKLOaLh0jY0F2+tr8POyKhY0uXgDjkeq8c4S55KEaL4s MrH/CvInlzGibJYCow1vivHlEAHmh9jwhgvRYqX8MIBR7yUluotuqfyc8Bx0osjgXBdh QWJQ== X-Gm-Message-State: AOJu0Yzng4cEIfW8WqeenL1oPqFKonEXy7iqmAHehE7jjuog2pFZB+KP TKTYQ1wZ2/G4Vs0yh1ZSt0ZaqgOIjeplrdJR1J5CaawB5QizK0j9j8OH4cJ0xr8ZLTE240HdLQn afJBNAd9uLw1PDaobptypRExAbYeWete8oJycLg== X-Google-Smtp-Source: AGHT+IG1RO1S1CGjtWe6sdVnFK9hrt/rPEDL4Axh5eOa3ueJwfSUAiJyzMwJ5iT2RnpW4Xryaw5teKzLiF6NWqCZcro= X-Received: by 2002:a81:5bd7:0:b0:610:1cd9:8c37 with SMTP id 00721157ae682-6429a7203bamr18933997b3.30.1719100559979; Sat, 22 Jun 2024 16:55:59 -0700 (PDT) MIME-Version: 1.0 From: Siyuan Chen Date: Sun, 23 Jun 2024 07:55:49 +0800 Message-ID: Subject: Deleting TAGS buffer will cause `etags-regen--update-file` doesn't work To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="00000000000035fea2061b834a65" Received-SPF: pass client-ip=2607:f8b0:4864:20::1134; envelope-from=chansey97@gmail.com; helo=mail-yw1-x1134.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit 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.1 (--) --00000000000035fea2061b834a65 Content-Type: text/plain; charset="UTF-8" Reproduce steps: 1. init.el ``` (setq etags-regen-program "C:/green/emacs/emacs-29.3/bin/etags.exe") (require 'etags-regen) ``` 2. Open test.c with the following code ``` #define APPLICATION_WINDOW_WIDTH 320 ``` 3. M-x etags-regen-mode 4. Move the cursor to APPLICATION_WINDOW_WIDTH and M-x xref-find-definitions. Then the TAGS file is created and the APPLICATION_WINDOW_WIDTH line is highlighted (good). 5. M-x kill-buffer TAGS 6. Add `#define APPLICATION_WINDOW_HEIGHT 320` to test.c and M-x save-buffer 7. Move the cursor to APPLICATION_WINDOW_HEIGHT and M-x xref-find-definitions. The expected behavior: The TAGS file is updated and the APPLICATION_WINDOW_HEIGHT line is highlighted. The actual behavior: The echo area reports: "No definition found for: APPLICATION_WINDOW_HEIGHT" Note that if I don't do step-5 then everything is OK. Emacs 29.3 has no this feature, I make it available via copy & paste etags-regen.el to load-path. I think this issue has nothing to do with the Emacs version though. Thanks. Best regards, Siyuan Chen --00000000000035fea2061b834a65 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reproduce = steps:

1. init.el
```
(se= tq etags-regen-program=C2=A0"C:/green/emacs/emacs-29.3/bin/etags.exe&q= uot;)
(require 'etags-regen)
```

=
2. Open test.c with the following code
```
#= define APPLICATION_WINDOW_WIDTH 320
```

<= div>3. M-x etags-regen-mode

4. Move the cursor= to=20 APPLICATION_WINDOW_WIDTH and M-x xref-find-definitions. Then the TAGS file = is created and=20 the APPLICATION_WINDOW_WIDTH line is highlighted (good).

=
5. M-x kill-buffer TAGS

6. Add `#define= APPLICATION_WINDOW_HEIGHT 320` to=20 test.c and M-x save-buffer

7.=20 Move the cursor to APPLICATION_WINDOW_HEIGHT and M-x xref-find-definitions.

The expected behavior:= The TAGS file is updated and=20 =20 the APPLICATION_WINDOW_HEIGHT line is highlighted.

The actual behavior: The echo area reports: "No definition found for:= APPLICATION_WINDOW_HEIGHT"

Note that if I do= n't do step-5 then everything is OK.

Emacs 29.= 3 has no this feature, I make it available via copy & paste etags-regen= .el to load-path. I think t= his issue has nothing to do with the Emacs version though.

Thanks.

Best regards,
Siyuan Chen

--00000000000035fea2061b834a65-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 27 04:50:01 2024 Received: (at 71727) by debbugs.gnu.org; 27 Jun 2024 08:50:01 +0000 Received: from localhost ([127.0.0.1]:40957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMkpM-0007ui-UW for submit@debbugs.gnu.org; Thu, 27 Jun 2024 04:50:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMkpK-0007uK-TL for 71727@debbugs.gnu.org; Thu, 27 Jun 2024 04:49:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMkpC-0004pC-Hz; Thu, 27 Jun 2024 04:49:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4NI7J8BoiEhkd0v019n4p52t2rmUd4k5n80al54UOCI=; b=FC87cGKOimPf cUmxhND4Jj7Z2n+ugSW9i6mW4BdQ92RywNhMXl8F7wukoH9lTevqVBJ0H0mJFywZxFdMxeyLU9//A 5Elg4SB3a3TsUB1scTtIxySq8D7J9ZthkYswscbP+IZASHZM4YoZpyapc5y2ZykgH98LcrBtUmjax aAYrz2uk70VwCYKLeRGHSL5IZzzPJmE+zoINVS0vb3xQnSYVxOZsEEaJvBW6O4SP6Lv5Kon39PuBl L7hTDNlCvbPOTDoBEG5ZjVnwEArocsqRcv2nNW6mLUzIkhL9USru3K9pcBDE56TLFLYrJDBbtY4a3 Kl9njf9MuMPX9EKTfRKibA==; Date: Thu, 27 Jun 2024 11:49:46 +0300 Message-Id: <86r0ci6a8l.fsf@gnu.org> From: Eli Zaretskii To: Siyuan Chen , Dmitry Gutov In-Reply-To: (message from Siyuan Chen on Sun, 23 Jun 2024 07:55:49 +0800) Subject: Re: bug#71727: Deleting TAGS buffer will cause `etags-regen--update-file` doesn't work References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71727 Cc: 71727@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: -3.3 (---) > From: Siyuan Chen > Date: Sun, 23 Jun 2024 07:55:49 +0800 > > Reproduce steps: > > 1. init.el > ``` > (setq etags-regen-program "C:/green/emacs/emacs-29.3/bin/etags.exe") > (require 'etags-regen) > ``` > > 2. Open test.c with the following code > ``` > #define APPLICATION_WINDOW_WIDTH 320 > ``` > > 3. M-x etags-regen-mode > > 4. Move the cursor to APPLICATION_WINDOW_WIDTH and M-x xref-find-definitions. Then the TAGS file is > created and the APPLICATION_WINDOW_WIDTH line is highlighted (good). > > 5. M-x kill-buffer TAGS > > 6. Add `#define APPLICATION_WINDOW_HEIGHT 320` to test.c and M-x save-buffer > > 7. Move the cursor to APPLICATION_WINDOW_HEIGHT and M-x xref-find-definitions. > > The expected behavior: The TAGS file is updated and the APPLICATION_WINDOW_HEIGHT line is > highlighted. > > The actual behavior: The echo area reports: "No definition found for: APPLICATION_WINDOW_HEIGHT" > > Note that if I don't do step-5 then everything is OK. > > Emacs 29.3 has no this feature, I make it available via copy & paste etags-regen.el to load-path. I think this > issue has nothing to do with the Emacs version though. Thanks. Dmitry, could you please look into this? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 01:51:44 2024 Received: (at 71727) by debbugs.gnu.org; 28 Jun 2024 05:51:44 +0000 Received: from localhost ([127.0.0.1]:51376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN4WO-0000Qj-Jf for submit@debbugs.gnu.org; Fri, 28 Jun 2024 01:51:44 -0400 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]:57421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sN4WM-0000QO-9u for 71727@debbugs.gnu.org; Fri, 28 Jun 2024 01:51:43 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 7C79A1140214; Thu, 27 Jun 2024 21:23:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 27 Jun 2024 21:23:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1719537814; x=1719624214; bh=5PfzzIDSKWBphS1nj1toAjtHOOU+WUj3gMe82T3/+qs=; b= 10gLyMs/MulDTQrJTQH2hdRSDV3DL4WcTv9hyn+J/TpAAYCVwassKQhNyWBRJHxy 68HtG72WlcCR4ik/PSrapJ7QT3cpZWMGTlsS43P+7Qa9qv4WEo2jXhcVvyyEJSR4 jfo1yuZvhW4G1oLLyqiFerYqeoMhXBtZ0ePheVB/1gsiVCWo1vcR+gp0alHUGxBC faMWibBLjuZ+jAZ9AuLMIi/U+4M94SMpqSXzkFzGKIl7V9Emlb4JKERkbxDGQd71 dhA83ByFbF5Jeqod1HsEe7g8vveEjuPzA2jSFtfYGkqyr9yg0ZNMI2hudg1vrADM 61dx06R3R3wXxa9My+iXeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719537814; x= 1719624214; bh=5PfzzIDSKWBphS1nj1toAjtHOOU+WUj3gMe82T3/+qs=; b=G GMxiyAYZnoOdqkMdefwEKoDFZZ23+4/gzRxij3AvdSOj7pf9yUlIbL5NJqD8u/ZK 4tOMsiHdaPy1OYWwRLhR5IJRkT+H7voKAMtaR+2YXWWaE1OMtUQOAs4GM22yPC50 NvqRWddNzYv6OF7Bd0d2B40zDmlMrpLEVW+pmzxxM2t4bGf2wOXyzVpBUEJyBI78 QRy4bAqrXDPpUmjjmKU/TZjk6yze66xWWVOjYpRZ4NegvTcCoBczxGiUgXk7CFrW gYoKFZgchJD7t71YGu8Bz0f9VeBcPvjR3ijmh1u03z4P909gwz1VBpLb8tzxOGvh LqyX377mYUA74mtXbghKA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdehgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejre dttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhht ohhvrdguvghvqeenucggtffrrghtthgvrhhnpedthfeuvddtveelgeeuleevvdejveehff evveehvdeuffdtfefhvdeugefgtefgtdenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 27 Jun 2024 21:23:33 -0400 (EDT) Message-ID: Date: Fri, 28 Jun 2024 04:23:32 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71727: Deleting TAGS buffer will cause `etags-regen--update-file` doesn't work To: Siyuan Chen , 71727@debbugs.gnu.org References: Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71727 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.7 (-) Hi! Thanks for the report. On 23/06/2024 02:55, Siyuan Chen wrote: > 5. M-x kill-buffer TAGS > > 6. Add `#define APPLICATION_WINDOW_HEIGHT 320` to test.c and M-x save-buffer > > 7. Move the cursor to APPLICATION_WINDOW_HEIGHT and M-x > xref-find-definitions. What happens here, is etags-regen--update-file (added to after-save-hook) fails the check (get-file-buffer etags-regen--tags-file) and so the buffer and the file are not updated. Note that if after step 7 you make an edit to the same file and then try navigating again it will work because at step 7 the tags file is visited again. So this doesn't seem an urgent problem, but it would be nice to fix nevertheless. I think we couldn't re-visit the tags file inside after-save-hook (it might not be fast enough, for one thing), but the second alternative mentioned inside the TODO at the top of etags-regen--update-file should be fix this as well. Is there are particular reason you killed the TAGS buffer? Perhaps a quicker fix would be to visit the tags file in a hidden buffer, rather than use the name that's so easy to find and kill or do something else by accident. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 07:50:45 2024 Received: (at 71727) by debbugs.gnu.org; 29 Jun 2024 11:50:45 +0000 Received: from localhost ([127.0.0.1]:37225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWbM-0005Ti-Nd for submit@debbugs.gnu.org; Sat, 29 Jun 2024 07:50:45 -0400 Received: from mail-yw1-f178.google.com ([209.85.128.178]:55702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWbK-0005TV-FJ for 71727@debbugs.gnu.org; Sat, 29 Jun 2024 07:50:44 -0400 Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-643f1ee4b3cso13954317b3.3 for <71727@debbugs.gnu.org>; Sat, 29 Jun 2024 04:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719661777; x=1720266577; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CorB/+5fzJkV7w7w7Cv73sa5dCr3YZA+cghyvGiz8tY=; b=ikNIP9inkpsRPsiTpaC/Xxilag1pYZGyy24xVtwX6fclrOW2OnJgc+CHc7ZMy8Stl7 v6JxzfzqsJvFyUCTYz6dDF3eJVU0N10283birrg+EaKJFzi//F2EfN2NcALItLeFcCAm qQ50Si84pPSwAQGvy7vy+ZoYMtHL7Xk45Uli0gX6+F0656QwFUhjeH1+McewxAnH80BQ MzkA3wrm7stkCt+Hq8gBjjASFMY29XwRi9Le2SngrsbLMOLXFpcOv8f1B63L6JByJ/Zt CeYb8VKww5VmD/hmABPylyfQKczHK/Oc8OCTzrmSBigprG/iuI5Nlk8rIYVJb/2EA0gt lxAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719661777; x=1720266577; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CorB/+5fzJkV7w7w7Cv73sa5dCr3YZA+cghyvGiz8tY=; b=lrva5syhb/LvYxjYtr2v0Ck7rKWGjkJZLWrpvd9XoiX5LJ89xWCEjEExpPBBZ1R2vm JhsNyuu9dG3pRTy1Y/Fk0skX2vcJuJJW4CzPD+6rhVb/R5J8ne3K1jsZtgLM6g1Soy1n BhBH5T3Fl8QLzn3CXE3hG5dvEUWy+sh7bbAaoUWe6MOEar6ojHotOXicyTh+4TX0TMpX LzVsNRNug6OAzkvoVijRHMHjBW5GK77+NaQi8trsVP5TiHTHKXvAM0EiKBbRCDChdmFE 7XgfliNvwTQbmd8hlvcVc6ZHnBTeFPCXV9tegNeTQeFTt+L4FICT2pEL0LiazqAQutpp mM8g== X-Gm-Message-State: AOJu0YwBmQVGxFC1Q+JfylvO/H77DCrEVCj/cXCcmBoxtWRKa9XngPwH 36fUaY0ywGwPHhIfJMFpeFjwMz0qEW2FzAhEVUM0Q7CwjDCyKnzMVt1AZsC3ks0jalNtQ8gRQU3 xrw8cmdgiLfW+zvSYoEfb9GOn+WI= X-Google-Smtp-Source: AGHT+IFWujFa9sbuDjn9K7I8xFZv1nArAimAmpuxRajo96uZbqvxg0kExUdge5tsmvc2EKO930IaO/AoRXw3afV5QeI= X-Received: by 2002:a05:690c:a8b:b0:64a:79f6:2f2d with SMTP id 00721157ae682-64c71fc2387mr8376527b3.31.1719661777076; Sat, 29 Jun 2024 04:49:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Siyuan Chen Date: Sat, 29 Jun 2024 19:49:50 +0800 Message-ID: Subject: Re: bug#71727: Deleting TAGS buffer will cause `etags-regen--update-file` doesn't work To: Dmitry Gutov Content-Type: multipart/alternative; boundary="0000000000005b4b21061c05f523" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 71727 Cc: 71727@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: -0.7 (/) --0000000000005b4b21061c05f523 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Is there are particular reason you killed the TAGS buffer? No. I found this bug is just because I tried to view the TAGS content while editing a .c file and then closed it (I am using tab-line-mode with tab-line-close-tab-function set to kill-buffer). Since then, I have stopped closing the TAGS buffer. Another option is to temporarily add documentation advising users not to close the TAGS buffer, because closing it accidentally can result in the odd behavior. Best regards, Siyuan Chen On Fri, Jun 28, 2024 at 9:23=E2=80=AFAM Dmitry Gutov wro= te: > Hi! > > Thanks for the report. > > On 23/06/2024 02:55, Siyuan Chen wrote: > > 5. M-x kill-buffer TAGS > > > > 6. Add `#define APPLICATION_WINDOW_HEIGHT 320` to test.c and M-x > save-buffer > > > > 7. Move the cursor to APPLICATION_WINDOW_HEIGHT and M-x > > xref-find-definitions. > > What happens here, is etags-regen--update-file (added to > after-save-hook) fails the check > > (get-file-buffer etags-regen--tags-file) > > and so the buffer and the file are not updated. > > Note that if after step 7 you make an edit to the same file and then try > navigating again it will work because at step 7 the tags file is visited > again. So this doesn't seem an urgent problem, but it would be nice to > fix nevertheless. > > I think we couldn't re-visit the tags file inside after-save-hook (it > might not be fast enough, for one thing), but the second alternative > mentioned inside the TODO at the top of etags-regen--update-file should > be fix this as well. > > Is there are particular reason you killed the TAGS buffer? Perhaps a > quicker fix would be to visit the tags file in a hidden buffer, rather > than use the name that's so easy to find and kill or do something else > by accident. > --0000000000005b4b21061c05f523 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> Is there are particular reason you killed the TAGS buffer?=20

No. I found this bug is just because I tri= ed to view the TAGS content while editing a .c file and then closed it (I=20 am using tab-line-mode with tab-line-close-tab-function set to=20 kill-buffer). Since then, <= /span>I have stopped closing the TAGS buffer.

Another option is to temporarily add documentation advising=20 users not to close the TAGS buffer, because closing it accidentally can result in the odd behavior.
=

Best regards,
Siyuan Chen

=

On Fri, Jun 28, 2024 at 9:23=E2=80=AFAM Dmitry Gutov <dmitry@gutov.dev> wrote:
Hi!

Thanks for the report.

On 23/06/2024 02:55, Siyuan Chen wrote:
> 5. M-x kill-buffer TAGS
>
> 6. Add `#define APPLICATION_WINDOW_HEIGHT 320` to test.c and M-x save-= buffer
>
> 7. Move the cursor to APPLICATION_WINDOW_HEIGHT and M-x
> xref-find-definitions.

What happens here, is etags-regen--update-file (added to
after-save-hook) fails the check

=C2=A0 =C2=A0(get-file-buffer etags-regen--tags-file)

and so the buffer and the file are not updated.

Note that if after step 7 you make an edit to the same file and then try navigating again it will work because at step 7 the tags file is visited again. So this doesn't seem an urgent problem, but it would be nice to =
fix nevertheless.

I think we couldn't re-visit the tags file inside after-save-hook (it <= br> might not be fast enough, for one thing), but the second alternative
mentioned inside the TODO at the top of etags-regen--update-file should be fix this as well.

Is there are particular reason you killed the TAGS buffer? Perhaps a
quicker fix would be to visit the tags file in a hidden buffer, rather
than use the name that's so easy to find and kill or do something else =
by accident.
--0000000000005b4b21061c05f523-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 08 22:50:28 2024 Received: (at 71727) by debbugs.gnu.org; 9 Jul 2024 02:50:28 +0000 Received: from localhost ([127.0.0.1]:51813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sR0vz-0003BG-Pk for submit@debbugs.gnu.org; Mon, 08 Jul 2024 22:50:28 -0400 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]:41707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sR0vy-0003B2-BO for 71727@debbugs.gnu.org; Mon, 08 Jul 2024 22:50:27 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id A2C6D1141BE7; Mon, 8 Jul 2024 22:50:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 08 Jul 2024 22:50:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1720493415; x=1720579815; bh=VfwPV/ySP/uBFufgDFi4snwFlr28XkO9rtf4dg6hEWA=; b= pSj/CxxVVzG3uTMsJC5Std1dhgZAWrUeTXnYcQSexEpx9ktsNw47j56nMbFQx+v6 TTRu5b7Muhw7+3JW3k6gMnamFGph/pqoKVSBvWkB3HbCyhD4qF9etI3XrGoDi/9x YjOqoxsg+WCxWvpMnVCqHw+q7y/Mmhx+9Oa8LIsvOQKQTJxe2EfjAPcGDuSZr08K xzoITMwrSiMIdpEXexIA2VfGpcfUanlRjI9tG46cO4MGjqM1SQB9lBUPRluLI/hP /iBElID2hqs9QiQgMnxiv2DFYNtXc6bbuJ7uqY79b21Z/G5jlC6dhJ4of3Cf+XHQ Z27x7YTQ2Ih/x1m+jIh8lQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720493415; x= 1720579815; bh=VfwPV/ySP/uBFufgDFi4snwFlr28XkO9rtf4dg6hEWA=; b=M 6lXK1U2GsJaE4sEWvG37HOekR/FivozYRns2juYlH/0T3H9jlVDZ7K1zwIR3jgfg bFRJBcsDfrpDse3uYmb2loRqoJ6XoA2wwMb4eiF0xuK8CWz29xcIT8WbsQHRed3w YAAPalGdRrm5/gYeCXrMjIYGk4kkdpR2cFrbJO5aIoWcjIynyz4jGLYKudC2iPt9 2wjolvxVkCQYNIox6LwkSDXXdI5OXVkht4BpLqRxv92WkhTkSWp72NsnI3LQaohH 37y0cv127J87yDwtdVZ/z1TAMXoC+oPLMoFWJUqUgBoFK7AOKlm5TUuVkw1bP42I E6hqApZn+qazFqsQ34ULw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtje ertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvd evieekueeftddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Jul 2024 22:50:13 -0400 (EDT) Message-ID: Date: Tue, 9 Jul 2024 05:50:12 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71727: Deleting TAGS buffer will cause `etags-regen--update-file` doesn't work To: Siyuan Chen References: Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71727 Cc: 71727@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.7 (-) Hi again! On 29/06/2024 14:49, Siyuan Chen wrote: > > Is there are particular reason you killed the TAGS buffer? > > No. I found this bug is just because I tried to view the TAGS content > while editing a .c file and then closed it (I am using tab-line-mode > with tab-line-close-tab-function set to kill-buffer). Since then, I have > stopped closing the TAGS buffer. Thanks for the clarification. > Another option is to temporarily add documentation advising users not to > close the TAGS buffer, because closing it accidentally can result in the > odd behavior. I think actually a simpler approach can suffice: using kill-buffer-hook in the TAGS buffer. Like this: diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el index dc778b14061..21ea9bfb8b3 100644 --- a/lisp/progmodes/etags-regen.el +++ b/lisp/progmodes/etags-regen.el @@ -294,7 +294,9 @@ etags-regen--visit-table (add-hook 'before-save-hook #'etags-regen--mark-as-new) (setq etags-regen--tags-file tags-file etags-regen--tags-root root) - (visit-tags-table etags-regen--tags-file)) + (visit-tags-table etags-regen--tags-file) + (with-current-buffer (get-file-buffer tags-file) + (add-hook 'kill-buffer-hook #'etags-regen--tags-cleanup nil t))) (defun etags-regen--ctags-p () (string-search "Ctags" @@ -390,7 +392,8 @@ etags-regen--mark-as-new (defun etags-regen--tags-cleanup () (when etags-regen--tags-file - (let ((buffer (get-file-buffer etags-regen--tags-file))) + (let ((buffer (get-file-buffer etags-regen--tags-file)) + kill-buffer-hook) (and buffer (kill-buffer buffer))) (tags-reset-tags-tables) From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 10 20:50:26 2024 Received: (at 71727-done) by debbugs.gnu.org; 11 Jul 2024 00:50:27 +0000 Received: from localhost ([127.0.0.1]:50594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRi0w-0007Ol-HD for submit@debbugs.gnu.org; Wed, 10 Jul 2024 20:50:26 -0400 Received: from fout6-smtp.messagingengine.com ([103.168.172.149]:55255) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRi0t-0007OY-Vh for 71727-done@debbugs.gnu.org; Wed, 10 Jul 2024 20:50:25 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 0D6BE138129A; Wed, 10 Jul 2024 20:50:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 10 Jul 2024 20:50:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1720659019; x=1720745419; bh=OR6iEekYIwFc3BooNHK3yRoZ0i/fdDupljDfNYX1API=; b= oHPUATYRm1HUXfzZvaIboFg1BCCNUN69NmCYk7dAcVZC6QOE2R0cMsEWr7DQhv0Z KWdrJPoFbdQJNU7HnGS8oIiuzPlZLWDgjaW0T6mHyJyu4SC9tMW8hvG+LR+VA9n8 uVZHb0KexyV+avIQ5voiHl+bg2ksU6A3rJ41LMHrMFLHXTeZXRbMWcwofS9nK7NT XyekQ9uDoWtZaGJ7pf3n7u9QBxy3Jzk5HFrPew+KN+6LmIOuMSNYI03X7fOShEx+ U8Wr7YmUEQjKDn1zTntui6vu+vM+8hDfo4sDQU57KmrtJ8BQrx1ZApPTF0vc2gNr pKVoq+v/jmPrAGpx/VcRww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720659019; x= 1720745419; bh=OR6iEekYIwFc3BooNHK3yRoZ0i/fdDupljDfNYX1API=; b=M AS5gSCKzaxcBfFPUKCd3Vm6Pu6Wxei9lfSVDVzLoQMas8UdxA/18ZBWVQt/SdZdt kKtXjeMxaXFIRlqhGEszXmxI8gcdn9+dWK58EV0pwIglZhA9eLWE48uq7VkDpYB7 P4PBB+hpl01XcTjbwacUtQ2m1oGvglb9EowbQePBZxMczT5XnA4dYtlFyXlnxMl1 /L7RUhdrXnLazGQjU0o4T1D/ygIaUzaqCcJMoK39aoOuONlXuub2hEAExomL82Cg o8/Z7NuydEnIXHgVrR2LDfR2IXx5ez7212nBezqAqFprbWiO8kyil2s8uRJ6/qTP jaxBrLcWAWamG+MWmMiNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrfeefgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffhvfevfhgjtgfgsehtke ertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnhepvdelieejveekjeelffegudeiudejff fhveduudffvdevteekgeevffejgfffleeunecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jul 2024 20:50:16 -0400 (EDT) Message-ID: Date: Thu, 11 Jul 2024 03:50:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71727: Deleting TAGS buffer will cause `etags-regen--update-file` doesn't work From: Dmitry Gutov To: Siyuan Chen References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71727-done Cc: 71727-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.7 (-) Now pushed to emacs-30, please report any further problems. On 09/07/2024 05:50, Dmitry Gutov wrote: > On 29/06/2024 14:49, Siyuan Chen wrote: >>  > Is there are particular reason you killed the TAGS buffer? >> >> No. I found this bug is just because I tried to view the TAGS content >> while editing a .c file and then closed it (I am using tab-line-mode >> with tab-line-close-tab-function set to kill-buffer). Since then, I >> have stopped closing the TAGS buffer. > > Thanks for the clarification. > >> Another option is to temporarily add documentation advising users not >> to close the TAGS buffer, because closing it accidentally can result >> in the odd behavior. > > I think actually a simpler approach can suffice: using kill-buffer-hook > in the TAGS buffer. Like this: > > diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el > index dc778b14061..21ea9bfb8b3 100644 > --- a/lisp/progmodes/etags-regen.el > +++ b/lisp/progmodes/etags-regen.el > @@ -294,7 +294,9 @@ etags-regen--visit-table >    (add-hook 'before-save-hook #'etags-regen--mark-as-new) >    (setq etags-regen--tags-file tags-file >          etags-regen--tags-root root) > -  (visit-tags-table etags-regen--tags-file)) > +  (visit-tags-table etags-regen--tags-file) > +  (with-current-buffer (get-file-buffer tags-file) > +    (add-hook 'kill-buffer-hook #'etags-regen--tags-cleanup nil t))) > >  (defun etags-regen--ctags-p () >    (string-search "Ctags" > @@ -390,7 +392,8 @@ etags-regen--mark-as-new > >  (defun etags-regen--tags-cleanup () >    (when etags-regen--tags-file > -    (let ((buffer (get-file-buffer etags-regen--tags-file))) > +    (let ((buffer (get-file-buffer etags-regen--tags-file)) > +          kill-buffer-hook) >        (and buffer >             (kill-buffer buffer))) >      (tags-reset-tags-tables) From unknown Sat Jun 21 10:37:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Aug 2024 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator