* src/xdisp.c (clear_message_stack): New function.
* src/emacs.c (terminate_due_to_signal): Call clear_message_stack
when we are being shut down by SIGINT under -batch.
* src/lisp.h (clear_message_stack): Add prototype.
totally_unblock_input ();
if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT)
- Fkill_emacs (make_fixnum (sig));
+ {
+ /* Avoid abort in shut_down_emacs if we were interrupted
+ by SIGINT in noninteractive usage, as in that case we
+ don't care about the message stack. */
+ if (sig == SIGINT && noninteractive)
+ clear_message_stack ();
+ Fkill_emacs (make_fixnum (sig));
+ }
shut_down_emacs (sig, Qnil);
emacs_backtrace (backtrace_limit);
extern void add_to_log (char const *, ...);
extern void vadd_to_log (char const *, va_list);
extern void check_message_stack (void);
+extern void clear_message_stack (void);
extern void setup_echo_area_for_printing (bool);
extern bool push_message (void);
extern void pop_message_unwind (void);
/* Check that Vmessage_stack is nil. Called from emacs.c when Emacs
- exits. If the stack is not empty, we have a missing pop_message
- somewhere. */
+ exits. If the stack is not empty, we have a missing
+ pop_message_unwind somewhere. */
void
check_message_stack (void)
emacs_abort ();
}
+void
+clear_message_stack (void)
+{
+ Vmessage_stack = Qnil;
+}
/* Truncate to NCHARS what will be displayed in the echo area the next
time we display it---but don't redisplay it now. */