unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Should customizing default-frame-alist change existing frames?
@ 2002-03-01  8:15 Per Abrahamsen
  2002-03-01 10:33 ` Juanma Barranquero
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Per Abrahamsen @ 2002-03-01  8:15 UTC (permalink / raw)
  Cc: Daniel Ortmann

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

RMS asked me to look at this, but did not say what to do.

I can see two solutions:

1. Change the doc string to say that existing frames will not be
   affected by setting default-frame-alist, only new ones. 

2. Add a :set method that applies the frame parameters to all existing
   frames.

I think #2 could be dangerous, especially if there are any "special
purpose" (like ediff of speedbar) frames around.  

One could try to be smart about it, by only changing the current
frame, or only changing the frame is there is only one, or only
changing the frames which were not marked as "special", or whose frame
parameters were close to the old value.  However, such partial
appliances might be even more confusing.

What do you think?


[-- Attachment #2: Type: message/rfc822, Size: 1410 bytes --]

From: "Daniel Ortmann" <dortmann@lsil.com>
To: <rms@gnu.org>
Subject: emacs customize / frame color setting [almost] bug
Date: Thu, 28 Feb 2002 10:53:51 -0600

Hello,

(I would use send-pr, except the company firewall won't let my GNU machine
[Linux] roam free.  Down with corrals!  I'll work on reconfiguring the
sendmail.cf so I can get through properly.:-)

Problem:

This is really a problem with user expectation, but it is surprising enough
that something should be done ...

The default frame colors are getting set from within the customize buffer,
but the changes are not immediately visible (since the "defaults" are
applied when a new frame initializes).

Steps to repeat:

- M-x customize-apropos <enter>
- default-frame-alist <enter>
- Insert (or change) the background color to something different (such as
gray20, etc)
- Click "Save for Current Session"

The result is that the color does not change as I expected it would.  I have
to start up a new frame so the default colors take effect.

Perhaps the correct response is "Yup, that's how it is", but it leaves users
[such as me] confused [at least for a while].

The version of emacs is:
GNU Emacs 21.2.50.1 (i686-linux-gnu, X toolkit, Xaw3d scroll bars) of
2002-01-16 on rmauctor.lsil.com

Thanks!

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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-01  8:15 Should customizing default-frame-alist change existing frames? Per Abrahamsen
@ 2002-03-01 10:33 ` Juanma Barranquero
  2002-03-01 18:33   ` Stefan Monnier
  2002-03-01 10:57 ` Eli Zaretskii
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Juanma Barranquero @ 2002-03-01 10:33 UTC (permalink / raw)
  Cc: emacs-devel, Daniel Ortmann


> I can see two solutions:
> 
> 1. Change the doc string to say that existing frames will not be
>    affected by setting default-frame-alist, only new ones. 
> 
> 2. Add a :set method that applies the frame parameters to all existing
>    frames.
 
> What do you think?

Perhaps applying the changes to the current frame and any new ones.

Making a customize change for the frame and not seeing the current frame
"adapt" to the changes would be confusing for beginners. More often than
not, the user is going to customize from inside the frame he's working
on, precisely because he does want to change it.

If a user makes the mistake of customizing from inside a special frame
I'd bet he (assuming is not experienced) is doing some exploring 'round
and he'll be able to understand his error.

OTOH, changing all existing frames could be fragile, I think.

                                                           /L/e/k/t/u


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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-01  8:15 Should customizing default-frame-alist change existing frames? Per Abrahamsen
  2002-03-01 10:33 ` Juanma Barranquero
@ 2002-03-01 10:57 ` Eli Zaretskii
  2002-03-01 11:20 ` Kim F. Storm
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2002-03-01 10:57 UTC (permalink / raw)
  Cc: emacs-devel, dortmann

> From: Per Abrahamsen <abraham@dina.kvl.dk>
> Date: Fri, 01 Mar 2002 09:15:39 +0100
> 
> 1. Change the doc string to say that existing frames will not be
>    affected by setting default-frame-alist, only new ones. 
> 
> 2. Add a :set method that applies the frame parameters to all existing
>    frames.
> 
> I think #2 could be dangerous, especially if there are any "special
> purpose" (like ediff of speedbar) frames around.  

Yes, I agree.  Emacs does try to do something similar at startup, to
make customizations of default-frame-alist take immediate effect on
the already existing frame, but this leads to a very convoluted code
that is not devoid of subtle surprises.  For example, changing the
order of some customizations can sometimes change the net effect.

While that is justified at startup, doing the same in the middle of a
session might be more trouble than it's worth.

So I think we should take #1, and make sure the doc string mentions
the functions that can be used to get immediate effect for important
frame parameters.

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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-01  8:15 Should customizing default-frame-alist change existing frames? Per Abrahamsen
  2002-03-01 10:33 ` Juanma Barranquero
  2002-03-01 10:57 ` Eli Zaretskii
@ 2002-03-01 11:20 ` Kim F. Storm
  2002-03-02 19:50 ` Richard Stallman
  2002-03-05  8:42 ` Per Abrahamsen
  4 siblings, 0 replies; 12+ messages in thread
