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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  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  8:14 ` Joost Kremers
  2 siblings, 0 replies; 11+ messages in thread
From: tpeplt @ 2024-02-27  3:31 UTC (permalink / raw)
  To: help-gnu-emacs

tpeplt <tpeplt@gmail.com> writes:

>
> 4. Set the width and height to larger values by setting the value of

My numbering of items is off by 1.  This should have been item 3, and
the subsequent items should be reduced by one, also.  There is no
missing item in the steps.

--



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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  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
  2 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-02-27  3:56 UTC (permalink / raw)
  To: help-gnu-emacs

> 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

That is weird.  IIRC it's supposed to be 40 lines of 80 columns.
I suggest `M-x report-emacs-bug`.

> 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)))

You might need to add `(user-size . t)` to those settings.
But maybe the real problem is at step 2 and prevents everything else
from working.


        Stefan




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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  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  8:14 ` Joost Kremers
  2024-02-27 10:14   ` Eli Zaretskii
  2 siblings, 1 reply; 11+ messages in thread
From: Joost Kremers @ 2024-02-27  8:14 UTC (permalink / raw)
  To: tpeplt; +Cc: help-gnu-emacs

On Mon, Feb 26 2024, tpeplt wrote:
> 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.

It's a bug! I've been noticing the same thing since I switched to Emacs 29.2,
but also figured it's probably user error. Since I don't often create a second
frame, it didn't bother me enough to investigate, but if it's happening to
others as well, it's probably a bug.

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

Yes, that's my setup as well.

> In brief, the problem is that when a new frame is created, the new
> frame’s default width and height are both small,

Yup. I actually never had any window size settings in my default-frame-alist,
but up until Emacs 28, the default width/height was fine. And if I start Emacs
by calling emacsclient, the frame that pops up is still that same size. But
creating a new frame with `C-x 5 2` produces a much smaller frame. Unusably
small, in fact.

> 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.

Indeed. Note that if you clone a frame with the `fullscreen` frame parameter set
(to `maximized` in my case), cloning the frame yields another maximised frame.

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

Emacs 29.2. I don't recall having this problem with Emacs 28, though I can't be
entirely sure.

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

I don't think there is anything you're doing wrong.

Stefan Monnier suggested you report it as a bug, which is probably a good idea.


-- 
Joost Kremers
Life has its moments



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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  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
  0 siblings, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2024-02-27 10:14 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Joost Kremers <joostkremers@fastmail.fm>
> Cc: help-gnu-emacs@gnu.org
> Date: Tue, 27 Feb 2024 09:14:20 +0100
> 
> On Mon, Feb 26 2024, tpeplt wrote:
> > 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.
> 
> It's a bug! I've been noticing the same thing since I switched to Emacs 29.2,
> but also figured it's probably user error. Since I don't often create a second
> frame, it didn't bother me enough to investigate, but if it's happening to
> others as well, it's probably a bug.
> 
> > The problem is happening when running Emacs 29.2 on GNU/Linux running
> > GNOME window manager.
> 
> Yes, that's my setup as well.
> 
> > In brief, the problem is that when a new frame is created, the new
> > frame’s default width and height are both small,
> 
> Yup. I actually never had any window size settings in my default-frame-alist,
> but up until Emacs 28, the default width/height was fine. And if I start Emacs
> by calling emacsclient, the frame that pops up is still that same size. But
> creating a new frame with `C-x 5 2` produces a much smaller frame. Unusably
> small, in fact.
> 
> > 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.
> 
> Indeed. Note that if you clone a frame with the `fullscreen` frame parameter set
> (to `maximized` in my case), cloning the frame yields another maximised frame.
> 
> > Are other Emacs 28/29 users able to reproduce this problem?
> 
> Emacs 29.2. I don't recall having this problem with Emacs 28, though I can't be
> entirely sure.
> 
> > If not, can you point to something erroneous that I am doing?
> 
> I don't think there is anything you're doing wrong.
> 
> Stefan Monnier suggested you report it as a bug, which is probably a good idea.

Isn't this bug#67654?  Are we talking about a GTK 3 build?



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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  2024-02-27 10:14   ` Eli Zaretskii
@ 2024-02-27 11:19     ` Joost Kremers
  2024-02-27 16:53     ` tpeplt
  1 sibling, 0 replies; 11+ messages in thread
