unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Introducing faces to mode-line-buffer-identification
@ 2024-07-30  6:42 Heime
  2024-07-30  8:43 ` Heime
  0 siblings, 1 reply; 2+ messages in thread
From: Heime @ 2024-07-30  6:42 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


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))))))



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Introducing faces to mode-line-buffer-identification
  2024-07-30  6:42 Introducing faces to mode-line-buffer-identification Heime
@ 2024-07-30  8:43 ` Heime
  0 siblings, 0 replies; 2+ messages in thread
From: Heime @ 2024-07-30  8:43 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

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)))) ))) )




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-30  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30  6:42 Introducing faces to mode-line-buffer-identification Heime
2024-07-30  8:43 ` Heime

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).