@item C-x 5 2
@kindex C-x 5 2
@findex make-frame-command
-Create a new frame (@code{make-frame-command}).
+Create a new frame using the default frame parameters
+(@code{make-frame-command}).
+
+@item C-x 5 c
+@kindex C-x 5 c
+@findex clone-frame
+Create a new frame using the parameters of the current frame
+(@code{clone-frame}).
@item C-x 5 b @var{bufname} @key{RET}
Select buffer @var{bufname} in another frame. This runs
** Commands 'set-frame-width' and 'set-frame-height' can now get their
input using the minibuffer.
++++
+** New command 'clone-frame' (bound to 'C-x 5 c').
+This is like 'C-x 5 2', but uses the frame parameters of the current
+frame instead of 'default-frame-alist'.
+
---
** New help window when Emacs prompts before opening a large file.
Commands like 'find-file' or 'visit-tags-table' ask to visit a file
(make-frame)
(select-frame (make-frame))))
+(defun clone-frame (&optional frame use-default-parameters)
+ "Make a new frame with the same parameters as FRAME.
+With a prefix arg (USE-DEFAULT-PARAMETERS), use
+`default-frame-alist' instead.
+
+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 use-default-parameters
+ (make-frame-command)
+ (let* ((default-frame-alist (frame-parameters frame))
+ (new-frame (make-frame)))
+ (unless (display-graphic-p)
+ (select-frame new-frame))
+ new-frame)))
+
(defvar before-make-frame-hook nil
"Functions to run before `make-frame' creates a new frame.")
(define-key ctl-x-5-map "0" #'delete-frame)
(define-key ctl-x-5-map "o" #'other-frame)
(define-key ctl-x-5-map "5" #'other-frame-prefix)
+(define-key ctl-x-5-map "c" #'clone-frame)
(define-key global-map [f11] #'toggle-frame-fullscreen)
(define-key global-map [(meta f10)] #'toggle-frame-maximized)
(define-key esc-map [f10] #'toggle-frame-maximized)