* Re: Mode line faces on ttys
2005-08-17 14:46 ` Juri Linkov
@ 2005-08-17 15:25 ` Romain Francoise
2005-08-17 16:36 ` Juri Linkov
2005-08-17 16:38 ` Juri Linkov
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Romain Francoise @ 2005-08-17 15:25 UTC (permalink / raw)
Cc: emacs-devel
Juri Linkov <juri@jurta.org> writes:
> This is correct. Since mode-line has the non-nil :inverse-video
> attribute, its foreground and background colors should be inverted.
I see, thanks for the explanation. It's somewhat confusing that setting
the face foreground actually changes the background on ttys--I
understand the logic, but it's surprising.
How are application writers supposed to handle this if they want the
mode line to "look similar" in X and on ttys? Use `face-inverse-video-p'
to invert values if needed?
> Since this change causes questions, maybe it should be mentioned in
> etc/NEWS?
Definitely.
--
Romain Francoise <romain@orebokech.com> | I used to think there is no
it's a miracle -- http://orebokech.com/ | future left at all.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Mode line faces on ttys
2005-08-17 15:25 ` Romain Francoise
@ 2005-08-17 16:36 ` Juri Linkov
2005-08-18 8:29 ` Romain Francoise
0 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2005-08-17 16:36 UTC (permalink / raw)
Cc: emacs-devel
>> This is correct. Since mode-line has the non-nil :inverse-video
>> attribute, its foreground and background colors should be inverted.
>
> I see, thanks for the explanation. It's somewhat confusing that setting
> the face foreground actually changes the background on ttys--I
> understand the logic, but it's surprising.
Perhaps the behavior of the :inverse-video face attribute is what is
confusing. It uses the swapped foreground and background colors for
actual display.
> How are application writers supposed to handle this if they want the
> mode line to "look similar" in X and on ttys? Use `face-inverse-video-p'
> to invert values if needed?
Application writers can specify the same face attributes on X and on
ttys. So if :inverse-video was off on X, turn it off on tty too, and
vice versa.
>> Since this change causes questions, maybe it should be mentioned in
>> etc/NEWS?
>
> Definitely.
In which NEWS section would you expect to find this fix?
Possible candidates:
* Lisp Changes in Emacs 22.1
** Face changes
or
* Incompatible Lisp Changes in Emacs 22.1
or
* Incompatible Editing Changes in Emacs 22.1
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Mode line faces on ttys
2005-08-17 14:46 ` Juri Linkov
2005-08-17 15:25 ` Romain Francoise
@ 2005-08-17 16:38 ` Juri Linkov
2005-08-18 21:15 ` Richard M. Stallman
2005-08-17 16:43 ` Juri Linkov
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2005-08-17 16:38 UTC (permalink / raw)
I've looked over the documentation of the functions that work with
the `:inverse-video' attribute in the Emacs Lisp Reference manual, and
I see that the documentation doesn't correspond to actual functions.
The description of `invert-face' is wrong, and `set-face-inverse-video-p'
is missing. I can install the following patch:
Index: lispref/display.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/display.texi,v
retrieving revision 1.180
diff -c -r1.180 display.texi
*** lispref/display.texi 11 Aug 2005 19:59:05 -0000 1.180
--- lispref/display.texi 17 Aug 2005 16:21:53 -0000
***************
*** 2288,2297 ****
Non-@code{nil} means do underline; @code{nil} means don't.
@end defun
@defun invert-face face &optional frame
! This function inverts the @code{:inverse-video} attribute of face
! @var{face}. If the attribute is @code{nil}, this function sets it to
! @code{t}, and vice versa.
@end defun
These functions examine the attributes of a face. If you don't
--- 2156,2169 ----
Non-@code{nil} means do underline; @code{nil} means don't.
@end defun
+ @defun set-face-inverse-video-p face inverse-video-p &optional frame
+ This function sets the @code{:inverse-video} attribute of face
+ @var{face}.
+ @end defun
+
@defun invert-face face &optional frame
! This function swaps the foreground and background colors of face
! @var{face}.
@end defun
These functions examine the attributes of a face. If you don't
***************
*** 2300,2306 ****
value for that attribute.
@defun face-foreground face &optional frame inherit
! @defunx face-background face &optional frame
These functions return the foreground color (or background color,
respectively) of face @var{face}, as a string.
--- 2172,2178 ----
value for that attribute.
@defun face-foreground face &optional frame inherit
! @defunx face-background face &optional frame inherit
These functions return the foreground color (or background color,
respectively) of face @var{face}, as a string.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Mode line faces on ttys
2005-08-17 14:46 ` Juri Linkov
2005-08-17 15:25 ` Romain Francoise
2005-08-17 16:38 ` Juri Linkov
@ 2005-08-17 16:43 ` Juri Linkov
2005-08-17 18:25 ` Eli Zaretskii
2005-08-18 14:47 ` Richard M. Stallman
4 siblings, 0 replies; 10+ messages in thread
From: Juri Linkov @ 2005-08-17 16:43 UTC (permalink / raw)
While looking at inverse-related functions , I noticed that there are
two duplicate functions in faces.el: `set-face-underline' and
`set-face-underline-p'. Since `set-face-underline-p' is documented in
the manual, so I assume that the correct name is `set-face-underline-p'.
The patch below deletes the function `set-face-underline' (with moving
its docstring to the `set-face-underline-p', because the docstring
of `set-face-underline' is more complete), and replaces
`set-face-underline' with an alias to `set-face-underline-p'.
Index: lisp/faces.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v
retrieving revision 1.333
diff -c -r1.333 faces.el
*** lisp/faces.el 6 Aug 2005 22:13:42 -0000 1.333
--- lisp/faces.el 17 Aug 2005 16:29:34 -0000
***************
*** 770,776 ****
(set-face-attribute face frame :stipple (or stipple 'unspecified)))
! (defun set-face-underline (face underline &optional frame)
"Specify whether face FACE is underlined.
UNDERLINE nil means FACE explicitly doesn't underline.
UNDERLINE non-nil means FACE explicitly does underlining
--- 770,776 ----
(set-face-attribute face frame :stipple (or stipple 'unspecified)))
! (defun set-face-underline-p (face underline-p &optional frame)
"Specify whether face FACE is underlined.
UNDERLINE nil means FACE explicitly doesn't underline.
UNDERLINE non-nil means FACE explicitly does underlining
***************
*** 781,800 ****
(interactive
(let ((list (read-face-and-attribute :underline)))
(list (car list) (eq (car (cdr list)) t))))
- (set-face-attribute face frame :underline underline))
-
-
- (defun set-face-underline-p (face underline-p &optional frame)
- "Specify whether face FACE is underlined.
- UNDERLINE-P nil means FACE explicitly doesn't underline.
- UNDERLINE-P non-nil means FACE explicitly does underlining.
- FRAME nil or not specified means change face on all frames.
- Use `set-face-attribute' to ``unspecify'' underlining."
- (interactive
- (let ((list (read-face-and-attribute :underline)))
- (list (car list) (eq (car (cdr list)) t))))
(set-face-attribute face frame :underline underline-p))
(defun set-face-inverse-video-p (face inverse-video-p &optional frame)
"Specify whether face FACE is in inverse video.
--- 781,791 ----
(interactive
(let ((list (read-face-and-attribute :underline)))
(list (car list) (eq (car (cdr list)) t))))
(set-face-attribute face frame :underline underline-p))
+ (define-obsolete-function-alias 'set-face-underline
+ 'set-face-underline-p "22.1")
+
(defun set-face-inverse-video-p (face inverse-video-p &optional frame)
"Specify whether face FACE is in inverse video.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Mode line faces on ttys
2005-08-17 14:46 ` Juri Linkov
` (2 preceding siblings ...)
2005-08-17 16:43 ` Juri Linkov
@ 2005-08-17 18:25 ` Eli Zaretskii
2005-08-18 14:47 ` Richard M. Stallman
4 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2005-08-17 18:25 UTC (permalink / raw)
Cc: romain, emacs-devel
> From: Juri Linkov <juri@jurta.org>
> Date: Wed, 17 Aug 2005 17:46:46 +0300
> Cc: emacs-devel@gnu.org
>
> Since this change causes questions, maybe it should be mentioned in
> etc/NEWS?
Hmm... we don't usually document bugfixes in NEWS.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Mode line faces on ttys
2005-08-17 14:46 ` Juri Linkov
` (3 preceding siblings ...)
2005-08-17 18:25 ` Eli Zaretskii
@ 2005-08-18 14:47 ` Richard M. Stallman
4 siblings, 0 replies; 10+ messages in thread
From: Richard M. Stallman @ 2005-08-18 14:47 UTC (permalink / raw)
Cc: romain, emacs-devel
Since this change causes questions, maybe it should be mentioned in
etc/NEWS?
I think it would be worth a brief mention, but please don't make
it precise and detailed. That would be too hard to read.
^ permalink raw reply [flat|nested] 10+ messages in thread