From: Joost Kremers @ 2024-02-27 11:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Tue, Feb 27 2024, Eli Zaretskii wrote:
> Isn't this bug#67654?  Are we talking about a GTK 3 build?

@Eli, I accidentally replied in person instead of to the list, apologies for
that.

What I was saying: yes, it's a GTK3 build. I just replaced it with the PGTK
build and the problem doesn't occur anymore.


-- 
Joost Kremers
Life has its moments



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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  2024-02-27  3:56 ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2024-02-27 16:13   ` tpeplt
  0 siblings, 0 replies; 11+ messages in thread
From: tpeplt @ 2024-02-27 16:13 UTC (permalink / raw)
  To: Stefan Monnier via Users list for the GNU Emacs text editor
  Cc: Stefan Monnier

Stefan Monnier via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

>
>> 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)))
>
> You might need to add `(user-size . t)` to those settings.
> But maybe the real problem is at step 2 and prevents everything else
> from working.
>

Thank you for the suggestion.  I attempted it (that is, added (user-size
. t) to the ‘setq’ expression before creating a new frame), but it did
not change the result (new frame is small).

Based on what Eli Zaretskii wrote in another reply, it appears that the
problem has been reported already (bug #67654).  I had searched through
this mailing list archives (Emacs help) before asking here about the
problem, but had not searched through the mailing list archives for
Emacs bugs (because I was assuming that it must have been my error
because it is such a large, reproducible problem).

--



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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  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
  1 sibling, 1 reply; 11+ messages in thread
From: tpeplt @ 2024-02-27 16:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>
> Isn't this bug#67654?  Are we talking about a GTK 3 build?

Yes, this Emacs is built with the configuration switch
‘--with-x-toolkit=gtk3’.  The bug report you identified can be read by
anyone else at:

https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-12/msg00262.html

--



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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-02-27 19:50 UTC (permalink / raw)
  To: help-gnu-emacs

>> Isn't this bug#67654?  Are we talking about a GTK 3 build?
>
> Yes, this Emacs is built with the configuration switch
> ‘--with-x-toolkit=gtk3’.  The bug report you identified can be read by
> anyone else at:

A more canonical URL is https://debbugs.gnu.org/67654


        Stefan




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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-02-27 20:28 UTC (permalink / raw)
  To: help-gnu-emacs

> A more canonical URL is https://debbugs.gnu.org/67654

Oh, and from within Emacs you can view it with

    M-x gnu-emacs-bug RET 67654 RET

[ That's not the actual name of the command, but completion makes it
  work, and I find it easier to remember it like that.  ]


        Stefan




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

* Re: Problem with new frame not recognizing `default-frame-alist' width and height
  2024-02-27 20:28         ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2024-02-27 22:05           ` tpeplt
  0 siblings, 0 replies; 11+ messages in thread
From: tpeplt @ 2024-02-27 22:05 UTC (permalink / raw)
  To: Stefan Monnier via Users list for the GNU Emacs text editor
  Cc: Stefan Monnier

Stefan Monnier via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

>> A more canonical URL is https://debbugs.gnu.org/67654
>
> Oh, and from within Emacs you can view it with
>
>     M-x gnu-emacs-bug RET 67654 RET
>
> [ That's not the actual name of the command, but completion makes it
>   work, and I find it easier to remember it like that.  ]
>

Thank you for the canonical URL.  I have the ‘debbugs’ package
installed, so it is possible in gnus to click on https link that you
provided to get a table listing of the bug(s) that looks like:

Id    State      Submitter          Title
67654 68463,normal Roshan Shariff     29.1; Hiding menu bar makes new frames very small

The table is displayed in ‘Debbugs’ major mode and includes a menu of
actions.  Pressing RET on 67654 in the table then displays the thread of
reports in a gnus article summary buffer, just as M-x gnu-emacs-bugs RET
67654 RET.

--



^ 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).