From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Riel Newsgroups: gmane.emacs.help Subject: Transferring focus to Emacs Date: Tue, 14 Jun 2011 09:45:43 -0700 Message-ID: <20110614094543.5928a5a6@gauss> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1308070068 16325 80.91.229.12 (14 Jun 2011 16:47:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Jun 2011 16:47:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 14 18:47:44 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QWWmD-0004Ut-PV for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Jun 2011 18:47:41 +0200 Original-Received: from localhost ([::1]:59129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWWmC-0008Vc-J8 for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Jun 2011 12:47:40 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWWkS-0008VD-Qi for help-gnu-emacs@gnu.org; Tue, 14 Jun 2011 12:45:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWWkR-0003bT-Bk for help-gnu-emacs@gnu.org; Tue, 14 Jun 2011 12:45:52 -0400 Original-Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.123]:44438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWWkR-0003bL-0r for help-gnu-emacs@gnu.org; Tue, 14 Jun 2011 12:45:51 -0400 X-Authority-Analysis: v=1.1 cv=aeMH4JcVOnVr0LmJAzqEvfnmJyuaZufWdlng4HTRGCk= c=1 sm=0 a=kj9zAlcOel0A:10 a=aH9rrzxNilo9zfKgDQpEiQ==:17 a=W49BGvfzZoK46t5t9lkA:9 a=CjuIK1q_8ugA:10 a=aH9rrzxNilo9zfKgDQpEiQ==:117 X-Cloudmark-Score: 0 X-Originating-IP: 72.130.158.15 Original-Received: from [72.130.158.15] ([72.130.158.15:58325] helo=gauss) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 62/D3-03893-D3097FD4; Tue, 14 Jun 2011 16:45:49 +0000 X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 75.180.132.123 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81346 Archived-At: I want a separate program to give the focus to Emacs, and put the cursor in a particular (existing) buffer. Using emacsclient doesn't work, for example $ emacsclient --eval '(pop-to-buffer "my-buffer")' That does pop-up and select the buffer, however, after the command executes, the window manager returns the focus to the xterm that evaluated the command. I want focus to remain in Emacs. The "normal" call to emacsclient, with a filename, does not help because that opens a file. I want it to open an existing buffer. Alternatively, emacs itself can issue whatever command is needed (I'm communicating with emacs via another link). Hmm. Probably I need to be sending the command to the window manager rather than Emacs (this is on X). Is there an Emacs command that tells the window manager to give the focus to Emacs (which might be on a different desktop)? Alas, I'll want similar capability in a Windows 7 environment. -- Joe Riel