GNU bug report logs - #74866
29.4; fit-frame-to-window + no vertical scroll bar + changed face height = mess

Previous Next

Package: emacs;

Reported by: toomas <at> rosin.ee

Date: Sat, 14 Dec 2024 12:58:04 UTC

Severity: normal

Merged with 74867

Found in version 29.4

Full log


Message #16 received at 74866 <at> debbugs.gnu.org (full text, mbox):

From: Toomas Rosin <toomas <at> rosin.ee>
To: "martin rudalics" <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 74866 <at> debbugs.gnu.org
Subject: Re: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch
Date: Sat, 14 Dec 2024 21:09:01 +0200
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.




This bug report was last modified 180 days ago.

Previous Next


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