help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with new frame not recognizing `default-frame-alist' width and h


From: tpeplt
Subject: Problem with new frame not recognizing `default-frame-alist' width and height
Date: Mon, 26 Feb 2024 22:11:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

The following problem seems like it is an error in Emacs that needs to
be reported, but it ought to be so common that it would have been
noticed already.  Since it hasn’t, perhaps it is a user error with
something I am overlooking.

The problem is happening when running Emacs 29.2 on GNU/Linux running
GNOME window manager.

In brief, the problem is that when a new frame is created, the new
frame’s default width and height are both small, and overriding the
default width and height cannot be done before creating the new frame
(but can be changed after the new frame has been created).

1. Start Emacs from a shell prompt, with all customization turned off:

   $ emacs -Q

2. Create a new frame using ‘make-frame-command’: Type C-x 5 2

   The new frame only has about 8 lines and about 20 columns.
   Delete the frame using ‘delete-frame’: Type C-x 5 0

4. Set the width and height to larger values by setting the value of
   the association list ‘default-frame-alist’.  Evaluate the
   expression:

   (setq default-frame-alist '((width . 80) (height . 25)))

   Again, create a new frame by typing C-x 5 2.  The new frame’s
   default width and height are unchanged.  Change the frame’s width
   using the command:

   M-x set-frame-width

   The frame’s width is adjusted to the new value.  Repeat for the new
   frame’s height:

   M-x set-frame-height

   Again, the frame’s height is adjusted accordingly.  So it is
   possible for Emacs to adjust the height and width of the new frame,
   but it is not possible make the adjustment before the new frame is
   created.

   Delete the new frame: Type C-x 5 0

   Check the *Messages* buffer.  Emacs does not report any problems with
   creating a new frame even though it did not accept the new values for
   the frame’s width and height.

5. Change other frame parameters.  Turn off the vertical scroll bars and
   set the location of the upper-left corner of the new frame.  Evaluate
   the expression:

   (setq default-frame-alist
         '((width . 80) (height . 25)
           (vertical-scroll-bars . nil)
           (top . 50) (left . 50)))
   
   Create a new frame using C-x 5 2.  The vertical scroll bar is now
   turned off and the upper-left corner of the new frame has been
   adjusted, but the width and height are still not adjusted to the new
   values.  Delete the new frame: type C-x 5 0

6. Try the ‘clone-frame’ command that was introduced in Emacs 28: Type
   C-x 5 c.  The new frame does not clone the current frame’s width
   and height, but instead keeps the small 8x20 size as all other
   newly-created frames.

This problem with the frame width and height also occurs when using
‘emacsclient’.

Note: I do not have either a ~/.Xdefaults or ~/.Xresources file, so
values in those files cannot be interfering with the default behavior of
Emacs.

Are other Emacs 28/29 users able to reproduce this problem?

If not, can you point to something erroneous that I am doing?

--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]