Hi,
at first: congratulations for this great piece of software! It's fun to
work with it, everything is well documented and goes straight forward.
Just one little bit was missing for me and adding it was easy ;)
Attached you find a tiny patch which adds a new command line option:
--socket-file. This way you can have different geany instances running
(e.g. one on each workspace) and are able to push new files to a
specific instance.
This applies as well to this feature request:
http://sourceforge.net/tracker/?func=detail&aid=2896027&group_id=153...
e.g. by using this cmd line to open files:
geany --socket-file=/tmp/geany-sock-$( xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}' )
Regards,
Jörn
--
Think before you code. And while you're coding it won't hurt either. ;)
Index: main.c
===================================================================
--- main.c (Revision 4424)
+++ main.c (Arbeitskopie)
@@ -126,6 +126,7 @@
{ "no-preprocessing", 'P', 0, G_OPTION_ARG_NONE, &no_preprocessing, N_("Don't preprocess C/C++ files when generating tags"), NULL },
#ifdef HAVE_SOCKET
{ "new-instance", 'i', 0, G_OPTION_ARG_NONE, &cl_options.new_instance, N_("Don't open files in a running instance, force opening a new instance"), NULL },
+ { "socket-file", 0, 0, G_OPTION_ARG_FILENAME, &cl_options.socket_filename, N_("Use this socket filename for communication with a geany instance"), NULL },
#endif
{ "line", 'l', 0, G_OPTION_ARG_INT, &cl_options.goto_line, N_("Set initial line number for the first opened file"), NULL },
{ "no-msgwin", 'm', 0, G_OPTION_ARG_NONE, &no_msgwin, N_("Don't show message window at startup"), NULL },
@@ -451,7 +452,7 @@
GError *error = NULL;
GOptionContext *context;
gint i;
- CommandLineOptions def_clo = {FALSE, TRUE, -1, -1, FALSE};
+ CommandLineOptions def_clo = {FALSE, NULL, TRUE, -1, -1, FALSE};
/* first initialise cl_options fields with default values */
cl_options = def_clo;
@@ -535,6 +536,10 @@
#ifdef HAVE_SOCKET
socket_info.ignore_socket = cl_options.new_instance;
+ if ( cl_options.socket_filename )
+ {
+ socket_info.file_name = cl_options.socket_filename;
+ }
#endif
#ifdef HAVE_VTE
vte_info.lib_vte = lib_vte;
Index: main.h
===================================================================
--- main.h (Revision 4424)
+++ main.h (Arbeitskopie)
@@ -28,6 +28,7 @@
typedef struct
{
gboolean new_instance;
+ gchar *socket_filename;
gboolean load_session;
gint goto_line;
gint goto_column;