Re: Adapting frame to match size of the invoking window

[email protected] Wed, 29 Jul 2026 21:59:37 -0400
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Heime <[email protected]> writes:

> On Thursday, July 30th, 2026 at 4:35 AM, [email protected] <[email protected]=
om> wrote:
>
>> Heime <[email protected]> writes:
>>=20
>> > galaxiakos-du makes a frame using parameters in frame-prmt.  I want
>> > to change this behaviour, making the frame take the size of the parent
>> > window from which the command was executed.  The text scale of the win=
dow
>> > has also to be applied to keep the same dimensions.
>> >
>>=20
>> It sounds like you want to use the variable
>> =E2=80=98frame-inherited-parameters=E2=80=99, which is described after t=
he
>> description of =E2=80=98make-frame=E2=80=99 in (info "(elisp) Creating F=
rames"):
>>=20
>>     -- Variable: frame-inherited-parameters
>>         This variable specifies the list of frame parameters that a newly
>>         created frame inherits from the currently selected frame.  For e=
ach
>>         parameter (a symbol) that is an element in this list and has not
>>         been assigned earlier when processing =E2=80=98make-frame=E2=80=
=99, the function
>>         sets the value of that parameter in the created frame to its val=
ue
>>         in the selected frame.
>>=20
>> So, you would change:
>>=20
>> >   (let ( (frm  (make-frame frame-prmt))
>> >          (bfr  (get-buffer-create bfr-name)) )
>> >   ...)
>>=20
>> to:
>>    (let* ((frame-inherited-parameters '(height width))
>>           (frm  (make-frame))
>>           (bfr  (get-buffer-create bfr-name)))
>>    ...)
>=20=20
> Although the frame size changes, it is not equivalent to that of the pare=
nt frame.
>

Based on the description of the variable
=E2=80=98frame-inherited-parameters=E2=80=99, this sounds like an error in
Emacs that should be reported using M-x report-emacs-bug.

If it is an error in Emacs, then an alternative that you
could try is:

   (let ((new-height (+ 1 (frame-height)))
         (new-width (+ 1 (frame-width))))
     (make-frame (list (cons 'height new-height)
                       (cons 'width new-width))))

And then you would adjust the value of =E2=80=98new-height=E2=80=99 and
=E2=80=98new-width=E2=80=99 as necessary until the new frame matches the
parent frame.  Of course, you do not need to create those
variables.  You could insert the calculations directly into
the =E2=80=98make-frame=E2=80=99 call, for example,=20

   (cons 'height (+ 1 (frame-height)))

--=20
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.