From: Ship Mints <shipmints@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Eli Zaretskii <eliz@gnu.org>, 74750@debbugs.gnu.org
Subject: bug#74750: clone-frame and make-frame pixelwise issues
Date: Mon, 16 Dec 2024 05:48:24 -0500 [thread overview]
Message-ID: <CAN+1HbrZNZb9+_=G8OVp8mQRPuSXiFVtVWx6ReypdyGnEn+u0g@mail.gmail.com> (raw)
In-Reply-To: <CAN+1Hbr0kKHyO6DLhgs3iquwJm4YHtBWvBw91KQFnqtMutimsg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3444 bytes --]
With your suggested wording changes but without the pixelwise argument:
(defun clone-frame (&optional frame no-windows)
"Make a new frame with the same parameters and windows as FRAME.
With a prefix arg NO-WINDOWS, don't clone the window configuration. When
the user option `frame-resize-pixelwise' is non-nil, and FRAME is not
text-only, clone the originating frame's pixel size. Otherwise, use the
number of FRAME's columns and lines in the clone.
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 (list (selected-frame) current-prefix-arg))
(let* ((frame (or frame (selected-frame)))
(windows (unless no-windows
(window-state-get (frame-root-window frame))))
(default-frame-alist
(seq-remove (lambda (elem)
(memq (car elem) frame-internal-parameters))
(frame-parameters frame)))
(new-frame))
(when (and (display-graphic-p frame)
frame-resize-pixelwise)
(push (cons 'width (cons 'text-pixels (frame-text-width frame)))
default-frame-alist)
(push (cons 'height (cons 'text-pixels (frame-text-height frame)))
default-frame-alist))
(setq new-frame (make-frame))
(when windows
(window-state-put windows (frame-root-window new-frame) 'safe))
(unless (display-graphic-p frame)
(select-frame new-frame))
new-frame))
On Mon, Dec 16, 2024 at 5:40 AM Ship Mints <shipmints@gmail.com> wrote:
> My expectation was that clone-frame, when frame-resize-pixelwise t, would
> implicitly DTRT. I expect most people would have the same expectation. Same
> as frameset-restore (now fixed with the patch).
>
> When packages we use invoke clone-frame, we can't control their
> parameterization of those invocations without advice, so
> implied pixelwise seems wise. I added the explicit parameter more as
> awareness than anything else, but I imagine that carefully-crafted
> pixelwise child frames in packages may want explicit pixelwise clones if
> the authors aren't going to let-bind frame-resize-pixelwise around
> clone-frame calls. I'd prefer that we recommend that, actually.
>
> Let's just do away with the pixelwise parameter and rely on the user
> setting? That would be in keeping with the rest of the implementation, I
> think.
>
> On Mon, Dec 16, 2024 at 4:32 AM martin rudalics <rudalics@gmx.at> wrote:
>
>> > I'd write that as
>> >
>> > If PIXELWISE or `frame-resize-pixelwise' is non-nil and FRAME's
>> terminal
>> > is not text-only, use the pixel size of FRAME for the cloned frame.
>> > Otherwise, use the number of columns and lines of FRAME for the
>> cloned
>> > frame.
>>
>> But may be we should write
>>
>> (and pixelwise frame-resize-pixelwise))
>>
>> and say
>>
>> If PIXELWISE and `frame-resize-pixelwise' are both non-nil and FRAME's
>> terminal is not text-only, use the pixel size of FRAME for the cloned
>> frame. Otherwise, use the number of columns and lines of FRAME for
>> the cloned frame.
>>
>> Setting PIXELWISE to t in a setting where 'frame-resize-pixelwise' is
>> nil means asking for trouble since the window manager might not honor
>> it. WDYT?
>>
>> martin
>>
>
[-- Attachment #2: Type: text/html, Size: 4816 bytes --]
next prev parent reply other threads:[~2024-12-16 10:48 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 15:51 bug#74750: clone-frame and make-frame pixelwise issues Ship Mints
2024-12-10 12:27 ` Eli Zaretskii
2024-12-10 15:56 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-10 16:24 ` Ship Mints
2024-12-11 9:37 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-11 22:41 ` Ship Mints
2024-12-12 6:05 ` Eli Zaretskii
2024-12-12 9:22 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-13 10:30 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-13 16:28 ` Ship Mints
2024-12-13 18:15 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-13 18:25 ` Ship Mints
2024-12-14 8:27 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-15 20:34 ` Ship Mints
2024-12-16 9:23 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 9:32 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 10:40 ` Ship Mints
2024-12-16 10:48 ` Ship Mints [this message]
2024-12-16 15:49 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 15:55 ` Ship Mints
2024-12-16 16:01 ` Ship Mints
2024-12-16 16:02 ` Ship Mints
2024-12-16 16:39 ` Ship Mints
2024-12-16 17:06 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 17:32 ` Eli Zaretskii
2024-12-16 17:51 ` Ship Mints
2024-12-16 16:07 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 16:41 ` Ship Mints
2024-12-16 17:06 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-16 16:07 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAN+1HbrZNZb9+_=G8OVp8mQRPuSXiFVtVWx6ReypdyGnEn+u0g@mail.gmail.com' \
--to=shipmints@gmail.com \
--cc=74750@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).