? depcomp
? intltool-extract.in
? intltool-merge.in
? intltool-update.in
? test.ly
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gedit/ChangeLog,v
retrieving revision 1.553
diff -p -u -r1.553 ChangeLog
--- ChangeLog	21 Feb 2005 14:01:39 -0000	1.553
+++ ChangeLog	28 Feb 2005 15:10:18 -0000
@@ -1,3 +1,9 @@
+2005-02-28  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* LilyPond point-and-click support.
+
+	* data/gedit.1: Update.
+
 2005-02-20  Paolo Maggi  <paolo@gnome.org>
 
 	* data/gedit.1: updated
Index: data/gedit.1
===================================================================
RCS file: /cvs/gnome/gedit/data/gedit.1,v
retrieving revision 1.7
diff -p -u -r1.7 gedit.1
--- data/gedit.1	21 Feb 2005 14:01:40 -0000	1.7
+++ data/gedit.1	28 Feb 2005 15:10:18 -0000
@@ -9,7 +9,7 @@
 .RI [--new-window]
 .RI [--new-document]
 .RI [--quit]
-.RI [+[num]]
+.RI [+[LINE[:COLUNM]]]
 .RI [filename(s)...]
 .SH DESCRIPTION
 .B gedit
@@ -40,9 +40,10 @@ Create a new document in an existing ins
 \fB\-\-quit\fR
 Quit an existing instance of gedit.
 .TP
-\fB+[num]\fR
-For the first file, go to the line specified by "num" (do not insert a space between the "+" sign and the number).
-If "num" is missing, go to the last line.
+\fB+[LINE[:COLUMN]]\fR For the first file, move the cursor the line
+specified by "LINE", and to the column specified by "COLUMN" (do not
+insert a spaces between the "+" or ":" signs and the number).  If
+"LINE" is missing, go to the last line.
 .TP
 \fBfilename(s)...\fR
 Specifies the file to open when gedit starts. If this is not specified, gedit will
Index: gedit/ChangeLog
===================================================================
RCS file: /cvs/gnome/gedit/gedit/ChangeLog,v
retrieving revision 1.750
diff -p -u -r1.750 ChangeLog
--- gedit/ChangeLog	27 Feb 2005 16:12:39 -0000	1.750
+++ gedit/ChangeLog	28 Feb 2005 15:10:19 -0000
@@ -1,3 +1,20 @@
+2005-02-28  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	LilyPond point-and-click support
+
+	* gedit-document.c (gedit_document_goto_line_column): Rename from
+	gedit_document_goto_line.  Add column argument.  Jump to column.
+
+	* GNOME_Gedit-common.c (_ORBIT_skel_small_GNOME_Gedit_Window_openURIList): 
+	* gedit-window-server.c (impl_gedit_window_server_openURIList): 
+	* gedit-file.c (gedit_file_open_uri_list):
+	* GNOME_Gedit-stubs.c (GNOME_Gedit_Window_openURIList): Add
+	colum_pos parameter.  Update declaration and callers.
+
+	* gedit2.c (gedit_get_command_line_data): Grok +LINE[:COLUMN] option.
+	(options): Document +LINE[:COLUMN] option, as good/bad as poptOption
+	seems to allow.
+
 2005-02-27  Paolo Maggi  <paolo@gnome.org>
 
 	* gedit-document.c (update_document_contents): fixes bug #167867 (Autosave
Index: gedit/gedit-document.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-document.c,v
retrieving revision 1.111
diff -p -u -r1.111 gedit-document.c
--- gedit/gedit-document.c	27 Feb 2005 16:12:39 -0000	1.111
+++ gedit/gedit-document.c	28 Feb 2005 15:10:19 -0000
@@ -2252,22 +2252,33 @@ gedit_document_end_user_action (GeditDoc
 
 /* FIXME: line should be an "int" -- Paolo (Feb. 20, 2005) */
 void
-gedit_document_goto_line (GeditDocument* doc, guint line)
+gedit_document_goto_line_column (GeditDocument* doc, guint line, guint column)
 {
 	guint line_count;
+	guint char_count;
 	GtkTextIter iter;
 	
 	gedit_debug (DEBUG_DOCUMENT, "");
 
 	g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
 	g_return_if_fail (doc->priv != NULL);
-	
-	line_count = gtk_text_buffer_get_line_count (GTK_TEXT_BUFFER (doc));
-	
-	if (line > line_count)
-		line = line_count;
 
-	gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc), &iter, line);
+	if (line)
+	{
+		line_count = gtk_text_buffer_get_line_count (GTK_TEXT_BUFFER (doc));
+		if (line > line_count)
+			line = line_count;
+	}
+
+	if (column)
+	{
+		gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc), &iter, line);
+		char_count = gtk_text_iter_get_chars_in_line (&iter);
+		if (column > char_count)
+			column = char_count;
+	}
+	
+	gtk_text_buffer_get_iter_at_line_offset (GTK_TEXT_BUFFER (doc), &iter, line, column);
 	gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &iter);
 }
 
