all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenneth Vestergaard Schmidt <kvs@binarysolutions.dk>
Subject: focusing a frame
Date: Thu, 30 Jan 2003 19:26:14 +0100	[thread overview]
Message-ID: <20030130183055.GA3325@shrek.binarysolutions.dk> (raw)

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	other threads:[~2003-01-30 18:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-30 18:26 Kenneth Vestergaard Schmidt [this message]
2003-02-01 11:03 ` focusing a frame Kenneth Vestergaard Schmidt
2003-02-02  5:46   ` Eli Zaretskii
2003-02-02  2:33 ` Unknown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030130183055.GA3325@shrek.binarysolutions.dk \
    --to=kvs@binarysolutions.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.