Hi Aidan,
Aidan Kehoe <kehoea(a)parhasard.net> wrote:
A while ago I applied a patch that avoided calling certain X code
when the
corresponding XEmacs device was being deleted. At the time my impression was
that the X code in general called ABORT() in contexts where it should rather
check if any frames exist on other devices, and delete the X device and
throw to top level if so.
That’s not true. The X code, while filled with calls to ABORT(), only calls
it in truly exceptional conditions, that indicate programming errors
somewhere, the sort of place where an assertion would be a better choice
since the check can be turned off in a production build. This patch changes
them to assertions; I’d especially like any commentary on it from Jerry,
since you’ve been looking at this code in detail recently.
Don't overestimate my ability to understand X code. :-)
Index: src/event-Xt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-Xt.c,v
retrieving revision 1.91
diff -u -u -r1.91 event-Xt.c
--- src/event-Xt.c 2005/12/24 19:54:01 1.91
+++ src/event-Xt.c 2006/06/25 10:13:10
@@ -1122,7 +1122,7 @@
This _might_ be possible within an XKB framework, changing
the keyboard to a US XKB layout for a moment at startup,
- storing the correspondance, and changing it back. But that
+ storing the correspondence, and changing it back. But that
won't work on non-XKB servers, it makes our already slow
startup slower, and it's not clear that it's really any
easier or more maintainable than storing a correspondence in
@@ -2419,7 +2419,8 @@
return;
}
}
- ABORT ();
+
+ assert (0);
}
static void
This change worries me a little. In a non-debug build, if we don't have
ABORT there, then Xt_process_to_emacs_event is going to return without
filling in emacs_event. Of course, as you point out, this should never
happen. Still, if we aren't going to abort here, perhaps we should fill
in emacs_event with something? (I have no idea what, and maybe that's
just silly. Use your own judgment.)
The rest of the changes look okay to me, but do keep in mind that I
wasn't kidding above. I really don't understand the X code very well.
Regards,
--
Jerry James, Assistant Professor james(a)xemacs.org
Computer Science Department
http://www.cs.usu.edu/~jerry/
Utah State University