Index: gedit/gedit-document.h
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-document.h,v
retrieving revision 1.41
diff -p -u -r1.41 gedit-document.h
--- gedit/gedit-document.h	13 Dec 2004 20:10:53 -0000	1.41
+++ gedit/gedit-document.h	28 Feb 2005 15:10:19 -0000
@@ -175,7 +175,7 @@ void		gedit_document_end_not_undoable_ac
 void		gedit_document_begin_user_action (GeditDocument *doc);
 void		gedit_document_end_user_action	 (GeditDocument *doc);
 
-void		gedit_document_goto_line 	(GeditDocument* doc, guint line);
+void		gedit_document_goto_line_column (GeditDocument* doc, guint line, guint column);
 
 gchar* 		gedit_document_get_last_searched_text (GeditDocument* doc);
 gchar* 		gedit_document_get_last_replace_text  (GeditDocument* doc);
Index: gedit/gedit-file.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-file.c,v
retrieving revision 1.88
diff -p -u -r1.88 gedit-file.c
--- gedit/gedit-file.c	26 Feb 2005 11:59:11 -0000	1.88
+++ gedit/gedit-file.c	28 Feb 2005 15:10:19 -0000
@@ -85,6 +85,7 @@ static gint                 opened_uris 
 static GSList              *uris_to_open 	= NULL;
 static const GeditEncoding *encoding_to_use 	= NULL;
 static gint                 line 		= -1;
+static gint                 column 		= -1;
 static GSList              *new_children 	= NULL;
 static GSList		   *children_to_unref	= NULL;
 static gint		    times_called	= 0;
@@ -195,7 +196,7 @@ gedit_file_open (GeditMDIChild *active_c
 			default_path,
 			&encoding);
 
-	gedit_file_open_uri_list (files, encoding, 0, TRUE);
+	gedit_file_open_uri_list (files, encoding, 0, 0, TRUE);
 
 	g_slist_free (files);
 	g_free (default_path);
@@ -773,7 +774,7 @@ gedit_file_open_single_uri (const gchar*
 
 	uri_list = g_slist_prepend (NULL, full_path);
 
-	gedit_file_open_uri_list (uri_list, encoding, 0, FALSE);
+	gedit_file_open_uri_list (uri_list, encoding, 0, 0, FALSE);
 
 	return TRUE;
 }
@@ -1184,7 +1185,7 @@ open_files_done ()
 	new_children = g_slist_reverse (new_children);
 
 	if (first_document != NULL)
