Commits

Anonymous committed f07636c

add option to not use emacsclient and to just print the window id

Comments (0)

Files changed (1)

 from optparse import OptionParser
 parser = OptionParser(__doc__)
 parser.add_option("--basic", help="use a basic display", action="store_true")
+parser.add_option("--no-client", help="do not use emacsclient", action="store_true")
+parser.add_option("--justprintid", help="just print the window Id so a program can attach from outside.", action="store_true")
 opts, args = parser.parse_args()
 
 if version_info > (2,7,0, 'final', 0): 
 container.resize(670, 630)
 container.show()
 
+if opts.justprintid:
+    print container.winId()
+    container.connect(container, SIGNAL("clientClosed()"), app.quit)
+    container.connect(container, SIGNAL("error(QX11EmbedContainer::Error)"), app.quit)
+    app.exec_()
+
 process = QProcess(container)
 args = ["--parent-id", str(container.winId())]
 if opts.basic:
     args.extend(["-Q", "--basic-display"])
 
-if vers >= 24 and not opts.basic: 
+if vers >= 24 and not opts.basic and not opts.no_client: 
     process.start("emacsclient", args)
 elif vers is None or vers >= 23.1: 
     process.start("emacs", args)