emacs-devel
[Top][All Lists]
Advanced

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

Re: inactive-mode-line face?


From: Eli Zaretskii
Subject: Re: inactive-mode-line face?
Date: Sat, 09 Feb 2002 11:37:09 +0200

> From: address@hidden (Kim F. Storm)
> Date: 09 Feb 2002 01:09:27 +0100
> 
> I just added a new mode-line-inactive face for non-selected windows.

Did it really compile without any warnings and work for you?  I find
that I need the additional changes below to make it compile and work.
(I installed these changes.)

> > Also, there could be complications with code that switches windows
> > temporarily (I'm not sure we want the active mode line to follow
> > that).
> 
> I haven't seen such problems, so don't hesitate to tell me if you find
> any!

Well, one problem is that all the windows become inactive when you are
in the minibuffer.  That is, as soon as you type "M-x" or "C-x C-f",
all the mode lines become displayed in the inactive face.  This might
be regarded as a feature, but perhaps users would like to know what
window is active even when they are typing at the minibuffer prompt.

Also, I wonder whether the default for this face should really be
different from the mode-line face.  Perhaps we want that by default
this feature is invisible; if so, the default face definitions should
just inherit from the mode-line face.

Here are the changes I installed:

Index: src/dispextern.h
===================================================================
RCS file: /cvs/emacs/src/dispextern.h,v
retrieving revision 1.124
diff -u -r1.124 dispextern.h
--- src/dispextern.h    8 Feb 2002 23:48:50 -0000       1.124
+++ src/dispextern.h    9 Feb 2002 09:09:20 -0000
@@ -927,7 +927,7 @@
    This depends on whether the window is selected or not.  */
 
 #define CURRENT_MODE_LINE_FACE_ID(W)           \
-     ((W) == selected_window                   \
+     ((W) == XWINDOW (selected_window)         \
       ? MODE_LINE_FACE_ID                      \
       : MODE_LINE_INACTIVE_FACE_ID)
 

Index: src/xdisp.c
===================================================================
RCS file: /cvs/emacs/src/xdisp.c,v
retrieving revision 1.724
diff -u -r1.724 xdisp.c
--- src/xdisp.c 8 Feb 2002 23:48:02 -0000       1.724
+++ src/xdisp.c 9 Feb 2002 09:15:34 -0000
@@ -13433,8 +13433,10 @@
 
   if (WINDOW_WANTS_MODELINE_P (w))
     {
+      struct window *old_w = XWINDOW (old_selected_window);
+
       /* Select mode line face based on the real selected window.  */
-      display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (old_selected_window),
+      display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (old_w),
                         current_buffer->mode_line_format);
       ++n;
     }



reply via email to

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