Subject: Re: bug#35466: 26.2; Feature request: add clone-indirect-buffer-other-frame to C-x 5 c

From: Juri Linkov <[email-masked]>
Date: Wed, 29 May 2019 00:41:23 +0300

> Not so much a bug, as a feature request. But upon reading that the very
> useful C-x 4 c is bound to `clone-indirect-buffer-other-window`[1] on
> reddit [2], and that the C-x 5 prefix is usually linked to frame related
> commands, I was hoping to see that C-x 5 c would create an indirect
> buffer copy in a new frame (since I rely on frames-only-mode and my
> winowmanager sway for moving between frames). I was sad to see this
> didn't exist yet, but glad that by looking at the source code I could
> whip a working function up very quickly:
>
> (defun clone-indirect-buffer-other-frame (newname display-flag &optional norecord)
>   "Like `clone-indirect-buffer' but display in another frame."
>   (interactive
>    (progn
>      (if (get major-mode 'no-clone-indirect)
> 	 (error "Cannot indirectly clone a buffer in %s mode" mode-name))
>      (list (if current-prefix-arg
> 	       (read-buffer "Name of indirect buffer: " (current-buffer)))
> 	   t)))
>   (let ((pop-up-frames t))
>     (clone-indirect-buffer newname display-flag norecord)))
>
> I think adding this to emacs, bound to C-x 5 c, would create a
> more consistent interface. I hope you agree!

The only problem with this binding is that bug#34715 proposed
to use the same binding C-x 5 c for clone-frame.