all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Understanding after-make-frame-functions
@ 2016-05-16 23:35 Kaushal Modi
  2016-05-16 23:42 ` Kaushal Modi
  2016-05-17  3:44 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Kaushal Modi @ 2016-05-16 23:35 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all,

I have certain code in my config like the find-font function call, which I
need to have in a after-make-frame-functions hook if I want that to work
correctly in an emacsclient session. So I have it so, and it works fine.

But I just learnt that that hook is apparently not called when I launch
emacs in a non-daemon mode (plain old emacs&).

Here is a little snippet for testing

===== temp.el =====
(add-hook 'after-make-frame-functions (lambda (frame) (message "frame:
%S")))
=====

When you run "emacs -Q -l temp.el&", the above message will not be printed.
But it prints fine when emacs is launched in daemon mode.

So I need to add the find-font call in window-setup-hook (which non-daemon
emacs can see but emacsclient cannot. Is that right?).

So I have ended up with few code snippets in both
after-make-frame-functions and in window-setup-hook.  I have the actual
snippets from my config at the end of this email, in the case they come
helpful in understanding my problem statement.

(1) Is the above after-make-frame-functions behavior specific to daemon
sessions as expected? If so, I was unable to find reference to that in the
emacs/elisp manual.
(2) Is window-setup-hook supposed to run only in non-daemon emacs?
(3) What would be a more concise manner to do stuff like linum activation,
find-font call, etc. correctly in both emacs and emacsclient?

Thanks.

--
Kaushal

##########
===== (in init.el) =====
;;
https://github.com/kaushalmodi/.emacs.d/blob/fa33440cc16c0601ad55d94a762a03f4f7f66a50/init.el#L324-L332
(defun modi/symbola-font-check (&optional frame)
  ;; The below `select-frame' form is required for the `find-font'
  ;; to work correctly when using emacs daemon (emacsclient).
  (when frame
    (select-frame frame))
  (require 'setup-symbola))
(if (daemonp) ; only for emacsclient launches
    (add-hook 'after-make-frame-functions #'modi/symbola-font-check)
  (add-hook 'window-setup-hook #'modi/symbola-font-check))
=====

===== setup-symbola.el =====
;;
https://github.com/kaushalmodi/.emacs.d/blob/fa33440cc16c0601ad55d94a762a03f4f7f66a50/setup-files/setup-symbola.el
(defvar font-symbola-p nil
  "If non-nil, Symbola font is available on the system.")
;; Set `font-symbola-p' to t if Symbola font is available.
(when (find-font (font-spec :name "Symbola"))
  ;; Manually choose a fallback font for Unicode
  ;;
http://endlessparentheses.com/manually-choose-a-fallback-font-for-unicode.html
  (set-fontset-font "fontset-default" nil (font-spec :size 20 :name
"Symbola"))
  (setq font-symbola-p t))
(provide 'setup-symbola)
=====
I do the above so that code snippets using unicode available only in
Symbola font can be nested in a "(with-eval-after-load 'setup-symbola (when
font-symbola-p ..))" form.

===== (in setup-linum.el) =====
;;
https://github.com/kaushalmodi/.emacs.d/blob/fa33440cc16c0601ad55d94a762a03f4f7f66a50/setup-files/setup-linum.el#L169-L171
(if (daemonp) ; only for emacsclient launches
    (add-hook 'after-make-frame-functions #'my-fn-to-enable-linum)
  (add-hook 'window-setup-hook #'my-fn-to-enable-linum))
=====
I get linum font error when running emacsclient if I do not put linum
enabling in after-make-frame-functions hook.
-- 

-- 
Kaushal Modi


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

* Re: Understanding after-make-frame-functions
  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
  2016-05-17  3:44 ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Kaushal Modi @ 2016-05-16 23:42 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

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.
> But it prints fine when emacs is launched in daemon mode.
>

On non-daemon emacs, that lambda form is never executed. On emacsclient, I
see

frame: #<frame emacs@<my host> 0x2b299e8>


-- 

-- 
Kaushal Modi


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

* Re: Understanding after-make-frame-functions
  2016-05-16 23:42 ` Kaushal Modi
@ 2016-05-17  3:39   ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2016-05-17  3:39 UTC (permalink / raw)
  To: help-gnu-emacs

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



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

* Re: Understanding after-make-frame-functions
  2016-05-16 23:35 Understanding after-make-frame-functions Kaushal Modi
  2016-05-16 23:42 ` Kaushal Modi
@ 2016-05-17  3:44 ` Eli Zaretskii
  2016-05-17 16:15   ` Kaushal Modi
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-05-17  3:44 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Mon, 16 May 2016 23:35:15 +0000
> 
> ===== temp.el =====
> (add-hook 'after-make-frame-functions (lambda (frame) (message "frame:
> %S")))
> =====
> 
> When you run "emacs -Q -l temp.el&", the above message will not be printed.
> But it prints fine when emacs is launched in daemon mode.
> 
> So I need to add the find-font call in window-setup-hook (which non-daemon
> emacs can see but emacsclient cannot. Is that right?).
> 
> So I have ended up with few code snippets in both
> after-make-frame-functions and in window-setup-hook.  I have the actual
> snippets from my config at the end of this email, in the case they come
> helpful in understanding my problem statement.
> 
> (1) Is the above after-make-frame-functions behavior specific to daemon
> sessions as expected? If so, I was unable to find reference to that in the
> emacs/elisp manual.

There's nothing specific to daemon here, it is all just side effect of
how and when frames are created by Emacs.  In particular, the daemon
creates frames when emacsclient connects to it, and doesn't have any
displayable frames before that.

In general, _any_ call to make-frame will always run
after-make-frame-functions, you can clearly see that in the code.

> (2) Is window-setup-hook supposed to run only in non-daemon emacs?

No, of course not.  It is supposed to be used by any customizations
that need to hook into stuff that Emacs does early on during its
startup (see startup.el), which you cannot do later.

> (3) What would be a more concise manner to do stuff like linum activation,
> find-font call, etc. correctly in both emacs and emacsclient?

I don't understand the question.  Emacs daemon can be started with a
non-empty ~/.emacs, so why is this an issue?  IOW, what's wrong with
the answer "as you usually do with customizations"?



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

* Re: Understanding after-make-frame-functions
  2016-05-17  3:44 ` Eli Zaretskii
@ 2016-05-17 16:15   ` Kaushal Modi
  2016-05-17 16:36     ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Kaushal Modi @ 2016-05-17 16:15 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs

On Mon, May 16, 2016 at 11:44 PM Eli Zaretskii <eliz@gnu.org> wrote:

> There's nothing specific to daemon here, it is all just side effect of
> how and when frames are created by Emacs.  In particular, the daemon
> creates frames when emacsclient connects to it, and doesn't have any
> displayable frames before that.
>
> In general, _any_ call to make-frame will always run
> after-make-frame-functions, you can clearly see that in the code.
>

Thanks. But I think that this side effect should be documented. I used the
below test snippet in 3 different invocations of emacs:

(1) emacs &
(2) emacsclient -c -a '' &
(3) emacs -nw

=====
(defvar my-index 1
  "Index that increments after each hook is called.")
(dolist (hook '(before-init-hook
                after-init-hook
                emacs-startup-hook
                window-setup-hook
                before-make-frame-hook
                after-make-frame-functions
                after-setting-font-hook))
  (add-hook hook
            `(lambda (&optional frame)
               (when frame
                 (select-frame frame))
               (message "[%d] Running `%s' .."
                        my-index (symbol-name (quote ,hook)))
               (message "[%d]  Symbola: %S"
                        my-index (find-font (font-spec :name "Symbola")))
               (setq my-index (1+ my-index))) :append))
