unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacsclient commandline
@ 2008-08-20 14:49 Rustom Mody
  2008-08-20 15:34 ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 6+ messages in thread
From: Rustom Mody @ 2008-08-20 14:49 UTC (permalink / raw)
  To: help-gnu-emacs

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)




^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <mailman.17151.1219243748.18990.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2008-09-12 17:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20 14:49 emacsclient commandline Rustom Mody
2008-08-20 15:34 ` Lennart Borgman (gmail)
2008-08-21  5:50   ` Rustom Mody
     [not found] <mailman.17151.1219243748.18990.help-gnu-emacs@gnu.org>
2008-09-11 17:45 ` Oleksandr Gavenko
2008-09-12 13:18   ` rustom
2008-09-12 17:37     ` Oleksandr Gavenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).