From: Heime <heimeborgia@protonmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Changing colour face for mode-line-buffer-identification
Date: Sat, 27 Jul 2024 13:04:34 +0000 [thread overview]
Message-ID: <GPD7vFzOtLgYCiiFxraB8QPyu9iy0W20hb9mKDvr-4rVRQFjoHHj4tcsJzuJ344I27PF0lqvt6LJBW6gbiwsvDPa0vgVUmdtFdmg0eIh3Zw=@protonmail.com> (raw)
In-Reply-To: <87wml7yqxu.fsf@web.de>
Sent with Proton Mail secure email.
On Sunday, July 28th, 2024 at 12:12 AM, Michael Heerdegen via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> Heime heimeborgia@protonmail.com writes:
>
> > I know about faces, but how do I include a different face to
> > propertized-buffer-identification. Or is the face to be applied
> > from another function ?
>
>
> Calling `propertized-buffer-identification' returns a one-element list containing the propertized string.` propertize' that string again to
> change the face.
>
> Unless the face should depend on the buffer or mode. This would be a
> different situation.
>
>
> Michael.
Have done this before but got an error
Debugger entered--Lisp error: (wrong-type-argument stringp (#(" %8b " 0 5 (face mode-line-buffer-id help-echo "Buffer name\nmouse-1: Previous buffer\nmouse-3: Next..." mouse-face mode-line-highlight local-map (keymap (header-line keymap (mouse-3 . mode-line-next-buffer) (down-mouse-3 . ignore) (mouse-1 . mode-line-previous-buffer) (down-mouse-1 . ignore)) (mode-line keymap (mouse-3 . mode-line-next-buffer) (mouse-1 . mode-line-previous-buffer)))))))
propertize((#(" %8b " 0 5 (face mode-line-buffer-id help-echo
(defface vodil-bfname-facespk
'((t :background "#ff4500" ; Orange Red
:foreground "#ffffff" ; White
:inherit bold))
"Face for displaying the Buffer Name in the Modeline of the
Active Window.")
(defface vodil-inaktv-facespk
`((t :background ,vodil-dark-gray ; "#222222"
:foreground ,vodil-light-gray)) ; "#888888"
"Face for displaying the Modeline in the Inactive Window.")
(defun vodil-bfname-face ()
"Return the appropriate face for the mode line based on window
selection."
(if (mode-line-window-selected-p)
'vodil-bfname-facespk
'vodil-inaktv-facespk))
(setq-default mode-line-buffer-identification
(list wmax
(propertize
(propertized-buffer-identification
(format " %%%db " wmin))
'face (vodil-bfname-face)))) ))
next prev parent reply other threads:[~2024-07-27 13:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 20:11 Changing colour face for mode-line-buffer-identification Heime
2024-07-26 20:32 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-27 9:43 ` Heime
2024-07-27 12:12 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-27 13:04 ` Heime [this message]
2024-07-27 14:13 ` Michael Heerdegen via Users list for the GNU Emacs text editor
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='GPD7vFzOtLgYCiiFxraB8QPyu9iy0W20hb9mKDvr-4rVRQFjoHHj4tcsJzuJ344I27PF0lqvt6LJBW6gbiwsvDPa0vgVUmdtFdmg0eIh3Zw=@protonmail.com' \
--to=heimeborgia@protonmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/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.
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).