=====

In the "emacs &" invocation, I got:

[1] Running ‘after-init-hook’ ..
[1]  Symbola: #<font-entity xft unknown Symbola nil iso10646-1 normal
normal semi-condensed 0 nil nil 0 ((:font-entity
"/home/kmodi/.fonts/Symbola.ttf" . 0) (:name . "Symbola"))>
For information about GNU Emacs and the GNU system, type C-h C-a.
[2] Running ‘emacs-startup-hook’ ..
[2]  Symbola: #<font-entity xft unknown Symbola nil iso10646-1 normal
normal semi-condensed 0 nil nil 0 ((:font-entity
"/home/kmodi/.fonts/Symbola.ttf" . 0) (:name . "Symbola"))>
[3] Running ‘window-setup-hook’ ..
[3]  Symbola: #<font-entity xft unknown Symbola nil iso10646-1 normal
normal semi-condensed 0 nil nil 0 ((:font-entity
"/home/kmodi/.fonts/Symbola.ttf" . 0) (:name . "Symbola"))>

In the "emacsclient -c -a '' &" invocation, I got:

[1] Running ‘after-init-hook’ ..
[1]  Symbola: nil
Starting Emacs daemon.
Restarting server
[2] Running ‘emacs-startup-hook’ ..
[2]  Symbola: nil
[3] Running ‘window-setup-hook’ ..
[3]  Symbola: nil
[4] Running ‘before-make-frame-hook’ ..
[4]  Symbola: nil
[5] Running ‘after-make-frame-functions’ ..
[5]  Symbola: #<font-entity xft unknown Symbola nil iso10646-1 normal
normal semi-condensed 0 nil nil 0 ((:font-entity
"/home/kmodi/.fonts/Symbola.ttf" . 0) (:name . "Symbola"))>
When done with this frame, type C-x 5 0

