1. Arne Babenhauserheide
  2. kembed-emacs

Source

kembed-emacs / qxembed-emacs.py

#!/usr/bin/env python
# encoding: utf-8

"""A test-program for embedding emacs in KDE."""

from PyQt4.QtGui import QX11EmbedContainer
from PyQt4.QtGui import QApplication
from PyQt4.QtCore import QProcess, SIGNAL, SLOT

from sys import argv

app = QApplication(argv)

container = QX11EmbedContainer()
container.show()

def resize():
    container.resize(670, 630)
container.resize_ = resize

process = QProcess(container)
print container.winId()
args = ["--parent-id", str(container.winId())]
process.start("emacs", args)
#process.start("emacsclient-emacs-24", args)
container.connect(container, SIGNAL("clientClosed()"), app.quit)
container.connect(container, SIGNAL("clientIsEmbedded()"), container.resize_)
container.connect(container, SIGNAL("error(QX11EmbedContainer::Error)"), app.quit)
status = app.exec_()
process.close()


### Self Test == Run the Program ###

if __name__ == "__main__":
    pass