Subject: bug#70049: 30.0.50; (server-running-p) in mode line freezes emacs

From: Stefan Kangas <[email-masked]>
Date: Sat, 1 Mar 2025 16:10:06 -0800

Pedro Andres Aranda Gutierrez <[email-masked]> writes:

> I think I bumped on (server-running-p), which doesn't seem
> to be very mode-line friendly.
> The workaround is working smoothly since I first reported.
> I'm using it on FreeBSD, Linux and macOS, emacs-30 and master.
>
> Feel free to include all this info in the documentation and close this bug,

IIUC, the workaround to get it working in the mode line is to redefine
`server-running-p' like so:

    (defun server-running-p()
       (and server-process (memq (process-status server-process)
                                 '(connect listen open run))))

There are some problems, for example I don't know where to document
this, or if that is safe enough to recommend (for example, will it break
something else).

In general, we don't guarantee that you can run arbitrary Lisp code in
the mode line without running into issues.  Maybe this is just one use
case that we don't support.  I'm leaning towards considering the
workaround as documented (in this bug report), and closing this as
wontfix.

Any other opinions here?