From: Eli Zaretskii <eliz@gnu.org>
To: Thuna <thuna.cing@gmail.com>, eric@ericabrahamsen.net
Cc: 72329@debbugs.gnu.org
Subject: bug#72329: Avoid recursion in gnus-message-citation-mode
Date: Fri, 02 Aug 2024 10:27:54 +0300 [thread overview]
Message-ID: <86y15fv0xx.fsf@gnu.org> (raw)
In-Reply-To: <877cd62thb.fsf@gmail.com> (message from Thuna on Sun, 28 Jul 2024 03:30:40 +0200)
> From: Thuna <thuna.cing@gmail.com>
> 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 (<however-long-before-giving-up>
> (error "Failed to enable `font-lock-mode'."))
> (while (not font-lock-mode)))
> ...
>
> might be preferable.
Thanks.
Eric, any comments or suggestions?
next prev parent reply other threads:[~2024-08-02 7:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-28 1:30 bug#72329: Avoid recursion in gnus-message-citation-mode Thuna
2024-08-02 7:27 ` Eli Zaretskii [this message]
2024-08-17 7:29 ` Eli Zaretskii
2024-08-31 7:56 ` Eli Zaretskii
2024-09-14 7:33 ` Eli Zaretskii
2024-09-28 8:48 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86y15fv0xx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=72329@debbugs.gnu.org \
--cc=eric@ericabrahamsen.net \
--cc=thuna.cing@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).