Accommodate new flymake variable name in Emacs 28+

This commit is contained in:
Jessie Hildebrandt 2021-09-03 07:42:56 -04:00
parent f96bca2323
commit 34a1304ede

View File

@ -291,7 +291,11 @@
(defun mood-line-segment-flymake () (defun mood-line-segment-flymake ()
"Displays information about the current status of flymake in the mode-line (if available)." "Displays information about the current status of flymake in the mode-line (if available)."
(when (and (boundp 'flymake-mode) flymake-mode) (when (and (boundp 'flymake-mode) flymake-mode)
(concat (mood-line--string-trim (format-mode-line flymake--mode-line-format)) " "))) ;; Depending on Emacs version, flymake stores the mode-line segment using one of two variable names
(let ((flymake-segment-format (if (boundp 'flymake-mode-line-format)
flymake-mode-line-format
flymake--mode-line-format)))
(concat (mood-line--string-trim (format-mode-line flymake-segment-format)) " "))))
(defun mood-line-segment-process () (defun mood-line-segment-process ()
"Displays the current value of `mode-line-process' in the mode-line." "Displays the current value of `mode-line-process' in the mode-line."