unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Where is the frame resized after startup?
@ 2007-01-21 23:44 Lennart Borgman
  2007-01-21 23:50 ` Juanma Barranquero
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Borgman @ 2007-01-21 23:44 UTC (permalink / raw)


Somewhere after running the init files the initial frame is resized - at 
least on w32. I would like to add a command after that happens. Is there 
any hook that runs after all startup code has run?

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

* Re: Where is the frame resized after startup?
  2007-01-21 23:44 Where is the frame resized after startup? Lennart Borgman
@ 2007-01-21 23:50 ` Juanma Barranquero
  2007-01-21 23:59   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 10+ messages in thread
From: Juanma Barranquero @ 2007-01-21 23:50 UTC (permalink / raw)
  Cc: Emacs Devel

On 1/22/07, Lennart Borgman <lennart.borgman.073@student.lu.se> wrote:

> Is there
> any hook that runs after all startup code has run?

Perhaps you could try on the "Starting Up Emacs" node of the Emacs
Lisp Reference...

                    /L/e/k/t/u

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

* Re: Where is the frame resized after startup?
  2007-01-21 23:50 ` Juanma Barranquero
@ 2007-01-21 23:59   ` Lennart Borgman (gmail)
  2007-01-22  1:32     ` Lennart Borgman (gmail)
  2007-01-22  4:16     ` Eli Zaretskii
  0 siblings, 2 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-21 23:59 UTC (permalink / raw)
  Cc: Emacs Devel

Juanma Barranquero wrote:
> On 1/22/07, Lennart Borgman <lennart.borgman.073@student.lu.se> wrote:
> 
>> Is there
>> any hook that runs after all startup code has run?
> 
> Perhaps you could try on the "Starting Up Emacs" node of the Emacs
> Lisp Reference...
> 
>                    /L/e/k/t/u


Thanks, I knew I had seen it somewhere ...

It turned out that there is no later hook than window-setup-hook, which 
I already tried.

However after some more testing I found that run-with-idle-timer now 
works as I expect it to do and that can be used to run code after all 
startup code has run.

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

* Re: Where is the frame resized after startup?
  2007-01-21 23:59   ` Lennart Borgman (gmail)
@ 2007-01-22  1:32     ` Lennart Borgman (gmail)
  2007-01-22  4:16     ` Eli Zaretskii
  1 sibling, 0 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-22  1:32 UTC (permalink / raw)
  Cc: Juanma Barranquero, Emacs Devel

Lennart Borgman (gmail) wrote:

> However after some more testing I found that run-with-idle-timer now 
> works as I expect it to do and that can be used to run code after all 
> startup code has run.


And that was too quick. It depends on what my pc is doing perhaps. My 
workaround is using one of the last hooks run at startup and then doing 
something like

   (run-with-idle-time 2 nil 'what-i-want)

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

* Re: Where is the frame resized after startup?
  2007-01-21 23:59   ` Lennart Borgman (gmail)
  2007-01-22  1:32     ` Lennart Borgman (gmail)
@ 2007-01-22  4:16     ` Eli Zaretskii
  2007-01-22 10:28       ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2007-01-22  4:16 UTC (permalink / raw)
  Cc: lekktu, emacs-devel

> Date: Mon, 22 Jan 2007 00:59:07 +0100
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
> It turned out that there is no later hook than window-setup-hook, which 
> I already tried.
> 
> However after some more testing I found that run-with-idle-timer now 
> works as I expect it to do and that can be used to run code after all 
> startup code has run.

What do you mean by ``after all startup code has run'', exactly?

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

* Re: Where is the frame resized after startup?
  2007-01-22  4:16     ` Eli Zaretskii
@ 2007-01-22 10:28       ` Lennart Borgman (gmail)
  2007-01-22 21:16         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-22 10:28 UTC (permalink / raw)
  Cc: lekktu, emacs-devel

Eli Zaretskii wrote:
>> Date: Mon, 22 Jan 2007 00:59:07 +0100
>> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
>> Cc: Emacs Devel <emacs-devel@gnu.org>
>>
>> It turned out that there is no later hook than window-setup-hook, which 
>> I already tried.
>>
>> However after some more testing I found that run-with-idle-timer now 
>> works as I expect it to do and that can be used to run code after all 
>> startup code has run.
> 
> What do you mean by ``after all startup code has run'', exactly?


Yes, that was a bit unclear. In this case I meant "after creation and 
sizing of the first frame".

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

