Ilya Zakharevich on Sun, 19 Apr 1998 23:44:46 +0200


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

Last ReadLine deenhancement removed


The following patch (diff -pu with 2.0.5) removes the last known
deenhancement of ReadLine support from 1.37.* to 2.0.*.  Currently, if
you press F1, the current command line is repeated twice, once before
the help, another time after the help.  The patch fixes this
behaviour.

Apply with -p1 or -p0.

Enjoy,
Ilya

--- ./src/gp/gp_rl.c~	Sat Feb  7 11:12:04 1998
+++ ./src/gp/gp_rl.c	Sun Apr 19 14:57:08 1998
@@ -288,15 +379,23 @@ pari_completion (char *text, int start, 
 static int
 rl_short_help(int count, int key)
 {
-  int p=rl_point, off=p;
+  int p=rl_point, off=p, e = rl_end, l = strlen(rl_prompt);
   FILE *save = outfile;
   long flag = h_RL;
 
   while (off && is_keyword_char(rl_line_buffer[off-1])) off--;
-  rl_point = 0; outfile = rl_outstream;
+  rl_point = 0; rl_end = 0; outfile = rl_outstream; 
   if (count < 0) flag |= h_LONG; /* long help */
+  ((void(*)(const char*))rl_message)("");
+  /* Erase prompt. */
+  pariputs("\r");
+  while (l--)
+      pariputs(" ");
+  pariputs("\r");
+
   aide(rl_line_buffer + off, flag);
-  rl_point = p; outfile = save; 
+  rl_point = p; rl_end = e; outfile = save; 
+  rl_clear_message(); 
   rl_refresh_line(); return 0;
 }
 
--- ./src/gp/gp.c~	Sat Feb  7 11:12:04 1998
+++ ./src/gp/gp.c	Sun Apr 19 14:57:36 1998
@@ -1832,7 +1832,7 @@ aide0(char *s, int flag)
     if (flag & h_RL) return;
     err(talker,"unknown identifier");
   }
-  if (flag & h_RL) pariputc('\n');
+/*  if (flag & h_RL) pariputc('\n'); */ /* Now the caller clears the line.  */
 
   ep1 = ep;  ep = do_alias(ep);
   if (ep1 != ep) { pariputs(s); pariputs(" is aliased to:\n\n"); }