emacs-devel
[Top][All Lists]
Advanced

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

frame.el: call before-make-frame-hook earlier in make-frame


From: Florian
Subject: frame.el: call before-make-frame-hook earlier in make-frame
Date: Thu, 30 Jul 2015 13:00:41 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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



reply via email to

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