[Top][All Lists]

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

Re: making emacsclient create/destroy a frame

From: Glenn Morris
Subject: Re: making emacsclient create/destroy a frame
Date: Tue, 14 Oct 2003 19:24:55 +0100
User-agent: Gnus (, GNU Emacs (

Roland Roberts wrote:

> I'm trying to figure out a way to make "emacsclient FOO" create a new
> frame for editing FOO, then have C-x # destroy the frame.  It's
> sort-of working....
>     (delete-frame
>      (setq server-window (make-frame)))

Oh, I didn't understand what this bit of code was for until now.

>     (defun rbr:server-done-hook ()
>       (if (boundp 'server-window)
>           (delete-frame server-window)))
>     (setq server-done-hook 'rbr:server-done-hook)
> Okay, the first thing is creating and destroying the initial frame is
> kludgey beyond words, but once done makes server-switch-buffer do the
> right thing.

Does the following strike you as any less kludgey?

(add-hook 'server-visit-hook
            '(lambda ()
               (setq server-window (make-frame))))

(add-hook 'server-done-hook
            '(lambda ()
               ;; Insert boundp safety test, etc, if being thorough.
               (delete-frame server-window)
               (setq server-window nil)))

reply via email to

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