From unknown Mon Jun 23 13:11:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#75946 <75946@debbugs.gnu.org> To: bug#75946 <75946@debbugs.gnu.org> Subject: Status: [PATCH] Avoid infinite questions if TAGS file was removed Reply-To: bug#75946 <75946@debbugs.gnu.org> Date: Mon, 23 Jun 2025 20:11:14 +0000 retitle 75946 [PATCH] Avoid infinite questions if TAGS file was removed reassign 75946 emacs submitter 75946 Konstantin Kharlamov severity 75946 normal tag 75946 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 30 09:16:40 2025 Received: (at submit) by debbugs.gnu.org; 30 Jan 2025 14:16:40 +0000 Received: from localhost ([127.0.0.1]:45056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tdVLT-0000m2-Ov for submit@debbugs.gnu.org; Thu, 30 Jan 2025 09:16:40 -0500 Received: from lists.gnu.org ([2001:470:142::17]:60620) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tdVLJ-0000lS-LL for submit@debbugs.gnu.org; Thu, 30 Jan 2025 09:16:35 -0500 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 1tdVLC-0005aN-Mg for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2025 09:16:22 -0500 Received: from forward103a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tdVLA-0007pj-Ip for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2025 09:16:22 -0500 Received: from mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:5c26:0:640:c63e:0]) by forward103a.mail.yandex.net (Yandex) with ESMTPS id 0932D60FC7 for ; Thu, 30 Jan 2025 17:16:14 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id DGgsQw6OgeA0-8V24hjwJ; Thu, 30 Jan 2025 17:16:13 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1738246573; bh=GpkzYxgA3kbVYIXvntHWvM211C+BL2w8j1wfptu13dI=; h=Date:To:From:Subject:Message-ID; b=Fc9RLaB3J0DdN4x4euXgNc5RunFWLNbpA9GfA3WUZyVXyD8ETIkfMOil5arze2Pxs zKS1VAh1Yw339Cr2jKTsZBm3Qw8nIGfeLs27gZWX259ygg9bzPxkfZ8XZRzPzyCfxT Qr8Spy6/35pjEzXpYHrdYyJ8WjRZOSz6Xp4TwqSE= Authentication-Results: mail-nwsmtp-smtp-production-main-38.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: Subject: [PATCH] Avoid infinite questions if TAGS file was removed From: Konstantin Kharlamov To: bug-gnu-emacs@gnu.org Date: Thu, 30 Jan 2025 17:16:13 +0300 Content-Type: multipart/mixed; boundary="=-njgk/8VrSDeidGs6Y/W4" User-Agent: Evolution 3.54.3 MIME-Version: 1.0 Received-SPF: pass client-ip=2a02:6b8:c0e:500:1:45:d181:d103; envelope-from=Hi-Angel@yandex.ru; helo=forward103a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) 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: -0.0 (/) --=-njgk/8VrSDeidGs6Y/W4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When the visited TAGS file was removed, commands that depend on TAGS such as auto-completion may invoke an interactive question whether a user wants to re-read the file. From that point on, the question will be asked over and over, because the file no longer exists, which results in mtime mismatch and inability to "fix the mismatch" by reading from the file. Fix that by simply ignoring the mismatch if the file no longer exists. --=-njgk/8VrSDeidGs6Y/W4 Content-Disposition: attachment; filename="1.patch" Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name="1.patch"; charset="UTF-8" RnJvbSAxZTQ0ZTY2ZGI5MThiNzI1YWZkNWZjNWM5YjZjMDc3YzJkNjUzYWIwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLb25zdGFudGluIEtoYXJsYW1vdiA8SGktQW5nZWxAeWFuZGV4 LnJ1PgpEYXRlOiBUaHUsIDMwIEphbiAyMDI1IDE3OjA5OjQ4ICswMzAwClN1YmplY3Q6IFtQQVRD SF0gQXZvaWQgaW5maW5pdGUgcXVlc3Rpb25zIGlmIFRBR1MgZmlsZSB3YXMgcmVtb3ZlZAoKV2hl biB0aGUgdmlzaXRlZCBUQUdTIGZpbGUgd2FzIHJlbW92ZWQsIGNvbW1hbmRzIHRoYXQgZGVwZW5k IG9uIFRBR1MKc3VjaCBhcyBhdXRvLWNvbXBsZXRpb24gbWF5IGludm9rZSBhbiBpbnRlcmFjdGl2 ZSBxdWVzdGlvbiB3aGV0aGVyIGEKdXNlciB3YW50cyB0byByZS1yZWFkIHRoZSBmaWxlLiAgRnJv bSB0aGF0IHBvaW50IG9uLCB0aGUgcXVlc3Rpb24gd2lsbApiZSBhc2tlZCBvdmVyIGFuZCBvdmVy LCBiZWNhdXNlIHRoZSBmaWxlIG5vIGxvbmdlciBleGlzdHMsIHdoaWNoCnJlc3VsdHMgaW4gbXRp bWUgbWlzbWF0Y2ggYW5kIGluYWJpbGl0eSB0byAiZml4IHRoZSBtaXNtYXRjaCIgYnkKcmVhZGlu ZyBmcm9tIHRoZSBmaWxlLiAgRml4IHRoYXQgYnkgc2ltcGx5IGlnbm9yaW5nIHRoZSBtaXNtYXRj aCBpZgp0aGUgZmlsZSBubyBsb25nZXIgZXhpc3RzLgoKKiBsaXNwL3Byb2dtb2Rlcy9ldGFncy5l bCAodGFncy12ZXJpZnktdGFibGUpOiBBdm9pZCBpbmZpbml0ZQpxdWVzdGlvbnMgaWYgVEFHUyBm aWxlIHdhcyByZW1vdmVkCi0tLQogbGlzcC9wcm9nbW9kZXMvZXRhZ3MuZWwgfCAzICsrKwogMSBm aWxlIGNoYW5nZWQsIDMgaW5zZXJ0aW9ucygrKQoKZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVz L2V0YWdzLmVsIGIvbGlzcC9wcm9nbW9kZXMvZXRhZ3MuZWwKaW5kZXggMzUyMzU2ZGRiYzUuLjNi YjU1M2FiNTUwIDEwMDY0NAotLS0gYS9saXNwL3Byb2dtb2Rlcy9ldGFncy5lbAorKysgYi9saXNw L3Byb2dtb2Rlcy9ldGFncy5lbApAQCAtNDQ1LDYgKzQ0NSw5IEBAIHRhZ3MtdmVyaWZ5LXRhYmxl CiAJKHNldC1idWZmZXIgKGdldC1maWxlLWJ1ZmZlciBmaWxlKSkKICAgICAgICAgKG9yIHZlcmlm eS10YWdzLXRhYmxlLWZ1bmN0aW9uICh0YWdzLXRhYmxlLW1vZGUpKQogCSh1bmxlc3MgKG9yICh2 ZXJpZnktdmlzaXRlZC1maWxlLW1vZHRpbWUgKGN1cnJlbnQtYnVmZmVyKSkKKyAgICAgICAgICAg ICAgICAgICAgOzsgQXZvaWQgYW4gaW5maW50ZSBsb29wIG9mIHF1ZXN0aW9ucyBhYm91dAorICAg ICAgICAgICAgICAgICAgICA7OyByZS1yZWFkaW5nIGNvbnRlbnQgaWYgZmlsZSB3YXMgcmVtb3Zl ZC4KKyAgICAgICAgICAgICAgICAgICAgKG5vdCAoZmlsZS1leGlzdHMtcCBmaWxlKSkKIAkJICAg IDs7IERlY2lkZSB3aGV0aGVyIHRvIHJldmVydCB0aGUgZmlsZS4KIAkJICAgIDs7IHJldmVydC13 aXRob3V0LXF1ZXJ5IGNhbiBzYXkgdG8gcmV2ZXJ0CiAJCSAgICA7OyBvciB0aGUgdXNlciBjYW4g c2F5IHRvIHJldmVydC4KLS0gCjIuNDguMQoK --=-njgk/8VrSDeidGs6Y/W4-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 30 10:37:56 2025 Received: (at 75946) by debbugs.gnu.org; 30 Jan 2025 15:37:56 +0000 Received: from localhost ([127.0.0.1]:47271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tdWc7-0005Pr-Er for submit@debbugs.gnu.org; Thu, 30 Jan 2025 10:37:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55218) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tdWc4-0005Pa-QG for 75946@debbugs.gnu.org; Thu, 30 Jan 2025 10:37:53 -0500 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 1tdWbz-0002kz-3g; Thu, 30 Jan 2025 10:37:47 -0500 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=sesVGdRsOv09Wn0JePBECJlegr2/XvNNN6vOX/YIzZQ=; b=cCFfBsE2wjXA yVw47u4Q2yERiw2dDFXEkpN0aCrjT//XhMOTZ6jgKoNxAnFppbaiA78hitLRwA5ge9suTqy81qsGi +YJt5JJpcP8YLie6450NKevbCqv+EYigawIV5jXgWLPvN2VQl5rZogzXU7LZrhJwKmzc+rTSkTQwz UWBdREZ3AlJLSh7stVs2k/mYKAGlcx7HST0m9wWrDgRQC3IoXQSzPukWXQ8dWTKP5vcohZ6mlfE81 q7tuMMpB+LqMO/NNjCfpegJJhuSRtlz1sOc8smCx8EP/40ftFIep2EavCuJpsnSOMcP05+sFBNdZv 8/LLWP0imtxX3CxYZzvXwA==; Date: Thu, 30 Jan 2025 17:37:34 +0200 Message-Id: <86jzacjosh.fsf@gnu.org> From: Eli Zaretskii To: Konstantin Kharlamov In-Reply-To: (message from Konstantin Kharlamov on Thu, 30 Jan 2025 17:16:13 +0300) Subject: Re: bug#75946: [PATCH] Avoid infinite questions if TAGS file was removed References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75946 Cc: 75946@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: Konstantin Kharlamov > Date: Thu, 30 Jan 2025 17:16:13 +0300 > > When the visited TAGS file was removed, commands that depend on TAGS > such as auto-completion may invoke an interactive question whether a > user wants to re-read the file. From that point on, the question will > be asked over and over, because the file no longer exists, which > results in mtime mismatch and inability to "fix the mismatch" by > reading from the file. Fix that by simply ignoring the mismatch if > the file no longer exists. Thanks, but can you please show a recipe, starting from "emacs -Q", which could be used to reproduce this problem? From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 30 10:44:44 2025 Received: (at 75946) by debbugs.gnu.org; 30 Jan 2025 15:44:44 +0000 Received: from localhost ([127.0.0.1]:47328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tdWih-0005lR-Sx for submit@debbugs.gnu.org; Thu, 30 Jan 2025 10:44:44 -0500 Received: from forward502b.mail.yandex.net ([178.154.239.146]:51032) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tdWig-0005lA-92 for 75946@debbugs.gnu.org; Thu, 30 Jan 2025 10:44:43 -0500 Received: from mail-nwsmtp-smtp-production-main-78.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-78.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:5520:0:640:148d:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id F07CE613FB; Thu, 30 Jan 2025 18:44:32 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-78.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id VihbBN7OmeA0-kweSZCt4; Thu, 30 Jan 2025 18:44:32 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1738251872; bh=9khCRwvJUqeTOhcPK4i5qi0lLvbSoIrkNtlCuA1OPjA=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=w6CQdfCNJXs1pMTIDM7I+xoHApUQSVToKL2lLakRIi8CvRXnxUV+EQ/h0T3GHoxiR V8x+QRI3aq5bc2jO7ouNlteSuPnqFCJY5LP8iA88fm/CdXAOe+4ih4PtVkqbuMxuK9 nZQcuwHOoFv+h90qaH1zdeQj/pfLrLLAQ846tXP4= Authentication-Results: mail-nwsmtp-smtp-production-main-78.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: Subject: Re: bug#75946: [PATCH] Avoid infinite questions if TAGS file was removed From: Konstantin Kharlamov To: Eli Zaretskii Date: Thu, 30 Jan 2025 18:44:31 +0300 In-Reply-To: <86jzacjosh.fsf@gnu.org> References: <86jzacjosh.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75946 Cc: 75946@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 Thu, 2025-01-30 at 17:37 +0200, Eli Zaretskii wrote: > > From: Konstantin Kharlamov > > Date: Thu, 30 Jan 2025 17:16:13 +0300 > > > > When the visited TAGS file was removed, commands that depend on > > TAGS > > such as auto-completion may invoke an interactive question whether > > a > > user wants to re-read the file.=C2=A0 From that point on, the question > > will > > be asked over and over, because the file no longer exists, which > > results in mtime mismatch and inability to "fix the mismatch" by > > reading from the file.=C2=A0 Fix that by simply ignoring the mismatch i= f > > the file no longer exists. > > Thanks, but can you please show a recipe, starting from "emacs -Q", > which could be used to reproduce this problem? Sure. Idk of any Emacs tags auto-completion functions, but I don't it's par= ticularly important in the context. I use below a `(tags-completion-table)` instead. 1. Create empty tags `touch /tmp/TAGS` 2. Launch Emacs with `emacs -Q --eval '(visit-tags-table "/tmp/TAGS")'` 3. Remove the tags: `rm /tmp/TAGS` 4. In Emacs evaluate `(tags-completion-table)` You'll get the question if you want to re-read from TAGS file, and disregar= ding whether you reply "yes" or "no", each time you execute `(tags-completion-ta= ble)` again you'll get the prompt again and again. In autocompletion context it results in complete inability type text, becau= se the user gets spammed by the prompt on every letter. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 05:03:42 2025 Received: (at 75946) by debbugs.gnu.org; 1 Feb 2025 10:03:42 +0000 Received: from localhost ([127.0.0.1]:56447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1teALl-0005VT-Oz for submit@debbugs.gnu.org; Sat, 01 Feb 2025 05:03:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55704) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1teALj-0005VB-BM for 75946@debbugs.gnu.org; Sat, 01 Feb 2025 05:03:39 -0500 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 1teALd-0007t3-CJ; Sat, 01 Feb 2025 05:03:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=5Ki/+YJ0+sNPc7JWjFF62i8a8Dv2sebRruJkdYH1Umc=; b=ryQsCSGDvyeFiHOCuS8S Ax7OjvGojmf09kmX5x7WD/ZfbvulzDhKNcReUbqAlz4CmjwL0IYl0ijtcfK5a7TmkT6M9F7Zd7xq+ yzDVZRBeAGm4Nob6Wm4pmLoPpbd5ZuXFizqOO0yH5kjL87kwUryZrsXRtV2PtUKB9mSdXS9uoqEWz +hAFj3/ksC2FEkAErRTuy/Q6DpIEORxYTLG1eIbUEGdqBzOuNUUdwrnDY3SHFPrCCKYMnyKz46Wnb jxZWVx42M7/8HrHrIltpM+q37C8PzFJHXqZbL/9Gl0eAtIzBLoOrr+oqTYYZqHJD+B95NEA2j4bhm 2vG8aKGmBG+VCQ==; Date: Sat, 01 Feb 2025 12:03:28 +0200 Message-Id: <86ikpugexb.fsf@gnu.org> From: Eli Zaretskii To: Konstantin Kharlamov In-Reply-To: (message from Konstantin Kharlamov on Thu, 30 Jan 2025 18:44:31 +0300) Subject: Re: bug#75946: [PATCH] Avoid infinite questions if TAGS file was removed References: <86jzacjosh.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75946 Cc: 75946@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: Konstantin Kharlamov > Cc: 75946@debbugs.gnu.org > Date: Thu, 30 Jan 2025 18:44:31 +0300 > > On Thu, 2025-01-30 at 17:37 +0200, Eli Zaretskii wrote: > > > From: Konstantin Kharlamov > > > Date: Thu, 30 Jan 2025 17:16:13 +0300 > > > > > > When the visited TAGS file was removed, commands that depend on > > > TAGS > > > such as auto-completion may invoke an interactive question whether > > > a > > > user wants to re-read the file.  From that point on, the question > > > will > > > be asked over and over, because the file no longer exists, which > > > results in mtime mismatch and inability to "fix the mismatch" by > > > reading from the file.  Fix that by simply ignoring the mismatch if > > > the file no longer exists. > > > > Thanks, but can you please show a recipe, starting from "emacs -Q", > > which could be used to reproduce this problem? > > Sure. Idk of any Emacs tags auto-completion functions, but I don't it's particularly > important in the context. I use below a `(tags-completion-table)` instead. > > 1. Create empty tags `touch /tmp/TAGS` > 2. Launch Emacs with `emacs -Q --eval '(visit-tags-table "/tmp/TAGS")'` > 3. Remove the tags: `rm /tmp/TAGS` > 4. In Emacs evaluate `(tags-completion-table)` > > You'll get the question if you want to re-read from TAGS file, and disregarding > whether you reply "yes" or "no", each time you execute `(tags-completion-table)` > again you'll get the prompt again and again. When I repeat these steps, Emacs signals an error: (error "File .../TAGS no longer exists!") This comes from revert-buffer, called by tags-verify-table. I wonder why you see something different. > In autocompletion context it results in complete inability type text, because the > user gets spammed by the prompt on every letter. Maybe the autocompletion runs with ignore-errors or something? As for your patch: verify-visited-file-modtime returns t for files that never existed -- is that case covered by the patch? Maybe we should text file-exists-p before calling verify-visited-file-modtime? From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 05:16:28 2025 Received: (at 75946) by debbugs.gnu.org; 1 Feb 2025 10:16:28 +0000 Received: from localhost ([127.0.0.1]:56462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1teAY8-00068d-6m for submit@debbugs.gnu.org; Sat, 01 Feb 2025 05:16:28 -0500 Received: from forward501a.mail.yandex.net ([178.154.239.81]:40042) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1teAY5-00068C-9y for 75946@debbugs.gnu.org; Sat, 01 Feb 2025 05:16:26 -0500 Received: from mail-nwsmtp-smtp-production-main-51.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-51.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0f:2f03:0:640:5d54:0]) by forward501a.mail.yandex.net (Yandex) with ESMTPS id DC8D461391; Sat, 1 Feb 2025 13:16:16 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-51.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id FGea0O5OgeA0-Jfot6aqN; Sat, 01 Feb 2025 13:16:16 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1738404976; bh=aShUV23p03ZSke8Iuo84QJXm+ekxlPcmNo2fQ1wo6IA=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=QQYYektpxSjlcW2Pdk4FYwHjjkRLBCJDQ2/MNlojWb2T0TIxbMA4dqrxvf2KSikyP /5GAVkp8jXQTrT3bV/Xd6leXMRfd25uGz211vZ7w7A+wJZiEKkaNp4bgysmGt4uEPp //oe3u9diVLQECX4bBJpxKm+pSk+w1pZFLIJsd1s= Authentication-Results: mail-nwsmtp-smtp-production-main-51.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <0b4f4ef979ee52d1e832d0ebdf8a18d11965b2f0.camel@yandex.ru> Subject: Re: bug#75946: [PATCH] Avoid infinite questions if TAGS file was removed From: Konstantin Kharlamov To: Eli Zaretskii Date: Sat, 01 Feb 2025 13:16:15 +0300 In-Reply-To: <86ikpugexb.fsf@gnu.org> References: <86jzacjosh.fsf@gnu.org> <86ikpugexb.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75946 Cc: 75946@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 Sat, 2025-02-01 at 12:03 +0200, Eli Zaretskii wrote: > > From: Konstantin Kharlamov > > Cc: 75946@debbugs.gnu.org > > Date: Thu, 30 Jan 2025 18:44:31 +0300 > >=20 > > On Thu, 2025-01-30 at 17:37 +0200, Eli Zaretskii wrote: > > > > From: Konstantin Kharlamov > > > > Date: Thu, 30 Jan 2025 17:16:13 +0300 > > > >=20 > > > > When the visited TAGS file was removed, commands that depend on > > > > TAGS > > > > such as auto-completion may invoke an interactive question > > > > whether > > > > a > > > > user wants to re-read the file.=C2=A0 From that point on, the > > > > question > > > > will > > > > be asked over and over, because the file no longer exists, > > > > which > > > > results in mtime mismatch and inability to "fix the mismatch" > > > > by > > > > reading from the file.=C2=A0 Fix that by simply ignoring the > > > > mismatch if > > > > the file no longer exists. > > >=20 > > > Thanks, but can you please show a recipe, starting from "emacs - > > > Q", > > > which could be used to reproduce this problem? > >=20 > > Sure. Idk of any Emacs tags auto-completion functions, but I don't > > it's particularly > > important in the context. I use below a `(tags-completion-table)` > > instead. > >=20 > > 1. Create empty tags `touch /tmp/TAGS` > > 2. Launch Emacs with `emacs -Q --eval '(visit-tags-table > > "/tmp/TAGS")'` > > 3. Remove the tags: `rm /tmp/TAGS` > > 4. In Emacs evaluate `(tags-completion-table)` > >=20 > > You'll get the question if you want to re-read from TAGS file, and > > disregarding > > whether you reply "yes" or "no", each time you execute `(tags- > > completion-table)` > > again you'll get the prompt again and again. >=20 > When I repeat these steps, Emacs signals an error: >=20 > =C2=A0 (error "File .../TAGS no longer exists!") >=20 > This comes from revert-buffer, called by tags-verify-table.=C2=A0 I wonde= r > why you see something different. Correct, I see the same thing. The error isn't a problem (a user likely knows the file was deleted), the problem is that every time you execute the function you'll be getting the question over and over, and you can't do anything with that. > > In autocompletion context it results in complete inability type > > text, because the > > user gets spammed by the prompt on every letter. >=20 > Maybe the autocompletion runs with ignore-errors or something? Sorry, maybe I was unclear. Triggering autocompletion works same way as triggering `(tags-completion-table)` in the example above: you get a question, you might answer "yes" or "no", but disregarding what you answer, the next time it's triggered you'll get the question again. But the problem is more prominent with autocompletion compared to manually calling the function above, because completion is triggered on every key you typing, so you get basically get spammed by these questions. It isn't something serious, it's just an annoyance a user have to work around somehow, but I figured it is an easy one to fix so decided to send the patch =F0=9F=98=8A > As for your patch: verify-visited-file-modtime returns t for files > that never existed -- is that case covered by the patch?=C2=A0 Maybe we > should text file-exists-p before calling verify-visited-file-modtime? I don't have strong preference, but given that order doesn't matter too much, I put the `(file-exists-p)` after the `(verify-visited-file- modtime)` check because it seems the case where TAGS file is deleted is an unlikely one. So basically I micro-optimized the order in preference of the more likely case. And the diff is also one line shorter =F0=9F=98=8A But if you prefer, I can swap the order =F0=9F=98=8A From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 08:46:24 2025 Received: (at 75946-done) by debbugs.gnu.org; 1 Feb 2025 13:46:24 +0000 Received: from localhost ([127.0.0.1]:57060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1teDpH-0005T8-EI for submit@debbugs.gnu.org; Sat, 01 Feb 2025 08:46:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35628) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1teDpE-0005Sm-RP for 75946-done@debbugs.gnu.org; Sat, 01 Feb 2025 08:46:21 -0500 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 1teDp9-0003uX-Ef; Sat, 01 Feb 2025 08:46:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=5oOmmGHRF5c3+ri7cQqaEK6bccTHaTGhTxlEyAJLxSk=; b=mvqLAVrwHRvf/wcl44Fh LAEkz9WJKS+sZFi7HEIIih1DaiqPBEsnzTiogGpfhQ4KLWDRYTeV5q/e9oOlc35lAel4lVG4jHV5s orwSPTmQX/cyaItJasW6bCAZAdHH1CDuaWZ8Kl7kLTX8YmUzrBeuBM+cpEU4T7Uqi8yFoxjubzgTh SyrHQ2naG0+7codXFLVlEsfP+VieREW4EBbHuEqjn0IWGdQhzvge0bcxmuQrx7u2da9ZByDa4VnL+ jy2vyvRFDfyt8NCgiCnb3VIxFIwoIkCszYVcSGB+P3njM2FsS3crmqLci3iXAjkCN5AM0kM7r9jDm siLDeUhNarny3A==; Date: Sat, 01 Feb 2025 15:46:11 +0200 Message-Id: <861pwhg4m4.fsf@gnu.org> From: Eli Zaretskii To: Konstantin Kharlamov In-Reply-To: <0b4f4ef979ee52d1e832d0ebdf8a18d11965b2f0.camel@yandex.ru> (message from Konstantin Kharlamov on Sat, 01 Feb 2025 13:16:15 +0300) Subject: Re: bug#75946: [PATCH] Avoid infinite questions if TAGS file was removed References: <86jzacjosh.fsf@gnu.org> <86ikpugexb.fsf@gnu.org> <0b4f4ef979ee52d1e832d0ebdf8a18d11965b2f0.camel@yandex.ru> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 75946-done Cc: 75946-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: -3.3 (---) > From: Konstantin Kharlamov > Cc: 75946@debbugs.gnu.org > Date: Sat, 01 Feb 2025 13:16:15 +0300 > > On Sat, 2025-02-01 at 12:03 +0200, Eli Zaretskii wrote: > > > From: Konstantin Kharlamov > > > Cc: 75946@debbugs.gnu.org > > > Date: Thu, 30 Jan 2025 18:44:31 +0300 > > > > > > On Thu, 2025-01-30 at 17:37 +0200, Eli Zaretskii wrote: > > > > > From: Konstantin Kharlamov > > > > > Date: Thu, 30 Jan 2025 17:16:13 +0300 > > > > > > > > > > When the visited TAGS file was removed, commands that depend on > > > > > TAGS > > > > > such as auto-completion may invoke an interactive question > > > > > whether > > > > > a > > > > > user wants to re-read the file.  From that point on, the > > > > > question > > > > > will > > > > > be asked over and over, because the file no longer exists, > > > > > which > > > > > results in mtime mismatch and inability to "fix the mismatch" > > > > > by > > > > > reading from the file.  Fix that by simply ignoring the > > > > > mismatch if > > > > > the file no longer exists. > > > > > > > > Thanks, but can you please show a recipe, starting from "emacs - > > > > Q", > > > > which could be used to reproduce this problem? > > > > > > Sure. Idk of any Emacs tags auto-completion functions, but I don't > > > it's particularly > > > important in the context. I use below a `(tags-completion-table)` > > > instead. > > > > > > 1. Create empty tags `touch /tmp/TAGS` > > > 2. Launch Emacs with `emacs -Q --eval '(visit-tags-table > > > "/tmp/TAGS")'` > > > 3. Remove the tags: `rm /tmp/TAGS` > > > 4. In Emacs evaluate `(tags-completion-table)` > > > > > > You'll get the question if you want to re-read from TAGS file, and > > > disregarding > > > whether you reply "yes" or "no", each time you execute `(tags- > > > completion-table)` > > > again you'll get the prompt again and again. > > > > When I repeat these steps, Emacs signals an error: > > > >   (error "File .../TAGS no longer exists!") > > > > This comes from revert-buffer, called by tags-verify-table.  I wonder > > why you see something different. > > Correct, I see the same thing. The error isn't a problem (a user likely > knows the file was deleted), the problem is that every time you execute > the function you'll be getting the question over and over, and you > can't do anything with that. > > > > In autocompletion context it results in complete inability type > > > text, because the > > > user gets spammed by the prompt on every letter. > > > > Maybe the autocompletion runs with ignore-errors or something? > > Sorry, maybe I was unclear. Triggering autocompletion works same way as > triggering `(tags-completion-table)` in the example above: you get a > question, you might answer "yes" or "no", but disregarding what you > answer, the next time it's triggered you'll get the question again. But > the problem is more prominent with autocompletion compared to manually > calling the function above, because completion is triggered on every > key you typing, so you get basically get spammed by these questions. It > isn't something serious, it's just an annoyance a user have to work > around somehow, but I figured it is an easy one to fix so decided to > send the patch 😊 > > > As for your patch: verify-visited-file-modtime returns t for files > > that never existed -- is that case covered by the patch?  Maybe we > > should text file-exists-p before calling verify-visited-file-modtime? > > I don't have strong preference, but given that order doesn't matter too > much, I put the `(file-exists-p)` after the `(verify-visited-file- > modtime)` check because it seems the case where TAGS file is deleted is > an unlikely one. So basically I micro-optimized the order in preference > of the more likely case. And the diff is also one line shorter 😊 > > But if you prefer, I can swap the order 😊 No need, I've now installed the patch on the master branch, and I'm therefore closing the bug. Thanks. From unknown Mon Jun 23 13:11:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Mar 2025 12:24:20 +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