all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Understanding after-make-frame-functions
Date: Tue, 17 May 2016 06:39:31 +0300	[thread overview]
Message-ID: <83h9dx4aks.fsf@gnu.org> (raw)
In-Reply-To: <CAFyQvY3HdTesMCdNw8r-HNGTehn9XCbb=qwGRNL_rC143AeNEw@mail.gmail.com> (message from Kaushal Modi on Mon, 16 May 2016 23:42:43 +0000)

> 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	other threads:[~2016-05-17  3:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 23:35 Understanding after-make-frame-functions Kaushal Modi
2016-05-16 23:42 ` Kaushal Modi
2016-05-17  3:39   ` Eli Zaretskii [this message]
2016-05-17  3:44 ` Eli Zaretskii
2016-05-17 16:15   ` Kaushal Modi
2016-05-17 16:36     ` Eli Zaretskii
2016-05-17 18:08       ` Kaushal Modi
2016-05-17 20:18         ` Eli Zaretskii
2016-05-18  2:31           ` Kaushal Modi
2016-05-18  2:39             ` Eli Zaretskii
2016-05-18  2:46               ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h9dx4aks.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.