From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#34715: 26.1; (1) Add `clone-frame', (2) bind it to `C-x 5 2' Date: Mon, 4 Mar 2019 09:25:20 -0800 (PST) Message-ID: <8f86ae8b-5cd8-4f0a-ab85-39192e2cdbe7@default> References: <<17bef02b-7dd4-4086-828f-59488a836ac1@default>> <<83sgw2ehzu.fsf@gnu.org>> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="75108"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34715@debbugs.gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 04 18:26:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0rLw-000JJ1-M4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 18:26:12 +0100 Original-Received: from localhost ([127.0.0.1]:57886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0rLv-0008Q1-F1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 12:26:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0rLp-0008Pr-GN for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 12:26:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0rLo-0005P1-9p for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 12:26:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0rLo-0005Og-5N for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 12:26:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h0rLm-0001Jf-Is for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 12:26:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Mar 2019 17:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34715 X-GNU-PR-Package: emacs Original-Received: via spool by 34715-submit@debbugs.gnu.org id=B34715.15517203325023 (code B ref 34715); Mon, 04 Mar 2019 17:26:02 +0000 Original-Received: (at 34715) by debbugs.gnu.org; 4 Mar 2019 17:25:32 +0000 Original-Received: from localhost ([127.0.0.1]:60145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0rLH-0001Iw-Er for submit@debbugs.gnu.org; Mon, 04 Mar 2019 12:25:31 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:33608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0rLF-0001Ii-Q9 for 34715@debbugs.gnu.org; Mon, 04 Mar 2019 12:25:30 -0500 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x24HOP1U014780; Mon, 4 Mar 2019 17:25:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=3VHzUINECJPrmYMlOIKbrdimTmnlMrtFmAoKNeMlDU4=; b=s1nDsdCKQ6ppP5VEZqBfg7Awn0S9UFPDPKcmo0+JFlVkmq7Mi2Izh8tmUbZvVRdC1GeY o0tqRm87n7tpBdYtJJiKjH8SMwBZYR5tzJt4WzwZvSC0JIfvTVsMakPakIKCurAV4uWA cI2wghSi6DZV/iNq0uv7btf/n32pTTcomNchny/Xx27duSzmjfxnDDKdVimxJgQT+pW2 PV9Lj5N1WDGVsdcljGMlx8TfNxPpP8BLmYF4AiuUSKep+fX2kQ6LP5DWyZsLisNTDsjZ 7NHGq/uviEsMWrAc5VhyeROvoQJ7tVmJoFzbS0TSQRteYrXsjjS2YrWkSD5i8q6LDHKV Gg== Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2qyfbe0g74-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Mar 2019 17:25:23 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x24HPMKb004544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 4 Mar 2019 17:25:23 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x24HPLCR021840; Mon, 4 Mar 2019 17:25:22 GMT In-Reply-To: <<83sgw2ehzu.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4810.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9185 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903040127 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156036 Archived-At: > > 2. Use it, not `make-frame-command', as the binding of `C-x 5 2'. >=20 > I'm okay with adding a new command, but rebinding "C-x 5 2" by default > at the same time is a non-starter. We should first let people use the > new command, and should see how many of them ask to change the default > binding. Juri suggested binding `clone-frame' to `C-x 5 c'. That's OK too. I suggested in my second mail that the use of a prefix arg could be flipped, so this would then become a redefinition of `make-frame-command', where a prefix arg causes cloning instead of being a no-op (just creating a frame using `default-frame-alist'). So that's another possibility, which is backward-compatible (except that a prefix arg would no longer be a no-op, as it is now). I personally think the cloning case is more useful than the make-a-default-frame case. If `make-frame-command' were updated to just let a prefix arg clone the selected frame then cloning would be less discoverable than if the name were `clone-frame'. > > Why change the default behavior of `C-x 5 2'? If I want the > > buffer of the selected window shown in another frame then I > > typically want that frame to have the same parameters. >=20 > That's what default-frame-alist is for. I already have what I need for my own use. Here I'm proposing something for Emacs - that's the point of this enhancement. > If you are used to change the > parameters of your frames a lot during their lifetime, which > presumably means each of your frames might look and work differently, > it is not entirely clear to me that "C-x 5 2" should produce a clone > of the random frame where you just happened to type the command. Sorry, I don't understand your point there. I don't just "happen to type the command" in "random frames". I hit its key (`C-x 5 2', for me) with a frame selected that I want to clone. If a frame for some reason has particular, unusual parameters (e.g., user-defined or from some library) then presumably a user of such a frame would be used to its special behavior (even if s?he were unaware of the particular frame parameters) and would be able to decide whether cloning it is useful. > It could even cause trouble/unexpected behavior, > with some exotic parameters, at least in principle. I don't see that either. Could you give an example? If I want to clone a frame then I want to clone that frame. If I don't then I don't. Cloning includes copying the frame parameters. If there were a situation where it would be problematic to copy some frame parameter then presumably a user wouldn't ask to clone that frame. Sure, someone could accidentally invoke the command. But I don't see the expected unexpected harm. And if there really were a problem then we could add a blacklist variable or a predicate that one could use to inhibit cloning in such a situation. In sum, unless there is some good reason here to fear trouble/unexpected behavior I don't see why this enhancement is different from others. Sure, something unexpected is always possible. But without some real expectation of a particular problem we should just discover it in practice and take care of it. =20 > So I think we definitely should collect more > experience before changing this veteran binding. In that case I'd vote for Juri's suggestion (use `C-x 5 c', not `C-x 5 2'), as just making cloning available via a prefix arg for `C-x 5 2' would make it less discoverable. It would also be possible to do both: bind `clone-frame' to `C-x 5 c' and let a prefix arg to `C-x 5 2' (as `make-frame-command') invoke `clone-frame'. > > 3. BTW, I think it would be good to add this to the doc string of > > `make-frame-command': > > > > Return the new frame. >=20 > "When called from Lisp, return the new frame." It returns the frame no matter how it's called. And only someone interested in calling it from Lisp is interested in the return value. But sure, go for it, if you think it adds something.