bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57652: 29.0.50; Warning setting attribute of face ‘term’


From: David Ponce
Subject: bug#57652: 29.0.50; Warning setting attribute of face ‘term’
Date: Thu, 8 Sep 2022 10:43:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1

On 08/09/2022 10:22, David Ponce wrote:
On 08/09/2022 07:02, Po Lu wrote:
David Ponce <da_vid@orange.fr> writes:

diff --git a/term.el b/term.el
index 797fb18074..c564a5429a 100644
--- a/term.el
+++ b/term.el
@@ -755,17 +755,19 @@ ansi-term-color-vector
     term-color-bright-cyan
     term-color-bright-white])

-(defcustom term-default-fg-color nil
-  "If non-nil, default color for foreground in Term mode."
+(defcustom term-default-fg-color 'unspecified
+  "Default color for foreground in Term mode."
    :group 'term
-  :type '(choice (const nil) (string :tag "color")))
+  :type '(choice (const unspecified)
+                 (string :tag "color")))

Doesn't that change behavior?

i.e. wouldn't it be better to test that term-default-fg-color is not nil
wherever the face is actually made that color?

To be honest I don't know.  I reread the spec that says:

    "Apart from the values given below, each face attribute can have the
value ‘unspecified’.  This special value means that the face doesn’t
specify that attribute directly.  An ‘unspecified’ attribute tells Emacs
to refer instead to a parent face (see the description ‘:inherit’
attribute below); or, failing that, to an underlying face (*note
Displaying Faces::).  (However, ‘unspecified’ is not a valid value in
‘defface’.)"

So it seems that unspecified is not allowed in defface.  So, how to specify a missing attribute excepted by using nil in the defface used in term.el?

(defface term
   `((t
      :foreground ,term-default-fg-color
      :background ,term-default-bg-color
      :inherit default))
   "Default face to use in Term mode."
   :group 'term)

Thanks!


Also it seems that nil attribute is allowed in some cases in defface, because when I show the definition of the default face as a lisp expression I get:

((t
(:family "Source Code Pro" :foundry "ADBO" :width normal :height 102 :weight regular :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "black" :background "white" :stipple nil :inherit nil)))

Thanks!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]