unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Problem with new frame not recognizing `default-frame-alist' width and height
@ 2024-02-27  3:11 tpeplt
  2024-02-27  3:31 ` tpeplt
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: tpeplt @ 2024-02-27  3:11 UTC (permalink / raw)
  To: help-gnu-emacs

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?

--



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-02-27 22:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27  3:11 Problem with new frame not recognizing `default-frame-alist' width and height tpeplt
2024-02-27  3:31 ` tpeplt
2024-02-27  3:56 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-02-27 16:13   ` tpeplt
2024-02-27  8:14 ` Joost Kremers
2024-02-27 10:14   ` Eli Zaretskii
2024-02-27 11:19     ` Joost Kremers
2024-02-27 16:53     ` tpeplt
2024-02-27 19:50       ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-02-27 20:28         ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-02-27 22:05           ` tpeplt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).