From xemacs-m  Sat Mar 15 02:21:25 1997
Received: from gol1.gol.com (gol1.gol.com [202.243.48.4])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id CAA15712
	for <xemacs-beta@xemacs.org>; Sat, 15 Mar 1997 02:21:23 -0600 (CST)
Received: from Pentagana.sonic.jp (jhod@pm-5-182.tokyo.gol.com [202.243.51.182])
	by gol1.gol.com (8.8.5/8.8.5) with ESMTP id RAA22607;
	Sat, 15 Mar 1997 17:21:07 +0900 (JST)
Received: (from jhod@localhost) by Pentagana.sonic.jp (8.7.2/8.7.2) id RAA25460; Sat, 15 Mar 1997 17:18:43 +0900
Date: Sat, 15 Mar 1997 17:18:43 +0900
Message-Id: <199703150818.RAA25460@Pentagana.sonic.jp>
From: P E Jareth Hein <jhod@po.iijnet.or.jp>
To: "Steven L. Baur" <steve@miranova.com>,
        XEmacs Beta Mailing List <xemacs-beta@xemacs.org>
Subject: XEmacs patches for i18n (2/2)
Mime-Version: 1.0 (split by tm-edit 7.105)
Content-Type: message/partial; id="Sat_Mar_15_17:18:42_1997@Pentagana.sonic.jp"; number=2; total=2

+which defaults to the system default table.
+*/
+       (chr, designator, category_table))
+{
+  Lisp_Object ctbl;
+  Emchar ch;
+  unsigned int des;
+
+  CHECK_CATEGORY_DESIGNATOR (designator);
+  des = XREALINT(designator);
+  CHECK_CHAR(chr);
+  ch = XCHAR(chr);
+  ctbl = check_category_table (category_table, Vstandard_category_table);
+  return (check_category_char(ch, ctbl, des, 0)
+	  ? Qt : Qnil);
+}
+       
 DEFUN ("category-table", Fcategory_table, 0, 1, 0, /*
 Return the current category table.
 This is the one specified by the current buffer, or by BUFFER if it
@@ -1790,6 +1810,7 @@
   DEFSUBR (Fcopy_category_table);
   DEFSUBR (Fset_category_table);
   DEFSUBR (Fcheck_category_at);
+  DEFSUBR (Fchar_in_category_p);
   DEFSUBR (Fcategory_designator_p);
   DEFSUBR (Fcategory_table_value_p);
 #endif /* MULE */
Index: XEmacs/src/chartab.h
diff -u XEmacs/src/chartab.h:1.1.1.1 XEmacs/src/chartab.h:1.2
--- XEmacs/src/chartab.h:1.1.1.1	Sat Mar 15 00:56:00 1997
+++ XEmacs/src/chartab.h	Sat Mar 15 16:56:00 1997
@@ -192,8 +192,8 @@
 
 
 #ifdef MULE
-int check_category_at(Emchar ch, Lisp_Object ctbl,
-		      unsigned int designator, unsigned int not);
+int check_category_char(Emchar ch, Lisp_Object ctbl,
+		        unsigned int designator, unsigned int not);
 
 extern Lisp_Object Qcategory_table_p, Qcategory_designator_p;
 extern Lisp_Object Qcategory_table_value_p;
Index: XEmacs/src/minibuf.c
diff -u XEmacs/src/minibuf.c:1.1.1.1 XEmacs/src/minibuf.c:1.2
--- XEmacs/src/minibuf.c:1.1.1.1	Sat Mar 15 00:56:03 1997
+++ XEmacs/src/minibuf.c	Sat Mar 15 16:56:00 1997
@@ -51,6 +51,10 @@
 /* Prompt to display in front of the minibuffer contents */
 Lisp_Object Vminibuf_prompt;
 
+/* Added on 97/3/14 by Jareth Hein (jhod@po.iijnet.or.jp) for input system support */
+/* String to be displayed in front of prompt of the minibuffer contents */
+Lisp_Object Vminibuf_preprompt;
+
 /* Hook to run just after entry to minibuffer. */
 Lisp_Object Qminibuffer_setup_hook, Vminibuffer_setup_hook;
 
@@ -106,6 +110,25 @@
   return Qnil;
 }
 
