From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72329: Avoid recursion in gnus-message-citation-mode Date: Fri, 02 Aug 2024 10:27:54 +0300 Message-ID: <86y15fv0xx.fsf@gnu.org> References: <877cd62thb.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39115"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72329@debbugs.gnu.org To: Thuna , eric@ericabrahamsen.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 02 09:28:55 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sZmid-0009xa-6L for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Aug 2024 09:28:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZmiT-0003Yq-5v; Fri, 02 Aug 2024 03:28:45 -0400 Original-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 1sZmiS-0003Wk-KT for bug-gnu-emacs@gnu.org; Fri, 02 Aug 2024 03:28:44 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZmiS-0004IH-Ay for bug-gnu-emacs@gnu.org; Fri, 02 Aug 2024 03:28:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=8RJLcfiu5xGBlf6D50j2l/h6AjoANHLEc2KKZmh9V3E=; b=HtOOODSwm2BF2AF4Ywe7RoQlGhhNF7cNU5YQam4/FKjUP2bAHQ6d0U42Au66qi/UPUDPwfm6TVnPbzoN+nVp4H4aUfchBhJu1FyuvR4b6y4XFBYht3Xwhb0LUUqbcuKPXvAieI/S0mUSlZAGo3amjYdnCY74gd9mxuFwtA97GYxXnH0LFayFfpoFmysjfYXwZhVFPpTWxefQO+81zjEHD5JIGfxW8WB9hgC+ubLWUHAWgva5DEjdVdf2jEZQN2QjjTB31fJNqynDiGocZ7NLqlRWktxdC0XqYU8NP+oGuuVZfo9RPNrXkp3o+hS75LF2WL3ZtTar53iWM0sLcnmq6g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sZmik-0007TD-7X for bug-gnu-emacs@gnu.org; Fri, 02 Aug 2024 03:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Aug 2024 07:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72329 X-GNU-PR-Package: emacs Original-Received: via spool by 72329-submit@debbugs.gnu.org id=B72329.172258370328665 (code B ref 72329); Fri, 02 Aug 2024 07:29:02 +0000 Original-Received: (at 72329) by debbugs.gnu.org; 2 Aug 2024 07:28:23 +0000 Original-Received: from localhost ([127.0.0.1]:52239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZmi7-0007SH-8D for submit@debbugs.gnu.org; Fri, 02 Aug 2024 03:28:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZmi4-0007S3-J9 for 72329@debbugs.gnu.org; Fri, 02 Aug 2024 03:28:21 -0400 Original-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 1sZmhg-00049v-LZ; Fri, 02 Aug 2024 03:27:56 -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=8RJLcfiu5xGBlf6D50j2l/h6AjoANHLEc2KKZmh9V3E=; b=B5jvSM1Nquz3 XAow0hB9mfi0HF+rpC9PQPd3aYDsgnT3c6oPKXjcNDdgne6/MxmMUfscI8mLA8c5p8s3ryGpwnoWK YA4DDmqTS72h/86l8IAeg+E8F1vIXTEE+YXi4aXBe8YSjz2SyXV/x5INfdWTV7XP0v35kBBa4bKEj 7N86jZiTIoUTM24BWmiiw/lbIifO8NQYoDzbH5aDvW4VPPg5D1qgZIqqd+CaHj5YvpjJQ0V7TNuEU thh5FO8X3ZgVOWKt1iGWTFUtvzo0b+1l7vAVkHKzrVmvy0qr7QbQuvBO5ZRu+8j6wihP1Z7MAI0kk HybX8H+5UuaeCmsiwTrdzA==; In-Reply-To: <877cd62thb.fsf@gmail.com> (message from Thuna on Sun, 28 Jul 2024 03:30:40 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289631 Archived-At: > From: Thuna > Date: Sun, 28 Jul 2024 03:30:40 +0200 > > In `gnus-message-citation-mode' the > > (if (not font-lock-mode) > (gnus-message-citation-mode (font-lock-mode 1)) > ...) > > can lead to excessive nesting if font-lock-mode fails to be set (quick > enough or altogether). Changing this with > > (while (not font-lock-mode) (font-lock-mode 1)) > ... > > should be better, assuming it is necessary for `font-lock-mode' to be > called repeatedly, otherwise > > (font-lock-mode 1) > (while (not font-lock-mode)) > ... > > might also work, or simply > > (font-lock-mode 1) > ... > > if it is not necessary to wait. > > One possible problem with these arrangements is that it may be desirable > to error in case there is an issue which prevents font-lock-mode from > being set perpetually, in which case something like > > (font-lock-mode 1) > (with-timeout ( > (error "Failed to enable `font-lock-mode'.")) > (while (not font-lock-mode))) > ... > > might be preferable. Thanks. Eric, any comments or suggestions?