From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Unknown Newsgroups: gmane.emacs.help Subject: Re: focusing a frame Date: Sun, 02 Feb 2003 02:33:22 GMT Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <20030130183055.GA3325@shrek.binarysolutions.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: main.gmane.org 1044153298 17925 80.91.224.249 (2 Feb 2003 02:34:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 2 Feb 2003 02:34:58 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18f9yC-0004ez-00 for ; Sun, 02 Feb 2003 03:34:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18f9zJ-0003x0-05 for gnu-help-gnu-emacs@m.gmane.org; Sat, 01 Feb 2003 21:36:05 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!HSNX.atgi.net!cyclone-sf.pbi.net!151.164.30.35!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!sjc70.webusenet.com!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news02.bloor.is.net.cable.rogers.com.POSTED!not-for-mail Original-From: Le Wang Original-Newsgroups: gnu.emacs.help Original-Lines: 29 User-Agent: KNode/0.7.1 Original-NNTP-Posting-Host: 24.192.182.203 Original-X-Complaints-To: abuse@rogers.com Original-X-Trace: news02.bloor.is.net.cable.rogers.com 1044153202 24.192.182.203 (Sat, 01 Feb 2003 21:33:22 EST) Original-NNTP-Posting-Date: Sat, 01 Feb 2003 21:33:22 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:109695 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6209 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6209 Kenneth Vestergaard Schmidt wrote: > 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? Maybe you can try using `select-frame-set-input-focus' instead of `x-focus-frame'? -- Le