From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34715: 26.1; (1) Add `clone-frame', (2) bind it to `C-x 5 2' Date: Mon, 04 Mar 2019 18:12:21 +0200 Message-ID: <83sgw2ehzu.fsf@gnu.org> References: <17bef02b-7dd4-4086-828f-59488a836ac1@default> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="9763"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34715@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 04 17:13:40 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 1h0qDk-0002RH-Et for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 17:13:40 +0100 Original-Received: from localhost ([127.0.0.1]:56539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0qDj-000529-5z for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 11:13:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0qD9-0004gV-A7 for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 11:13:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0qD8-0005La-Ga for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 11:13:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0qD8-0005LB-CA for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 11:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h0qD8-0007pw-2M for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 11:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Mar 2019 16:13: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.155171595630087 (code B ref 34715); Mon, 04 Mar 2019 16:13:02 +0000 Original-Received: (at 34715) by debbugs.gnu.org; 4 Mar 2019 16:12:36 +0000 Original-Received: from localhost ([127.0.0.1]:60096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0qCh-0007pD-Kf for submit@debbugs.gnu.org; Mon, 04 Mar 2019 11:12:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0qCf-0007oz-6r for 34715@debbugs.gnu.org; Mon, 04 Mar 2019 11:12:33 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0qCZ-0004iI-HB; Mon, 04 Mar 2019 11:12:27 -0500 Original-Received: from [176.228.60.248] (port=1218 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h0qCZ-00064G-3Z; Mon, 04 Mar 2019 11:12:27 -0500 In-reply-to: <17bef02b-7dd4-4086-828f-59488a836ac1@default> (message from Drew Adams on Sat, 2 Mar 2019 16:47:47 -0800 (PST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:156030 Archived-At: > Date: Sat, 2 Mar 2019 16:47:47 -0800 (PST) > From: Drew Adams > > 1. Add a `clone-frame' command such as this one, which is similar to > what I've been using: > > (defun clone-frame (&optional frame no-clone) > "Make a new frame with the same parameters as FRAME. > With a prefix arg, don't clone - just call `make-frame-command'. > > FRAME defaults to the selected frame. The frame is created on the > same terminal as FRAME. If the terminal is a text-only terminal then > also select the new frame." > (interactive "i\nP") > (if no-clone > (make-frame-command) > (let* ((default-frame-alist (frame-parameters frame)) > (new-fr (make-frame))) > (unless (display-graphic-p) (select-frame new-fr)) > new-fr))) > > 2. Use it, not `make-frame-command', as the binding of `C-x 5 2'. 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. > 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. That's what default-frame-alist is for. 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. It could even cause trouble/unexpected behavior, with some exotic parameters, at least in principle. So I think we definitely should collect more experience before changing this veteran binding. > 3. BTW, I think it would be good to add this to the doc string of > `make-frame-command': > > Return the new frame. "When called from Lisp, return the new frame."