From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Rustom Mody" Newsgroups: gmane.emacs.help Subject: emacsclient commandline Date: Wed, 20 Aug 2008 20:19:02 +0530 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1219243790 23530 80.91.229.12 (20 Aug 2008 14:49:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2008 14:49:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 20 16:50:40 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KVp0z-0007yt-R4 for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Aug 2008 16:50:26 +0200 Original-Received: from localhost ([127.0.0.1]:54363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVp02-00030A-Ky for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Aug 2008 10:49:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVozi-0002xU-Mb for help-gnu-emacs@gnu.org; Wed, 20 Aug 2008 10:49:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVozh-0002vi-5i for help-gnu-emacs@gnu.org; Wed, 20 Aug 2008 10:49:06 -0400 Original-Received: from [199.232.76.173] (port=41386 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVozh-0002vU-1H for help-gnu-emacs@gnu.org; Wed, 20 Aug 2008 10:49:05 -0400 Original-Received: from mail-gx0-f12.google.com ([209.85.217.12]:47151) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVozg-0002Yj-Ur for help-gnu-emacs@gnu.org; Wed, 20 Aug 2008 10:49:05 -0400 Original-Received: by gxk5 with SMTP id 5so227400gxk.18 for ; Wed, 20 Aug 2008 07:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=1DZkACkF+78TkZnxEHfM/ks8Eoqe8XkVjo4P02mAoS0=; b=AKjdRUmZnEDv0HbxUV77v5vD90z6AY9xaGSXBMTtsTUS7A7yjbK2kw3pHz1rzzSdFd J9522Fm87zsR3gnmAgmrUQPsTWntGJKx9ykjbt4g9rgE9p6w3v7LPHgAkr9j4+TO580e gtxGcjfEcyb9hZNqH5wYA6jw/wmze8/eQ/YeU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=LeNNBkdB54+QgD5rXQ3w8ZeTl913Ur+jNGZEePtZ3JNwMfYJkvFITecE8tKx9i7hX8 q9ylTcyrgzJnZBB63tYr6+x5KUpEMSx0K5ujYuR9dPYbRoxIXUsAt+2Q52ZO1+z5z23m /kL5gVqOg6tPgS9xJWU7ot4d45qO2+COC+uBY= Original-Received: by 10.142.154.20 with SMTP id b20mr49714wfe.59.1219243742160; Wed, 20 Aug 2008 07:49:02 -0700 (PDT) Original-Received: by 10.142.156.11 with HTTP; Wed, 20 Aug 2008 07:49:02 -0700 (PDT) Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56822 Archived-At: I am trying to construct a command line such that: if emacs is running the client asks the server to raise-frame else it calls runemacs. The command line Ive given is: $ emacsclient -a runemacs -e "(raise-frame)" But this opens a file (or buffer) called '(raise-frame)' !! Of course just $ emacsclient -e "(raise-frame)" raises the emacs frame alright but fails for the case of no server. Another minor point: When emacsclient is used with the -a option and there is no server running it pops up a window saying ERROR No error !! I guess this is an error (in emacsclient) :-) Starting from the vbs file on the emacswiki Ive constructed my own launch-emacs as below but I dont like the loop and the sql and all the heavy stuff, hence this attempt. My launch-emacs-client.vbs ------------------------ Set objShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_Process") Dim isRunning isRunning = False For Each objItem in colItems If InStr(objItem.CommandLine, "emacs.exe") Then isRunning = True End If Next parent = fso.GetParentFolderName(WScript.ScriptFullName) If WScript.Arguments.Count = 1 Then If isRunning Then callString = parent & "/emacsclientw.exe -n """ & WScript.Arguments(0) & """" Else callString = parent & "/runemacs.exe """ & WScript.Arguments(0) & """" End If Else If isRunning Then callString = parent & "/emacsclientw.exe -n -e ""(raise-frame)""" else callString = parent & "/runemacs.exe" End If End if objShell.Run(callString)