From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#74750: clone-frame and make-frame pixelwise issues Date: Mon, 16 Dec 2024 12:51:14 -0500 Message-ID: References: <861pyfd8pe.fsf@gnu.org> <4d057282-8ec2-4ddb-ac0f-23e65af6e5a1@gmx.at> <7404039b-e71e-44e5-a446-70fa07889528@gmx.at> <1ed054fc-4b82-47cf-8d89-4768b56b88a7@gmx.at> <544d13ee-54f0-4786-8c5b-b1c87570f36c@gmx.at> <391ac457-09d0-4541-bc65-cddde4d23929@gmx.at> <86msgvpm8p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000079d325062966d604" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35355"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, 74750@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 18:54:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNFIS-0008t3-IW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 18:54:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNFIL-0005yX-Lu; Mon, 16 Dec 2024 12:54:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNFIJ-0005sp-Nf for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 12:54:11 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNFIA-0005zm-Mr for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 12:54:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=MpHPonu40um9NiSbkcTD42djM09W2Q0nnombwSW2Qpk=; b=DW8BL8D5VwEFfXazsPrxU+H61pMRYVq2jXkTFKY/zZbfx7Y7+DJwV42nvzGogZcZnFiDESp0dzPTyefhPJO/sjrDMI3vdHgy7vpBfjje5drzyHyK8zU7CigJXEmb6rD/y9wuhi2htR09/zC9cpvpCizfz5NYCSzFI6CirwYz5/BK+H6BiUhqJxwrnfcZfYoJ9rZv/20G9IGpUSpF/It3riSZjHQqZsPQrjHhBrZQ1CDfky/zh5T0FjooRXnPfvudhLtruUwaE7dipTafQNtjLWe38qAzQqmupehvHYuzqmiJf7wpqVIitFAm9D5VILbNySpt95Ph3SXsvMzj5jvN/w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNFI9-0007oj-WA for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 12:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Dec 2024 17:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74750 X-GNU-PR-Package: emacs Original-Received: via spool by 74750-submit@debbugs.gnu.org id=B74750.173437159529973 (code B ref 74750); Mon, 16 Dec 2024 17:54:01 +0000 Original-Received: (at 74750) by debbugs.gnu.org; 16 Dec 2024 17:53:15 +0000 Original-Received: from localhost ([127.0.0.1]:55968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNFHO-0007nM-R6 for submit@debbugs.gnu.org; Mon, 16 Dec 2024 12:53:15 -0500 Original-Received: from mail-ua1-f46.google.com ([209.85.222.46]:52435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNFHH-0007mp-LZ for 74750@debbugs.gnu.org; Mon, 16 Dec 2024 12:53:12 -0500 Original-Received: by mail-ua1-f46.google.com with SMTP id a1e0cc1a2514c-85b8c94a6b4so911898241.0 for <74750@debbugs.gnu.org>; Mon, 16 Dec 2024 09:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734371522; x=1734976322; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XdR7YWdnTQUML3LjZva6jfXUTF81HYl0/RkbY3OOcVk=; b=Ej9MGkSuhXlQWxEaFx91wRXo5u02BZP4Yt045BtSOlL7Z5hQPinzey97XnA3rPsazS G38paOWb7vKCHf33UdCA5dU8Gbceulcrp7ZSu9ugBRYOgQPOBDAr2psa0Uz2YyP5BvKL uEoHcMjvIqFS4fpp/bJqXtR5+Dj93UsP4x1FrESyCidx22nl0alEMrLiTZeUrmh29bE9 tIcPhOUeyYfnoCw1heh24JZ5NlXGjUUn1Y3ADbkGBueP2sDugrfAvm5IjCbFlMM4KoPY UH+IB1XI6DhBuMP7Bgr0EdnWq62otDhe9qqq4f5jNkK/5kh9qbN4MYXkmekyQvJ/R8Dz ztnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734371522; x=1734976322; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XdR7YWdnTQUML3LjZva6jfXUTF81HYl0/RkbY3OOcVk=; b=jLfDmkJA4wlUfa5CqYis2TS/sISA1Vz7hk8OZwA4gXxt4omAvn8Ftz9A9Db+qbCHIp n9rmFzYUaD7eL3N/ZCFtz42YG7yFY2q62LeaeohKfjx9SA8O81GR9AV5tzfD9AQkFsSb TmgpuW1isU59sEXdDzry2NJZJsGfB73+qSqe/Jh8rC3kyTs/rJwvMNnZGOA3cLRiYnqC tFTgcMB351FHJZf96oNKTRxxdp6esL5u0wx/GTr1ot+LOeQquebRWXnsDRwGTfqUksqJ uYT3uTVlfNHdcJKor3Xbn8z4d4VKt7FPAFWiuDdBwZs1ERShRvXGlm04tHrw4lc1yI0z 6EMg== X-Forwarded-Encrypted: i=1; AJvYcCXlEOrU/hy7K3YXKEhcj4O+7z90GsZa53NmdA2+1c/1v4X8qOBF3u39WhZQ/SYLHjs3SaTZNw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx+PAbGebOKGRRippigQWNEjzVvet/kBdw88MpZSbulq2jbwP0G EduN7PD7NsGTEAxMm6M+G3Y5OCLFHJEmOux8OXnIf0E+xhkq3nWB8oqyNY1hCraykm6TI0aa7mF B0GEMgejswrbi9qgspScBN/ZaLQM= X-Gm-Gg: ASbGncuy44VXQLsPLWh/sKonFYQpainTJ/A4Jjtj6YMWDYKLZvyzMTfltR0GtWQoPeM mPbhes4lUSyex5/+JxU4ja7C0FGw72LypNgQk5g== X-Google-Smtp-Source: AGHT+IG/IX+tdWvT691YwUkoql/qyymLbTeY8Nn/JawhJdTFf6g6NiMHH/OIaOQzkm4kHchFB9CK0+wvWjykXYZLA/I= X-Received: by 2002:a05:6102:290d:b0:4af:b8e4:e8b2 with SMTP id ada2fe7eead31-4b25d9a3e97mr14709578137.7.1734371521965; Mon, 16 Dec 2024 09:52:01 -0800 (PST) In-Reply-To: <86msgvpm8p.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297204 Archived-At: --00000000000079d325062966d604 Content-Type: multipart/alternative; boundary="00000000000079d323062966d602" --00000000000079d323062966d602 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Updated patch with docstring amendments. The tty test you're asking about was already in place, I merely added the missing frame argument that ensures the test is against the source frame rather than the ambient selected-frame. As to its utility, I can go only by the docstring sentence that reads "If the terminal is a text-only terminal then also select the new frame." Seems to have originated with this commit 2c662e6d66165db8ead2f4d19a61af521807b8ba in 2021 when clone-frame was introduced. On Mon, Dec 16, 2024 at 12:32=E2=80=AFPM Eli Zaretskii wrote= : > > From: Ship Mints > > Date: Mon, 16 Dec 2024 11:39:02 -0500 > > Cc: Eli Zaretskii , 74750@debbugs.gnu.org > > > > Patch attached. > > Thanks. > > > (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 > > Please avoid using "when" as a conditional; use "if" instead. "When" > can be interpreted as time-related condition, which is not what you > want. > > > +not text-only, clone the originating frame's pixel size. Otherwise, u= se > > +the number of FRAME's columns and lines for the clone. > > This uses double negation, which makes the documentation harder to > understand. Suggest to rephrase: > > By default, clone the pixel-size of the original frame, but if > `frame-resize-pixelwise' is nil or FRAME is a text-only frame, use > the FRAME's number of lines and columns for the clone. > > > - (unless (display-graphic-p) > > + (unless (display-graphic-p frame) > > (select-frame new-frame)) > > Why do you need this condition? > --00000000000079d323062966d602 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Updated patch with docstring amendments.

