unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thuna <thuna.cing@gmail.com>
To: 72329@debbugs.gnu.org
Subject: bug#72329: Avoid recursion in gnus-message-citation-mode
Date: Sun, 28 Jul 2024 03:30:40 +0200	[thread overview]
Message-ID: <877cd62thb.fsf@gmail.com> (raw)

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.





             reply	other threads:[~2024-07-28  1:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28  1:30 Thuna [this message]
2024-08-02  7:27 ` bug#72329: Avoid recursion in gnus-message-citation-mode Eli Zaretskii
2024-08-17  7:29   ` Eli Zaretskii
2024-08-31  7:56     ` Eli Zaretskii
2024-09-14  7:33       ` 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=877cd62thb.fsf@gmail.com \
    --to=thuna.cing@gmail.com \
    --cc=72329@debbugs.gnu.org \
    /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).