all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#72329: Avoid recursion in gnus-message-citation-mode
@ 2024-07-28  1:30 Thuna
  2024-08-02  7:27 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Thuna @ 2024-07-28  1:30 UTC (permalink / raw)
  To: 72329

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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-28  8:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-28  1:30 bug#72329: Avoid recursion in gnus-message-citation-mode Thuna
2024-08-02  7:27 ` Eli Zaretskii
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.