GNU bug report logs - #34715
26.1; (1) Add `clone-frame', (2) bind it to `C-x 5 2'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 3 Mar 2019 01:04:01 UTC

Severity: wishlist

Merged with 32736

Found in version 26.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 34715 <at> debbugs.gnu.org
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
> Date: Sat, 2 Mar 2019 16:47:47 -0800 (PST)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> 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."




This bug report was last modified 3 years and 256 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.