Subject: bug#53629: 27.1: add option to change face `mode-line-buffer-id` when mode-line is inactive

From: martin rudalics <[email-masked]>
Date: Sat, 5 Feb 2022 08:47:13 +0100

> Thanks martin, but it seems that the behavior did not change. Any ideas?

I disregarded the useless complication that 'minibuffer-selected-window'
returns nil when the selected window is not a minibuffer window.  Please
try the below.

martin

(defun my-buffer-identification (fmt)
   (list (propertize
	 fmt
	 'face (if (let ((window (selected-window)))
		     (or (eq window (old-selected-window))
			 (and (minibuffer-window-active-p (minibuffer-window))
			      (with-selected-window (minibuffer-window)
				(eq window (minibuffer-selected-window))))))
		   'error
		 'mode-line-buffer-id)
	 'mouse-face 'mode-line-highlight
	 'local-map mode-line-buffer-identification-keymap)))

(setq-default mode-line-buffer-identification
	      '(:eval (my-buffer-identification "%12b")))