In the "emacs -nw" invocation, I got:

[1] Running ‘after-init-hook’ ..
[1]  Symbola: nil
For information about GNU Emacs and the GNU system, type C-h C-a.
[2] Running ‘emacs-startup-hook’ ..
[2]  Symbola: nil
[3] Running ‘window-setup-hook’ ..
[3]  Symbola: nil

So in conclusion, it looks like however the user customizes the
before-make-frame-hook and after-make-frame-functions, those would be
ineffective when running non-daemon emacs and emacs -nw. It is obvious that
frames are not being created for emacs -nw and so those hooks are not
called. But it is not evident that the init.el/.emacs is called after frame
generation when running emacs& and so those frame hook customizations serve
no purpose in that case.


> > (2) Is window-setup-hook supposed to run only in non-daemon emacs?
>
> No, of course not.  It is supposed to be used by any customizations
> that need to hook into stuff that Emacs does early on during its
> startup (see startup.el), which you cannot do later.
>

Thanks. I now understand that. Just that I cannot use window-setup-hook for
my font check when running emacsclient because the frame/fonts haven't been
loaded yet (as we also see in the above experiment:

[3] Running ‘window-setup-hook’ ..
[3]  Symbola: nil
...
[5] Running ‘after-make-frame-functions’ ..
[5]  Symbola: #<font-entity xft unknown Symbola ...


> > (3) What would be a more concise manner to do stuff like linum
> activation,
> > find-font call, etc. correctly in both emacs and emacsclient?
>
> I don't understand the question.  Emacs daemon can be started with a
> non-empty ~/.emacs, so why is this an issue?  IOW, what's wrong with
> the answer "as you usually do with customizations"?
>

With the help of the above experiment, I think I now better understand
which hooks to use and if I need to use those:

I now have the below in my init:

=====
(defun modi/symbola-font-check (&optional frame)
  (require 'setup-symbola))
(if (daemonp)
    (progn
      ;; The below `select-frame' call is mandatory for the `find-font'
      ;; to work correctly when using emacs daemon or emacsclient (learned
      ;; through experimentation).
      (add-hook 'after-make-frame-functions #'select-frame :append)
      ;; Need to delay font check till the fonts are actually available,
which
      ;; does not happen until the point when `after-make-frame-functions'
hook
      ;; is run (only for emacsclient launches).
      (add-hook 'after-make-frame-functions #'modi/symbola-font-check))
  ;; For non-daemon, regular emacs launches, the frame/fonts are loaded
*before*
  ;; the emacs config is read. So in that case there is no need to add the
font
  ;; check function to any specific hook.
  (modi/symbola-font-check))
=====

There's something else too which is undocumented and I learned through
experimentation; that I need to add select-frame to
after-make-frame-functions first for the find-font to work as intended
(else it always returns nil). Would adding that to that hook be a good
default?

At the end of this, let me know if you too think that the
after-make-frame-functions needs more clarification in the documentation,
and I will file a bug report for that.

Thanks for going through my email in detail.

Kaushal
-- 

-- 
Kaushal Modi


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

* Re: Understanding after-make-frame-functions
  2016-05-17 16:15   ` Kaushal Modi
@ 2016-05-17 16:36     ` Eli Zaretskii
  2016-05-17 18:08       ` Kaushal Modi
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-05-17 16:36 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Tue, 17 May 2016 16:15:39 +0000
> 
> > There's nothing specific to daemon here, it is all just side effect of
> > how and when frames are created by Emacs.  In particular, the daemon
> > creates frames when emacsclient connects to it, and doesn't have any
> > displayable frames before that.
> >
> > In general, _any_ call to make-frame will always run
> > after-make-frame-functions, you can clearly see that in the code.
> >
> 
> Thanks. But I think that this side effect should be documented. I used the
> below test snippet in 3 different invocations of emacs:
> 
> (1) emacs &
> (2) emacsclient -c -a '' &
> (3) emacs -nw

What Emacs does during startup is documented in the ELisp manual, see
the node "Startup Summary".  If you have specific suggestions for
amendments there, please file a bug report with those suggestions.

> So in conclusion, it looks like however the user customizes the
> before-make-frame-hook and after-make-frame-functions, those would be
> ineffective when running non-daemon emacs and emacs -nw. It is obvious that
> frames are not being created for emacs -nw and so those hooks are not
> called. But it is not evident that the init.el/.emacs is called after frame
> generation when running emacs& and so those frame hook customizations serve
> no purpose in that case.

The above-mentioned node in the manual describes more hooks, so maybe
you should simply use a different hook for your needs.

> > > (2) Is window-setup-hook supposed to run only in non-daemon emacs?
> >
> > No, of course not.  It is supposed to be used by any customizations
> > that need to hook into stuff that Emacs does early on during its
> > startup (see startup.el), which you cannot do later.
> 
> Thanks. I now understand that. Just that I cannot use window-setup-hook for
> my font check when running emacsclient because the frame/fonts haven't been
> loaded yet

Once again, perhaps a different hook, which runs later, will do what
you want.

> There's something else too which is undocumented and I learned through
> experimentation; that I need to add select-frame to
> after-make-frame-functions first for the find-font to work as intended
> (else it always returns nil). Would adding that to that hook be a good
> default?

I would suggest moving the code to a hook that runs later, when the
initial frame is already the selected one.

> At the end of this, let me know if you too think that the
> after-make-frame-functions needs more clarification in the documentation,
> and I will file a bug report for that.

Not sure, but if there's specific information you'd like to be there,
let's talk specifics.



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

* Re: Understanding after-make-frame-functions
  2016-05-17 16:36     ` Eli Zaretskii
@ 2016-05-17 18:08       ` Kaushal Modi
  2016-05-17 20:18         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Kaushal Modi @ 2016-05-17 18:08 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs

On Tue, May 17, 2016 at 12:37 PM Eli Zaretskii <eliz@gnu.org> wrote:

> What Emacs does during startup is documented in the ELisp manual, see
> the node "Startup Summary".  If you have specific suggestions for
> amendments there, please file a bug report with those suggestions.
>

I had already gone through that but it does not talk about the nuance that
in daemon mode case, the frame is created after the window-setup-hook is
run; whereas it is created before evaluating the init in the case of
non-daemon mode. The side effect of that on after-make-frame-functions hook
being useful only for daemon cases is also not mentioned anywhere.

The above-mentioned node in the manual describes more hooks, so maybe
> you should simply use a different hook for your needs.
>

Thanks! I had already gone through the list of startup hooks in (elisp)
Standard Hooks node. I went through it once again and figured out that
focus-in-hook is what I need (the only drawback being that hook is called
each time a frame gets in focus, not just at startup. And for that reason,
I didn't even consider using it. But now I am, as shown after the below
test snippet).

I updated my test snippet to add the debug statement to focus-in-hook too!

=====
(defvar my-index 1
  "Index that increments after each hook is called.")
(dolist (hook '(before-init-hook
                after-init-hook
                emacs-startup-hook
                window-setup-hook
                before-make-frame-hook
                after-make-frame-functions
                after-setting-font-hook
                focus-in-hook))
  (add-hook hook
            `(lambda (&optional frame)
               (message "[%d] Running `%s' .."
                        my-index (symbol-name (quote ,hook)))
               (message "[%d]  Symbola: %S"
                        my-index (find-font (font-spec :name "Symbola")))
               (setq my-index (1+ my-index))) :append))
=====

Based on what I learned, I updated the font check code to below:
=====
(defun modi/font-check (&optional frame)
  "Do font-check; require `setup-font-check' just once."
  (unless (featurep 'setup-font-check)
    (require 'setup-font-check)))
(add-hook 'focus-in-hook #'modi/font-check)
=====

Explanation for the above:
 For non-daemon, regular emacs launches, the frame/fonts are loaded *before*
 the emacs config is read. But when emacs is launched as a daemon (using
 emacsclient, the fonts are not actually loaded until the point when the
 `after-make-frame-functions' hook is run. But even at that point, the frame
 is not yet selected (for the daemon case). Without a selected frame, the
 `find-font' will not work correctly. So we do the font check in
 `focus-in-hook' instead by which all the below are true:
  - Fonts are loaded (in both daemon and non-daemon cases).
  - The frame is selected and so `find-font' calls work correctly.

I would suggest moving the code to a hook that runs later, when the
> initial frame is already the selected one.
>

Looks like focus-in-hook is the next one available when the frame is
selected.


> Not sure, but if there's specific information you'd like to be there,
> let's talk specifics.
>

I do not know what's the correct terminology to be used for "user emacs
config", "daemon mode" and "non-daemon mode" in documentation, but the idea
for after-make-frame-functions documentation is as below:

=====
Functions to run after a frame is created.
The functions are run with one arg, the newly created frame.

In daemon mode (emacs --daemon or emacsclient), the frame is created at
some point after the `window-setup-hook' is run (after the user emacs
config is evaluated). So this hook is called _after_ the user config
evaluation.

But in the non-daemon mode, the frame is created before the user emacs
config is evaluated. So this hook is run before that, and so any user
customization done to this hook would be ineffective in the non-daemon case.
=====

-- 

-- 
Kaushal Modi


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

* Re: Understanding after-make-frame-functions
  2016-05-17 18:08       ` Kaushal Modi
@ 2016-05-17 20:18         ` Eli Zaretskii
  2016-05-18  2:31           ` Kaushal Modi
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-05-17 20:18 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Tue, 17 May 2016 18:08:43 +0000
> 
>  What Emacs does during startup is documented in the ELisp manual, see
>  the node "Startup Summary". If you have specific suggestions for
>  amendments there, please file a bug report with those suggestions.
> 
> I had already gone through that but it does not talk about the nuance that in daemon mode case, the frame is
> created after the window-setup-hook is run; whereas it is created before evaluating the init in the case of
> non-daemon mode. The side effect of that on after-make-frame-functions hook being useful only for daemon
> cases is also not mentioned anywhere.

When Emacs starts in daemon mode, it doesn't create any frames at all,
so I don't think I understand what you are saying here.

> I do not know what's the correct terminology to be used for "user emacs config", "daemon mode" and
> "non-daemon mode" in documentation, but the idea for after-make-frame-functions documentation is as
> below:
> 
> =====
> Functions to run after a frame is created.
> The functions are run with one arg, the newly created frame.
> 
> In daemon mode (emacs --daemon or emacsclient), the frame is created at some point after the
> `window-setup-hook' is run (after the user emacs config is evaluated). So this hook is called _after_ the user
> config evaluation.
> 
> But in the non-daemon mode, the frame is created before the user emacs config is evaluated. So this hook is
> run before that, and so any user customization done to this hook would be ineffective in the non-daemon
> case.

I think it would be clearer just to say that this hook cannot be used
for the initial frame.



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

* Re: Understanding after-make-frame-functions
  2016-05-17 20:18         ` Eli Zaretskii
@ 2016-05-18  2:31           ` Kaushal Modi
  2016-05-18  2:39             ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Kaushal Modi @ 2016-05-18  2:31 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs

On Tue, May 17, 2016, 9:59 PM Eli Zaretskii <eliz@gnu.org> wrote:

> When Emacs starts in daemon mode, it doesn't create any frames at all,
> so I don't think I understand what you are saying here.
>

Yup, I messed up the terminology. As I mentioned in my earlier email and
code snippets, my "daemon mode" is "emacsclient -c -a ''". So I run
emacsclient (emacs daemon), but do create a frame using the -c argument.
Please consider all my "emacs daemon" explanation in context of
"emacsclient -c -a ''". In the debug message output (earlier email)
corresponding to this case, you will see that the
after-make-frame-functions hook is called *after* the emacs init is
evaluated.


I think it would be clearer just to say that this hook cannot be used
> for the initial frame.
>

Well, that hook (after-make-frame-functions) is what I can use for the
initial frame in the case of "emacsclient -c -a''&" but never in the case
of "emacs &".

> --

-- 
Kaushal Modi


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

* Re: Understanding after-make-frame-functions
  2016-05-18  2:31           ` Kaushal Modi
@ 2016-05-18  2:39             ` Eli Zaretskii
  2016-05-18  2:46               ` Kaushal Modi
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-05-18  2:39 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Wed, 18 May 2016 02:31:09 +0000
> 
>  I think it would be clearer just to say that this hook cannot be used
>  for the initial frame.
> 
> Well, that hook (after-make-frame-functions) is what I can use for the initial frame in the case of "emacsclient
> -c -a''&"

That's not the initial frame.  "Initial frame" is a term reserved for
the frame Emacs creates at startup, the one whose parameters are in
initial-frame-alist.



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

* Re: Understanding after-make-frame-functions
  2016-05-18  2:39             ` Eli Zaretskii
@ 2016-05-18  2:46               ` Kaushal Modi
  0 siblings, 0 replies; 11+ messages in thread
From: Kaushal Modi @ 2016-05-18  2:46 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs

On Tue, May 17, 2016, 10:42 PM Eli Zaretskii <eliz@gnu.org> wrote:

> That's not the initial frame.  "Initial frame" is a term reserved for
> the frame Emacs creates at startup, the one whose parameters are in
> initial-frame-alist.
>

Noted. I wasn't aware of that. In that case, yes, I think that it should be
documented that the before and after frame hooks cannot be used for the
Initial Frame.

> --

-- 
Kaushal Modi


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

end of thread, other threads:[~2016-05-18  2:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.