emacs-devel
[Top][All Lists]
Advanced

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

Re: Standard check before creating large num of frames


From: Tino Calancha
Subject: Re: Standard check before creating large num of frames
Date: Fri, 16 Sep 2016 00:33:06 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)



On Thu, 15 Sep 2016, Stefan Monnier wrote:

several functions might create new frames.  In particular when
`pop-up-frames' is non-nil, `display-buffer' creates a new frame.
Creating a lot of new frames might be expensive.

Some functions may ask for user confirmation before creating an many
frames.  For instance, see `ibuffer-do-view-1': this function ask for
confirmation before creating > 3 frames.  IMO, it's good if each
function creating a large number of frames do a similar check.  We might
add a new option, for instance 'max-number-of-frames' or
'frame-max-number':

I get the impression that setting pop-up-frames will inevitably lead to
many more frames than 3.  IOW setting pop-up-frames non-nil is already
a way to say that you're OK with having many frames.
That was an example: that's why i said 'in particular'.
Anyway, i might say i want icecream: maybe i eat 2, 3 or even more. I ate one summer one icecream cone with 6 balls (the shop offered cones with
even 20 balls).  Said that, I will not eat one cone with 100 icecream balls;
i would prefer to be asked for confirmation before pay it.

`ibuffer-do-view-1' is another example: introduces a hardcoded `3'.
Why `3'? Isn't it better allow users to define what is in their opinion a large number of frames? It's good having an standard check. Otherwise we could have one Emacs library FOO asking you if nframes > N1 is Ok, and another Emacs library BAR asking the same when nframes > N2.

I saw more use cases in 3rd party code where this could be useful.
It might be more cases in Emacs source.



reply via email to

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