From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Changing colour face for mode-line-buffer-identification Date: Sat, 27 Jul 2024 13:04:34 +0000 Message-ID: References: <0gwKIdfuetF3gaLVrK01O8vvP8m0wAbEBuFl3dJ8Jo4a2iI1hwW5COEtHjO0C40gssuuOJ4jVvsvAeChgBsG_-uvxZ3XnpwJ0LJha2DWho8=@protonmail.com> <878qxn28u2.fsf@web.de> <87wml7yqxu.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15320"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 27 15:05:18 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sXh6s-0003og-12 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 27 Jul 2024 15:05:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXh6R-0006zU-91; Sat, 27 Jul 2024 09:04:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXh6P-0006yu-6r for help-gnu-emacs@gnu.org; Sat, 27 Jul 2024 09:04:49 -0400 Original-Received: from mail-43166.protonmail.ch ([185.70.43.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXh6N-0000U1-9E for help-gnu-emacs@gnu.org; Sat, 27 Jul 2024 09:04:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722085480; x=1722344680; bh=XP8WuM/OfYDPNXu9U3xWHOkNM1aKu/89x40fTGhuHpI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=f9K/8wlocfxL/Ry1pBr6sxyHftjT36haWmXQW5GvPLXevP+MXrCputtbjTi0OqEMQ upA/z9hu2QV5TW6jTHABA5V32YQMRLmivMGVUmID7fYw8W1UnELy0vUgloqTk8fiXN IJw+D4j/649CUoCEVLtC6Ff5RQdwsPu5mFTgEr488V+nm7AxSN+JkqAQonWl0yk27o hgnHrmQ0qvedxy1Mjf+7McrMRFZHtWZ88PHMViu7/TDWd++6h8qWi3nmWAa9o/s2mC mTIHqZgjMQuJ2/HT8IwQErkNNSItJsK/C8RkM5Iv9F+j6GI/8Ui1FzF3tlXQXnWsLj qBhJlSXwya7PA== In-Reply-To: <87wml7yqxu.fsf@web.de> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 8ef2af46dbb3e51422fb2281b0f9dd293d4c2124 Received-SPF: pass client-ip=185.70.43.166; envelope-from=heimeborgia@protonmail.com; helo=mail-43166.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147398 Archived-At: Sent with Proton Mail secure email. On Sunday, July 28th, 2024 at 12:12 AM, Michael Heerdegen via Users list fo= r the GNU Emacs text editor wrote: > Heime heimeborgia@protonmail.com writes: >=20 > > 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 ? >=20 >=20 > Calling `propertized-buffer-identification' returns a one-element list co= ntaining the propertized string.` propertize' that string again to > change the face. >=20 > Unless the face should depend on the buffer or mode. This would be a > different situation. >=20 >=20 > 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\n= mouse-3: Next..." mouse-face mode-line-highlight local-map (keymap (header-= line keymap (mouse-3 . mode-line-next-buffer) (down-mouse-3 . ignore) (mous= e-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)))) ))