[evolution-patches] Re: emacs keybindings



On Wed, 2003-09-03 at 12:57 -0500, Larry Ewing wrote:
> This is a quick hack to make emacs keybindings work a little better in
> the editor.
> 
> --Larry

Let me try that again.

--Larry

? .Makefile.am.swp
? GNOME_GtkHTML_Editor-emacs.xml.in
? test_editor
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
retrieving revision 1.410.2.5
diff -u -p -r1.410.2.5 ChangeLog
--- ChangeLog	3 Sep 2003 19:08:35 -0000	1.410.2.5
+++ ChangeLog	4 Sep 2003 20:55:47 -0000
@@ -1,3 +1,13 @@
+2003-09-02  Larry Ewing  <lewing ximian com>
+
+	* GNOME_GtkHTML_Editor-emacs.xml.in: add file with emacs friendly
+	keybindings converted by Alain Mellan (see Ximian #41187).
+
+	* menubar.c (menubar_setup): load emacs keybindings if the
+	use_emacs_keybindings is set in the class.
+
+	* Makefile.am: add rules for GNOME_GtkHTML_Editor-emacs.xml.in.
+
 2003-09-03  Dan Winship  <danw ximian com>
 
 	* Makefile.am (libgnome_gtkhtml_editor_3_0_la_LDFLAGS): Remove
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/Makefile.am,v
retrieving revision 1.89.2.1
diff -u -p -r1.89.2.1 Makefile.am
--- Makefile.am	3 Sep 2003 19:08:35 -0000	1.89.2.1
+++ Makefile.am	4 Sep 2003 20:55:47 -0000
@@ -166,8 +166,11 @@ server_DATA = $(server_in_files:.server.
 GNOME_GtkHTML_Editor.xml: GNOME_GtkHTML_Editor.xml.in Makefile
 	sed -e 's|\ ICONSDIR\@|$(gtkhtml_data)/icons|g' $< > $@
 
+GNOME_GtkHTML_Editor-emacs.xml: GNOME_GtkHTML_Editor-emacs.xml.in Makefile
+	sed -e 's|\ ICONSDIR\@|$(gtkhtml_data)/icons|g' $< > $@
+
 uidir = $(gtkhtml_data)
-ui_DATA = GNOME_GtkHTML_Editor.xml
+ui_DATA = GNOME_GtkHTML_Editor.xml GNOME_GtkHTML_Editor-emacs.xml
 
 # The Test program
 
@@ -188,6 +191,7 @@ EXTRA_DIST =					\
 	ChangeLog				\
 	$(ui_DATA)				\
 	GNOME_GtkHTML_Editor.xml.in		\
+	GNOME_GtkHTML_Editor-emacs.xml.in	\
 	gtkhtml-editor-properties.glade		\
 	$(server_in_files) $(server_DATA)
 idldir = $(gtkhtml_data)
@@ -200,4 +204,5 @@ BUILT_SOURCES = $(IDL_GENERATED) $(SPELL
 
 CLEANFILES = \
 	GNOME_GtkHTML_Editor.xml		\
+	GNOME_GtkHTML_Editor-emacs.xml		\
 	$(BUILT_SOURCES)
Index: menubar.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/menubar.c,v
retrieving revision 1.91.6.1
diff -u -p -r1.91.6.1 menubar.c
--- menubar.c	8 Aug 2003 04:20:26 -0000	1.91.6.1
+++ menubar.c	4 Sep 2003 20:55:47 -0000
@@ -680,13 +680,10 @@ menubar_setup (BonoboUIComponent  *uic,
 	       GtkHTMLControlData *cd)
 {
 	gchar *domain;
-
 	g_return_if_fail (cd->html != NULL);
 	g_return_if_fail (GTK_IS_HTML (cd->html));
 	g_return_if_fail (BONOBO_IS_UI_COMPONENT (uic));
 
-	/* printf ("xml: %s/%s\n", GTKHTML_DATADIR, "GNOME_GtkHTML_Editor.xml"); */
-
 	/*
 	  FIXME
 
@@ -698,7 +695,12 @@ menubar_setup (BonoboUIComponent  *uic,
 	domain = g_strdup (textdomain (NULL));
 	textdomain (GNOME_EXPLICIT_TRANSLATION_DOMAIN);
 	bonobo_ui_component_add_verb_list_with_data (uic, editor_verbs, cd);
-	bonobo_ui_util_set_ui (uic, GTKHTML_DATADIR, "GNOME_GtkHTML_Editor.xml", "GNOME_GtkHTML_Editor", NULL);
+
+	if (GTK_HTML_CLASS(G_OBJECT_GET_CLASS (cd->html))->use_emacs_bindings) {
+		bonobo_ui_util_set_ui (uic, GTKHTML_DATADIR, "GNOME_GtkHTML_Editor-emacs.xml", "GNOME_GtkHTML_Editor", NULL);
+	} else {
+		bonobo_ui_util_set_ui (uic, GTKHTML_DATADIR, "GNOME_GtkHTML_Editor.xml", "GNOME_GtkHTML_Editor", NULL);
+	}
 
 	spell_create_language_menu (cd);
 	menubar_update_format (cd);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]