* Re: Where is the frame resized after startup?
  2007-01-22 10:28       ` Lennart Borgman (gmail)
@ 2007-01-22 21:16         ` Eli Zaretskii
  2007-01-22 22:20           ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2007-01-22 21:16 UTC (permalink / raw)
  Cc: lekktu, emacs-devel

> Date: Mon, 22 Jan 2007 11:28:52 +0100
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> CC:  lekktu@gmail.com,  emacs-devel@gnu.org
> > 
> > What do you mean by ``after all startup code has run'', exactly?
> 
> 
> Yes, that was a bit unclear. In this case I meant "after creation and 
> sizing of the first frame".

Assuming that window-setup-hook is not good for that, perhaps you can
explain why you need that hook to run after sizing of the initial
frame and no earlier.

One idea to try is inside window-setup-hook put a function into
after-make-frame-functions.  That function should do whatever you want
to do after initial frame is created, then remove itself from
after-make-frame-functions.

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

* Re: Where is the frame resized after startup?
  2007-01-22 21:16         ` Eli Zaretskii
@ 2007-01-22 22:20           ` Lennart Borgman (gmail)
  2007-01-23  4:08             ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-22 22:20 UTC (permalink / raw)
  Cc: lekktu, emacs-devel

Eli Zaretskii wrote:
>> Date: Mon, 22 Jan 2007 11:28:52 +0100
>> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
>> CC:  lekktu@gmail.com,  emacs-devel@gnu.org
>>> What do you mean by ``after all startup code has run'', exactly?
>>
>> Yes, that was a bit unclear. In this case I meant "after creation and 
>> sizing of the first frame".
> 
> Assuming that window-setup-hook is not good for that, perhaps you can
> explain why you need that hook to run after sizing of the initial
> frame and no earlier.


A very simple thing. I want to maximize the frame.


> One idea to try is inside window-setup-hook put a function into
> after-make-frame-functions.  That function should do whatever you want
> to do after initial frame is created, then remove itself from
> after-make-frame-functions.


Thanks, I have done that, but it does not work for the first frame. I 
add to the hook in a defcustom.

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

* Re: Where is the frame resized after startup?
  2007-01-22 22:20           ` Lennart Borgman (gmail)
@ 2007-01-23  4:08             ` Eli Zaretskii
  2007-01-23 18:22               ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2007-01-23  4:08 UTC (permalink / raw)
  Cc: lekktu, emacs-devel

> Date: Mon, 22 Jan 2007 23:20:40 +0100
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> CC:  lekktu@gmail.com,  emacs-devel@gnu.org
> > 
> > Assuming that window-setup-hook is not good for that, perhaps you can
> > explain why you need that hook to run after sizing of the initial
> > frame and no earlier.
> 
> A very simple thing. I want to maximize the frame.

And why is window-setup-hook not good for that?

> > One idea to try is inside window-setup-hook put a function into
> > after-make-frame-functions.  That function should do whatever you want
> > to do after initial frame is created, then remove itself from
> > after-make-frame-functions.
> 
> Thanks, I have done that, but it does not work for the first frame. I 
> add to the hook in a defcustom.

What do you mean by ``does not work''?  Is the function called?

Also, I'm not quite clear about your usage of defcustom.  Could you
show the code?  Defcustoms have pitfalls.

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

* Re: Where is the frame resized after startup?
  2007-01-23  4:08             ` Eli Zaretskii
@ 2007-01-23 18:22               ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-23 18:22 UTC (permalink / raw)
  Cc: lekktu, emacs-devel

Eli Zaretskii wrote:

>> A very simple thing. I want to maximize the frame.
> 
> And why is window-setup-hook not good for that?


Sorry, I seemed to have made some mistake while testing (probably I 
mixed some versions here). It actually works to maximize the frame in 
window-setup-hook AFAICS now.

after-make-frame-functions is not called for the first frame.

Thanks for responding. It helped me finding my mistake.

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

end of thread, other threads:[~2007-01-23 18:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-21 23:44 Where is the frame resized after startup? Lennart Borgman
2007-01-21 23:50 ` Juanma Barranquero
2007-01-21 23:59   ` Lennart Borgman (gmail)
2007-01-22  1:32     ` Lennart Borgman (gmail)
2007-01-22  4:16     ` Eli Zaretskii
2007-01-22 10:28       ` Lennart Borgman (gmail)
2007-01-22 21:16         ` Eli Zaretskii
2007-01-22 22:20           ` Lennart Borgman (gmail)
2007-01-23  4:08             ` Eli Zaretskii
2007-01-23 18:22               ` Lennart Borgman (gmail)

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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