unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Changing mode-line-inactive
@ 2002-02-09 20:00 Karl Eichwalder
  2002-02-09 20:38 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Eichwalder @ 2002-02-09 20:00 UTC (permalink / raw)


Emacs doesn't see mode-line-inactive changes immediately.  Split your
window (C-x 2) and change mode-line-inactive:

    (copy-face 'mode-line 'mode-line-inactive)

The mode-line of the inactive window stays unchanged.  Even after C-x 1
and C-x 2.  Than create an new frame and with a sudden mode-lines of
the old frame change as desired.

The new frame does not inherit the new setting but that's probably a
different issue.

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-09 20:00 Changing mode-line-inactive Karl Eichwalder
@ 2002-02-09 20:38 ` Eli Zaretskii
  2002-02-11  2:09   ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2002-02-09 20:38 UTC (permalink / raw)
  Cc: emacs-devel

> From: Karl Eichwalder <ke@gnu.franken.de>
> Date: Sat, 09 Feb 2002 21:00:25 +0100
> 
> Emacs doesn't see mode-line-inactive changes immediately.  Split your
> window (C-x 2) and change mode-line-inactive:
> 
>     (copy-face 'mode-line 'mode-line-inactive)
> 
> The mode-line of the inactive window stays unchanged.

Did it ever worked differently?  I mean, if you copy-face some face
into mode-line face in Emacs 21.1, does the mode line change
immediately?

I think faces are recomputed only on certain occasions, and otherwise
cached and delivered from the cache.

> The new frame does not inherit the new setting but that's probably a
> different issue.

I think this is expected: faces are frame-specific.  If you want the
change on all frames, use set-face-attribute.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-09 20:38 ` Eli Zaretskii
@ 2002-02-11  2:09   ` Richard Stallman
  2002-02-11  6:45     ` Eli Zaretskii
  2002-02-11  7:56     ` Karl Eichwalder
  0 siblings, 2 replies; 10+ messages in thread
From: Richard Stallman @ 2002-02-11  2:09 UTC (permalink / raw)
  Cc: keichwa, emacs-devel

Face changes do not happen often and they always go through certain
code.  So any face change should clear caches, force redisplay, or
whatever it takes so that the change takes immediate effect.

Is this not generally true now?  If so, what other cases fail?
Can someone figure out how to make it work?


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-11  2:09   ` Richard Stallman
@ 2002-02-11  6:45     ` Eli Zaretskii
  2002-02-12 15:24       ` Richard Stallman
  2002-02-11  7:56     ` Karl Eichwalder
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2002-02-11  6:45 UTC (permalink / raw)
  Cc: keichwa, emacs-devel


On Sun, 10 Feb 2002, Richard Stallman wrote:

> Face changes do not happen often and they always go through certain
> code.  So any face change should clear caches, force redisplay, or
> whatever it takes so that the change takes immediate effect.
> 
> Is this not generally true now?

I think it still is.

I never tried to use copy-face in my customizations, so I don't know 
whether it should automatically clear the face caches.  Perhaps it 
shouldn't.

> If so, what other cases fail?

I'm not sure what was reported is a failure.

> Can someone figure out how to make it work?

I don't know of any way except force the face caches to be cleared,
e.g., with a call to clear-face-cache.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-11  2:09   ` Richard Stallman
  2002-02-11  6:45     ` Eli Zaretskii
@ 2002-02-11  7:56     ` Karl Eichwalder
  2002-02-11  9:33       ` Kim F. Storm
  1 sibling, 1 reply; 10+ messages in thread
From: Karl Eichwalder @ 2002-02-11  7:56 UTC (permalink / raw)
  Cc: eliz, emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Is this not generally true now?

The inactive mode line doesn't see the change; calling something like
switch-to-buffer will propagate it.  Maybe, it is not necessary to care
about it as long as there's a recipe how to disable this new feature.
Is it enough to add to this fragment to .emacs:

    (copy-face 'mode-line 'mode-line-inactive)


Eli Zaretskii <eliz@is.elta.co.il> writes:

> I never tried to use copy-face in my customizations,

Whenever I try to improve face I use it a lot.  Admittedly, I stopped to
change the mode line appearance once I figured out these settings are
good for my needs:

    (set-face-font 'modeline
                   "-*-helvetica-medium-r-normal--12-*-*-*-p-*-iso8859-*")
    (set-face-background 'modeline "lightgrey")

At the moment I'm inclined to believe I should drop the 3D look to gain
one more pixel.

> I'm not sure what was reported is a failure.

It's all archived :)

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-11  7:56     ` Karl Eichwalder
@ 2002-02-11  9:33       ` Kim F. Storm
  2002-02-12 15:23         ` Richard Stallman
  2002-02-12 15:23         ` Richard Stallman
  0 siblings, 2 replies; 10+ messages in thread
From: Kim F. Storm @ 2002-02-11  9:33 UTC (permalink / raw)
  Cc: emacs-devel

Karl Eichwalder <ke@gnu.franken.de> writes:

> Richard Stallman <rms@gnu.org> writes:
> 
> > Is this not generally true now?
> 
> The inactive mode line doesn't see the change; calling something like
> switch-to-buffer will propagate it.  Maybe, it is not necessary to care
> about it as long as there's a recipe how to disable this new feature.

Customizing faces to get rid of this might seem too radical, so
maybe there should be a lisp variable to control this behaviour?

The customization could have three choices:
  nil - use mode-line face for all mode lines
  t   - use mode-line-inactive for inactive windows
        use mode-line face for active window and window
        that was selected when using the mini-buffer
  other - use mode-line-inactive even for the window that
          was selected when minibuffer is active.

(the last option corresponds to the current behaviour and is my
personal preference!)

 
> At the moment I'm inclined to believe I should drop the 3D look to gain
> one more pixel.

When the :box width is specified as -1, you wont gain an extra pixel
by removing the 3d look.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-11  9:33       ` Kim F. Storm
@ 2002-02-12 15:23         ` Richard Stallman
  2002-02-12 15:23         ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2002-02-12 15:23 UTC (permalink / raw)
  Cc: keichwa, emacs-devel

    > > Is this not generally true now?
    > 
    > The inactive mode line doesn't see the change; calling something like
    > switch-to-buffer will propagate it.

That is a bug--I think my changes in another message should fix it.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-11  9:33       ` Kim F. Storm
  2002-02-12 15:23         ` Richard Stallman
@ 2002-02-12 15:23         ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2002-02-12 15:23 UTC (permalink / raw)
  Cc: keichwa, emacs-devel

    Customizing faces to get rid of this might seem too radical, so
    maybe there should be a lisp variable to control this behaviour?

It seems unnecessary and wasteful to me.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-11  6:45     ` Eli Zaretskii
@ 2002-02-12 15:24       ` Richard Stallman
  2002-02-13 19:55         ` Karl Eichwalder
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2002-02-12 15:24 UTC (permalink / raw)
  Cc: keichwa, emacs-devel

