GNU logs - #74866, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + changed face height = mess
Resent-From: toomas@HIDDEN
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 14 Dec 2024 12:58:04 +0000
Resent-Message-ID: <handler.74866.B.173418106631113 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 74866 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.173418106631113
          (code B ref -1); Sat, 14 Dec 2024 12:58:04 +0000
Received: (at submit) by debbugs.gnu.org; 14 Dec 2024 12:57:46 +0000
Received: from localhost ([127.0.0.1]:45867 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tMRiL-00085j-4J
	for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 07:57:45 -0500
Received: from lists.gnu.org ([209.51.188.17]:53120)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <toomas@HIDDEN>)
 id 1tMRiI-00085T-9N
 for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 07:57:44 -0500
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 <toomas@HIDDEN>)
 id 1tMRiD-0002LR-Ds
 for bug-gnu-emacs@HIDDEN; Sat, 14 Dec 2024 07:57:37 -0500
Received: from 92-115-235-80.sta.estpak.ee ([80.235.115.92] helo=rosin.ee)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <toomas@HIDDEN>)
 id 1tMRiA-0004rJ-OO
 for bug-gnu-emacs@HIDDEN; Sat, 14 Dec 2024 07:57:37 -0500
Received: by rosin.ee (Postfix, from userid 1000)
 id C2E2B1AB7AC; Sat, 14 Dec 2024 14:57:31 +0200 (EET)
From: toomas@HIDDEN
Date: Sat, 14 Dec 2024 14:57:31 +0200
Message-ID: <87msgyzakk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: none client-ip=80.235.115.92;
 envelope-from=toomas@HIDDEN; helo=rosin.ee
X-Spam_score_int: 7
X-Spam_score: 0.7
X-Spam_bar: /
X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, FORGED_SPF_HELO=1,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, KHOP_HELO_FCRDNS=0.4,
 NO_DNS_FOR_FROM=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001,
 SPF_NONE=0.001, TVD_RCVD_IP=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.7 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)


----------------8<----------------8<----------------8<----------------

In "emacs -Q" under X (I have XFCE), evaluate:

