Sublime Forum

DDE commands

#1

Hi,

this is really a question for jps. Is it OK to include the GPL-licensed “ddeclient” command-line utility (from Emacs)? IT provides a simple way to send DDE commands to programs that implement the DDE server protocol (including Acrobat, Sumatra PDF, etc.).

DDE functionality is provided by the pywin32 package, but that’s a pretty big dependency for a single package!

Alternatively, one could use ctypes to access the ddeml DLL functions directly [or perhaps ST might implement DDE calls in a future version…]. This is the hard way :wink: so it would be nice if one could take a shortcut!

M

PS: the LaTeX plugin I am developing is shaping up nicely, IMHO. I’d be honored if you wanted to include it in a future release.

0 Likes

#2

Distributing GPLed executables and calling them from Python is fine from a legal POV, yeah. Relying on ddeclient sounds more pleasant than going via ctypes too.

0 Likes

#3

So I ended up implementing DDE Execute commands in python, using ctypes. The code is in the LaTeX package: see the file DDEExecute.py, which implements the “sendDDEExecute” command, with the following syntax:

sendDDEExecute

For instance, to get SumatraPDF to jump to a point in the file “file.pdf” corresponding to line 100, column 1 of “file.tex” (actually, the column is disregarded at this time), the command is

sendDDEExecute “SUMATRA” “control” “[ForwardSearch(“c:\file.pdf”,“c:\file.tex”,100,1)]”

Maybe this may be useful in other applications (e.g. telling a web browser to reload the current page, etc.).

The file DDEExecute.py is independent of the LaTeX package; it is only used by it.

M

0 Likes