unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* frame.el: call before-make-frame-hook earlier in make-frame
@ 2015-07-30 11:00 Florian
  2015-07-30 15:34 ` Stephen Leake
  2015-07-31  7:09 ` martin rudalics
  0 siblings, 2 replies; 11+ messages in thread
From: Florian @ 2015-07-30 11:00 UTC (permalink / raw)
  To: emacs-devel

Dear Emacs developers,

I would like to propose to call the before-make-frame-hook in the function
make-frame *before* retrieving the parameters of the new frame
(window-system-default-frame-alist and default-frame-alist) and not after.

That way, one could dynamically set these variables inside the hook, e.g. to
create the new frame under the current position of the mouse cursor.

frame.el:
[...]
(defun make-frame (&optional parameters)
[...]
    ;; NEW position of hook
    (run-hooks 'before-make-frame-hook)
    ;; Add parameters from `window-system-default-frame-alist'.
    (dolist (p (cdr (assq w window-system-default-frame-alist)))
      (unless (assq (car p) params)
        (push p params)))
    ;; Add parameters from `default-frame-alist'.
    (dolist (p default-frame-alist)
      (unless (assq (car p) params)
        (push p params)))
    ;; Now make the frame.
    ;; OLD position of hook
    ;;(run-hooks 'before-make-frame-hook)
[...]

Is there a reason that the hook is called after reading the params?

Kind regards,
Florian



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

end of thread, other threads:[~2015-08-03 21:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30 11:00 frame.el: call before-make-frame-hook earlier in make-frame Florian
2015-07-30 15:34 ` Stephen Leake
2015-07-31  7:09 ` martin rudalics
2015-07-31  7:40   ` floriansbriefe
2015-07-31  9:55     ` martin rudalics
2015-07-31 10:38       ` floriansbriefe
2015-08-01 10:50         ` martin rudalics
2015-08-03  9:16         ` Florian
2015-08-03 10:41           ` martin rudalics
2015-08-03 14:57             ` Eli Zaretskii
2015-08-03 21:14             ` Stefan Monnier

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