I think this change should arrange to update display immediately
whenever face attributes are changed.  Does it work?

*** xfaces.c.~1.249.~	Sat Feb  9 04:06:22 2002
--- xfaces.c	Tue Feb 12 06:54:47 2002
***************
*** 3687,3692 ****
--- 3687,3700 ----
    else
      lface = global_lface;
  
+   /* Changing a named face means that all realized faces depending on
+      that face are invalid.  Since we cannot tell which realized faces
+      depend on the face, make sure they are all removed.  This is done
+      by incrementing face_change_count.  The next call to
+      init_iterator will then free realized faces.  */
+   ++face_change_count;
+   ++windows_or_buffers_changed;
+ 
    xassert (LFACEP (lface));
    check_lface (lface);
    return lface;
***************
*** 3754,3759 ****
--- 3762,3775 ----
    bcopy (XVECTOR (lface)->contents, XVECTOR (copy)->contents,
  	 LFACE_VECTOR_SIZE * sizeof (Lisp_Object));
  
+   /* Changing a named face means that all realized faces depending on
+      that face are invalid.  Since we cannot tell which realized faces
+      depend on the face, make sure they are all removed.  This is done
+      by incrementing face_change_count.  The next call to
+      init_iterator will then free realized faces.  */
+   ++face_change_count;
+   ++windows_or_buffers_changed;
+ 
    return to;
  }
  
***************
*** 4263,4268 ****
--- 4279,4292 ----
       face-set-after-frame-defaults.  */
    if (NILP (f->face_alist))
      return;
+ 
+   /* Changing a named face means that all realized faces depending on
+      that face are invalid.  Since we cannot tell which realized faces
+      depend on the face, make sure they are all removed.  This is done
+      by incrementing face_change_count.  The next call to
+      init_iterator will then free realized faces.  */
+   ++face_change_count;
+   ++windows_or_buffers_changed;
  
    if (EQ (param, Qforeground_color))
      {

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: Changing mode-line-inactive
  2002-02-12 15:24       ` Richard Stallman
@ 2002-02-13 19:55         ` Karl Eichwalder
  0 siblings, 0 replies; 10+ messages in thread
From: Karl Eichwalder @ 2002-02-13 19:55 UTC (permalink / raw)
  Cc: eliz, emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I think this change should arrange to update display immediately
> whenever face attributes are changed.  Does it work?
>
> *** xfaces.c.~1.249.~	Sat Feb  9 04:06:22 2002
> --- xfaces.c	Tue Feb 12 06:54:47 2002

Yes, it does.

Another problem is the following (using your patch):

    C-x 2

And in *Scratch* eval:

    (copy-face 'mode-line 'mode-line-inactive)

Now both mode lines are displayed with the mode-line face.  Open
another frame:

    C-x 5 b RET

The new frame has the old mode-line-inactive.  Okay.  But, and that is
a little bit astonishing, going back to *Scratch* and eval:

    (copy-face 'highlight 'mode-line-inactive)

This time it will affect the other frame, too.

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-02-13 19:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-09 20:00 Changing mode-line-inactive Karl Eichwalder
2002-02-09 20:38 ` Eli Zaretskii
2002-02-11  2:09   ` Richard Stallman
2002-02-11  6:45     ` Eli Zaretskii
2002-02-12 15:24       ` Richard Stallman
2002-02-13 19:55         ` Karl Eichwalder
2002-02-11  7:56     ` Karl Eichwalder
2002-02-11  9:33       ` Kim F. Storm
2002-02-12 15:23         ` Richard Stallman
2002-02-12 15:23         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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