-		gedit_document_goto_line (first_document, MAX (0, line - 1));	
+		gedit_document_goto_line_column (first_document, MAX (0, line - 1), MAX (0, column - 1));
 	
 	PROFILE (
 		g_message ("Document Loaded: %.3f", g_timer_elapsed (timer, NULL));
@@ -1235,6 +1236,7 @@ open_files_done ()
 	opened_uris = 0;
 	encoding_to_use = NULL;
 	line = -1;
+	column = -1;
 	first_document = NULL;
 	active_doc_reused = FALSE;
 
@@ -1396,6 +1398,7 @@ gboolean
 gedit_file_open_uri_list (GSList *uri_list,
 			  const GeditEncoding *encoding,
 			  gint line_pos,
+			  gint column_pos,
 			  gboolean create)
 {
 	GSList *l;
@@ -1476,6 +1479,7 @@ gedit_file_open_uri_list (GSList *uri_li
 
 		encoding_to_use = encoding;
 		line = line_pos > 0 ? line_pos : 0;
+		column = column_pos > 0 ? column_pos : 0;
 
 		gedit_mdi_set_state (gedit_mdi, GEDIT_STATE_LOADING);
 		
Index: gedit/gedit-file.h
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-file.h,v
retrieving revision 1.15
diff -p -u -r1.15 gedit-file.h
--- gedit/gedit-file.h	2 Oct 2004 19:05:50 -0000	1.15
+++ gedit/gedit-file.h	28 Feb 2005 15:10:19 -0000
@@ -46,7 +46,7 @@ gboolean	gedit_file_close_all 	(void);
 void		gedit_file_exit 	(void);
 void		gedit_file_revert 	(GeditMDIChild *child);
 
-gboolean 	gedit_file_open_uri_list (GSList* uri_list, const GeditEncoding *encoding, gint line_pos, gboolean create);
+gboolean 	gedit_file_open_uri_list (GSList* uri_list, const GeditEncoding *encoding, gint line_pos, gint column_pos, gboolean create);
 gboolean 	gedit_file_open_recent   (EggRecentView *view, EggRecentItem *item, gpointer data);
 gboolean 	gedit_file_open_single_uri (const gchar* uri, const GeditEncoding *encoding);
 
Index: gedit/gedit-mdi.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-mdi.c,v
retrieving revision 1.95
diff -p -u -r1.95 gedit-mdi.c
--- gedit/gedit-mdi.c	26 Feb 2005 11:59:11 -0000	1.95
+++ gedit/gedit-mdi.c	28 Feb 2005 15:10:19 -0000
@@ -789,7 +789,7 @@ gedit_mdi_drag_data_received_handler (Gt
 	if (file_list == NULL)
 		return;
 
-	gedit_file_open_uri_list (file_list, NULL, 0, FALSE);	
+	gedit_file_open_uri_list (file_list, NULL, 0, 0, FALSE);
 	
 	g_slist_foreach (file_list, (GFunc)g_free, NULL);	
 	g_slist_free (file_list);
Index: gedit/gedit-window-server.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-window-server.c,v
retrieving revision 1.8
diff -p -u -r1.8 gedit-window-server.c
--- gedit/gedit-window-server.c	21 Feb 2005 16:38:45 -0000	1.8
+++ gedit/gedit-window-server.c	28 Feb 2005 15:10:19 -0000
@@ -64,6 +64,7 @@ impl_gedit_window_server_openURIList (Po
 				      const GNOME_Gedit_URIList *uris,
 				      const char *enc_charset,
 				      int line_pos,
+				      int column_pos,
 				      CORBA_Environment *ev)
 {
 	GSList *list = NULL;
@@ -83,7 +84,7 @@ impl_gedit_window_server_openURIList (Po
 
 	if (list != NULL) 
 	{
-		gedit_file_open_uri_list (list, encoding, line_pos, TRUE);
+		gedit_file_open_uri_list (list, encoding, line_pos, column_pos, TRUE);
 
 		g_slist_foreach (list, (GFunc)g_free, NULL);
 		g_slist_free (list);
Index: gedit/gedit2.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit2.c,v
retrieving revision 1.56
diff -p -u -r1.56 gedit2.c
--- gedit/gedit2.c	23 Feb 2005 10:42:39 -0000	1.56
+++ gedit/gedit2.c	28 Feb 2005 15:10:19 -0000
@@ -71,6 +71,7 @@ struct _CommandLineData
 	const GeditEncoding *encoding;
 
 	gint line_pos;
+	gint column_pos;
 };
 
 static void gedit_load_file_list (CommandLineData *data);
@@ -89,6 +90,9 @@ static const struct poptOption options [
 	{ "new-document", '\0', POPT_ARG_NONE, &new_document_option, 0,
 	  N_("Create a new document in an existing instance of gedit"), NULL },
 
+	{ " +LINE[:COLUMN]", '\0', POPT_ARG_NONE, 0, 0,
+	  N_("Move cursor to LINE, COLUMN"), NULL },
+
 	{NULL, '\0', 0, NULL, 0}
 };
 
@@ -111,7 +115,7 @@ gedit_load_file_list (CommandLineData *d
 	}
 
 	/* Load files */
-	gedit_file_open_uri_list (data->file_list, data->encoding, data->line_pos, TRUE);
+	gedit_file_open_uri_list (data->file_list, data->encoding, data->line_pos, data->column_pos, TRUE);
 	
 	g_slist_foreach (data->file_list, (GFunc)g_free, NULL);
 	g_slist_free (data->file_list);
@@ -147,7 +151,12 @@ gedit_get_command_line_data (GnomeProgra
 					/* goto the last line of the document */
 					data->line_pos = G_MAXINT;
 				else
-					data->line_pos = atoi (args[i] + 1);		
+					{
+						char *p = strchr (args[i], ':');
+						if (p != NULL)
+							data->column_pos = atoi (p + 1);
+						data->line_pos = atoi (args[i] + 1);
+					}
 			}
 			else
 			{
@@ -227,6 +236,7 @@ gedit_handle_automation (GnomeProgram *p
 						uri_list,
 						data->encoding ? encoding_charset : "",
 						data->line_pos,
+						data->column_pos,
 						&env);
 
 		g_slist_foreach (data->file_list, (GFunc)g_free, NULL);
Index: gedit/dialogs/gedit-dialog-goto-line.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/dialogs/gedit-dialog-goto-line.c,v
retrieving revision 1.21
diff -p -u -r1.21 gedit-dialog-goto-line.c
--- gedit/dialogs/gedit-dialog-goto-line.c	25 Jan 2005 10:26:25 -0000	1.21
+++ gedit/dialogs/gedit-dialog-goto-line.c	28 Feb 2005 15:10:19 -0000
@@ -86,7 +86,7 @@ goto_button_pressed (GeditDialogGotoLine
 	if (text != NULL && text[0] != 0)
 	{
 		guint line = MAX (atoi (text) - 1, 0);		
-		gedit_document_goto_line (active_document, line);
+		gedit_document_goto_line_column (active_document, line, 0);
 		gedit_view_scroll_to_cursor (active_view);
 		gtk_widget_grab_focus (GTK_WIDGET (active_view));
 	}