+/* 97/4/13 jhod: Added for input methods */
+DEFUN ("set-minibuffer-preprompt", Fset_minibuffer_preprompt, 1, 1, 0, /*
+Set the minibuffer preprompt string to PREPROMPT. This is used by language
+input methods to relay state information to the user.
+*/
+       (preprompt))
+{
+  if (NILP (preprompt))
+    {
+      Vminibuf_preprompt = Qnil;
+    }
+  else
+    {
+      CHECK_STRING (preprompt);
+  
+      Vminibuf_preprompt = LISP_GETTEXT (preprompt);
+    }
+}
+
 DEFUN ("read-minibuffer-internal", Fread_minibuffer_internal, 1, 1, 0, /*
 Lowest-level interface to minibuffers.  Don't call this.
 */
@@ -865,7 +888,7 @@
   DEFSUBR (Fminibuffer_prompt);
   DEFSUBR (Fminibuffer_prompt_width);
 #endif
-
+  DEFSUBR (Fset_minibuffer_preprompt);
   DEFSUBR (Fread_minibuffer_internal);
 
   DEFSUBR (Ftry_completion);
@@ -885,6 +908,10 @@
   staticpro (&Vminibuf_prompt);
   Vminibuf_prompt = Qnil;
 
+  /* Added by Jareth Hein (jhod@po.iijnet.or.jp) for input system support */
+  staticpro (&Vminibuf_preprompt);
+  Vminibuf_preprompt = Qnil;
+								
   DEFVAR_LISP ("minibuffer-setup-hook", &Vminibuffer_setup_hook /*
 Normal hook run just after entry to minibuffer.
 */ );
Index: XEmacs/src/redisplay.c
diff -u XEmacs/src/redisplay.c:1.1.1.1 XEmacs/src/redisplay.c:1.2
--- XEmacs/src/redisplay.c:1.1.1.1	Sat Mar 15 00:56:04 1997
+++ XEmacs/src/redisplay.c	Sat Mar 15 16:56:00 1997
@@ -4233,17 +4233,20 @@
 
   bounds = calculate_display_line_boundaries (w, 0);
 
+  /* 97/3/14 jhod: stuff added here to support pre-prompts (used for input systems) */
   if (MINI_WINDOW_P (w)
-      && !NILP (Vminibuf_prompt)
+      && (!NILP (Vminibuf_prompt) || !NILP (Vminibuf_preprompt))
       && !echo_area_active (f)
       && start_pos == BUF_BEGV (b))
     {
       struct prop_block pb;
+      Lisp_Object string;
       prop = Dynarr_new (struct prop_block);
 
+      string = concat2(Vminibuf_preprompt, Vminibuf_prompt);
       pb.type = PROP_MINIBUF_PROMPT;
-      pb.data.p_string.str = XSTRING_DATA   (Vminibuf_prompt);
-      pb.data.p_string.len = XSTRING_LENGTH (Vminibuf_prompt);
+      pb.data.p_string.str = XSTRING_DATA(string);
+      pb.data.p_string.len = XSTRING_LENGTH(string);
       Dynarr_add (prop, pb);
     }
   else
@@ -4328,7 +4331,7 @@
     }
 
   if (prop)
-    Dynarr_free (prop);
+      Dynarr_free (prop);
 
   /* #### More not quite right, but close enough. */
   /* #### Ben sez: apparently window_end_pos[] is measured
Index: XEmacs/src/regex.c
diff -u XEmacs/src/regex.c:1.1.1.1 XEmacs/src/regex.c:1.2
--- XEmacs/src/regex.c:1.1.1.1	Sat Mar 15 00:56:05 1997
+++ XEmacs/src/regex.c	Sat Mar 15 16:56:01 1997
@@ -5519,8 +5519,8 @@
 	    PREFETCH ();
 	    emch = charptr_emchar ((CONST Bufbyte *) d);
 	    INC_CHARPTR (d);
-	    if (check_category_at(emch, regex_emacs_buffer->category_table,
-				  mcnt, should_succeed))
+	    if (check_category_char(emch, regex_emacs_buffer->category_table,
+				    mcnt, should_succeed))
 	      goto fail;
 	    SET_REGS_MATCHED ();
 	  }
Index: XEmacs/src/window.h
diff -u XEmacs/src/window.h:1.1.1.1 XEmacs/src/window.h:1.2
--- XEmacs/src/window.h:1.1.1.1	Sat Mar 15 00:56:07 1997
+++ XEmacs/src/window.h	Sat Mar 15 16:56:01 1997
@@ -341,6 +341,8 @@
 
 /* Prompt to display in front of the minibuffer contents, or nil */
 extern Lisp_Object Vminibuf_prompt;
+/* Prompt to display in front of the minibuffer prompt, or nil */
+extern Lisp_Object Vminibuf_preprompt;
 
 /* Depth in minibuffer invocations */
 extern int minibuf_level;

--Multipart_Sat_Mar_15_17:18:42_1997-1--

