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

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

Re: Understanding after-make-frame-functions


From: Eli Zaretskii
Subject: Re: Understanding after-make-frame-functions
Date: Tue, 17 May 2016 06:39:31 +0300

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Mon, 16 May 2016 23:42:43 +0000
> 
> On Mon, May 16, 2016 at 7:35 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:
> 
> > Here is a little snippet for testing
> >
> > ===== temp.el =====
> > (add-hook 'after-make-frame-functions (lambda (frame) (message "frame:
> > %S")))
> > =====
> >
> I have a typo above; it should be
> 
> (add-hook 'after-make-frame-functions (lambda (frame) (message "frame: %S"
> frame)))
> 
> When you run "emacs -Q -l temp.el&", the above message will not be printed.

By the time Emacs gets around to run the code in temp.el, it already
created the initial frame, so your hook is not called because
make-frame for the initial frame was already done by that time.

Which is exactly the reason we have various hooks that specifically
target steps in the startup procedure.  Just use them.



reply via email to

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