The tty test you're asking about was= already in place, I merely added the missing frame argument that ensures t= he test is against the source frame rather than the ambient selected-frame.= As to its utility, I can go only by the docstring sentence that reads &quo= t;If the terminal is a text-on= ly terminal then=C2=A0also select the new frame." Seems to have originated w= ith this commit=C2=A02c662e6d66165db8ead2f4d19a61af521807b8ba in 2021 when = clone-frame was introduced.

On Mon, Dec 1= 6, 2024 at 12:32=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Ship Mints <shipmints@gmail.com>
> Date: Mon, 16 Dec 2024 11:39:02 -0500
> Cc: Eli Zaretskii <eliz@gnu.org>, 74750@debbugs.gnu.org
>
> Patch attached.

Thanks.

>=C2=A0 (defun clone-frame (&optional frame no-windows)
>=C2=A0 =C2=A0 "Make a new frame with the same parameters and windo= ws as FRAME.
>=C2=A0 With a prefix arg NO-WINDOWS, don't clone the window configu= ration.
> +When the user option `frame-resize-pixelwise' is non-nil, and FRA= ME is

Please avoid using "when" as a conditional; use "if" in= stead.=C2=A0 "When"
can be interpreted as time-related condition, which is not what you
want.

> +not text-only, clone the originating frame's pixel size.=C2=A0 Ot= herwise, use
> +the number of FRAME's columns and lines for the clone.

This uses double negation, which makes the documentation harder to
understand.=C2=A0 Suggest to rephrase:

=C2=A0 By default, clone the pixel-size of the original frame, but if
=C2=A0 `frame-resize-pixelwise' is nil or FRAME is a text-only frame, u= se
=C2=A0 the FRAME's number of lines and columns for the clone.

> -=C2=A0 =C2=A0 (unless (display-graphic-p)
> +=C2=A0 =C2=A0 (unless (display-graphic-p frame)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (select-frame new-frame))

Why do you need this condition?
--00000000000079d323062966d602-- --00000000000079d325062966d604 Content-Type: application/octet-stream; name="0001-Support-pixelwise-frame-cloning-bug-74750.patch" Content-Disposition: attachment; filename="0001-Support-pixelwise-frame-cloning-bug-74750.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m4rbt3w50 RnJvbSBhZTdkZTA2Y2UxYTI4NTk2MGM1Yzc3OTU1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ocHVzaCAoY29ucyAnaGVp Z2h0IChjb25zICd0ZXh0LXBpeGVscyAoZnJhbWUtdGV4dC1oZWlnaHQgZnJhbWUpKSkKKyAgICAg ICAgICAgIGRlZmF1bHQtZnJhbWUtYWxpc3QpKQorICAgIChzZXRxIG5ldy1mcmFtZSAobWFrZS1m cmFtZSkpCiAgICAgKHdoZW4gd2luZG93cwogICAgICAgKHdpbmRvdy1zdGF0ZS1wdXQgd2luZG93 cyAoZnJhbWUtcm9vdC13aW5kb3cgbmV3LWZyYW1lKSAnc2FmZSkpCi0gICAgKHVubGVzcyAoZGlz cGxheS1ncmFwaGljLXApCisgICAgKHVubGVzcyAoZGlzcGxheS1ncmFwaGljLXAgZnJhbWUpCiAg ICAgICAoc2VsZWN0LWZyYW1lIG5ldy1mcmFtZSkpCiAgICAgbmV3LWZyYW1lKSkKCi0tCjIuNDcu MQo= --00000000000079d325062966d604--