From: Kim F. Storm @ 2002-03-01 11:20 UTC (permalink / raw)
  Cc: emacs-devel, Daniel Ortmann

Per Abrahamsen <abraham@dina.kvl.dk> writes:

> RMS asked me to look at this, but did not say what to do.
> 
> I can see two solutions:
> 
> 1. Change the doc string to say that existing frames will not be
>    affected by setting default-frame-alist, only new ones. 
> 
> 2. Add a :set method that applies the frame parameters to all existing
>    frames.

I'd prefer 2, but as you indicate there are short-comings.

However, the request is related to colors - and I think that is what
most users would expect to change if default-frame-alist is modified.
Other parameters related to the default face (e.g. the font) may also
be expected to be propagated to all frames.

My proposal is:

Change foreground and background color and other default font setting for
all frames which are using the current default settings of those parameters.

All other parameters only take effect on new frames.

-- 
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] 12+ messages in thread

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-01 10:33 ` Juanma Barranquero
@ 2002-03-01 18:33   ` Stefan Monnier
  2002-03-04  9:18     ` Juanma Barranquero
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2002-03-01 18:33 UTC (permalink / raw)
  Cc: Per Abrahamsen, emacs-devel, Daniel Ortmann

> 
> > I can see two solutions:
> > 
> > 1. Change the doc string to say that existing frames will not be
> >    affected by setting default-frame-alist, only new ones. 
> > 
> > 2. Add a :set method that applies the frame parameters to all existing
> >    frames.
>  
> > What do you think?
> 
> Perhaps applying the changes to the current frame and any new ones.
> 
> Making a customize change for the frame and not seeing the current frame
> "adapt" to the changes would be confusing for beginners. More often than
> not, the user is going to customize from inside the frame he's working
> on, precisely because he does want to change it.
> 
> If a user makes the mistake of customizing from inside a special frame
> I'd bet he (assuming is not experienced) is doing some exploring 'round
> and he'll be able to understand his error.
> 
> OTOH, changing all existing frames could be fragile, I think.

Many of my frames have slightly different settings (the minibuffer-only
frame is the most obvious one, but I also use many other dedicated frames),
but I think it would still be OK to do something like:

	(dolist (param new-default-frame-alist)
	  (dolist (frame (frame-list))
	    (when (eq (frame-parameter frame (car param))
	              (cdr (assq (car param) old-default-frame-alist))
	      (set-frame-parameter frame (car param) (cdr param)))))

It wouldn't be "perfect" but should be mostly acceptable.

I don't think that leaving dedicated frames as-is is a good answer because
all my dedicated frames use the same background color as the rest and
if I changed the background color of default-frame-alist, I wouldn't
want my dedicated frames to be excluded from the update.


	Stefan


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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-01  8:15 Should customizing default-frame-alist change existing frames? Per Abrahamsen
                   ` (2 preceding siblings ...)
  2002-03-01 11:20 ` Kim F. Storm
@ 2002-03-02 19:50 ` Richard Stallman
  2002-03-05  8:42 ` Per Abrahamsen
  4 siblings, 0 replies; 12+ messages in thread
From: Richard Stallman @ 2002-03-02 19:50 UTC (permalink / raw)
  Cc: emacs-devel, dortmann

    RMS asked me to look at this, but did not say what to do.

I didn't try to figure out what to do--I hoped you would do that.

    1. Change the doc string to say that existing frames will not be
       affected by setting default-frame-alist, only new ones. 

I think that is probably best, as the usual action.  But there could
be another option or button to adjust all existing frames.

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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-01 18:33   ` Stefan Monnier
@ 2002-03-04  9:18     ` Juanma Barranquero
  2002-03-04 21:29       ` Kim F. Storm
  0 siblings, 1 reply; 12+ messages in thread
From: Juanma Barranquero @ 2002-03-04  9:18 UTC (permalink / raw)
  Cc: Per Abrahamsen, emacs-devel, Daniel Ortmann


On Fri, 01 Mar 2002 13:33:43 -0500, "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu> wrote:

> It wouldn't be "perfect" but should be mostly acceptable.
> 
> I don't think that leaving dedicated frames as-is is a good answer [...]

