- Subject: message_keep update
- From: Paul Boekholt <p.boekholt@xxxxxxxxx>
- Date: Wed, 16 Jun 2004 18:56:28 +0200
Hello,
I applied Dino's message_keep patch (see
<87B6D0A6B80ED311BF710008C7DAAACD0E5CD6D4@xxxxxxxxxxxxxxxxxxx>)
to 0.99.17.
Here's the updated diff:
diff -ruap jed-B0.99-17-orig/src/intrin.c jed-B0.99-17/src/intrin.c
--- jed-B0.99-17-orig/src/intrin.c Wed Jun 16 17:08:33 2004
+++ jed-B0.99-17/src/intrin.c Wed Jun 16 17:21:06 2004
@@ -860,6 +860,7 @@ static SLang_Intrin_Fun_Type Jed_Intrins
MAKE_INTRINSIC("blink_match", blink_match, VOID_TYPE, 0),
MAKE_INTRINSIC_S("set_expansion_hook", set_expansion_hook, VOID_TYPE),
MAKE_INTRINSIC("clear_message", clear_message, VOID_TYPE, 0),
+ MAKE_INTRINSIC_S("message_keep", message_keep, VOID_TYPE),
MAKE_INTRINSIC("flush_input", flush_input, VOID_TYPE, 0),
MAKE_INTRINSIC_0("get_word_chars", jed_get_word_chars, STRING_TYPE),
MAKE_INTRINSIC_SI("core_dump", exit_error_cmd, VOID_TYPE),
diff -ruap jed-B0.99-17-orig/src/ledit.c jed-B0.99-17/src/ledit.c
--- jed-B0.99-17-orig/src/ledit.c Wed Jun 16 17:08:33 2004
+++ jed-B0.99-17/src/ledit.c Wed Jun 16 17:21:57 2004
@@ -1333,6 +1333,8 @@ int num_windows() /*{{{*/
void flush_message(char *m) /*{{{*/
{
message(m);
+ /* tell update_minibuffer() to keep this message */
+ Mini_Ghost = -1;
if (Batch || (JWindow == NULL)) return;
do_dialog(Message_Buffer);
SLsmg_gotorc (Jed_Num_Screen_Rows - 1, strlen(Message_Buffer));
diff -ruap jed-B0.99-17-orig/src/misc.c jed-B0.99-17/src/misc.c
--- jed-B0.99-17-orig/src/misc.c Wed Jun 16 17:08:33 2004
+++ jed-B0.99-17/src/misc.c Wed Jun 16 17:24:32 2004
@@ -247,6 +247,7 @@ void msg_error(char *msg) /*{{{*/
if (!SLang_Error) SLang_Error = INTRINSIC_ERROR;
if (Error_Buffer[0] == 0) safe_strcpy(Error_Buffer, msg, sizeof (Error_Buffer));
+ Mini_Ghost = 1;
}
/*}}}*/
@@ -259,11 +260,17 @@ void message (char *msg) /*{{{*/
if (Batch) fprintf(stdout, "%s\n", msg);
- if (*msg == 0)
- Mini_Ghost = 1;
-
+ Mini_Ghost = 1;
+
strncpy(Message_Buffer, msg, 255);
Message_Buffer[255] = 0;
+}
+
+
+void message_keep (char *msg)
+{
+ message(msg);
+ Mini_Ghost = 2;
}
/*}}}*/
diff -ruap jed-B0.99-17-orig/src/misc.h jed-B0.99-17/src/misc.h
--- jed-B0.99-17-orig/src/misc.h Wed Jun 16 17:08:43 2004
+++ jed-B0.99-17/src/misc.h Wed Jun 16 17:25:05 2004
@@ -11,6 +11,7 @@
extern void exit_error(char *, int);
extern void msg_error(char *);
extern void jed_verror (char *, ...);
+extern void message_keep (char *msg);
extern void message(char *);
extern void jed_vmessage (int, char *, ...);
extern void clear_message (void);
diff -ruap jed-B0.99-17-orig/src/screen.c jed-B0.99-17/src/screen.c
--- jed-B0.99-17-orig/src/screen.c Wed Jun 16 17:08:33 2004
+++ jed-B0.99-17/src/screen.c Wed Jun 16 17:29:58 2004
@@ -1369,13 +1369,17 @@ static void update_minibuffer(void)
while (w != JWindow) other_window();
Mini_Ghost = 1;
}
- else if (Mini_Ghost && !*Error_Buffer && !*Message_Buffer)
+ else
{
- /* if < 0, it is a result of flush message so let it pass this round */
- if (Mini_Ghost < 0) Mini_Ghost = 1;
- else Mini_Ghost = 0;
+ if (!*Error_Buffer && !*Message_Buffer)
+ {
+ /* if < 0, it is a result of flush message so let it pass this round */
+ if (Mini_Ghost < 0) Mini_Ghost = 1;
+ else if (Mini_Ghost == 1) Mini_Ghost = 0;
+ /* else Leave as is */
+ }
+ else if (Mini_Ghost == 0) Mini_Ghost = 1;
}
- else Mini_Ghost = ((*Message_Buffer) || (*Error_Buffer));
if (Mini_Ghost == 0)
display_line(NULL, Jed_Num_Screen_Rows-1, 0);
@@ -1421,9 +1425,7 @@ void do_dialog(char *b)
SLsmg_refresh ();
(void) input_pending(&Number_Ten);
}
- Mini_Ghost = -1;
}
- else Mini_Ghost = 0;
}
static void set_hscroll(int col)
@@ -1602,7 +1604,6 @@ void update(Line *line, int force, int f
SLKeyBoard_Quit = 0;
SLang_restart(0);
SLang_Error = 0;
- Mini_Ghost = 1;
(void) update_1(line, 1);
update_minibuffer();
}
@@ -1612,7 +1613,6 @@ void update(Line *line, int force, int f
goto done;
do_dialog(Message_Buffer);
- Mini_Ghost = 1;
update_minibuffer();
}
else
@@ -1638,7 +1638,6 @@ void update(Line *line, int force, int f
if (MiniBuf_Get_Response_String != NULL)
{
do_dialog (MiniBuf_Get_Response_String);
- Mini_Ghost = 1;
}
else if (Point_Cursor_Flag || pc_flag)
point_cursor(col);
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2004 date index]
[2004 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]