commit: Backed out changeset 53c066311921, I have a better approach.
13 years, 3 months
Aidan Kehoe
changeset: 5558:10455659ab64
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Aug 28 10:22:24 2011 +0100
files: ChangeLog configure configure.ac src/ChangeLog src/config.h.in src/event-Xt.c
description:
Backed out changeset 53c066311921, I have a better approach.
diff -r 53c066311921 -r 10455659ab64 ChangeLog
--- a/ChangeLog Sat Aug 27 20:35:23 2011 +0100
+++ b/ChangeLog Sun Aug 28 10:22:24 2011 +0100
@@ -1,9 +1,3 @@
-2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
-
- * configure.ac: Check whether X11/XF86keysym.h is available, to
- allow us to avoid a bug in the interaction of XKB and XLookupKeysym.
- * configure: Regenerate.
-
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac:
diff -r 53c066311921 -r 10455659ab64 configure
--- a/configure Sat Aug 27 20:35:23 2011 +0100
+++ b/configure Sun Aug 28 10:22:24 2011 +0100
@@ -13351,7 +13351,7 @@
done
- for ac_header in X11/Xlocale.h X11/Xfuncproto.h X11/XF86keysym.h
+ for ac_header in X11/Xlocale.h X11/Xfuncproto.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff -r 53c066311921 -r 10455659ab64 configure.ac
--- a/configure.ac Sat Aug 27 20:35:23 2011 +0100
+++ b/configure.ac Sun Aug 28 10:22:24 2011 +0100
@@ -3120,7 +3120,7 @@
AC_CHECK_FUNCS(XConvertCase XtRegisterDrawable)
- AC_CHECK_HEADERS(X11/Xlocale.h X11/Xfuncproto.h X11/XF86keysym.h)
+ AC_CHECK_HEADERS(X11/Xlocale.h X11/Xfuncproto.h)
dnl XFree86 has a non-standard prototype for this X11R6 function
AC_CHECK_FUNCS(XRegisterIMInstantiateCallback)
diff -r 53c066311921 -r 10455659ab64 src/ChangeLog
--- a/src/ChangeLog Sat Aug 27 20:35:23 2011 +0100
+++ b/src/ChangeLog Sun Aug 28 10:22:24 2011 +0100
@@ -1,14 +1,3 @@
-2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
-
- * config.h.in: Make HAVE_X11_XF86KEYSYM_H available here.
- * event-Xt.c: #include X11/XF86keysym.h if available.
- * event-Xt.c (x_event_to_emacs_event):
- If XLookupKeysym () returned one of the XFree86 "special action
- keys" for the shifted keysym, treat that as NoSymbol, fixing a
- long-standing bug with shifted function keys under X.org.
- Details of why in:
- http://mid.gmane.org/16960.15685.26911.644835@parhasard.net
-
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
diff -r 53c066311921 -r 10455659ab64 src/config.h.in
--- a/src/config.h.in Sat Aug 27 20:35:23 2011 +0100
+++ b/src/config.h.in Sun Aug 28 10:22:24 2011 +0100
@@ -284,7 +284,6 @@
#undef HAVE_SYS_WAIT_H
#undef HAVE_LIBINTL_H
#undef HAVE_X11_XLOCALE_H
-#undef HAVE_X11_XF86KEYSYM_H
/* About __STDC__: Different compilers differ wrt __STDC__. Sunpro C
defines it, but its value is 0 unless we disable non-ANSI extensions.
diff -r 53c066311921 -r 10455659ab64 src/event-Xt.c
--- a/src/event-Xt.c Sat Aug 27 20:35:23 2011 +0100
+++ b/src/event-Xt.c Sun Aug 28 10:22:24 2011 +0100
@@ -66,10 +66,6 @@
#include "xmotif.h"
#endif
-#ifdef HAVE_X11_XF86KEYSYM_H
-#include <X11/XF86keysym.h>
-#endif
-
#ifdef HAVE_DRAGNDROP
#include "dragdrop.h"
#endif
@@ -1234,21 +1230,6 @@
int Mode_switch_p = *state & xd->ModeMask;
KeySym bot = XLookupKeysym (ev, Mode_switch_p ? 2 : 0);
KeySym top = XLookupKeysym (ev, Mode_switch_p ? 3 : 1);
-
-#ifdef HAVE_X11_XF86KEYSYM_H
- /* XLookupKeysm() and XLookupString() differ for these
- keysyms under X.org. The latter treats them as not
- visible to X11 apps (so if the event has the shift
- modifer, the keysym of the unshifted key will be
- returned) while the former treats them as visible. We
- chose to follow XLookupString in x_to_emacs_keysym(), so
- we need to do that here, too. */
-
- if (XF86XK_Switch_VT_1 <= top && top <= XF86XK_Prev_VMode)
- {
- top = NoSymbol;
- }
-#endif
if (top && bot && top != bot)
modifiers &= ~XEMACS_MOD_SHIFT;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: If XLookupKeysym() returned an XFree86 "special key", ignore it. Fixes Sh-F11.
13 years, 3 months
Aidan Kehoe
changeset: 5557:53c066311921
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Aug 27 20:35:23 2011 +0100
files: ChangeLog configure configure.ac src/ChangeLog src/config.h.in src/event-Xt.c
description:
If XLookupKeysym() returned an XFree86 "special key", ignore it. Fixes Sh-F11.
src/ChangeLog addition:
2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in: Make HAVE_X11_XF86KEYSYM_H available here.
* event-Xt.c: #include X11/XF86keysym.h if available.
* event-Xt.c (x_event_to_emacs_event):
If XLookupKeysym () returned one of the XFree86 "special action
keys" for the shifted keysym, treat that as NoSymbol, fixing a
long-standing bug with shifted function keys under X.org.
Details of why in:
http://mid.gmane.org/16960.15685.26911.644835@parhasard.net
ChangeLog addition:
2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac: Check whether X11/XF86keysym.h is available, to
allow us to avoid a bug in the interaction of XKB and XLookupKeysym.
* configure: Regenerate.
diff -r a142ad1a9140 -r 53c066311921 ChangeLog
--- a/ChangeLog Wed Aug 24 23:41:29 2011 +0100
+++ b/ChangeLog Sat Aug 27 20:35:23 2011 +0100
@@ -1,3 +1,9 @@
+2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * configure.ac: Check whether X11/XF86keysym.h is available, to
+ allow us to avoid a bug in the interaction of XKB and XLookupKeysym.
+ * configure: Regenerate.
+
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac:
diff -r a142ad1a9140 -r 53c066311921 configure
--- a/configure Wed Aug 24 23:41:29 2011 +0100
+++ b/configure Sat Aug 27 20:35:23 2011 +0100
@@ -13351,7 +13351,7 @@
done
- for ac_header in X11/Xlocale.h X11/Xfuncproto.h
+ for ac_header in X11/Xlocale.h X11/Xfuncproto.h X11/XF86keysym.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff -r a142ad1a9140 -r 53c066311921 configure.ac
--- a/configure.ac Wed Aug 24 23:41:29 2011 +0100
+++ b/configure.ac Sat Aug 27 20:35:23 2011 +0100
@@ -3120,7 +3120,7 @@
AC_CHECK_FUNCS(XConvertCase XtRegisterDrawable)
- AC_CHECK_HEADERS(X11/Xlocale.h X11/Xfuncproto.h)
+ AC_CHECK_HEADERS(X11/Xlocale.h X11/Xfuncproto.h X11/XF86keysym.h)
dnl XFree86 has a non-standard prototype for this X11R6 function
AC_CHECK_FUNCS(XRegisterIMInstantiateCallback)
diff -r a142ad1a9140 -r 53c066311921 src/ChangeLog
--- a/src/ChangeLog Wed Aug 24 23:41:29 2011 +0100
+++ b/src/ChangeLog Sat Aug 27 20:35:23 2011 +0100
@@ -1,3 +1,14 @@
+2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * config.h.in: Make HAVE_X11_XF86KEYSYM_H available here.
+ * event-Xt.c: #include X11/XF86keysym.h if available.
+ * event-Xt.c (x_event_to_emacs_event):
+ If XLookupKeysym () returned one of the XFree86 "special action
+ keys" for the shifted keysym, treat that as NoSymbol, fixing a
+ long-standing bug with shifted function keys under X.org.
+ Details of why in:
+ http://mid.gmane.org/16960.15685.26911.644835@parhasard.net
+
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
diff -r a142ad1a9140 -r 53c066311921 src/config.h.in
--- a/src/config.h.in Wed Aug 24 23:41:29 2011 +0100
+++ b/src/config.h.in Sat Aug 27 20:35:23 2011 +0100
@@ -284,6 +284,7 @@
#undef HAVE_SYS_WAIT_H
#undef HAVE_LIBINTL_H
#undef HAVE_X11_XLOCALE_H
+#undef HAVE_X11_XF86KEYSYM_H
/* About __STDC__: Different compilers differ wrt __STDC__. Sunpro C
defines it, but its value is 0 unless we disable non-ANSI extensions.
diff -r a142ad1a9140 -r 53c066311921 src/event-Xt.c
--- a/src/event-Xt.c Wed Aug 24 23:41:29 2011 +0100
+++ b/src/event-Xt.c Sat Aug 27 20:35:23 2011 +0100
@@ -66,6 +66,10 @@
#include "xmotif.h"
#endif
+#ifdef HAVE_X11_XF86KEYSYM_H
+#include <X11/XF86keysym.h>
+#endif
+
#ifdef HAVE_DRAGNDROP
#include "dragdrop.h"
#endif
@@ -1230,6 +1234,21 @@
int Mode_switch_p = *state & xd->ModeMask;
KeySym bot = XLookupKeysym (ev, Mode_switch_p ? 2 : 0);
KeySym top = XLookupKeysym (ev, Mode_switch_p ? 3 : 1);
+
+#ifdef HAVE_X11_XF86KEYSYM_H
+ /* XLookupKeysm() and XLookupString() differ for these
+ keysyms under X.org. The latter treats them as not
+ visible to X11 apps (so if the event has the shift
+ modifer, the keysym of the unshifted key will be
+ returned) while the former treats them as visible. We
+ chose to follow XLookupString in x_to_emacs_keysym(), so
+ we need to do that here, too. */
+
+ if (XF86XK_Switch_VT_1 <= top && top <= XF86XK_Prev_VMode)
+ {
+ top = NoSymbol;
+ }
+#endif
if (top && bot && top != bot)
modifiers &= ~XEMACS_MOD_SHIFT;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT GTK] gtk_init() stomps on LC_NUMERIC; set it back to C after it's done.
13 years, 3 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1314459970 -3600
# Node ID c9d335183ef0519a6903f25f286f88b351e428b1
# Parent d20ffd0cf85df0423b9ab74f414904e3688cdae4
gtk_init() stomps on LC_NUMERIC; set it back to C after it's done.
src/ChangeLog.GTK addition:
2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* device-gtk.c:
* device-gtk.c (Fgtk_init):
Call setlocale (LC_NUMERIC, "C") after gtk_init(); the latter
stomps on LC_NUMERIC, taking the value from the environment, which
we explicitly don't want, because we use the C library functions
to parse Lisp floats and so on.
diff -r d20ffd0cf85d -r c9d335183ef0 src/ChangeLog.GTK
--- a/src/ChangeLog.GTK Fri Aug 26 16:34:16 2011 +0100
+++ b/src/ChangeLog.GTK Sat Aug 27 16:46:10 2011 +0100
@@ -1,3 +1,12 @@
+2011-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * device-gtk.c:
+ * device-gtk.c (Fgtk_init):
+ Call setlocale (LC_NUMERIC, "C") after gtk_init(); the latter
+ stomps on LC_NUMERIC, taking the value from the environment, which
+ we explicitly don't want, because we use the C library functions
+ to parse Lisp floats and so on.
+
2011-08-26 Aidan Kehoe <kehoea(a)parhasard.net>
* frame-gtk.c:
diff -r d20ffd0cf85d -r c9d335183ef0 src/device-gtk.c
--- a/src/device-gtk.c Fri Aug 26 16:34:16 2011 +0100
+++ b/src/device-gtk.c Sat Aug 27 16:46:10 2011 +0100
@@ -51,6 +51,8 @@
#include <bonobo.h>
#endif
+#include <locale.h>
+
Lisp_Object Qmake_device_early_gtk_entry_point,
Qmake_device_late_gtk_entry_point;
@@ -184,6 +186,11 @@
slow_down_interrupts ();
gtk_init (&argc, &argv);
+ /* Sigh, gtk_init stomped on LC_NUMERIC, which we need to be C. Otherwise
+ the Lisp reader doesn't necessarily understand the radix character for
+ floats, which is a problem. */
+ setlocale (LC_NUMERIC, "C");
+
#ifdef HAVE_BONOBO
orb = oaf_init (argc, argv);
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT GTK] Tell KKCC about some hash tables in the GTK frame object, frame-gtk.c
13 years, 4 months
Aidan Kehoe
Again, another discrete change that shouldn’t affect you, Jeff.
APPROVE COMMIT GTK
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1314372856 -3600
# Node ID d20ffd0cf85df0423b9ab74f414904e3688cdae4
# Parent 811ef64bb11a5ba4f8b7b899eb4d8260d3603536
Tell KKCC about some hash tables in the GTK frame object, frame-gtk.c
src/ChangeLog.GTK addition:
2011-08-26 Aidan Kehoe <kehoea(a)parhasard.net>
* frame-gtk.c:
* frame-gtk.c (gtk_mark_frame):
For the sake of KKCC, add information on the various weak hash
tables in gtk_frame to the data description. Otherwise they get
garbage collected, which is less than optimal.
Reorder the mark_object calls in gtk_mark_frame() to reflect the
order of the Lisp_Objects in the structure, to make omitting things
a little harder to forget.
diff -r 811ef64bb11a -r d20ffd0cf85d src/ChangeLog.GTK
--- a/src/ChangeLog.GTK Fri Aug 26 15:07:13 2011 +0100
+++ b/src/ChangeLog.GTK Fri Aug 26 16:34:16 2011 +0100
@@ -1,3 +1,14 @@
+2011-08-26 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * frame-gtk.c:
+ * frame-gtk.c (gtk_mark_frame):
+ For the sake of KKCC, add information on the various weak hash
+ tables in gtk_frame to the data description. Otherwise they get
+ garbage collected, which is less than optimal.
+ Reorder the mark_object calls in gtk_mark_frame() to reflect the
+ order of the Lisp_Objects in the structure, to make omitting things
+ a little harder to forget.
+
2011-08-26 Aidan Kehoe <kehoea(a)parhasard.net>
* device-gtk.c:
diff -r 811ef64bb11a -r d20ffd0cf85d src/frame-gtk.c
--- a/src/frame-gtk.c Fri Aug 26 15:07:13 2011 +0100
+++ b/src/frame-gtk.c Fri Aug 26 16:34:16 2011 +0100
@@ -89,11 +89,15 @@
#endif
static const struct memory_description gtk_frame_data_description_1 [] = {
- { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap) },
- { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap_mask) },
{ XD_LISP_OBJECT_ARRAY, offsetof (struct gtk_frame, lisp_visible_widgets),
3 },
{ XD_LISP_OBJECT, offsetof (struct gtk_frame, menubar_data) },
+ { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap) },
+ { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap_mask) },
+ { XD_LISP_OBJECT, offsetof (struct gtk_frame, widget_instance_hash_table) },
+ { XD_LISP_OBJECT, offsetof (struct gtk_frame, widget_callback_hash_table) },
+ { XD_LISP_OBJECT, offsetof (struct gtk_frame,
+ widget_callback_ex_hash_table) },
{ XD_END }
};
@@ -1142,12 +1146,12 @@
static void
gtk_mark_frame (struct frame *f)
{
- mark_object (FRAME_GTK_ICON_PIXMAP (f));
- mark_object (FRAME_GTK_ICON_PIXMAP_MASK (f));
- mark_object (FRAME_GTK_MENUBAR_DATA (f));
mark_object (FRAME_GTK_LISP_WIDGETS (f)[0]);
mark_object (FRAME_GTK_LISP_WIDGETS (f)[1]);
mark_object (FRAME_GTK_LISP_WIDGETS (f)[2]);
+ mark_object (FRAME_GTK_MENUBAR_DATA (f));
+ mark_object (FRAME_GTK_ICON_PIXMAP (f));
+ mark_object (FRAME_GTK_ICON_PIXMAP_MASK (f));
mark_object (FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f));
mark_object (FRAME_GTK_WIDGET_CALLBACK_HASH_TABLE (f));
mark_object (FRAME_GTK_WIDGET_CALLBACK_EX_HASH_TABLE (f));
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT GTK] Support all the types in selection-converter-out-alist on GTK.
13 years, 4 months
Aidan Kehoe
Jeff, this is a relatively discrete change, I can’t imagine it’ll have much
effect on you.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1314367633 -3600
# Node ID 811ef64bb11a5ba4f8b7b899eb4d8260d3603536
# Parent f981f0cd7c99a7e8f4790145cf167165ff5d73db
Support all the types in selection-converter-out-alist on GTK.
src/ChangeLog.GTK addition:
2011-08-26 Aidan Kehoe <kehoea(a)parhasard.net>
* device-gtk.c:
* device-gtk.c (gtk_init_device):
* device-gtk.c (vars_of_device_gtk):
At startup, tell GTK that we're capable of and interested in
passing selections for all those selection types in
selection-converter-out-alist. This means that we now support
non-Latin-1 data when copying and pasting, which previously wasn't
the case on GTK.
Call va_run_hook_with_args, don't reimplement it ourselves.
Remove Qgtk_seen_characters in passing, nothing was using it.
* select-gtk.c (emacs_gtk_selection_handle):
Fix a bug in this function; because of X11, the fifth argument to
lisp_data_to_selection_data is not the number of octets at the
address DATA, rather the number of elements, each of size FORMAT
bits, in the array at that address.
* select.h:
device-gtk.c now needs to see selection-converter-out-alist.
diff -r f981f0cd7c99 -r 811ef64bb11a src/ChangeLog.GTK
--- a/src/ChangeLog.GTK Wed Jul 13 09:18:00 2011 -0400
+++ b/src/ChangeLog.GTK Fri Aug 26 15:07:13 2011 +0100
@@ -1,3 +1,23 @@
+2011-08-26 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * device-gtk.c:
+ * device-gtk.c (gtk_init_device):
+ * device-gtk.c (vars_of_device_gtk):
+ At startup, tell GTK that we're capable of and interested in
+ passing selections for all those selection types in
+ selection-converter-out-alist. This means that we now support
+ non-Latin-1 data when copying and pasting, which previously wasn't
+ the case on GTK.
+ Call va_run_hook_with_args, don't reimplement it ourselves.
+ Remove Qgtk_seen_characters in passing, nothing was using it.
+ * select-gtk.c (emacs_gtk_selection_handle):
+ Fix a bug in this function; because of X11, the fifth argument to
+ lisp_data_to_selection_data is not the number of octets at the
+ address DATA, rather the number of elements, each of size FORMAT
+ bits, in the array at that address.
+ * select.h:
+ device-gtk.c now needs to see selection-converter-out-alist.
+
2011-07-12 Jeff Sparkes <jsparkes(a)gmail.com>
* event-gtk.c (emacs_gtk_add_timeout): Use glib timeout instead of
diff -r f981f0cd7c99 -r 811ef64bb11a src/device-gtk.c
--- a/src/device-gtk.c Wed Jul 13 09:18:00 2011 -0400
+++ b/src/device-gtk.c Fri Aug 26 15:07:13 2011 +0100
@@ -36,6 +36,7 @@
#include "redisplay.h"
#include "sysdep.h"
#include "window.h"
+#include "select.h"
#include "console-gtk-impl.h"
#include "gccache-gtk.h"
@@ -59,8 +60,6 @@
Lisp_Object Vgtk_initial_argv_list; /* #### ugh! */
Lisp_Object Vgtk_initial_geometry;
-Lisp_Object Qgtk_seen_characters;
-
static void gtk_device_init_x_specific_cruft (struct device *d);
static const struct memory_description gtk_device_data_description_1 [] = {
@@ -306,12 +305,60 @@
purposes */
gtk_widget_realize (GTK_WIDGET (app_shell));
- /* Need to set up some selection handlers */
- gtk_selection_add_target (GTK_WIDGET (app_shell), GDK_SELECTION_PRIMARY,
- GDK_SELECTION_TYPE_STRING, 0);
- gtk_selection_add_target (GTK_WIDGET (app_shell),
- gdk_atom_intern("CLIPBOARD", FALSE),
- GDK_SELECTION_TYPE_STRING, 0);
+ /* Set up the selection handlers. I attempted just to register the handler
+ for TARGETS, and this works in that the requestor does see our offered
+ list of targets (GTK gets out of the way for this), but then further
+ attempts to transfer COMPOUND_TEXT and so on fail, because GTK
+ interposes itself, and ignores that we've demonstrated we know what
+ formats we can transfer by sending TARGETS.
+
+ Note that under X11 the cars of selection-converter-out-alist can
+ usefully be modified at runtime, making fewer or more selection types
+ available; this isn't the case under GTK, the set is examined once at
+ startup. */
+ {
+ guint target_count = XINT (Fsafe_length (Vselection_converter_out_alist));
+ GtkTargetEntry *targets = alloca_array (GtkTargetEntry, target_count);
+ Lisp_Object tail = Vselection_converter_out_alist;
+ DECLARE_EISTRING(ei_symname);
+ guint ii;
+
+ for (ii = 0; ii < target_count; ii++)
+ {
+ targets[ii].flags = 0;
+ /* We don't use info at the moment. */
+ targets[ii].info = ii;
+ if (CONSP (Fcar (tail)) && SYMBOLP (XCAR (XCAR (tail))))
+ {
+ eicpy_lstr (ei_symname, XSYMBOL_NAME (XCAR (XCAR (tail))));
+ /* GTK doesn't specify the encoding of their atom names. */
+ eito_external (ei_symname, Qbinary);
+ targets[ii].target = alloca_array (gchar, eiextlen (ei_symname)
+ + 1);
+ memcpy ((void *) (targets[ii].target),
+ (void *) eiextdata (ei_symname), eiextlen (ei_symname) + 1);
+ }
+ else
+ {
+ if (ii > 0xFF)
+ {
+ /* It was corrupt long before ii > 0xff, of course. */
+ gui_error ("selection-converter-out-alist is corrupt",
+ Vselection_converter_out_alist);
+ }
+ targets[ii].target = alloca_array (gchar, sizeof ("TARGETFF"));
+ sprintf (targets[ii].target, "TARGET%02X", ii);
+ }
+ tail = Fcdr (tail);
+ }
+
+ gtk_selection_add_targets (GTK_WIDGET (app_shell), GDK_SELECTION_PRIMARY,
+ targets, target_count);
+ gtk_selection_add_targets (GTK_WIDGET (app_shell), GDK_SELECTION_SECONDARY,
+ targets, target_count);
+ gtk_selection_add_targets (GTK_WIDGET (app_shell), GDK_SELECTION_CLIPBOARD,
+ targets, target_count);
+ }
g_signal_connect (G_OBJECT (app_shell), "selection_get",
GTK_SIGNAL_FUNC (emacs_gtk_selection_handle), NULL);
@@ -754,8 +801,6 @@
Vgtk_initial_geometry = Qnil;
Vgtk_initial_argv_list = Qnil;
-
- Qgtk_seen_characters = Qnil;
}
#include "sysgdkx.h"
diff -r f981f0cd7c99 -r 811ef64bb11a src/select-gtk.c
--- a/src/select-gtk.c Wed Jul 13 09:18:00 2011 -0400
+++ b/src/select-gtk.c Fri Aug 26 15:07:13 2011 +0100
@@ -198,20 +198,26 @@
make_opaque_ptr (cl));
{
- Rawbyte *data;
- Bytecount size;
- int format;
+ Rawbyte *data; /* The selection data to transfer. */
+ Elemcount len; /* The number of *elements*, each of size FORMAT bits, in
+ the array at address DATA. */
+ gint format, format_octets;
GdkAtom type;
- lisp_data_to_selection_data (d, converted_selection,
- &data, &type, &size, &format);
+ lisp_data_to_selection_data (d, converted_selection, &data, &type, &len,
+ &format);
+ format_octets = format / 8;
gtk_selection_data_set (selection_data, type, format, data,
- /* #### is this right? */
- (unsigned int) size);
+ format_octets * len);
successful_p = Qt;
/* Tell x_selection_request_lisp_error() it's cool. */
cl->successful = TRUE;
- xfree (data);
+ /* Data need not have been allocated; cf. select-convert-to-delete in
+ lisp/select.el . */
+ if (data)
+ {
+ xfree (data);
+ }
}
unbind_to (count);
@@ -224,18 +230,8 @@
UNGCPRO;
/* Let random lisp code notice that the selection has been asked for. */
- {
- Lisp_Object val = Vgtk_sent_selection_hooks;
- if (!UNBOUNDP (val) && !NILP (val))
- {
- Lisp_Object rest;
- if (CONSP (val) && !EQ (XCAR (val), Qlambda))
- for (rest = val; !NILP (rest); rest = Fcdr (rest))
- call3 (Fcar (rest), selection_symbol, target_symbol, successful_p);
- else
- call3 (val, selection_symbol, target_symbol, successful_p);
- }
- }
+ va_run_hook_with_args (Vgtk_sent_selection_hooks, 3, selection_symbol,
+ target_symbol, successful_p);
}
diff -r f981f0cd7c99 -r 811ef64bb11a src/select.h
--- a/src/select.h Wed Jul 13 09:18:00 2011 -0400
+++ b/src/select.h Fri Aug 26 15:07:13 2011 +0100
@@ -64,4 +64,6 @@
EXFUN (Fselection_owner_p, 1);
EXFUN (Fselection_exists_p, 3);
+extern Lisp_Object Vselection_converter_out_alist;
+
#endif /* INCLUDED_select_h_ */
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[PATCH] XEmacs Xt dont recognize SHIFT F10 in linux
13 years, 4 months
FKtPp
Dear all,
I've just come out a patch for the XEmacs don't recognize shift
Function key issue.
please help review.
Thanks,
Kai
src/ChangeLog addition:
2011-08-25 It's me FKtPp ;) <m_pupil(a)yahoo.com.cn>
Fix issue in event-Xt so function keys can have shift bit set.
* event-Xt.c (x_event_to_emacs_event): make use of XConvertCase,
instead of hardcoded keysym lookup, to determind if a key is
subject to case convertion or not.
XEmacs source patch:
Diff command: hg diff --git
Files affected: src/event-Xt.c
diff --git a/src/event-Xt.c b/src/event-Xt.c
--- a/src/event-Xt.c
+++ b/src/event-Xt.c
@@ -1227,9 +1227,9 @@
if (modifiers & XEMACS_MOD_SHIFT)
{
- int Mode_switch_p = *state & xd->ModeMask;
- KeySym bot = XLookupKeysym (ev, Mode_switch_p ? 2 : 0);
- KeySym top = XLookupKeysym (ev, Mode_switch_p ? 3 : 1);
+ KeySym sym = XLookupKeysym (ev, 0);
+ KeySym top, bot;
+ XConvertCase (sym, &top, &bot);
if (top && bot && top != bot)
modifiers &= ~XEMACS_MOD_SHIFT;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Use dlsym() in preference to NSLookupSymbolInModule() on Darwin, if available.
13 years, 4 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
configure change omitted for readability. Close readers of the diff may
wonder what’s changed, now that DLSYM_NEEDS_UNDERSCORE isn’t automatically
set when HAVE_SHLIB is set. The answer is; nothing, DLSYM_NEEDS_UNDERSCORE
is respected in sysdll.c and only there, and only within #defines that
reflect that the system’s dynamic library architecture has been detected.
The system’s dynamic library architecture is only detected when
--with-modules is on, and in this case, DLYSYM_NEEDS_UNDERSCORE now gets an
appropriate value when --with-modules is on.
ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac:
On OS X, if dlopen() is available in dlfcn.h, use it in preference
to dyld; the latter API is deprecated.
Move DLSYM_NEEDS_UNDERSCORE together with HAVE_DLYD, it's not
needed if the dlsym() and dlopen() APIs are being used.
Define REALPATH_CORRECTS_CASE, DEFAULT_FILE_SYSTEM_IGNORE_CASE in
this file, don't define them in terms of HAVE_DYLD in
src/config.h.in.
* configure: Regenerate.
src/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* config.h.in:
Move REALPATH_CORRECTS_CASE, DEFAULT_FILE_SYSTEM_IGNORE_CASE to
../configure.ac rather than implementing them in terms of
HAVE_DYLD here.
diff -r a39cd9dc92ba -r a142ad1a9140 configure.ac
--- a/configure.ac Wed Aug 24 11:22:30 2011 +0100
+++ b/configure.ac Wed Aug 24 23:41:29 2011 +0100
@@ -1475,7 +1475,6 @@
if test "$with_dynamic" = "yes"; then
case "$opsys" in
hpux* ) opsys="${opsys}-shr" ;;
- darwin ) AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) ;;
esac
else dnl "$with_dynamic" = "no"
case "$opsys" in
@@ -3375,6 +3374,13 @@
fi
AC_SUBST(LIBSTDCPP)
+dnl Tell the pathname handling code about a couple of Darwin-specific things
+dnl it needs to know:
+if test "$opsys" = "darwin"; then
+ AC_DEFINE(REALPATH_CORRECTS_CASE)
+ AC_DEFINE(DEFAULT_FILE_SYSTEM_IGNORE_CASE)
+fi
+
dnl This must come before the detection code for anything that is in a module
if test "$with_modules" != "no"; then
AC_MSG_CHECKING([for module support])
@@ -3382,10 +3388,7 @@
case "$opsys" in
mingw* | cygwin* ) have_dl=yes ;;
- darwin ) have_dl=yes
- AC_DEFINE(HAVE_DYLD)
- ;;
- * )
+ *)
dnl Check for the ELFish dlopen()
AC_CHECK_HEADER(dlfcn.h, [
AC_MSG_CHECKING([for dlopen in -lc])
@@ -3406,38 +3409,45 @@
if test "$have_dl" = "yes"; then
AC_DEFINE(HAVE_DLOPEN)
else
- dnl Check for HP/UX shl_load
- AC_CHECK_HEADER(dl.h, [
- AC_MSG_CHECKING([for shl_load in -lc])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>],
- [shl_load ("", 0, 0);])], [have_dl=yes; AC_MSG_RESULT($have_dl)], [
- AC_MSG_RESULT([no])
- AC_MSG_CHECKING([for shl_load in -ldl])
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS -ldld"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>],
- [shl_load ("", 0, 0);])], [have_dl=yes],
- [LIBS="$ac_save_LIBS"; AC_MSG_RESULT([no])])])])
- if test "$have_dl" = "yes"; then
- AC_DEFINE(HAVE_SHL_LOAD)
- else
- dnl Check for libtool's libltdl
- AC_CHECK_HEADER(ltdl.h, [
- AC_MSG_CHECKING([for lt_dlinit in -lltdl])
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS -lltdl"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ltdl.h>],
- [lt_dlinit ();])], [have_dl=yes], [LIBS="$ac_save_LIBS"])])
- AC_MSG_RESULT($have_dl)
- if test "$have_dl" = "yes"; then
- AC_DEFINE(HAVE_LTDL)
- fi
- dnl end !HP/UX
- fi
+ dnl On Darwin, the DYLD API is deprecated, so we prefer dlopen if
+ dnl available, above.
+ if test "$opsys" = "darwin"; then
+ have_dl=yes
+ AC_DEFINE(HAVE_DYLD)
+ AC_DEFINE(DLSYM_NEEDS_UNDERSCORE)
+ else
+ dnl Check for HP/UX shl_load
+ AC_CHECK_HEADER(dl.h, [
+ AC_MSG_CHECKING([for shl_load in -lc])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>],
+ [shl_load ("", 0, 0);])], [have_dl=yes; AC_MSG_RESULT($have_dl)],[
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for shl_load in -ldl])
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS -ldld"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>],
+ [shl_load ("", 0, 0);])], [have_dl=yes],
+ [LIBS="$ac_save_LIBS"; AC_MSG_RESULT([no])])])])
+ if test "$have_dl" = "yes"; then
+ AC_DEFINE(HAVE_SHL_LOAD)
+ else
+ dnl Check for libtool's libltdl
+ AC_CHECK_HEADER(ltdl.h, [
+ AC_MSG_CHECKING([for lt_dlinit in -lltdl])
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS -lltdl"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ltdl.h>],
+ [lt_dlinit ();])], [have_dl=yes], [LIBS="$ac_save_LIBS"])])
+ AC_MSG_RESULT($have_dl)
+ if test "$have_dl" = "yes"; then
+ AC_DEFINE(HAVE_LTDL)
+ fi
+ dnl end !HP/UX
+ fi
+ fi
dnl end !dlopen
fi
ac_save_LIBS=
- dnl end !darwin
esac
if test -n "$have_dl"; then
diff -r a39cd9dc92ba -r a142ad1a9140 src/config.h.in
--- a/src/config.h.in Wed Aug 24 11:22:30 2011 +0100
+++ b/src/config.h.in Wed Aug 24 23:41:29 2011 +0100
@@ -330,11 +330,8 @@
#undef DLSYM_NEEDS_UNDERSCORE
#undef HAVE_SHLIB
-/* Darwin; realpath corrects for case: */
-#ifdef HAVE_DYLD
-#define REALPATH_CORRECTS_CASE 1
-#define DEFAULT_FILE_SYSTEM_IGNORE_CASE 1
-#endif
+#undef REALPATH_CORRECTS_CASE
+#undef DEFAULT_FILE_SYSTEM_IGNORE_CASE
#undef HAVE_LIBINTL
#undef HAVE_LIBDNET
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Correct a typo from Mats' merge, process.el, thank you the byte-compiler
13 years, 4 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1314181350 -3600
# Node ID a39cd9dc92ba3be6018f8f47b050fe878a4c1d47
# Parent a42e686a01bf8ac842742769c8362bc22db7d733
Correct a typo from Mats' merge, process.el, thank you the byte-compiler
lisp/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* process.el (shell-command-on-region):
Correct typo from the merge, nnot -> not.
diff -r a42e686a01bf -r a39cd9dc92ba lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 24 11:07:26 2011 +0100
+++ b/lisp/ChangeLog Wed Aug 24 11:22:30 2011 +0100
@@ -1,3 +1,8 @@
+2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * process.el (shell-command-on-region):
+ Correct typo from the merge, nnot -> not.
+
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (apply-partially):
diff -r a42e686a01bf -r a39cd9dc92ba lisp/process.el
--- a/lisp/process.el Wed Aug 24 11:07:26 2011 +0100
+++ b/lisp/process.el Wed Aug 24 11:22:30 2011 +0100
@@ -453,7 +453,7 @@
t)
nil shell-command-switch command))
(let ((shell-buffer (get-buffer "*Shell Command Output*")))
- (and shell-buffer (nnot (eq shell-buffer (current-buffer)))
+ (and shell-buffer (not (eq shell-buffer (current-buffer)))
(kill-buffer shell-buffer)))
;; Don't muck with mark unless REPLACE says we should.
(and replace swap (exchange-point-and-mark t)))
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Add an assertion about argument order to #'apply-partially compiler macro
13 years, 4 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1314180401 -3600
# Node ID 62edcc6a11ecf12eabdf78eff45e444431391223
# Parent b908c7265a2b98c3dcb5bbc4edecd5c9a158fc02
Add an assertion about argument order to #'apply-partially compiler macro
lisp/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (apply-partially):
Add an assertion to this compiler macro, requiring that the order
of the placeholders corresponding to the arguments in the
constants vector of the constructed compiled function be the same
as the order of the arguments to #'apply-partially.
tests/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el:
Add a test of apply partially that depends on the relative order
of its arguments.
diff -r b908c7265a2b -r 62edcc6a11ec lisp/ChangeLog
--- a/lisp/ChangeLog Fri Aug 12 16:02:30 2011 +0100
+++ b/lisp/ChangeLog Wed Aug 24 11:06:41 2011 +0100
@@ -1,3 +1,11 @@
+2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (apply-partially):
+ Add an assertion to this compiler macro, requiring that the order
+ of the placeholders corresponding to the arguments in the
+ constants vector of the constructed compiled function be the same
+ as the order of the arguments to #'apply-partially.
+
2011-08-12 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el:
diff -r b908c7265a2b -r 62edcc6a11ec lisp/cl-macs.el
--- a/lisp/cl-macs.el Fri Aug 12 16:02:30 2011 +0100
+++ b/lisp/cl-macs.el Wed Aug 24 11:06:41 2011 +0100
@@ -3519,6 +3519,13 @@
(let* ((placeholders (mapcar 'quote-maybe (mapcar 'gensym args)))
(compiled (byte-compile-sexp
`#'(lambda (&rest args) (apply ,@placeholders args)))))
+ (assert (equal (intersection
+ (mapcar 'quote-maybe (compiled-function-constants
+ compiled))
+ placeholders :test 'equal :stable t)
+ placeholders)
+ t "This macro requires that the relative order is the same\
+in the constants vector and in the arguments")
`(make-byte-code
',(compiled-function-arglist compiled)
,(compiled-function-instructions compiled)
diff -r b908c7265a2b -r 62edcc6a11ec tests/ChangeLog
--- a/tests/ChangeLog Fri Aug 12 16:02:30 2011 +0100
+++ b/tests/ChangeLog Wed Aug 24 11:06:41 2011 +0100
@@ -1,3 +1,9 @@
+2011-08-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/lisp-tests.el:
+ Add a test of apply partially that depends on the relative order
+ of its arguments.
+
2011-08-12 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el:
diff -r b908c7265a2b -r 62edcc6a11ec tests/automated/lisp-tests.el
--- a/tests/automated/lisp-tests.el Fri Aug 12 16:02:30 2011 +0100
+++ b/tests/automated/lisp-tests.el Wed Aug 24 11:06:41 2011 +0100
@@ -2929,10 +2929,13 @@
;; Basic tests of #'apply-partially.
(let* ((four 4)
(times-four (apply-partially '* four))
- (plus-twelve (apply-partially '+ 6 (* 3 2))))
+ (plus-twelve (apply-partially '+ 6 (* 3 2)))
+ (construct-list (apply-partially 'list (incf four) (incf four)
+ (incf four))))
(Assert (eql (funcall times-four 6) 24))
(Assert (eql (funcall times-four 4 4) 64))
(Assert (eql (funcall plus-twelve (funcall times-four 4) 4 4) 36))
- (Check-Error wrong-number-of-arguments (apply-partially)))
+ (Check-Error wrong-number-of-arguments (apply-partially))
+ (Assert (equal (funcall construct-list) '(5 6 7))))
;;; end of lisp-tests.el
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches