From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Toomas Rosin Newsgroups: gmane.emacs.bugs Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch Date: Sat, 14 Dec 2024 21:09:01 +0200 Message-ID: <20241214210901.14730@toomas> References: <87msgyzakk.fsf@toomas.mail-host-address-is-not-set> <86zfkytmyt.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36559"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: MH (GNU Mailutils 3.17) Cc: Eli Zaretskii , 74866@debbugs.gnu.org To: "martin rudalics" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 14 20:10:31 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 1tMXX4-0009Lv-SU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Dec 2024 20:10:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMXWi-0003nI-2L; Sat, 14 Dec 2024 14:10:09 -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 1tMXWe-0003mN-Ub for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 14:10:04 -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 1tMXWd-0004Wy-CA for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 14:10:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:References:In-reply-to:From:To:Subject; bh=HQzdGqoquMBIcZICyaZbUzLkUTwkwqUZqCUmrZNNE0U=; b=DuGJWdE4vmGZBB2+nyneopkBTS5ilmGVogAKAzVYNFwq8q5guiHwHE7G9SYdsT32aBQf1CQdm11uS7nmqpgPAfhzwPyDOMNE3koQpxBq10vkpkpINvFkamGsg3gT/M5/AhVoOcrHNb9MEd55rFFqOstdr5oibY0QC4MLX410+Fj7OTQxg2S32zBfxizYVMuqdd+i7hbVFE5wxb0sPloJXDDtggeEM2ccoBwQNTSzD2JwMeOninqKakYKLVmTlwVA9Zle/EJ4DiZ0OY3F/Yz/zY/V+mI+LScBzUdA5NNc58w/xbdgylYLiMVJXWkx9U40cbkjBwQLU4QuCB3CCjb64A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMXWc-0001sE-72 for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 14:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Toomas Rosin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2024 19:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74866 X-GNU-PR-Package: emacs Original-Received: via spool by 74866-submit@debbugs.gnu.org id=B74866.17342033467099 (code B ref 74866); Sat, 14 Dec 2024 19:10:02 +0000 Original-Received: (at 74866) by debbugs.gnu.org; 14 Dec 2024 19:09:06 +0000 Original-Received: from localhost ([127.0.0.1]:48385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMXVh-0001qP-Ge for submit@debbugs.gnu.org; Sat, 14 Dec 2024 14:09:05 -0500 Original-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 ) id 1tMXVf-0001q1-EG for 74866@debbugs.gnu.org; Sat, 14 Dec 2024 14:09:04 -0500 Original-Received: by rosin.ee (Postfix, from userid 1000) id 89CA11AB7AC; Sat, 14 Dec 2024 21:09:01 +0200 (EET) In-reply-to: Your message of Sat, 14 Dec 2024 18:16:22 +0100 X-Mailer: MH-E 8.6+git; GNU Mailutils 3.17; Emacs 29.4 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:297071 Archived-At: 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.