bug#81523: frame-inherited-parameters does not create a frame of the same size
Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]> Thu, 30 Jul 2026 22:10:23 +0000
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <0tO3U1Xz6CHD7fMJrBM-4uSEFhj37pS3dFN9m2lacV1e4fOI3LAJGQiWXKUYtuHHuW12d6g25mZwfpDQ9rbmuyvgeolHOMbDBYYsB8lstIU=@protonmail.com> |
The provided code defines a function galaxiakos-du that makes a new frame
with specified inherited parameters and displays a buffer within it.
But, when using frame-inherited-parameters such as (width height), the code
does not create a frame of the same size as the previous frame or a specific
size at all. Instead, the new frame often defaults to a minimal or default
size, leading to unexpected behavior.
(defvar galaxiakos-frame-prmt '( (minibuffer . t) ))
(defun galaxiakos-du (frm-name bfr-name &rest implfds)
(interactive)
;; Make the nem frame, then change its name afterwards
(let ( (frame-inherited-parameters '(width height))
(frm (make-frame galaxiakos-frame-prmt))
(bfr (get-buffer-create bfr-name)) )
;; Change frame parameter for name
(set-frame-parameter frm 'name frm-name)
;; Iterate and call each function passed as argument
(select-frame frm)
(with-current-buffer bfr
(dolist (implfd implfds)
(funcall implfd))
(goto-char (point-min)))
;; Display the buffer in the selected frame
(switch-to-buffer bfr)) )
(defun galaxiakos-frame-sumr ()
"Display a formatted alist of frame parameters.
Construct the feed function to `galaxiakos-du'."
(interactive)
;; FEED is a display function
(let ( (frm-name "Galaxiakos DU")
(bfr-name "Frame Parameters")
(feed (lambda ()
"Display function for frame parameters."
(erase-buffer)
(insert
(concat "Frame Parameters "
"for Dedicated Display Units\n\n"))
(insert (format "%s: \n\n%S\n\n"
"galaxiakos-frame-prmt" galaxiakos-frame-prmt))
(dolist (frm-prmt galaxiakos-frame-prmt)
(insert (format "%S\n" frm-prmt))))) )
;; ---------------------------------------------------------------
;; Call the feed function to insert each frame parameter
(galaxiakos-du frm-name bfr-name feed)))
(galaxiakos-frame-sumr)