changeset 2862:b95fe16005fd

[xemacs-hg @ 2005-07-17 20:08:40 by aidan] Restore the last argument to event-to-character, document that it's unused.
author aidan
date Sun, 17 Jul 2005 20:08:48 +0000
parents cf9f69706740
children 10bde22f341b
files etc/ChangeLog etc/NEWS man/ChangeLog man/lispref/commands.texi src/ChangeLog src/cmds.c src/editfns.c src/event-stream.c src/events.c src/keymap.c src/lisp.h
diffstat 11 files changed, 58 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Sat Jul 16 21:51:13 2005 +0000
+++ b/etc/ChangeLog	Sun Jul 17 20:08:48 2005 +0000
@@ -1,3 +1,8 @@
+2005-07-17  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* NEWS: Add information on the last argument to event-to-character
+	being ignored. 
+
 2005-05-28  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.21 "corn" is released.
--- a/etc/NEWS	Sat Jul 16 21:51:13 2005 +0000
+++ b/etc/NEWS	Sun Jul 17 20:08:48 2005 +0000
@@ -57,6 +57,17 @@
 resources at some point.
 
 
+* Lisp and internal changes in XEmacs 21.5
+==========================================
+
+** The ALLOW-NON-ASCII argument to event-to-character is not used. 
+
+While it is still accepted, for compatibilty with older code,
+event-to-character no longer takes note of this argument, since the specific
+type of mapping between characters and keysyms that it affected is no longer
+in place. 
+
+
 * Changes in XEmacs 21.4
 ========================
 
--- a/man/ChangeLog	Sat Jul 16 21:51:13 2005 +0000
+++ b/man/ChangeLog	Sun Jul 17 20:08:48 2005 +0000
@@ -1,3 +1,9 @@
+2005-07-17  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* lispref/commands.texi (Converting Events):
+	Give details on the deprecated ALLOW-NON-ASCII argument to
+	event-to-character, and why you shouldn't use it. 
+
 2005-06-26  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* lispref/commands.texi (Converting Events): 
--- a/man/lispref/commands.texi	Sat Jul 16 21:51:13 2005 +0000
+++ b/man/lispref/commands.texi	Sun Jul 17 20:08:48 2005 +0000
@@ -1485,7 +1485,7 @@
 information than the XEmacs internal character encoding can store.
 @end defun
 
-@defun event-to-character event &optional allow-extra-modifiers allow-meta
+@defun event-to-character event &optional allow-extra-modifiers allow-meta allow-no-ascii
 This function returns the closest character approximation to
 @var{event}.  If the event isn't a keypress, this returns @code{nil}.
 
@@ -1504,6 +1504,20 @@
 Specifying @var{allow-meta} will give ambiguous results---@key{M-x} and
 @key{oslash} will return the same thing, for example---so you should
 probably not use it.
+
+@var{allow-non-ascii} is ignored; in previous versions of XEmacs, it
+controlled whether one particular type of mapping between X11 keysyms
+and characters would take place.  The intention was that this flag could
+be clear and you could be sure that if you got a Latin-1 character with
+the high bit set back, you could assume that the lower seven bits of the
+character were the ASCII code of the character in question, and that the
+Meta key was pressed at the same time.  This didn't work in the general
+case, however, because it left the other type of X11 keysym-to-character
+mapping in place, ready to give you a Latin-1 character for a Latin-1
+key.  If you feel the need to use such a flag, sit back and think about
+abstracting your code, and if you still feel the need, bear in mind that
+it will be buggy in earlier versions of XEmacs.
+
 @end defun
 
 @defun events-to-keys events &optional no-mice
--- a/src/ChangeLog	Sat Jul 16 21:51:13 2005 +0000
+++ b/src/ChangeLog	Sun Jul 17 20:08:48 2005 +0000
@@ -1,3 +1,15 @@
+2005-07-17  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cmds.c (Fself_insert_command):
+	* editfns.c (Fchar_to_string):
+	* event-stream.c (Fnext_event):
+	* event-stream.c (execute_command_event):
+	* events.c (Fevent_to_character):
+	* keymap.c (Ftext_char_description):
+	* lisp.h:
+	Add back the last argument to event-to-character; document that
+	it's unused. 
+	
 2005-07-11  Atanu Ghosh <atanu@icsi.berkeley.edu>
 
 	* sysdll.c (dll_open): Under MacOS X return NULL under the
