From: Heime <heimeborgia@protonmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Re: Introducing faces to mode-line-buffer-identification
Date: Tue, 30 Jul 2024 08:43:27 +0000 [thread overview]
Message-ID: <ZezC5-AJG1lzUwDjlXF9cpUVBicX66N9VV2VNbnKPIFf7Mi1J29cWiUdQpRn1kfYX4v5slRA9EbcygnArKSuRrQFSs6tsKSTWB51tJoKVA8=@protonmail.com> (raw)
In-Reply-To: <Z9fpnw9ScTzJSpLgiIDAnkosItH-tgZSwVlIYROIUtaoKHwzDLdVvzJGu8d8PFeQJ6TLv2aBnDQxSr-QGIIoje9IMwUiaoSMXds--PmpWa0=@protonmail.com>
On Tuesday, July 30th, 2024 at 6:42 PM, Heime <heimeborgia@protonmail.com> wrote:
> I have two faces, one for the active and another for an inactive window.
>
> (defface bfnap-facespk
> `((t :background ,vodil-orange-red :foreground ,vodil-white :inherit mode-line-buffer-id)) "Face for the modeline buffer identification name.") (defface inaktv-facespk` ((t :background ,vodil-dark-gray
> :foreground ,vodil-light-gray))
> "Face for displaying the Modeline in the Inactive Window.")
>
> (defun bfnap-face ()
> "Return the appropriate face for the mode line based on window
> selection."
>
> (if (mode-line-window-selected-p)
> 'bfnap-facespk
> 'inaktv-facespk))
>
> I want to adapt this customisation of the modeline buffer identification
> to use different background and foreground colours.
>
> (setq-default mode-line-buffer-identification
> `(:eval
> (let* ( (bfnm (buffer-name (window-buffer)))
> (tknm (if (> (length bfnm) ,wmax)
>
> (vodilac-ellipses bfnm ,wmax ,actm)
> bfnm)) )
>
> (propertized-buffer-identification (format " %s " tknm))))))
Have been scrutinising the application of propertize,
though the face is not changing.
(setq-default mode-line-buffer-identification
`(:eval
(let* ( (bfnm (buffer-name (window-buffer)))
(tknm (if (> (length bfnm) ,wmax)
(vodil-ellipses bfnm ,wmax ,actm)
bfnm)) )
(list (propertized-buffer-identification
(propertize (format " %s " tknm)
'face (bfnap-face)))) ))) )
prev parent reply other threads:[~2024-07-30 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 6:42 Introducing faces to mode-line-buffer-identification Heime
2024-07-30 8:43 ` Heime [this message]
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='ZezC5-AJG1lzUwDjlXF9cpUVBicX66N9VV2VNbnKPIFf7Mi1J29cWiUdQpRn1kfYX4v5slRA9EbcygnArKSuRrQFSs6tsKSTWB51tJoKVA8=@protonmail.com' \
--to=heimeborgia@protonmail.com \
--cc=help-gnu-emacs@gnu.org \
/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).