From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: Standard check before creating large num of frames Date: Fri, 16 Sep 2016 00:33:06 +0900 (JST) Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1473954735 17731 195.159.176.226 (15 Sep 2016 15:52:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2016 15:52:15 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 15 17:52:06 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkYxJ-0003Wp-Me for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2016 17:52:05 +0200 Original-Received: from localhost ([::1]:35682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYxK-0004dh-PE for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2016 11:52:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYge-0007Ph-2W for emacs-devel@gnu.org; Thu, 15 Sep 2016 11:34:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkYgX-0000t3-VJ for emacs-devel@gnu.org; Thu, 15 Sep 2016 11:34:50 -0400 Original-Received: from mail-pf0-f170.google.com ([209.85.192.170]:36330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYgX-0000h9-Pp for emacs-devel@gnu.org; Thu, 15 Sep 2016 11:34:45 -0400 Original-Received: by mail-pf0-f170.google.com with SMTP id 128so17729944pfb.3 for ; Thu, 15 Sep 2016 08:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Bp27LHxcQnm8QQGBD8Sr0DF44IEDow3P2yUClPso3YU=; b=xxiOanE4cTOVjgbXhYrr25ZTJXZo3Gets+yUdlE7ia3lrOybzCjiaMu/oCbEs2SRlF 86NKkfZCWxNd1wJIGDu+BDPrsSmuWmhmCv1uTc8z56Cz7HI8dEbfnG+xA79DW68jIwvt Nilgo5llfATI2Tx5jnUfFfbq9wk9n7AiOUQfRsQxuq/Cv4Dzcc1/VdWABVaZyACx/Ndm K1q050f7/6/aNv9sARn4eTB4AQ6L0ubr4V5HhkkRQ/nV6UkJoZ3V/FU3c291aLx04XRG fK4xI7U3NtYK8EnteJh0BGCg1zTaPucE4oIzobznw83UpxnzeBJw7KF9UGCT3Mll3zEp f4Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=Bp27LHxcQnm8QQGBD8Sr0DF44IEDow3P2yUClPso3YU=; b=BquVb7Ky5/h+OaaG74Bem5AP7893XNMSa9wbPsMoUYuXLbxgeRvmEAKnsGqbjJoeE3 Dt03giVgeXkFgg6+HAriijHFFOAg2jWhzN1zp0W9L5BjMqQW+4RgLYHXZZ8Sxajn3xm4 P2I9X9TrWFrcX0hRBzeNzHCHYQqyWDSSOd6LWgMf92ZNTL6H+Vrew+zev/EaXtS8MTMP FCrTWR0VsYmGpL3yHF+js18O6yIxlSC12ZZcfp8N22TxBugwwQqJ99uJLq0QJvGwjeAZ ovhgveFpEPnZth9nQ0fUmFzyDX5IkdQZzKAJfUsVXjyXtGFxbsTl5gAJ4LM3OLW1CGHI j7NQ== X-Gm-Message-State: AE9vXwM9h056XGOrjO735+envZJ/TC8mRkaUpkrtoCBq/nBP7emoQhe2VOApKzTsrjlFMg== X-Received: by 10.98.152.69 with SMTP id q66mr1698410pfd.176.1473953603978; Thu, 15 Sep 2016 08:33:23 -0700 (PDT) Original-Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id 27sm5150854pfr.29.2016.09.15.08.33.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 08:33:23 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.170 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207446 Archived-At: 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.