Re: [Geany-devel] Writing a plugin, not sure what to do with it

2011-11-18 Thread Frank Lanitz
Am 18.11.2011 02:31, schrieb Matthew Brush:
 On 11/17/2011 10:01 AM, Meyer wrote:
 I've never used a version control system before for my own code, but I
 think I it up correctly: https://github.com/pzoxiuv/Geany-Plugins

 
 Yep, I just cloned it and had a quick look.  I left some comments on the
 github commit.
 
 We could add this to the geany-plugins project if you want, but it seems
 a bit on the small side, IMO.  Maybe the code would fit better in the
 Addons plugin?

We could do that (adding to addons) but to be honest I think addons is
already really big and would like to leave it as single plugin. However,
integrating to combined geany-plugins-project is a good idea as it will
prevent you from maintaining your own build system and doing regular
releases on your own.

Cheers,
Frank
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] --readonly handling

2011-11-18 Thread Dimitar Zhekov
On Thu, 17 Nov 2011 21:07:41 +0100
Thomas Martitz thomas.mart...@student.htw-berlin.de wrote:

 Am 17.11.2011 19:20, schrieb Dimitar Zhekov:
 
  Is there any technical reason to check cl_options.readonly in
  document.c, and clear it load_startup_files() [...]
 
 
 In an earlier version it also worked when opening a .geany file (so all 
 session files would be opened readonly). As opening via socket also goes 
 through main_handle_filename() (and hopefully nothing else?), I guess 
 there's no real reason anymore.

Here's a small patch that cleanups readonly handling, and adds the
missing def_clo.readonly initializer, which was a bug. Tested with
normal and socket open.

BTW, -Wmissing-field-initializers displays a huge number of warnings in
highlightingmappings.h (fill_eol and merge), and no warnings in any
other source file (except def_clo above).

-- 
E-gards: Jimmy
--- ./src/document.c.orig	2011-11-17 19:36:09.0 +0200
+++ ./src/document.c	2011-11-18 19:03:10.0 +0200
@@ -1162,7 +1162,7 @@
 		doc-has_bom = filedata.bom;
 		store_saved_encoding(doc);	/* store the opened encoding for undo/redo */
 
-		doc-readonly = readonly || filedata.readonly || cl_options.readonly;
+		doc-readonly = readonly || filedata.readonly;
 		sci_set_readonly(doc-editor-sci, doc-readonly);
 
 		/* update line number margin width */
--- ./src/main.c.orig	2011-11-17 19:36:09.0 +0200
+++ ./src/main.c	2011-11-18 19:24:52.0 +0200
@@ -497,7 +497,7 @@
 	GError *error = NULL;
 	GOptionContext *context;
 	gint i;
-	CommandLineOptions def_clo = {FALSE, NULL, TRUE, -1, -1, FALSE, FALSE};
+	CommandLineOptions def_clo = {FALSE, NULL, TRUE, -1, -1, FALSE, FALSE, FALSE};
 
 	/* first initialise cl_options fields with default values */
 	cl_options = def_clo;
@@ -774,7 +774,7 @@
 
 	if (g_file_test(filename, G_FILE_TEST_IS_REGULAR))
 	{
-		doc = document_open_file(filename, FALSE, NULL, NULL);
+		doc = document_open_file(filename, cl_options.readonly, NULL, NULL);
 		/* add recent file manually if opening_session_files is set */
 		if (doc != NULL  main_status.opening_session_files)
 			ui_add_recent_document(doc);
@@ -887,19 +887,13 @@
 static void load_startup_files(gint argc, gchar **argv)
 {
 	gboolean load_project_from_cl = FALSE;
-	gboolean cl_files_opened = FALSE;
 
 	/* ATM when opening a project file any other filenames are ignored */
 	load_project_from_cl = (argc  1)  g_str_has_suffix(argv[1], .geany);
 	if (load_project_from_cl  argc  2)
 		g_print(Ignoring extra filenames after %s, argv[1]);
 
-	if (!load_project_from_cl)
-		cl_files_opened = open_cl_files(argc, argv);
-	/* switch readonly mode off for session files, future files and projects */
-	cl_options.readonly = FALSE;
-
-	if (! cl_files_opened)
+	if (load_project_from_cl || ! open_cl_files(argc, argv))
 	{
 		if (prefs.load_session)
 		{
--- ./src/socket.c.orig	2011-11-17 19:36:09.0 +0200
+++ ./src/socket.c	2011-11-18 19:25:26.0 +0200
@@ -601,13 +601,11 @@
 	{
 		if (strncmp(buf, open, 4) == 0)
 		{
-			if (strncmp(buf+4, ro, 2) == 0) /* open in readonly? */
-cl_options.readonly = TRUE;
+			cl_options.readonly = strncmp(buf+4, ro, 2) == 0; /* open in readonly? */
 			while (socket_fd_gets(sock, buf, sizeof(buf)) != -1  *buf != '.')
 			{
 handle_input_filename(g_strstrip(buf));
 			}
-			cl_options.readonly = FALSE; /* disable again for future files */
 			popup = TRUE;
 		}
 		else if (strncmp(buf, doclist, 7) == 0)
___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


Re: [Geany-devel] Writing a plugin, not sure what to do with it

2011-11-18 Thread Meyer
On Thu, Nov 17, 2011 at 8:31 PM, Matthew Brush mbr...@codebrainz.ca wrote:

 On 11/17/2011 10:01 AM, Meyer wrote:

 I've never used a version control system before for my own code, but I
 think I it up correctly: 
 https://github.com/pzoxiuv/**Geany-Pluginshttps://github.com/pzoxiuv/Geany-Plugins


 Yep, I just cloned it and had a quick look.  I left some comments on the
 github commit.


 We could add this to the geany-plugins project if you want, but it seems a
 bit on the small side, IMO.  Maybe the code would fit better in the
 Addons plugin?


Thanks for looking at it, I've fixed the g_strdup_printf stuff.  I agree
it's too small to be its own plugin, and if you thought it could be put in
with the Addons plugin that would be great.  How would that happen?

Cheers,
Alex


 Cheers,
 Matthew Brush


  Cheers,
 Alex

 On Thu, Nov 17, 2011 at 4:01 AM, Frank Lanitz fr...@frank.uvena.de
 mailto:fr...@frank.uvena.de wrote:

Am 17.11.2011 02:49, schrieb Meyer:

  Thanks very much for the input!  I've pasted an updated version
here [1]
  which should implement your suggestions (assuming I understand them
  correctly).

Didn't check the source code but maybe you can put it into some version
control system. Maybe at github or gitourios. Would make things for us
 a
bit easier.

Cheers,
Frank

__**_
Geany-devel mailing list
Geany-devel@uvena.de mailto:Geany-devel@uvena.de

 https://lists.uvena.de/cgi-**bin/mailman/listinfo/geany-**develhttps://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel





 __**_
 Geany-devel mailing list
 Geany-devel@uvena.de
 https://lists.uvena.de/cgi-**bin/mailman/listinfo/geany-**develhttps://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel


 __**_
 Geany-devel mailing list
 Geany-devel@uvena.de
 https://lists.uvena.de/cgi-**bin/mailman/listinfo/geany-**develhttps://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

___
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel