[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch
From: |
Stefan Kangas |
Subject: |
bug#74866: 29.4; fit-frame-to-window + no vertical scroll bar + ch |
Date: |
Tue, 17 Dec 2024 13:07:10 +0000 |
Toomas Rosin <toomas@rosin.ee> 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?