emacs-devel
[Top][All Lists]
Advanced

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

Re: Display-local settings


From: Lőrentey Károly
Subject: Re: Display-local settings
Date: Mon, 19 Apr 2004 17:10:09 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

David Kastrup <address@hidden> writes:
>> So frame-local settings are sufficient as long as we get a chance to
>> dynamically setup those parameters whenever a new frame is created.
>
> We currently only have
>
> frame-creation-function's value is 
> x-create-frame-with-faces
>
> Window-system dependent function to call to create a new frame.
> The window system startup file should set this to its frame creation
> function, which should take an alist of parameters as its argument.
>
> Defined in `frame'.
>
> [back]
>
> That's hardly sufficient.

I think I should mention that the behaviour of make-frame has changed
a bit in the multi-tty branch: `frame-creation-function' has been
replaced by a window system-dependent `frame-creation-function-alist'.
(I know it's an ugly incompatible change--providing an equivalent
compatible solution is on my todo list.)

But changing the frame creation method is perhaps not the best way to
approach this particular problem: if a Lisp package really does need
to do window-system specific frame initialization, then I think it
should simply hook into after-make-frame-functions, like this:

(defun xyzzy-after-make-frame-function (frame)
  (let ((w (window-system frame)))
    (cond
     ((eq w 'x) (xyzzyfy-x-frame frame))
     ((eq w 'nil) (xyzzyfy-tty-frame frame))
     ;; etc.
     (t (error "Can not xyzzyfy frame: window-system %s unknown" w)))))

(add-hook 'after-make-frame-functions 'xyzzy-after-make-frame-function)

Probably most packages only need to set special frame parameters; we
could introduce a simple window-system specific default-frame-alist
mechanism to make that easier.

-- 
Károly




reply via email to

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