(defun fit (lin col)
  "Fit some text (LIN lines and COL columns) into a newly created frame."
  (interactive)
  (let ((buf (get-buffer-create "*foo*"))
        (frm (make-frame '((z-group . above)))))
    (with-current-buffer buf
      (erase-buffer)
      (setq mode-line-format '(""))
      (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
      (goto-char (point-min)))
    (with-selected-frame frm
      (switch-to-buffer buf)
      (fit-frame-to-buffer))))
;;; LIN and COL are arbitrary, make them sufficiently small.
(fit 9 23)

So far, so good.  Now evaluate the following:

(setq-default vertical-scroll-bar nil)
(set-face-attribute 'default nil :height 75)
(fit 9 23)

On my system, the frame's width is now one character short and the lines
do not fit in the new frame any more.

---------------->8---------------->8---------------->8----------------

In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
 cairo version 1.18.2) of 2024-12-10 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101014
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-29.4
 --htmldir=/usr/share/doc/emacs-29.4/html --libdir=/usr/lib64
 --program-suffix=-emacs-29 --includedir=/usr/include/emacs-29
 --infodir=/usr/share/info/emacs-29 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --enable-acl
 --with-dbus --without-modules --without-gameuser --with-libgmp
 --without-gpm --without-native-compilation --without-json
 --without-kerberos --without-kerberos5 --with-lcms2 --with-xml2
 --without-mailutils --without-selinux --without-sqlite3 --with-gnutls
 --without-libsystemd --with-threads --without-tree-sitter
 --without-wide-int --with-sound=alsa --with-zlib --with-x
 --without-pgtk --without-ns --without-gconf --without-gsettings
 --without-toolkit-scroll-bars --with-xpm --with-xft --with-cairo
 --without-harfbuzz --without-libotf --without-m17n-flt
 --with-x-toolkit=gtk3 --without-xwidgets --with-gif --with-jpeg
 --with-png --with-rsvg --with-tiff --without-webp --without-imagemagick
 --with-dumping=pdumper 'CFLAGS=-O2 -pipe -fno-fast-math
 -ffp-contract=off' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed
 -Wl,-z,pack-relative-relocs''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

Important settings:
  value of $LANG: C.UTF8
  locale-coding-system: utf-8-unix

Major mode: Helpful

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  server-mode: t
  repeat-mode: t
  gdb-many-windows: t
  auto-insert-mode: t
  shell-dirtrack-mode: t
  desktop-save-mode: t
  windmove-mode: t
  display-time-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  window-divider-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/transient/transient hides /usr/share/emacs/29.4/lisp/transient
/usr/share/emacs/site-lisp/seq/seq hides /usr/share/emacs/29.4/lisp/emacs-lisp/seq

Features:
(shadow emacsbug cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine files-x etags fileloop xref project warnings sort
cal-move cl-print mh-search mh-thread cus-start cus-load mh-identity
mh-letter mh-comp mh-alias shr-color color textsec uni-scripts
idna-mapping ucs-normalize uni-confusable textsec-check qp mm-archive
mail-extr mh-mime mh-gnus dabbrev misearch multi-isearch vc-hg vc-bzr
vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc bug-reference
magit-bookmark magit-submodule magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit package url-handlers magit-repos magit-apply magit-wip magit-log
magit-diff smerge-mode diff git-commit log-edit pcvs-util add-log
magit-core magit-autorevert magit-margin magit-transient magit-process
with-editor server magit-mode transient benchmark magit-git magit-base
magit-section cursor-sensor crm compat compat-30 org-clock diary-lib
diary-loaddefs face-remap image-file image-converter ttk-mt mh-show
goto-addr gnus-cite mh-seq mh-inc hl-line mh-tool-bar mh-acros mh-xface
mh-utils mh-folder which-func mh-scan mule-util repeat ttk rst
ttk-para-minutes ttk-bookmarks ttk-windows loop bookmark pp ttk-fonts
view autorevert vc-git diff-mode vc-dispatcher oc-basic ol-eww ol-rmail
ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view
mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start
gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time
gnus-spec gnus-int gnus-range message sendmail yank-media rfc822 mml
mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils
mailheader gnus-win ol-docview doc-view filenotify jka-compr image-mode
exif ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi
ebuild-mode skeleton mh-e mh-buffers mh-loaddefs dired dired-loaddefs
helpful cc-langs cc-vars cc-defs imenu trace edebug debug backtrace
info-look info f help-fns radix-tree elisp-refs s dash rect org-agenda
org-element org-persist org-id avl-tree generator org-refile org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint
org-pcomplete org-list org-footnote org-faces org-entities noutline
outline icons ob-emacs-lisp ob-core ob-eval org-cycle org-table ol
org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu
calendar cal-loaddefs org-version org-compat org-macs format-spec eww
xdg url-queue thingatpt shr pixel-fill kinsoku url-file svg xml dom
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source
eieio eieio-core password-cache url-vars mailcap puny mm-url gnus
nnheader gnus-util time-date mail-utils range wid-edit mm-util
mail-prsvr generic quail gdb-mi bindat gud autoinsert compile
text-property-search term disp-table shell pcomplete ehelp comint
ansi-osc ansi-color ring sh-script rx json subr-x map byte-opt smie
treesit executable edmacro kmacro desktop frameset windmove cl-macs gv
cl-extra help-mode cl-seq time use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core cl-loaddefs cl-lib bytecomp byte-compile
site-gentoo pcase rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting font-render-setting cairo move-toolbar gtk x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 834942 136709)
 (symbols 48 50845 60)
 (strings 32 231167 12276)
 (string-bytes 1 6352031)
 (vectors 16 117969)
 (vector-slots 8 2666758 108652)
 (floats 8 538 622)
 (intervals 56 32979 1150)
 (buffers 976 61))




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: toomas@HIDDEN
Subject: bug#74866: Acknowledgement (29.4; fit-frame-to-window + no
 vertical scroll bar + changed face height = mess)
Message-ID: <handler.74866.B.173418106631113.ack <at> debbugs.gnu.org>
References: <87msgyzakk.fsf@HIDDEN>
X-Gnu-PR-Message: ack 74866
X-Gnu-PR-Package: emacs
Reply-To: 74866 <at> debbugs.gnu.org
Date: Sat, 14 Dec 2024 12:58:04 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 74866 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
74866: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D74866
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + changed face height = mess
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 14 Dec 2024 13:29:02 +0000
Resent-Message-ID: <handler.74866.B74866.17341829314669 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: toomas@HIDDEN, martin rudalics <rudalics@HIDDEN>
Cc: 74866 <at> debbugs.gnu.org
Received: via spool by 74866-submit <at> debbugs.gnu.org id=B74866.17341829314669
          (code B ref 74866); Sat, 14 Dec 2024 13:29:02 +0000
Received: (at 74866) by debbugs.gnu.org; 14 Dec 2024 13:28:51 +0000
Received: from localhost ([127.0.0.1]:45942 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tMSCN-0001D7-Rx
	for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 08:28:51 -0500
Received: from eggs.gnu.org ([209.51.188.92]:33992)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1tMSCL-0001Cs-EC
 for 74866 <at> debbugs.gnu.org; Sat, 14 Dec 2024 08:28:46 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tMSA8-0004dO-PV; Sat, 14 Dec 2024 08:26:28 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=GD3momTah1EAAlrBcwBef+41RV5GTadxd/h50Fk/2Dc=; b=V566wu+OQAEz
 fl1LxojRWmaSNoDiUFlfJFAsEAU7cyNcCfZbF9t5zHn7SSN3l7kW92Td23xHKMrTpaMzqSe97XGz3
 uG76pKWHMrdAS5NeHQXtNE4AV8ENsu8wYaDs/ViKuVyJgvACCq9/glNIQyX+st7ceCVtdHc5NkmxG
 +jISu4YgJdS3YUL1aADia8swqnquj5aXXk2QBJ9ZE0oRQ/FUDfC8+bu9jD0uMBh3XgERVa8Lhptfm
 t9KtmOlGzg37tlbqWauJp0AhgNxo7Bq9l3xfDLW3yZh7aVFeJJRE9X1sQs1Xtz/T8BzJqf5zuuZRL
 ftUyXKw3/ZIXY32baw4LLA==;
Date: Sat, 14 Dec 2024 15:26:18 +0200
Message-Id: <86zfkytmyt.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87msgyzakk.fsf@HIDDEN>
References: <87msgyzakk.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: toomas@HIDDEN
> Date: Sat, 14 Dec 2024 14:57:31 +0200
> 
> 
> ----------------8<----------------8<----------------8<----------------
> 
> In "emacs -Q" under X (I have XFCE), evaluate:
> 
> (defun fit (lin col)
>   "Fit some text (LIN lines and COL columns) into a newly created frame."
>   (interactive)
>   (let ((buf (get-buffer-create "*foo*"))
>         (frm (make-frame '((z-group . above)))))
>     (with-current-buffer buf
>       (erase-buffer)
>       (setq mode-line-format '(""))
>       (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
>       (goto-char (point-min)))
>     (with-selected-frame frm
>       (switch-to-buffer buf)
>       (fit-frame-to-buffer))))
> ;;; LIN and COL are arbitrary, make them sufficiently small.
> (fit 9 23)
> 
> So far, so good.  Now evaluate the following:
> 
> (setq-default vertical-scroll-bar nil)
> (set-face-attribute 'default nil :height 75)
> (fit 9 23)
> 
> On my system, the frame's width is now one character short and the lines
> do not fit in the new frame any more.
> 
> ---------------->8---------------->8---------------->8----------------
> 
> In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
>  cairo version 1.18.2) of 2024-12-10 built on localhost
> Windowing system distributor 'The X.Org Foundation', version 11.0.12101014
> System Description: Gentoo Linux

FWIW, I cannot reproduce this, neither in Emacs 29.2 nor in the
current emacs-30 branch (which will soon become Emacs 30.1).

Martin, any comments?




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 14 Dec 2024 13:29:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 14 08:29:52 2024
Received: from localhost ([127.0.0.1]:45949 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tMSDQ-0001FK-4b
	for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 08:29:52 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1tMSDM-0001Et-9c; Sat, 14 Dec 2024 08:29:49 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tMSDH-0006af-1g; Sat, 14 Dec 2024 08:29:43 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=BX9bOVsZg0BWu2svzRpBU6OfdAkcixqgGL7IHuVMD7Y=; b=abeX8F927o+I
 k4EZgnSgDigekMyOwXzUinnmrlPaWvbA1qq//GvpdKlx/poqSMq/GMLlvPKiKwusF7lOfBCDRu3hr
 yBNpSFWHL6qcS0JNDnVGdHeS1BaG0A2+VF8F7Ewy0gDBw+eq/bB5E/eW2x4nqewkyvLqOp3JR0Cs0
 v8ukeHYYat9jQL7goPufZZU4Ie5HsL0yd7fnoV2XtNc4amj1mQAzmtXKZWCWqcCw9Ck8ecU9POuUw
 6mFyZhNNqLuG/Bax9a3sLTiFQiulFSps0BhORbuGqalv3tGHOcfqKvhNcnl9VDeFzVkxesThfaZjT
 SuVhK+qoz3yjW8eK09EtRA==;
Date: Sat, 14 Dec 2024 15:29:34 +0200
Message-Id: <86y10itmtd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: toomas@HIDDEN
In-Reply-To: <87jzc2z9jj.fsf@HIDDEN>
Subject: Re: bug#74867: 29.4;
 fit-frame-to-window + no vertical scroll bar + changed face height =
 mess
References: <87jzc2z9jj.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
Cc: 74867 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

merge 74867 74866
thanks

> From: toomas@HIDDEN
> Date: Sat, 14 Dec 2024 15:19:44 +0200
> 
> 
> ----------------8<----------------8<----------------8<----------------
> 
> In "emacs -Q" under X (I have XFCE), evaluate:
> 
> (defun fit (lin col)
>   "Try to fit some text (LIN lines and COL columns) in a newly created frame."
>   (interactive)
>   (let ((buf (get-buffer-create "*foo*"))
>         (frm (make-frame '((z-group . above)))))
>     (with-current-buffer buf
>       (erase-buffer)
>       (setq mode-line-format '(""))
>       (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
>       (goto-char (point-min)))
>     (with-selected-frame frm
>       (switch-to-buffer buf)
>       (fit-frame-to-buffer))))
> ;;; LIN and COL are arbitrary, make them sufficiently small.
> (fit 9 23)
> 
> So far, so good.  Now evaluate the following:
> 
> (setq-default vertical-scroll-bar nil)
> (set-face-attribute 'default nil :height 75)
> (fit 9 23)
> 
> On my system, the new frame's width is one character short and the lines
> do not fit into the new frame any more.

This is an exact duplicate of bug#74866, which you filed about 20
minutes earlier, so I'm now merging them.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + changed face height = mess
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 14 Dec 2024 17:17:02 +0000
Resent-Message-ID: <handler.74866.B74866.173419659818331 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>, toomas@HIDDEN
Cc: 74866 <at> debbugs.gnu.org
Received: via spool by 74866-submit <at> debbugs.gnu.org id=B74866.173419659818331
          (code B ref 74866); Sat, 14 Dec 2024 17:17:02 +0000
Received: (at 74866) by debbugs.gnu.org; 14 Dec 2024 17:16:38 +0000
Received: from localhost ([127.0.0.1]:48204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tMVkr-0004lb-Mt
	for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 12:16:38 -0500
Received: from mout.gmx.net ([212.227.17.22]:56447)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1tMVkp-0004lG-Ae
 for 74866 <at> debbugs.gnu.org; Sat, 14 Dec 2024 12:16:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1734196585; x=1734801385; i=rudalics@HIDDEN;
 bh=ZUJjqCt3zwMuzsdZvRxuo1X2O5pg/KgiqTN9czwSNgg=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=jPWzwyy3smN0+zXTgnpjMSjeAg1rfkwJj6vVbNbK0P/zkYHeVnlKG5Z+GOvqI1FU
 zZcZIfyZN1Ms6ibKcbJqGXU3Aq0poNfI/uIeVq1QMAA8OkPURQG0+KQbUb2hDh24r
 MxfzRjDph5ORLxaS4IiqEHnCG7hJDMAymFoUhwv4/vvKJJi/s0lPkWR4pa9SSX18y
 Y6onfi8Sw3/eeaK8On2FvfAs5WsPulh5WobH4eB7feKuaHznPVFoutVm9AFDM/+Ib
 Z6xpArlHbElYWCT1OD5uWKqfjmCg1j6pmE9GhFbrZdHxrI4Y38nUukDvJz10IKl52
 JIm3xzYSI6G0Jzorhg==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.8.232]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N4hvb-1tlyiU1nfz-010N8K; Sat, 14
 Dec 2024 18:16:25 +0100
Message-ID: <d704c04f-e315-4823-bb2e-cd4821ca3d2b@HIDDEN>
Date: Sat, 14 Dec 2024 18:16:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87msgyzakk.fsf@HIDDEN>
 <86zfkytmyt.fsf@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <86zfkytmyt.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:/Me9CGAMVnOnEPFRh/IVYOsvn5PeYZSOAK7XtCVcyUL7e/Zahxn
 nwQvTtLDMq4aOmNiUE2PdlKQlIpmtwlTwAEToA/xqIRqkosrRPSpTJAoBb24OqxYK8JNpYK
 d/bhkho6XTGs/U3duk13Gw660pOePMuNdoVp7V0YKURGsvTfaRI7vX/epJuR7j2MC/Wn5mS
 fNcFVFGYDPIGPqoxe/omg==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:9z0AeDGcKvg=;UdvsUtCLZqJ31KCpA6jFIbjK7tS
 BQAGIyW7Mn+CWuEUsbP1x5QZKgE5NMyQkKIyUFQySghsLgk/6CSzqaihgzgQ6MLytuZSXG3nZ
 WH6eOe2ZdlB4C53CCaUlq1Woac4Eqo8itmdXkBRXhfD1JE4mQWBtxBm/1rUyjb/ecFL07veS5
 sGoJOyWZeH0v8e+F/m7wxYxWivrZvqHd28OxbwuXQFkRA2zTQa/t6Me7BQ1y2A3xgCIAd0oNS
 vWrUaIp8PB8IFjK3NG6enVD3HeOkbfzKBvvwDmjTtdLuCdUvWPT5ae4BZ49y73FoOmBAIajkl
 5vaBVbNvB3j6VzCAsjGcd1n6JD9zDiPmn4wkoHX279RpfC/y1Ujjia+RYxiep/DJvzOKeRHCU
 HughH+FnexqJ1rXTIwOHyTziHmz6AD5v4q8WIPAhTeXVuZ/rMSr9L66/gXm3JMZ4WhAquFWE+
 UsHo+3PKZupB9uUhu07NwyMPTz51L3v+xwPOXTgZqkOGsOPffSPzn2v3L2fi9jRK6KPSdxm3d
 s5uFOcPZ4+l/oKpVnTN9EyvDWk5yen5JFQ44PgJdfwiFbop3ccpQak9NLVgrgcaaLS2hMxaB4
 oSXpe67427j+h5+dI9NicxfLi4rougsGbwfoM9oYRCH1HJRzSbrNBrSNgJxdnjMF9E7omEp9u
 +mmeLfBd9ROlPcGy7AGEO3e5uPd4cTrKBJfqazRUk7f6j06Fg0qxtNZcV5uzRahNjSB5/YvCy
 RQI2xwJiEvREMk+w4rXl+n4KBygwSF+kw9ypTX59IsK2aH3/O9ML/FPk4NQXWdczf9Y5nnav1
 NZK0eige+5tiPGA1HWCFNyNHN2/dLr6R/0Mjmd8+6uGLQubjQ60bqfIUDlHdkRH3eLxbXs56R
 Bb7+QRRRa66iXbE7At/CMRqwQpENiSEu8dN1yrQ5E7LXCbMejI4CL+csBwU7S3YQpBQJbWo41
 vG4x6At9wre+vVG9BrcVaVS67IfDh/BeCTXSO3iy5+CwTQZhZ1Q9nPKKDuCkSWByTdIQcOxGV
 4klHOS7veJsVgeJpkpAC5+D//gnDQLrB7Qm1vLP4o3IwcV/je3GS5R1hMaxMI59vVoNJNaZdx
 4m1Sj4aPWmll5asCQ+HuoNBtPQ+eiz
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > Martin, any comments?

Looks like an idiosyncrasy of 'set-face-attribute'.  The following seems
to work here.  Don't ask me why.

(defun fit (lin col)
   "Fit some text (LIN lines and COL columns) into a newly created frame."
   (interactive)
   (let ((buf (get-buffer-create "*foo*"))
         (frm (make-frame '((z-group . above) (vertical-scroll-bars . nil)))))
     (with-current-buffer buf
       (erase-buffer)
       (setq mode-line-format '(""))
       (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
       (goto-char (point-min)))
     (with-selected-frame frm
       (switch-to-buffer buf)
       (set-face-attribute 'default nil :height 57)
       (fit-frame-to-buffer))))

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch
Resent-From: Toomas Rosin <toomas@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 14 Dec 2024 19:10:02 +0000
Resent-Message-ID: <handler.74866.B74866.17342033467099 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: "martin rudalics" <rudalics@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 74866 <at> debbugs.gnu.org
Received: via spool by 74866-submit <at> debbugs.gnu.org id=B74866.17342033467099
          (code B ref 74866); Sat, 14 Dec 2024 19:10:02 +0000
Received: (at 74866) by debbugs.gnu.org; 14 Dec 2024 19:09:06 +0000
Received: from localhost ([127.0.0.1]:48385 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tMXVh-0001qP-Ge
	for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 14:09:05 -0500
Received: from 92-115-235-80.sta.estpak.ee ([80.235.115.92]:47998
 helo=rosin.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <toomas@HIDDEN>) id 1tMXVf-0001q1-EG
 for 74866 <at> debbugs.gnu.org; Sat, 14 Dec 2024 14:09:04 -0500
Received: by rosin.ee (Postfix, from userid 1000)
 id 89CA11AB7AC; Sat, 14 Dec 2024 21:09:01 +0200 (EET)
From: Toomas Rosin <toomas@HIDDEN>
In-reply-to: Your message of Sat, 14 Dec 2024 18:16:22 +0100
 <d704c04f-e315-4823-bb2e-cd4821ca3d2b@HIDDEN>
References: <87msgyzakk.fsf@HIDDEN>
 <86zfkytmyt.fsf@HIDDEN> <d704c04f-e315-4823-bb2e-cd4821ca3d2b@HIDDEN>
X-Mailer: MH-E 8.6+git; GNU Mailutils 3.17; Emacs 29.4
Date: Sat, 14 Dec 2024 21:09:01 +0200
Message-ID: <20241214210901.14730@toomas>
User-Agent: MH (GNU Mailutils 3.17)
X-Spam-Score: 0.4 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.6 (/)

Thank you, this got the damn thing working for me.  As the lines about
vertical scroll bars and font size were from my init.el, I was loath to
clutter my function with them and hoped to get away with only adding the
`vertical-scroll-bars' item to the `frame-attributes' arg of
`make-frame'.  And indeed, this worked.  So the final form of my MWM
looks like this:

;;; init.el:
(setq-default vertical-scroll-bar nil)
(set-face-attribute 'default nil :height 75)

;;; main code:
(defun fit (lin col)
  "Fit some text (LIN lines and COL columns) into a newly created frame."
  (interactive)
  (let ((buf (get-buffer-create "*foo*"))
        (frm (make-frame
         `((z-group . above)
           (vertical-scroll-bars . ,vertical-scroll-bar)))))
    (with-current-buffer buf
      (erase-buffer)
      (setq mode-line-format '(""))
      (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
      (goto-char (point-min)))
    (with-selected-frame frm
      (switch-to-buffer buf)
      (fit-frame-to-buffer))))

Cheers, T.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch
Resent-From: Stefan Kangas <stefankangas@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 17 Dec 2024 13:09:01 +0000
Resent-Message-ID: <handler.74866.B74866.173444089726528 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Toomas Rosin <toomas@HIDDEN>, martin rudalics <rudalics@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 74866 <at> debbugs.gnu.org
Received: via spool by 74866-submit <at> debbugs.gnu.org id=B74866.173444089726528
          (code B ref 74866); Tue, 17 Dec 2024 13:09:01 +0000
Received: (at 74866) by debbugs.gnu.org; 17 Dec 2024 13:08:17 +0000
Received: from localhost ([127.0.0.1]:57972 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tNXJA-0006tn-PW
	for submit <at> debbugs.gnu.org; Tue, 17 Dec 2024 08:08:17 -0500
Received: from mail-ed1-f52.google.com ([209.85.208.52]:49500)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1tNXJ6-0006tY-H0
 for 74866 <at> debbugs.gnu.org; Tue, 17 Dec 2024 08:08:13 -0500
Received: by mail-ed1-f52.google.com with SMTP id
 4fb4d7f45d1cf-5d3ea065b79so359889a12.3
 for <74866 <at> debbugs.gnu.org>; Tue, 17 Dec 2024 05:08:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1734440832; x=1735045632; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=JjGaG1TfiV4pf4ImV/79cfDo49xRplGB3dxg0dzS9u4=;
 b=g3/ShCaiKMTp626s6DKwGxuREhKfdmxUl6OH7yQAskNOhpUwtXRtfBHEc5vgOrmNnc
 v/E76KC4Cl0CO+rtEU+OqyyMqa0GlrWK9vQiUhX1PbxIekrWQVeqaY60TSg5nQW+4bPD
 nrSf35IYQALBqj1+sCp5JGJ5q5Rz19JcYTJdGqBcpjONn2IgMFuLo5Nqw/hruSA+Tmwd
 iaX9lVELBmmSzFeTxlc1W6+BMTycff7EO9KpLw0GupYiiLiAEcSUCxeAcmV9FS8XIlfi
 84WJJLYhCdbtEjobvnVQMWsvCmE4EBXyDChl8DylfTuOnFjZ4U3cv7PGDQGYJAMAE2aR
 WdlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1734440832; x=1735045632;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=JjGaG1TfiV4pf4ImV/79cfDo49xRplGB3dxg0dzS9u4=;
 b=NJHndKS0ePuQf9j4fTHHBlVSvYPYFqs9muzDuy7ZGgoBIRKCheGvfpF4QakTO0DdNi
 U9LyUkTYFUI2Uxj3HDXGdzQIgJA1L9sy5bk7a85YztQakIFWqek01Sh0IB1XN+qVCq1L
 GGHU3oGoUPhq9GGGdv/QNdZEVnVcYHPQBy0mzXZmRh8aXyK2NiuuTKxyrPs77cM3N1PT
 XcyC8GBCB6pllhtqr3MSmvDzTt0wtl4YDxGG2UIG5BF1My5KOxYB1P4meyLEELlCW0Ny
 GBia0EejxDwiXcZvFSy7yburh6TbBTuiX2+BFZhGf5YuMofwUw+UeZkOlrlmrMwdJaZq
 f0yg==
X-Forwarded-Encrypted: i=1;
 AJvYcCVRiN+KNFvn0I08s/+DLcNCCumMzKQiP9HRtNaE83Hq6kvZGDYlf3oXWrKTEMMWvrBYyIHR5g==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YybC2WYkotkhOvUq0z6l5/6yA8OW6npGG+35BusMHgtbOdvKMA9
 CQIMDVSQen5E19uK+IgcccWRgkKY17VLYjrRhlVFiSHJjD0OiOkL2onRnxHLNkCyMwK2o6STayH
 ObCoa9ZAgXijx7CWfrIU63S71RcbrHh1hq7M=
X-Gm-Gg: ASbGncuTPvh9++4yX7Q1ahAPLsiuLCZfnZ2Zq+J8cqBLkbSaVSL97e85G6xBwaW+LSJ
 aec3JeeIx/pHvsnODWA3tqC4B+cw4EgFOy6yrnw==
X-Google-Smtp-Source: AGHT+IF9kQEyDR8Ld6g1q01SCgWREZ3ubHq+RtLouWH5Smows5kZwB/1QGLOHoyfHk02/5vLkapZ19I9rUGyFvYaaes=
X-Received: by 2002:a05:6402:3551:b0:5cf:f42f:de82 with SMTP id
 4fb4d7f45d1cf-5d63c2e51b6mr14117030a12.7.1734440831321; Tue, 17 Dec 2024
 05:07:11 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 17 Dec 2024 13:07:10 +0000
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <20241214210901.14730@toomas>
References: <87msgyzakk.fsf@HIDDEN>
 <86zfkytmyt.fsf@HIDDEN> <d704c04f-e315-4823-bb2e-cd4821ca3d2b@HIDDEN>
 <20241214210901.14730@toomas>
MIME-Version: 1.0
Date: Tue, 17 Dec 2024 13:07:10 +0000
Message-ID: <CADwFkm=-HhE-N0sk9HnocSBOM-pMzes8mU9+sn_Lrf24eV1LXA@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Toomas Rosin <toomas@HIDDEN> writes:

> Thank you, this got the damn thing working for me.  As the lines about
> vertical scroll bars and font size were from my init.el, I was loath to
> clutter my function with them and hoped to get away with only adding the
> `vertical-scroll-bars' item to the `frame-attributes' arg of
> `make-frame'.  And indeed, this worked.  So the final form of my MWM
> looks like this:
>
> ;;; init.el:
> (setq-default vertical-scroll-bar nil)
> (set-face-attribute 'default nil :height 75)
>
> ;;; main code:
> (defun fit (lin col)
>   "Fit some text (LIN lines and COL columns) into a newly created frame."
>   (interactive)
>   (let ((buf (get-buffer-create "*foo*"))
>         (frm (make-frame
>          `((z-group . above)
>            (vertical-scroll-bars . ,vertical-scroll-bar)))))
>     (with-current-buffer buf
>       (erase-buffer)
>       (setq mode-line-format '(""))
>       (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
>       (goto-char (point-min)))
>     (with-selected-frame frm
>       (switch-to-buffer buf)
>       (fit-frame-to-buffer))))
>
> Cheers, T.

So is there a bug here?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch
Resent-From: Toomas Rosin <toomas@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 17 Dec 2024 13:16:02 +0000
Resent-Message-ID: <handler.74866.B74866.173444132528046 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: "Stefan Kangas" <stefankangas@HIDDEN>
Cc: martin rudalics <rudalics@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 74866 <at> debbugs.gnu.org
Received: via spool by 74866-submit <at> debbugs.gnu.org id=B74866.173444132528046
          (code B ref 74866); Tue, 17 Dec 2024 13:16:02 +0000
Received: (at 74866) by debbugs.gnu.org; 17 Dec 2024 13:15:25 +0000
Received: from localhost ([127.0.0.1]:57992 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tNXQ4-0007IH-3M
	for submit <at> debbugs.gnu.org; Tue, 17 Dec 2024 08:15:24 -0500
Received: from 92-115-235-80.sta.estpak.ee ([80.235.115.92]:37216
 helo=rosin.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <toomas@HIDDEN>) id 1tNXQ1-0007Hu-Ir
 for 74866 <at> debbugs.gnu.org; Tue, 17 Dec 2024 08:15:22 -0500
Received: by rosin.ee (Postfix, from userid 1000)
 id 456B01A1B3D; Tue, 17 Dec 2024 15:15:19 +0200 (EET)
From: Toomas Rosin <toomas@HIDDEN>
In-reply-to: Your message of Tue, 17 Dec 2024 13:07:10 +0000
 <CADwFkm=-HhE-N0sk9HnocSBOM-pMzes8mU9+sn_Lrf24eV1LXA@HIDDEN>
References: <87msgyzakk.fsf@HIDDEN>
 <86zfkytmyt.fsf@HIDDEN> <d704c04f-e315-4823-bb2e-cd4821ca3d2b@HIDDEN>
 <20241214210901.14730@toomas>
 <CADwFkm=-HhE-N0sk9HnocSBOM-pMzes8mU9+sn_Lrf24eV1LXA@HIDDEN>
X-Mailer: MH-E 8.6+git; GNU Mailutils 3.17; Emacs 29.4
Date: Tue, 17 Dec 2024 15:15:19 +0200
Message-ID: <20241217151519.14184@toomas>
User-Agent: MH (GNU Mailutils 3.17)
X-Spam-Score: 0.4 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.6 (/)

Stefan Kangas <stefankangas@HIDDEN> wrote:

> So is there a bug here?

I would say there is, because Martin's fix is more of a workaround than
regular coding.  At least there seems to be no way to arrive at this
hack by reading the documentation.

T.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 18 Dec 2024 10:06:02 +0000
Resent-Message-ID: <handler.74866.B74866.17345163346857 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Kangas <stefankangas@HIDDEN>, Toomas Rosin <toomas@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 74866 <at> debbugs.gnu.org
Received: via spool by 74866-submit <at> debbugs.gnu.org id=B74866.17345163346857
          (code B ref 74866); Wed, 18 Dec 2024 10:06:02 +0000
Received: (at 74866) by debbugs.gnu.org; 18 Dec 2024 10:05:34 +0000
Received: from localhost ([127.0.0.1]:33471 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tNqvt-0001mV-E3
	for submit <at> debbugs.gnu.org; Wed, 18 Dec 2024 05:05:34 -0500
Received: from mout.gmx.net ([212.227.15.15]:50709)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1tNqvm-0001m6-QU
 for 74866 <at> debbugs.gnu.org; Wed, 18 Dec 2024 05:05:30 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1734516319; x=1735121119; i=rudalics@HIDDEN;
 bh=EHsk3xKWCs345qDYG5erVHOISdmY3v14QOpGAspgakE=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc:
 References:From:In-Reply-To:Content-Type:
 Content-Transfer-Encoding:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=YdrC4EKFzJPg9IC+LyRsOFkDXsgADv38IY90Ah4aR3KytlVeB751r8zsaCvhEpHH
 jGX+MhLnBQC9rMDtlDs17Zx02L8q2s7xMek3sbPind61TcQcLPdP8r01nQc2qDt6l
 MNHpoVG9cCKkRPpaxoCRllOSjMzejimcQe3BgwKb/408WslL2ahm/Zj06vxwBGQS/
 FcdYsBjxFEPXE0j9xb42UxxW7f/o58xRjWkJydTSFoSrD7GRjtNBNik4KP/g3O78G
 KbyNY5y3G6lgg3kzvDLOM5DF5osxlnBK0NzUXp+nN+4lo4SdESsgnwz33CQ+xtxuC
 ZmHAZeuF7xUwCtiqLw==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([213.142.97.162]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M2wGs-1tR8iI3jMS-00B03N; Wed, 18
 Dec 2024 11:05:19 +0100
Message-ID: <7e7b4037-5f71-4c74-9a93-2db76d2eb86e@HIDDEN>
Date: Wed, 18 Dec 2024 11:05:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <87msgyzakk.fsf@HIDDEN>
 <86zfkytmyt.fsf@HIDDEN> <d704c04f-e315-4823-bb2e-cd4821ca3d2b@HIDDEN>
 <20241214210901.14730@toomas>
 <CADwFkm=-HhE-N0sk9HnocSBOM-pMzes8mU9+sn_Lrf24eV1LXA@HIDDEN>
Content-Language: en-US
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <CADwFkm=-HhE-N0sk9HnocSBOM-pMzes8mU9+sn_Lrf24eV1LXA@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:wtyzLiS1Q/9RZetpFfIq6WrNDN4EplOJka4YvI6ZtV+1nwv3JSA
 pGphtrrY7fKo+XJjMV8k18MRXgBfS517YTvunT41aiLtowhkwK2LA7VZ4xt+H1YFN/Al1FW
 dkUaH9qFHQkx4PEWQkOVr4N+BuDJOpnrOMcIPwK0lh4tVezPNBkXm3+SYTC2GeYKpn1L2z2
 RbDwWPrqmQgrW4LzDMHwQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:0x49v2Yf/sU=;yssmDxySflna0HGM3X5Xda9C+Fy
 IlGEtzEW6R1tiDS8Bjo/rtsbthIHRzN5LC51smTxqEI1at9obqMdPVNJStn0aXnehX6C72Nt2
 oQDtzXFlA/7MM26Ay9f6lE7l/wgEwPJfplJ9IH5+kcY+guK9G8pxcMsFeRtvTgC+Cjobdpjqr
 ERKOcrnKjQSow47IFh/28AM0jJ34x0S0iGrPkVnNS9ex0rGPJ11TWnA4UVhQ6XvpfocabYMdA
 3BvdWzsX5xyQgt8K96nF+58SB5fYkfepcrO1mXynhMG7kE3narLTRvUXI67e4VKjC42u978kK
 WRq1BmOjaDmvQZI6MNybr1HL7cpbmPF5/S4+Aj83DiZQVSl9y+f6cHuv0GA2ZxyskGuY8x489
 LEd7FoE62gBDoLmsK0SvXCWVcW1psb1Spu4LeIqaZ9K6yfKcwncr7vXm0S0gK9ajgj8o7iAXx
 +I/Vj+s2F5E81h3pTS7Xo7+UPXYykunV9SXfjTZ3AEbwKHKN3Azv6GWiCn/PIGJZmhpaoKjuA
 +DSDm559Y6/41iTWpfzQBzaqnrNKHk2oPY+BA6V76IQts97wgKLujUPb5xPcm9W6wQSW+9tyB
 O+jEkfqVrs225CEeJ2G23tXGCCa3mOgsZE2FD/0Qy4rxBgpVr9XkGZ373MVEofMtZcExzyNuU
 RrI8BvRdxbB42s/m6Z8USzI1SqCf5d1L+eHBVuLNCZlyk5LFGhNPLNDee1AZ4LQuIJvWGa2eR
 Nb5K4uGxsakvRIlXBp6KpQZnNHzQ8DJDQYJDKiHg9CIVNz/QTp2gT0a0RQyw3gbSIMDnTqvOH
 ay+mZEPZSyXpMXyYJExlx410+HgDcivnjZ4mXpLc0E4u4n2WEAY9lrCkSdVkMkZnx8H1VTDG0
 xy1kIy4UjDaSXD4hXuYocYncpL2uWoJBTnkhB1Aj3V9aTaThs+psb5RdOig7w3unZFL3TTYBT
 kYpmXV9W5VVOpPwVKuyClrkQPLWczKOMmVQ8C0kpBsNnjAaOatkiTVK9HcdH+SdiP6pDszlFW
 mM2/Fn+rPvok5WR2ypMzYC9tsX0NKHQms1hYWIJHFP4lTq38lE9OjP20UVU7rvHLm/UvBLFMs
 5Vdx3qX17n/BLcESCpBipUJvnzapOu
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > Toomas Rosin <toomas@HIDDEN> writes:

Toomas please include me in the recipients.

 >> Thank you, this got the damn thing working for me.  As the lines about
 >> vertical scroll bars and font size were from my init.el, I was loath to
 >> clutter my function with them and hoped to get away with only adding the
 >> `vertical-scroll-bars' item to the `frame-attributes' arg of
 >> `make-frame'.  And indeed, this worked.  So the final form of my MWM
 >> looks like this:
 >>
 >> ;;; init.el:
 >> (setq-default vertical-scroll-bar nil)
 >> (set-face-attribute 'default nil :height 75)
 >>
 >> ;;; main code:
 >> (defun fit (lin col)
 >>    "Fit some text (LIN lines and COL columns) into a newly created frame."
 >>    (interactive)
 >>    (let ((buf (get-buffer-create "*foo*"))
 >>          (frm (make-frame
 >>           `((z-group . above)
 >>             (vertical-scroll-bars . ,vertical-scroll-bar)))))
 >>      (with-current-buffer buf
 >>        (erase-buffer)
 >>        (setq mode-line-format '(""))
 >>        (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
 >>        (goto-char (point-min)))
 >>      (with-selected-frame frm
 >>        (switch-to-buffer buf)
 >>        (fit-frame-to-buffer))))
 >>
 >> Cheers, T.
 >
 > So is there a bug here?

It might be a synchronization problem.  When in the new frame I type M-x
fit-frame-to-buffer, it behaves as intended here.

Whatever it is, I'd suggest to never ever use the idiom

(setq-default vertical-scroll-bar nil)

'vertical-scroll-bar' is an automatically buffer-local variable meant to
override what the frame specifies for any buffer displayed in it.  But
the size hints Emacs sends to the window manager are derived from the
settings for the frame.  So it's easily possible that the window manager
truncates the frame size to the next size specified by our size
increments just that in the case at hand the base width would still
include the vertical scroll bar.  In fact, here I have to set
'frame-resize-pixelwise' to t to make your scenario work even without
the 'set-face-attribute' call.

So if you want to turn off vertical scroll bars for all frames please
use a (vertical-scroll-bars . nil) entry in 'default-frame-alist'.

Whether 'set-face-attribute' DTRT and how it is involved in the scenario
at hand is a question I'd prefer not to answer.  If it affects the
canonical line height or column width of a frame, it should find its way
into the size hints for each frame.  Otherwise, chaos may result.

martin




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch
Resent-From: martin rudalics <rudalics@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 23 Dec 2024 18:00:09 +0000
Resent-Message-ID: <handler.74866.B74866.17349768067185 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 74866
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Kangas <stefankangas@HIDDEN>, Toomas Rosin <toomas@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 74866 <at> debbugs.gnu.org
Received: via spool by 74866-submit <at> debbugs.gnu.org id=B74866.17349768067185
          (code B ref 74866); Mon, 23 Dec 2024 18:00:09 +0000
Received: (at 74866) by debbugs.gnu.org; 23 Dec 2024 18:00:06 +0000
Received: from localhost ([127.0.0.1]:56050 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tPmio-0001ql-Mb
	for submit <at> debbugs.gnu.org; Mon, 23 Dec 2024 13:00:05 -0500
Received: from mout.gmx.net ([212.227.17.21]:38537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1tPmil-0001q2-Sz
 for 74866 <at> debbugs.gnu.org; Mon, 23 Dec 2024 13:00:01 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at;
 s=s31663417; t=1734976792; x=1735581592; i=rudalics@HIDDEN;
 bh=zin/484uBy1cPAg9T5sfpbC51/cBNKvVyhZVhFPdjb0=;
 h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:From:To:
 Cc:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:
 cc:content-transfer-encoding:content-type:date:from:message-id:
 mime-version:reply-to:subject:to;
 b=jrW7P4/4dtPoCPSsPzU8Lx5W3GKVAjlW8vT4qAWFGrqU86VCEYDCmw60f/OCJH/l
 5tVijLF65ESemkZflIYONRWzdBn+oW5HluHA/EUZFsoXwvAeZR77lzw1pQHyiX2bg
 1ww8sS8mOAUR2Sss1ptslVYCadAh2fCDpdtRizViK00WeiE/R3+z8S//2mjQsa/hH
 cv6xukVipmdIClFjF1MlOvBnBqQwAuq4oji6KsbP3+EjQENa0eSqipY1UO44bxYa6
 ZVIy67kc4hxJxY32QIQ2o6Exm8k99Y2RaBHnlf4wKpFVvlmz0JyPwQ76qcEuIF3W8
 dgQofq4HZoXKsBQ98w==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from [192.168.31.113] ([212.95.5.6]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MgesG-1u2AP53iSy-00gFm6; Mon, 23
 Dec 2024 18:59:51 +0100
Message-ID: <44136318-1e16-406b-984f-b760f5fa4f8f@HIDDEN>
Date: Mon, 23 Dec 2024 18:59:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: martin rudalics <rudalics@HIDDEN>
References: <87msgyzakk.fsf@HIDDEN>
 <86zfkytmyt.fsf@HIDDEN> <d704c04f-e315-4823-bb2e-cd4821ca3d2b@HIDDEN>
 <20241214210901.14730@toomas>
 <CADwFkm=-HhE-N0sk9HnocSBOM-pMzes8mU9+sn_Lrf24eV1LXA@HIDDEN>
 <7e7b4037-5f71-4c74-9a93-2db76d2eb86e@HIDDEN>
Content-Language: en-US
In-Reply-To: <7e7b4037-5f71-4c74-9a93-2db76d2eb86e@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:JcRlEhW7lOGmbvaL2TVXNJ5RDZiItjFMqkv5eEADyjA2rP57gEr
 ijIz3WSvFUnIJICglmVyig5sANZiMLlIjbmsP9UUqKllPXODDwmgNtedp2Bmiy8H5hxDuYz
 olB7Z0Y5eS3iY03bkX5wt1DyGaSsFb1n/i4QR5HFr9IyoHaA+JQ8kn1rJoH6Y8RorOT8Rhh
 2DWzgYhGGG0rK5qLGQCVg==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:ivLHbq8P014=;WZWPgO8QRguN7ZFCr4Y9H5Umtny
 EyTxV9RTgIv9I++eCLq6qRdtaphhgT0AbD5ksxFCEHkZcqi+B4Zg1vUWSv1yrzXTBox0AB+Z7
 6GYudeAJYXxr2XVTpK6XFkGFmQQL2zwlAJIOiSdsr3ZUh9FTybuHgipfXhPTPqjh+3QgNDCHN
 DvJopDBFOAoX3d/w2L1hzyFcj380AcxIUOcipRxn7Fj2Lf/uH8z06Nb77cRp7YVAlpH1Rzwtq
 fB83sWGiVrABemQ6WcyxLpC4CepBTygxwrGShdzdWH+pbEF+OWwG6b+FsPLAEISiZMiZwoPta
 ksm1sJabJOiOCt6oEe8H3B47ODk9xSVxXkXkkBdsf7ZdFmxneq0+T/j4avm4gDLv4w5S4iOa1
 vrb6KzwthmQemnvX0EXtogwRg9qiWU2PIoCA1LzS03y2vP/j2eUh7/bvB7OMtAiq6RtGVEA4J
 ychIeL6VhoatPThDeUoauu4CT9lNgtZahu/MSw7EBEhsnrJ5GUoDTomPjhQUsk2dVdePQTD65
 XZO3v5HPve06/3SDdDFl5xyOio2IQoTknBiZyei3qI7rn5FmF8V+HbV7RWrLYILHBEQ/H0/7r
 LT+OjU1f+YKrgX1DQGqpYIpiIFrR4imQSr3LhlkS/CoIuozFLdiiClqT4nP13T3ZUlYZs30dx
 +RBr9pEuuayM52ITMVmw88LaDybYXKJ/DmTTByMvU5lNfQUUi8ejvdo9iO+esHWoUN8CPZjzj
 JNGLJCq6YI9EyskHbhdWEGSEhpRyJZ/6dmTALBiYjhSvyAecM0JYXj6cZlnXypMoY0pjuGCcE
 dwdxUXizVQnVYQ08tNmOKMY8igYn4h3mMxrO0vd9OVJucF4ZL+57akzeVuUcp8f1xZiHCmy3z
 HbSmYiGZjSLeW4PDKHSzs5KSA4MSaNSI6JVjD0f/vypwqf86zITeO7/jGxVv+RK6rf6Xfn0pe
 g3Cxl/goc5jnMUsGBV2tvBhzFUXwLS6Clxi+hWs/TeV8f/2FNOxPUeD+UZBtelQZzedJvTM0n
 DJkYXrrebBek6uV0+q2H1Dct4MGeD/8ypaHKRiT9ER3zimrNqz7REGxyGJw8k6ZYPepUp/V2d
 lFDyDf/obKt+3T8iMOsh3brlzepL3+
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > Whether 'set-face-attribute' DTRT and how it is involved in the scenario
 > at hand is a question I'd prefer not to answer.  If it affects the
 > canonical line height or column width of a frame, it should find its way
 > into the size hints for each frame.  Otherwise, chaos may result.

I now analyzed the problem and came to the conclusion below.  Note that
the scenario below is interesting only for window systems that employ
size hints as is the case for most GNU/Linux based systems.  The problem
cannot be seen on Windows, for example, because it does not use size
hints.

With emacs -Q of the release version put the following code into
*scratch* (which is the code from the OP plus two commented lines).

(defun fit (lin col)
   "Fit some text (LIN lines and COL columns) into a newly created frame."
   (interactive)
   (let ((buf (get-buffer-create "*bar*"))
         (frm (make-frame '((z-group . above)))))
     (with-current-buffer buf
       (erase-buffer)
       (setq mode-line-format '(""))
       (dotimes (_ lin) (insert (format "%s\n" (make-string col ?x))))
       (goto-char (point-min)))
     (with-selected-frame frm
       (switch-to-buffer buf)
       (fit-frame-to-buffer))))
;;; LIN and COL are arbitrary, make them sufficiently small.

;; (setq frame-resize-pixelwise t)
(setq-default vertical-scroll-bar nil)
(set-face-attribute 'default nil :height 75)
(fit 9 23)
;; (eval-buffer)

Now first evaluate the

(set-face-attribute 'default nil :height 75)

line to shrink the selected frame.  Note that if you call 'eval-buffer'
immediately, total chaos will ensue because the face attribute handling
code will annihilate any previous attempt to fit the frame.

Next evaluate the buffer.  You should see a new frame with wrapped
lines.  Now uncomment the

;; (setq frame-resize-pixelwise t)

line and eval the buffer again.  You should see a new frame fitting the
buffer.

What goes wrong when you see wrapped lines?

'fit-frame-to-buffer-1' inherently (assuming a fixed width font and
other simplifications) calculates the frame width by multiplying the
frame's character width (6 pixels) with the number of characters on the
longest line (23) resulting in 138 pixels.  It adds 16 pixels for the
fringes resulting in a requested width of 154 pixels.  Emacs asks the
window manager via xg_frame_set_char_size to set the width to 154 pixels
but the window manager allots us only 152 pixels.  Emacs concurs and
wraps the lines.

The reason for this is deeply rooted in the way we calculate size hints.
Emacs sets the base width of the frame to 32 pixels here (16 for the
widths of the frame's fringes, 16 for the scroll bar width).  So we have
a "variable" frame width of 154 - 32 = 122 pixels.  At the same time
Emacs sets the width increment to the frame's default character width.
Now the nearest multiple of 6 to 122 is 120 and that's the number of
pixels the window manager gives us.

I now installed a workaround in 'fit-frame-to-buffer-1' on master to
make the frame at least as large as needed to not wrap lines in such a
case (hopefully, it does not break anything on systems that do not use
size hints).

On the Emacs I daily use I do not see the problem because I calculate
size hints in a way that adds the "missing" 2 pixels to the base width -
resulting in a base width of 34 pixels and a "variable" width of 120
pixels.  If and when I feel that it's save to install it, I will do that
on master.  Till then either live with the workaround or either remove
the scroll bar from the frame (and not from the buffer) or set
'frame-resize-pixelwise' to t.

martin







Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.