* Weird problem with inital frame sizing
@ 2018-09-12 14:37 Perry E. Metzger
2018-09-12 14:50 ` Noam Postavsky
2018-09-13 11:49 ` Stefan Monnier
0 siblings, 2 replies; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-12 14:37 UTC (permalink / raw)
To: emacs-devel
For some time, I've noticed that in circumstances I can't quite pin
down, the size settings for the initial frame that I put in my .emacs
aren't always followed.
Often, for example, the frame will end up created but (apparently, I'm
just guessing!) in the size it would have been if the new (larger)
font I've set hadn't been employed, so the frame is too narrow and
short.
Subsequent frames created are _always_ correctly sized.
Thinking that this might be some sort of weird race condition during
initialization, I put a "(sleep-for 1)" into my .emacs just before the
code that sets everything, i.e., before all my "set-face-attribute"
and "default-frame-alist" manipulation. When I do this, the frame pops
up in its initial size and configuration, and then after the sleep
ends, the size of the default frame adjusts and is consistently
correct.
Can anyone guess what might be going wrong, and how we might fix
this correctly?
(I'm running the master branch, as of a few days ago, under X11. One
factor may be that I'm remote displaying over a slow link using Xpra,
but I can't be sure if this is at all relevant or not.)
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-12 14:37 Weird problem with inital frame sizing Perry E. Metzger
@ 2018-09-12 14:50 ` Noam Postavsky
2018-09-12 15:35 ` Perry E. Metzger
2018-09-13 11:49 ` Stefan Monnier
1 sibling, 1 reply; 20+ messages in thread
From: Noam Postavsky @ 2018-09-12 14:50 UTC (permalink / raw)
To: Perry E. Metzger; +Cc: Emacs developers
On 12 September 2018 at 10:37, Perry E. Metzger <perry@piermont.com> wrote:
> Thinking that this might be some sort of weird race condition during
> initialization, I put a "(sleep-for 1)" into my .emacs just before the
> code that sets everything, i.e., before all my "set-face-attribute"
> and "default-frame-alist" manipulation. When I do this, the frame pops
> up in its initial size and configuration, and then after the sleep
> ends, the size of the default frame adjusts and is consistently
> correct.
>
> Can anyone guess what might be going wrong, and how we might fix
> this correctly?
Does changing x-wait-for-event-timeout help (or hurt)?
Possibly doing your manipulation in after-make-frame-functions would
be the correct fix.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-12 14:50 ` Noam Postavsky
@ 2018-09-12 15:35 ` Perry E. Metzger
2018-09-12 15:47 ` Robert Pluim
0 siblings, 1 reply; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-12 15:35 UTC (permalink / raw)
To: Noam Postavsky; +Cc: Emacs developers
On Wed, 12 Sep 2018 10:50:05 -0400 Noam Postavsky
<npostavs@gmail.com> wrote:
> On 12 September 2018 at 10:37, Perry E. Metzger
> <perry@piermont.com> wrote:
>
> > Thinking that this might be some sort of weird race condition
> > during initialization, I put a "(sleep-for 1)" into my .emacs
> > just before the code that sets everything, i.e., before all my
> > "set-face-attribute" and "default-frame-alist" manipulation. When
> > I do this, the frame pops up in its initial size and
> > configuration, and then after the sleep ends, the size of the
> > default frame adjusts and is consistently correct.
> >
> > Can anyone guess what might be going wrong, and how we might fix
> > this correctly?
>
> Does changing x-wait-for-event-timeout help (or hurt)?
>
> Possibly doing your manipulation in after-make-frame-functions would
> be the correct fix.
It would seem to me that requiring users to change their default font
in that way rather than just in their .emacs file is a bit
heavyweight. It's certainly not documented, and hasn't always been
needed in the past...
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-12 15:35 ` Perry E. Metzger
@ 2018-09-12 15:47 ` Robert Pluim
2018-09-12 17:01 ` Perry E. Metzger
0 siblings, 1 reply; 20+ messages in thread
From: Robert Pluim @ 2018-09-12 15:47 UTC (permalink / raw)
To: Perry E. Metzger; +Cc: Noam Postavsky, Emacs developers
"Perry E. Metzger" <perry@piermont.com> writes:
> On Wed, 12 Sep 2018 10:50:05 -0400 Noam Postavsky
> <npostavs@gmail.com> wrote:
>> On 12 September 2018 at 10:37, Perry E. Metzger
>> <perry@piermont.com> wrote:
>>
>> > Thinking that this might be some sort of weird race condition
>> > during initialization, I put a "(sleep-for 1)" into my .emacs
>> > just before the code that sets everything, i.e., before all my
>> > "set-face-attribute" and "default-frame-alist" manipulation. When
>> > I do this, the frame pops up in its initial size and
>> > configuration, and then after the sleep ends, the size of the
>> > default frame adjusts and is consistently correct.
>> >
>> > Can anyone guess what might be going wrong, and how we might fix
>> > this correctly?
>>
>> Does changing x-wait-for-event-timeout help (or hurt)?
>>
>> Possibly doing your manipulation in after-make-frame-functions would
>> be the correct fix.
>
> It would seem to me that requiring users to change their default font
> in that way rather than just in their .emacs file is a bit
> heavyweight. It's certainly not documented, and hasn't always been
> needed in the past...
This might be <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31745>,
which I haven't gotten around to tracking down fully. Itʼs very
window-manager dependent though. I found that starting emacs with
'--no-x-resources' made the issue go away, which points to a race
condition in the initial frame setup.
Robert
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-12 15:47 ` Robert Pluim
@ 2018-09-12 17:01 ` Perry E. Metzger
0 siblings, 0 replies; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-12 17:01 UTC (permalink / raw)
To: Robert Pluim; +Cc: Noam Postavsky, Emacs developers
On Wed, 12 Sep 2018 17:47:29 +0200 Robert Pluim <rpluim@gmail.com>
wrote:
> "Perry E. Metzger" <perry@piermont.com> writes:
>
> > On Wed, 12 Sep 2018 10:50:05 -0400 Noam Postavsky
> > <npostavs@gmail.com> wrote:
> >> On 12 September 2018 at 10:37, Perry E. Metzger
> >> <perry@piermont.com> wrote:
> >>
> >> > Thinking that this might be some sort of weird race condition
> >> > during initialization, I put a "(sleep-for 1)" into my .emacs
> >> > just before the code that sets everything, i.e., before all my
> >> > "set-face-attribute" and "default-frame-alist" manipulation.
> >> > When I do this, the frame pops up in its initial size and
> >> > configuration, and then after the sleep ends, the size of the
> >> > default frame adjusts and is consistently correct.
> >> >
> >> > Can anyone guess what might be going wrong, and how we might
> >> > fix this correctly?
> >>
> >> Does changing x-wait-for-event-timeout help (or hurt)?
> >>
> >> Possibly doing your manipulation in after-make-frame-functions
> >> would be the correct fix.
> >
> > It would seem to me that requiring users to change their default
> > font in that way rather than just in their .emacs file is a bit
> > heavyweight. It's certainly not documented, and hasn't always been
> > needed in the past...
>
> This might be <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31745>,
> which I haven't gotten around to tracking down fully. Itʼs very
> window-manager dependent though. I found that starting emacs with
> '--no-x-resources' made the issue go away, which points to a race
> condition in the initial frame setup.
emacs --no-x-resources doesn't seem to fix it for me. That said, this
is clearly a race condition in the initial frame setup.
Setting x-wait-for-event-timeout to 0.5 "fixes" the problem. The
problem is apparent at the default value of 0.1.
This is quite frustrating and I want it fixed badly so I'm willing
to do whatever will be of assistance to fix this. I've had on and off
issues with race conditions in the initial frame setup, both on X11
and on MacOS/Quartz for years. I'd like them extirpated once and for
all.
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-12 14:37 Weird problem with inital frame sizing Perry E. Metzger
2018-09-12 14:50 ` Noam Postavsky
@ 2018-09-13 11:49 ` Stefan Monnier
2018-09-13 19:08 ` Perry E. Metzger
1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2018-09-13 11:49 UTC (permalink / raw)
To: emacs-devel
> Can anyone guess what might be going wrong, and how we might fix
> this correctly?
IMO fixing this "correctly" is the following: move your face&frame
settings from ~/.emacs.d/init.el to ~/.emacs.d/early-init.el
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 11:49 ` Stefan Monnier
@ 2018-09-13 19:08 ` Perry E. Metzger
2018-09-13 19:15 ` Perry E. Metzger
2018-09-13 19:15 ` Eli Zaretskii
0 siblings, 2 replies; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-13 19:08 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Thu, 13 Sep 2018 07:49:00 -0400 Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
> > Can anyone guess what might be going wrong, and how we might fix
> > this correctly?
>
> IMO fixing this "correctly" is the following: move your face&frame
> settings from ~/.emacs.d/init.el to ~/.emacs.d/early-init.el
I use a single .emacs file (I'm an old fogey). Where in the manual
is early-init.el documented, and the semantic difference between what
should be in there and what should be elsewhere? I was unable to find
it searching through the info manual.
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 19:08 ` Perry E. Metzger
@ 2018-09-13 19:15 ` Perry E. Metzger
2018-09-13 19:17 ` Perry E. Metzger
2018-09-13 19:23 ` Perry E. Metzger
2018-09-13 19:15 ` Eli Zaretskii
1 sibling, 2 replies; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-13 19:15 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Thu, 13 Sep 2018 15:08:51 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> On Thu, 13 Sep 2018 07:49:00 -0400 Stefan Monnier
> <monnier@iro.umontreal.ca> wrote:
> > > Can anyone guess what might be going wrong, and how we might fix
> > > this correctly?
> >
> > IMO fixing this "correctly" is the following: move your face&frame
> > settings from ~/.emacs.d/init.el to ~/.emacs.d/early-init.el
>
> I use a single .emacs file (I'm an old fogey). Where in the manual
> is early-init.el documented, and the semantic difference between
> what should be in there and what should be elsewhere? I was unable
> to find it searching through the info manual.
FYI, I did as you suggested, and my initial frame and subsequent
frames do not get the change to the font at all now, so this doesn't
seem to work. I'm not sure where early-init.el is loaded, or if it is
loaded at all.
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 19:08 ` Perry E. Metzger
2018-09-13 19:15 ` Perry E. Metzger
@ 2018-09-13 19:15 ` Eli Zaretskii
2018-09-13 19:25 ` Perry E. Metzger
1 sibling, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2018-09-13 19:15 UTC (permalink / raw)
To: Perry E. Metzger; +Cc: monnier, emacs-devel
> Date: Thu, 13 Sep 2018 15:08:51 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: emacs-devel@gnu.org
>
> > IMO fixing this "correctly" is the following: move your face&frame
> > settings from ~/.emacs.d/init.el to ~/.emacs.d/early-init.el
>
> I use a single .emacs file (I'm an old fogey). Where in the manual
> is early-init.el documented, and the semantic difference between what
> should be in there and what should be elsewhere? I was unable to find
> it searching through the info manual.
The early-init file is available only in Emacs 27, are you tracking
the master branch? In the Info manual built from the master branch,
there's a section named "Early Init File".
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 19:15 ` Perry E. Metzger
@ 2018-09-13 19:17 ` Perry E. Metzger
2018-09-13 19:23 ` Perry E. Metzger
1 sibling, 0 replies; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-13 19:17 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Thu, 13 Sep 2018 15:15:16 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> On Thu, 13 Sep 2018 15:08:51 -0400 "Perry E. Metzger"
> <perry@piermont.com> wrote:
> > On Thu, 13 Sep 2018 07:49:00 -0400 Stefan Monnier
> > <monnier@iro.umontreal.ca> wrote:
> > > > Can anyone guess what might be going wrong, and how we might
> > > > fix this correctly?
> > >
> > > IMO fixing this "correctly" is the following: move your
> > > face&frame settings from ~/.emacs.d/init.el to
> > > ~/.emacs.d/early-init.el
> >
> > I use a single .emacs file (I'm an old fogey). Where in the manual
> > is early-init.el documented, and the semantic difference between
> > what should be in there and what should be elsewhere? I was unable
> > to find it searching through the info manual.
>
> FYI, I did as you suggested, and my initial frame and subsequent
> frames do not get the change to the font at all now, so this doesn't
> seem to work. I'm not sure where early-init.el is loaded, or if it
> is loaded at all.
If it helps, my emacs version reports itself as 27.0.50 of September
9th.
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 19:15 ` Perry E. Metzger
2018-09-13 19:17 ` Perry E. Metzger
@ 2018-09-13 19:23 ` Perry E. Metzger
2018-09-13 19:31 ` Perry E. Metzger
1 sibling, 1 reply; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-13 19:23 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Thu, 13 Sep 2018 15:15:16 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> On Thu, 13 Sep 2018 15:08:51 -0400 "Perry E. Metzger"
> <perry@piermont.com> wrote:
> > On Thu, 13 Sep 2018 07:49:00 -0400 Stefan Monnier
> > <monnier@iro.umontreal.ca> wrote:
> > > > Can anyone guess what might be going wrong, and how we might
> > > > fix this correctly?
> > >
> > > IMO fixing this "correctly" is the following: move your
> > > face&frame settings from ~/.emacs.d/init.el to
> > > ~/.emacs.d/early-init.el
> >
> > I use a single .emacs file (I'm an old fogey). Where in the manual
> > is early-init.el documented, and the semantic difference between
> > what should be in there and what should be elsewhere? I was unable
> > to find it searching through the info manual.
>
> FYI, I did as you suggested, and my initial frame and subsequent
> frames do not get the change to the font at all now, so this doesn't
> seem to work. I'm not sure where early-init.el is loaded, or if it
> is loaded at all.
FYI, this is (some) of what I put in early-init.el:
(if (eq window-system 'x)
(progn
(menu-bar-mode 0)
(set-face-attribute 'default nil
:family "DejaVu Sans Mono" :height 140)
(set-face-attribute 'cursor nil
:background "red")
(set-face-attribute 'trailing-whitespace nil
:background "pink")
(setq default-frame-alist '((scroll-bar-width . 10)))))
(if window-system
(progn
(add-to-list 'default-frame-alist
(cons 'height 50))
(add-to-list 'default-frame-alist
(cons 'width 80))))
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 19:15 ` Eli Zaretskii
@ 2018-09-13 19:25 ` Perry E. Metzger
0 siblings, 0 replies; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-13 19:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: monnier, emacs-devel
On Thu, 13 Sep 2018 22:15:36 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Thu, 13 Sep 2018 15:08:51 -0400
> > From: "Perry E. Metzger" <perry@piermont.com>
> > Cc: emacs-devel@gnu.org
> >
> > > IMO fixing this "correctly" is the following: move your
> > > face&frame settings from ~/.emacs.d/init.el to
> > > ~/.emacs.d/early-init.el
> >
> > I use a single .emacs file (I'm an old fogey). Where in the manual
> > is early-init.el documented, and the semantic difference between
> > what should be in there and what should be elsewhere? I was
> > unable to find it searching through the info manual.
>
> The early-init file is available only in Emacs 27, are you tracking
> the master branch? In the Info manual built from the master branch,
> there's a section named "Early Init File".
I found the section. I'm indeed tracking 27. See my other notes.
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 19:23 ` Perry E. Metzger
@ 2018-09-13 19:31 ` Perry E. Metzger
2018-09-13 20:20 ` Stefan Monnier
0 siblings, 1 reply; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-13 19:31 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Thu, 13 Sep 2018 15:23:55 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> > > > IMO fixing this "correctly" is the following: move your
> > > > face&frame settings from ~/.emacs.d/init.el to
> > > > ~/.emacs.d/early-init.el
>
> > FYI, I did as you suggested, and my initial frame and subsequent
> > frames do not get the change to the font at all now, so this
> > doesn't seem to work. I'm not sure where early-init.el is loaded,
> > or if it is loaded at all.
>
> FYI, this is (some) of what I put in early-init.el:
>
> (if (eq window-system 'x)
> (progn
> (menu-bar-mode 0)
> (set-face-attribute 'default nil
> :family "DejaVu Sans Mono" :height 140)
> (set-face-attribute 'cursor nil
> :background "red")
> (set-face-attribute 'trailing-whitespace nil
> :background "pink")
> (setq default-frame-alist '((scroll-bar-width . 10)))))
>
> (if window-system
> (progn
> (add-to-list 'default-frame-alist
> (cons 'height 50))
> (add-to-list 'default-frame-alist
> (cons 'width 80))))
Okay, I think I see a problem here. At the time that early-init.el
runs, "window-system" is set to nil.
I need to condition my init on whether I'm running under X, on a
terminal, or under cocoa ("ns"), so I need to know the value of
window-system when setting things in my init file. (I use a single
init file on many different machines for sanity's sake.)
What should I be doing here? It appears that early-init.el is _too_
early.
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 19:31 ` Perry E. Metzger
@ 2018-09-13 20:20 ` Stefan Monnier
2018-09-13 21:34 ` Perry E. Metzger
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2018-09-13 20:20 UTC (permalink / raw)
To: Perry E. Metzger; +Cc: emacs-devel
>> (set-face-attribute 'default nil
>> :family "DejaVu Sans Mono" :height 140)
I'd recommend you move away from set-face-attribute.
> I need to condition my init on whether I'm running under X, on a
> terminal, or under cocoa ("ns"), so I need to know the value of
> window-system when setting things in my init file. (I use a single
> init file on many different machines for sanity's sake.)
Faces can be set on a per-frame basis, and Custom knows how to describe
face settings that depend on the terminal.
You can try something like
(face-spec-set 'default
'((((type x)) :family "DejaVu Sans Mono" :height 140)
(((type ns)) :family "Monaco" :height 100)
(t :family :height 120)))
-- Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 20:20 ` Stefan Monnier
@ 2018-09-13 21:34 ` Perry E. Metzger
2018-09-14 1:14 ` Stefan Monnier
0 siblings, 1 reply; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-13 21:34 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Thu, 13 Sep 2018 16:20:10 -0400 Stefan Monnier
<monnier@IRO.UMontreal.CA> wrote:
> >> (set-face-attribute 'default nil
> >> :family "DejaVu Sans Mono" :height
> >> 140)
>
> I'd recommend you move away from set-face-attribute.
What's the reason for that?
> > I need to condition my init on whether I'm running under X, on a
> > terminal, or under cocoa ("ns"), so I need to know the value of
> > window-system when setting things in my init file. (I use a single
> > init file on many different machines for sanity's sake.)
>
> Faces can be set on a per-frame basis, and Custom knows how to
> describe face settings that depend on the terminal.
>
> You can try something like
>
> (face-spec-set 'default
> '((((type x)) :family "DejaVu Sans Mono" :height
> 140) (((type ns)) :family "Monaco" :height 100)
> (t :family :height 120)))
Why is this preferable? And what does it have to do with the overall
problem I'm having?
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-13 21:34 ` Perry E. Metzger
@ 2018-09-14 1:14 ` Stefan Monnier
2018-09-15 23:23 ` Perry E. Metzger
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2018-09-14 1:14 UTC (permalink / raw)
To: Perry E. Metzger; +Cc: emacs-devel
>> >> (set-face-attribute 'default nil
>> >> :family "DejaVu Sans Mono" :height 140)
>> I'd recommend you move away from set-face-attribute.
> What's the reason for that?
It's a low-level tool that's designed to modify the face for a particular
frame, and not some user-level preference.
>> (face-spec-set 'default
>> '((((type x)) :family "DejaVu Sans Mono" :height 140)
>> (((type ns)) :family "Monaco" :height 100)
>> (t :family :height 120)))
>
> Why is this preferable?
Because it lets you set your face-preferences before knowing whether
they will apply to a frame under the X11 GUI, or under a tty, or ...
This started being important when we added the multi-tty support, so the
same Emacs session can have both GUI frames and tty frames (where some
tty frames offer 8 colors, other 256 color, others no colors at all),
but the problem existed before already since previous Emacsen could also
have several GUI frames on different X server, some limited to
a monochrome display, and others not.
> And what does it have to do with the overall problem I'm having?
Nothing directly. You just pulled on one of the loose threads ;-)
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-14 1:14 ` Stefan Monnier
@ 2018-09-15 23:23 ` Perry E. Metzger
2018-09-16 21:58 ` Stefan Monnier
0 siblings, 1 reply; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-15 23:23 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Thu, 13 Sep 2018 21:14:23 -0400 Stefan Monnier
<monnier@IRO.UMontreal.CA> wrote:
> > And what does it have to do with the overall problem I'm having?
>
> Nothing directly. You just pulled on one of the loose threads ;-)
I changed my font setting to use "face-spec-set". Naturally it changed
nothing but now no one can complain that I'm using the wrong
function. :)
So getting back to my problem:
On one of my remote machines (which I view over xpra), if I set:
(add-hook 'window-setup-hook
(lambda ()
(when window-system
(sleep-for 1) ; *** NOTE THIS PART HERE ***
(set-frame-size (car (frame-list)) 80 50))))
the frame is set to 50 lines, and if I do
(add-hook 'window-setup-hook
(lambda ()
(when window-system
;;(sleep-for 1)
(set-frame-size (car (frame-list)) 80 50))))
that is, without the sleep, it does not get set properly (and indeed
sometimes is very messed up indeed, at random, as though the frame
size was set to what it would have been in pixels if I hadn't changed
the font.)
Note that I have both default-frame-alist and initial-frame-alist set
to indicate the frame should be 50 lines. This only seems to work for
subsequent frames.
(fyi, why "(car (frame-list))": I was using it instead of
"selected-frame" just in case there was some weirdness with the frame
not being selected at the start. This helped nothing.)
Anyone with ideas on how to debug this apparent race condition? I'd be
very grateful.
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-15 23:23 ` Perry E. Metzger
@ 2018-09-16 21:58 ` Stefan Monnier
2018-09-17 13:31 ` Perry E. Metzger
0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2018-09-16 21:58 UTC (permalink / raw)
To: emacs-devel
> I changed my font setting to use "face-spec-set". Naturally it changed
> nothing but now no one can complain that I'm using the wrong
> function. :)
[...]
> Note that I have both default-frame-alist and initial-frame-alist set
> to indicate the frame should be 50 lines. This only seems to work for
> subsequent frames.
That's weird. I've just done the following:
% mkdir ~/tmp/test/.emacs.d
% cat >~/tmp/test/.emacs.d/early-init.e
(face-spec-set 'default
'((((type x)) :family "DejaVu Sans Mono" :height 70)
(((type ns)) :family "Monaco" :height 100)
(t :family :height 120)))
(setq default-frame-alist '((user-size . t) (width . 86) (height . 46)))
% HOME=~/tmp/test/ emacs
and Emacs pops up with apparently the font specified and the
width&height specified as well (actually, with what appears to be an
off-by-one error).
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-16 21:58 ` Stefan Monnier
@ 2018-09-17 13:31 ` Perry E. Metzger
2018-09-17 13:49 ` Noam Postavsky
0 siblings, 1 reply; 20+ messages in thread
From: Perry E. Metzger @ 2018-09-17 13:31 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On Sun, 16 Sep 2018 17:58:13 -0400 Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
> > I changed my font setting to use "face-spec-set". Naturally it
> > changed nothing but now no one can complain that I'm using the
> > wrong function. :)
> [...]
> > Note that I have both default-frame-alist and initial-frame-alist
> > set to indicate the frame should be 50 lines. This only seems to
> > work for subsequent frames.
>
> That's weird. I've just done the following:
>
> % mkdir ~/tmp/test/.emacs.d
> % cat >~/tmp/test/.emacs.d/early-init.e
> (face-spec-set 'default
> '((((type x)) :family "DejaVu Sans Mono" :height 70)
> (((type ns)) :family "Monaco" :height 100)
> (t :family :height 120)))
>
> (setq default-frame-alist '((user-size . t) (width . 86)
> (height . 46))) % HOME=~/tmp/test/ emacs
>
> and Emacs pops up with apparently the font specified and the
> width&height specified as well (actually, with what appears to be an
> off-by-one error).
I'm guessing there's some race condition involved, and that the fact
that it takes a couple of seconds for xpra to display stuff tickles
it. I don't get consistent results run to run which makes things
seem like a race condition is at fault. On your local machine, since
everything is running fast, you don't hit it, or only hit it
rarely.
Perry
--
Perry E. Metzger perry@piermont.com
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Weird problem with inital frame sizing
2018-09-17 13:31 ` Perry E. Metzger
@ 2018-09-17 13:49 ` Noam Postavsky
0 siblings, 0 replies; 20+ messages in thread
From: Noam Postavsky @ 2018-09-17 13:49 UTC (permalink / raw)
To: Perry E. Metzger; +Cc: Stefan Monnier, Emacs developers
On 17 September 2018 at 09:31, Perry E. Metzger <perry@piermont.com> wrote:
> I'm guessing there's some race condition involved, and that the fact
> that it takes a couple of seconds for xpra to display stuff tickles
> it. I don't get consistent results run to run which makes things
> seem like a race condition is at fault. On your local machine, since
> everything is running fast, you don't hit it, or only hit it
> rarely.
Setting x-wait-for-event-timeout to nil might help hit it more often.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2018-09-17 13:49 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-12 14:37 Weird problem with inital frame sizing Perry E. Metzger
2018-09-12 14:50 ` Noam Postavsky
2018-09-12 15:35 ` Perry E. Metzger
2018-09-12 15:47 ` Robert Pluim
2018-09-12 17:01 ` Perry E. Metzger
2018-09-13 11:49 ` Stefan Monnier
2018-09-13 19:08 ` Perry E. Metzger
2018-09-13 19:15 ` Perry E. Metzger
2018-09-13 19:17 ` Perry E. Metzger
2018-09-13 19:23 ` Perry E. Metzger
2018-09-13 19:31 ` Perry E. Metzger
2018-09-13 20:20 ` Stefan Monnier
2018-09-13 21:34 ` Perry E. Metzger
2018-09-14 1:14 ` Stefan Monnier
2018-09-15 23:23 ` Perry E. Metzger
2018-09-16 21:58 ` Stefan Monnier
2018-09-17 13:31 ` Perry E. Metzger
2018-09-17 13:49 ` Noam Postavsky
2018-09-13 19:15 ` Eli Zaretskii
2018-09-13 19:25 ` Perry E. Metzger
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.