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


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, toomas <at> rosin.ee
Cc: 74866 <at> debbugs.gnu.org
Subject: bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + changed face height = mess
Date: Sat, 14 Dec 2024 18:16:22 +0100
> 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




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.