--- a/src/cmds.c	Sat Jul 16 21:51:13 2005 +0000
+++ b/src/cmds.c	Sun Jul 17 20:08:48 2005 +0000
@@ -339,7 +339,7 @@
   if (CHAR_OR_CHAR_INTP (Vlast_command_char))
     c = Vlast_command_char;
   else
-    c = Fevent_to_character (Vlast_command_event, Qnil, Qnil);
+    c = Fevent_to_character (Vlast_command_event, Qnil, Qnil, Qnil);
 
   if (NILP (c))
     invalid_operation (
--- a/src/editfns.c	Sat Jul 16 21:51:13 2005 +0000
+++ b/src/editfns.c	Sun Jul 17 20:08:48 2005 +0000
@@ -110,7 +110,7 @@
 
   if (EVENTP (character))
     {
-      Lisp_Object ch2 = Fevent_to_character (character, Qt, Qnil);
+      Lisp_Object ch2 = Fevent_to_character (character, Qt, Qnil, Qnil);
       if (NILP (ch2))
         invalid_argument
 	  ("key has no character equivalent:", Fcopy_event (character, Qnil));
--- a/src/event-stream.c	Sat Jul 16 21:51:13 2005 +0000
+++ b/src/event-stream.c	Sun Jul 17 20:08:48 2005 +0000
@@ -2362,7 +2362,7 @@
      Note that last-input-char will never have its high-bit set, in an
      effort to sidestep the ambiguity between M-x and oslash.
      */
-  Vlast_input_char = Fevent_to_character (Vlast_input_event, Qnil, Qnil);
+  Vlast_input_char = Fevent_to_character (Vlast_input_event, Qnil, Qnil, Qnil);
   {
     EMACS_TIME t;
     EMACS_GET_TIME (t);
@@ -4252,7 +4252,7 @@
   /* Note that last-command-char will never have its high-bit set, in
      an effort to sidestep the ambiguity between M-x and oslash. */
   Vlast_command_char = Fevent_to_character (Vlast_command_event,
-					    Qnil, Qnil);
+					    Qnil, Qnil, Qnil);
 
   /* Actually call the command, with all sorts of hair to preserve or clear
      the echo-area and region as appropriate and call the pre- and post-
--- a/src/events.c	Sat Jul 16 21:51:13 2005 +0000
+++ b/src/events.c	Sun Jul 17 20:08:48 2005 +0000
@@ -1385,7 +1385,7 @@
   return c;
 }
 
-DEFUN ("event-to-character", Fevent_to_character, 1, 3, 0, /*
+DEFUN ("event-to-character", Fevent_to_character, 1, 4, 0, /*
 Return the closest character approximation to the given event object.
 If the event isn't a keypress, this returns nil.
 If the ALLOW-EXTRA-MODIFIERS argument is non-nil, then this is lenient in
@@ -1398,8 +1398,9 @@
  will be returned for events containing the Meta modifier.
 Note that ALLOW-META may cause ambiguity between meta characters and
  Latin-1 characters.
+ALLOW-NON-ASCII is unused, and retained for compatibility. 
 */
-       (event, allow_extra_modifiers, allow_meta))
+       (event, allow_extra_modifiers, allow_meta, UNUSED(allow_non_ascii)))
 {
   Ichar c;
   CHECK_LIVE_EVENT (event);
--- a/src/keymap.c	Sat Jul 16 21:51:13 2005 +0000
+++ b/src/keymap.c	Sun Jul 17 20:08:48 2005 +0000
@@ -3399,7 +3399,7 @@
 
   if (EVENTP (chr))
     {
-      Lisp_Object ch = Fevent_to_character (chr, Qnil, Qnil);
+      Lisp_Object ch = Fevent_to_character (chr, Qnil, Qnil, Qnil);
       if (NILP (ch))
 	return
 	  signal_continuable_error
--- a/src/lisp.h	Sat Jul 16 21:51:13 2005 +0000
+++ b/src/lisp.h	Sun Jul 17 20:08:48 2005 +0000
@@ -4309,7 +4309,7 @@
 
 /* Defined in events.c */
 EXFUN (Fcopy_event, 2);
-EXFUN (Fevent_to_character, 3);
+EXFUN (Fevent_to_character, 4);
 
 void clear_event_resource (void);
 Lisp_Object allocate_event (void);