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 11:39:02 -0500 [thread overview]
Message-ID: <CAN+1HbqEO0nbA5ZdpUHS+Bmd088TUhjP7p6Tfdr_akYyFyVZ2A@mail.gmail.com> (raw)
In-Reply-To: <391ac457-09d0-4541-bc65-cddde4d23929@gmx.at>
[-- Attachment #1.1: Type: text/plain, Size: 708 bytes --]
Patch attached.
On Mon, Dec 16, 2024 at 10:49 AM martin rudalics <rudalics@gmx.at> wrote:
> > With your suggested wording changes but without the pixelwise argument:
> ...
> > (new-frame))
>
> Please omit the parentheses here.
> ...
> > (unless (display-graphic-p frame)
>
> This is a fix you should mention in the commit message.
> ...
>
> Please provide a diff to the current frame.el of master and a commit
> message. Have you done your Emacs paperwork already? If not, I can
> install this as a tiny change because it's short enough. Still you
> should start the paperwork since otherwise we cannot install further
> changes from you.
>
> Thanks, martin
>
[-- Attachment #1.2: Type: text/html, Size: 1129 bytes --]
[-- Attachment #2: 0001-Support-pixelwise-frame-cloning-bug-74750.patch --]
[-- Type: application/octet-stream, Size: 2003 bytes --]
From ae7de06ce1a285960c5c77955f66fb30a88a828c Mon Sep 17 00:00:00 2001
From: shipmints <shipmints@gmail.com>
Date: Mon, 16 Dec 2024 11:36:27 -0500
Subject: [PATCH] Support pixelwise frame cloning (bug#74750)
* lisp/frame.el (clone-frame):
Honor frame-resize-pixelwise when cloning a frame's geometry
via make-frame text-pixel feature.
Correctly specify source frame in display-graphic-p test for
tty selection behavior.
---
lisp/frame.el | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/lisp/frame.el b/lisp/frame.el
index 1b5aa8cff08..02f3f9f9dae 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -863,6 +863,9 @@ make-frame-command
(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 for 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
@@ -875,10 +878,17 @@ clone-frame
(seq-remove (lambda (elem)
(memq (car elem) frame-internal-parameters))
(frame-parameters frame)))
- (new-frame (make-frame)))
+ new-frame)
+ (when (and frame-resize-pixelwise
+ (display-graphic-p frame))
+ (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)
+ (unless (display-graphic-p frame)
(select-frame new-frame))
new-frame))
--
2.47.1
next prev parent reply other threads:[~2024-12-16 16:39 UTC|newest]
Thread overview: 33+ 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
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 [this message]
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 19:10 ` Eli Zaretskii
2024-12-16 19:13 ` Eli Zaretskii
2024-12-16 19:26 ` 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+1HbqEO0nbA5ZdpUHS+Bmd088TUhjP7p6Tfdr_akYyFyVZ2A@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).