I'm starting to think that's one of those issues where there's
considerable individual variation; perhaps it is wise to choose the
easier answer (be that changing all frames, or just the current one) and
be done with it. I don't think adding complexity to support several
styles is worth the cost, because if the user likes some particular
frame configuration he's probably going to write it down in his .emacs
and restart Emacs.

Just MHO, of course. I don't use many frames, though.


                                                           /L/e/k/t/u


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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-04  9:18     ` Juanma Barranquero
@ 2002-03-04 21:29       ` Kim F. Storm
  0 siblings, 0 replies; 12+ messages in thread
From: Kim F. Storm @ 2002-03-04 21:29 UTC (permalink / raw)
  Cc: Daniel Ortmann

Juanma Barranquero <lektu@terra.es> writes:

> On Fri, 01 Mar 2002 13:33:43 -0500, "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu> wrote:
> 
> > It wouldn't be "perfect" but should be mostly acceptable.
> > 
> > I don't think that leaving dedicated frames as-is is a good answer [...]
> 
> I'm starting to think that's one of those issues where there's
> considerable individual variation;

So maybe it could be customizeable (with sensible default setting).

A simple list with the frame parameters where changes should be
reflected on all frames could do the trick.  [of course this
should be a defcustom], e.g.

(defvar frame-parameters-all-frames '(background-mode
scroll-bar-background scroll-bar-foreground border-color cursor-color
mouse-color background-color foreground-color font))


-- 
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] 12+ messages in thread

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-01  8:15 Should customizing default-frame-alist change existing frames? Per Abrahamsen
                   ` (3 preceding siblings ...)
  2002-03-02 19:50 ` Richard Stallman
@ 2002-03-05  8:42 ` Per Abrahamsen
  2002-03-05 21:58   ` Richard Stallman
  4 siblings, 1 reply; 12+ messages in thread
From: Per Abrahamsen @ 2002-03-05  8:42 UTC (permalink / raw)
  Cc: Daniel Ortmann

I fixed the doc string.

The interactive functionality could be achieved by adding [Set for
current frame] and [Set for all frames] buttons to the customize type.

Or alternatively, add a specialized configure-frame-colors tool,
available from the Options menu.  I do not believe that customizing
'default-frame-alist' is a very intuitive path to achive this
functionality, especially for a new user.

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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-05  8:42 ` Per Abrahamsen
@ 2002-03-05 21:58   ` Richard Stallman
  2002-03-06 11:15     ` Per Abrahamsen
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Stallman @ 2002-03-05 21:58 UTC (permalink / raw)
  Cc: emacs-devel, dortmann

    Or alternatively, add a specialized configure-frame-colors tool,
    available from the Options menu.

For the colors in particular, can't you do this by customizing the
default face and other special faces?

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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-05 21:58   ` Richard Stallman
@ 2002-03-06 11:15     ` Per Abrahamsen
  2002-03-08  9:08       ` Richard Stallman
  0 siblings, 1 reply; 12+ messages in thread
From: Per Abrahamsen @ 2002-03-06 11:15 UTC (permalink / raw)
  Cc: emacs-devel, dortmann

Richard Stallman <rms@gnu.org> writes:

>     Or alternatively, add a specialized configure-frame-colors tool,
>     available from the Options menu.
>
> For the colors in particular, can't you do this by customizing the
> default face and other special faces?

I don't know.  If so, I don't think we need a special tool.  Maybe

  (customize-group 'basic-faces)

should be available from the Options menu?

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


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

* Re: Should customizing default-frame-alist change existing frames?
  2002-03-06 11:15     ` Per Abrahamsen
@ 2002-03-08  9:08       ` Richard Stallman
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Stallman @ 2002-03-08  9:08 UTC (permalink / raw)
  Cc: emacs-devel, dortmann

      Maybe

      (customize-group 'basic-faces)

    should be available from the Options menu?

I don't think so.  I don't think that is among the 20 most important
things to customize in all of Emacs.

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


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

end of thread, other threads:[~2002-03-08  9:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-01  8:15 Should customizing default-frame-alist change existing frames? Per Abrahamsen
2002-03-01 10:33 ` Juanma Barranquero
2002-03-01 18:33   ` Stefan Monnier
2002-03-04  9:18     ` Juanma Barranquero
2002-03-04 21:29       ` Kim F. Storm
2002-03-01 10:57 ` Eli Zaretskii
2002-03-01 11:20 ` Kim F. Storm
2002-03-02 19:50 ` Richard Stallman
2002-03-05  8:42 ` Per Abrahamsen
2002-03-05 21:58   ` Richard Stallman
2002-03-06 11:15     ` Per Abrahamsen
2002-03-08  9:08       ` 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).