help-gnu-emacs
[Top][All Lists]
Advanced

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

focusing a frame


From: Kenneth Vestergaard Schmidt
Subject: focusing a frame
Date: Thu, 30 Jan 2003 19:26:14 +0100
User-agent: Mutt/1.4i

Hello.

I've tried getting my Emacs to focus a frame when emacsclient is
invoked. I've added this snippet to my .emacs:

(setq-default main-frame (selected-frame))
(add-hook 'server-visit-hook '(lambda ()
          (if emacs-iconified (iconify-or-deiconify-frame))
          (raise-frame main-frame)
          (x-focus-frame main-frame)
))

This works in all cases, except when I iconify Emacs with C-z. If I
invoke emacsclient, all I get is an:

       X protocol error: BadMatch (invalid parameter attributes) on
       protocol request 42

and a *woosh* as Emacs dies.

What am I doing wrong? I tried using (other-frame 0) instead of
(x-focus-frame main-frame), but that made no difference. Commenting
that line out entirely also prevents the crashes, but also prevents
Emacs from gaining focus, which is what I really would like.

For the record, I'm using Emacs 21.2 on a Debian GNU/Linux (unstable)
system.

-- 
Best Regards

Kenneth Vestergaard Schmidt


reply via email to

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