From 9a21decd8d4528c36870a86f631c754b0b63411f Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sun, 21 Jun 2020 20:14:20 -0600 Subject: * Alpine will ding the terminal bell when asking about quitting when new mail arrives. This is consistent with Alpine dinging the bell when new mail arrives. Bell will not ding if it is disabled for status messages. Suggested by Chime Hart. --- alpine/alpine.c | 2 +- alpine/radio.c | 6 ++++++ alpine/radio.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'alpine') diff --git a/alpine/alpine.c b/alpine/alpine.c index d72c60cf..e11a47c7 100644 --- a/alpine/alpine.c +++ b/alpine/alpine.c @@ -3232,7 +3232,7 @@ quit_screen(struct pine *pine_state) && pine_state->mail_stream != NULL && new_mail(1, VeryBadTime, NM_STATUS_MSG | NM_DEFER_SORT) > 0 && (quit = want_to(_("Quit even though new mail just arrived"), 'y', 0, - NO_HELP, WT_NORM)) != 'y'){ + NO_HELP, WT_NORM | WT_DING)) != 'y'){ refresh_sort(pine_state->mail_stream, pine_state->msgmap, SRT_VRB); pine_state->next_screen = pine_state->prev_screen; return; diff --git a/alpine/radio.c b/alpine/radio.c index 65355a8b..40b99211 100644 --- a/alpine/radio.c +++ b/alpine/radio.c @@ -107,6 +107,7 @@ pre_screen_config_want_to(char *question, int dflt, int on_ctrl_C) on_ctrl_C -- Answer returned on ^C help -- Two line help text flags -- Flags to modify behavior + WT_DING - ding the bell when asking. WT_FLUSH_IN - Discard pending input. WT_SEQ_SENSITIVE - Caller is sensitive to sequence number changes caused by @@ -123,6 +124,11 @@ want_to(char *question, int dflt, int on_ctrl_C, HelpType help, int flags) int rv, width; size_t len; + if((flags & WT_DING) && F_OFF(F_QUELL_BEEPS, ps_global)){ + Writechar(BELL, 0); + fflush(stdout); + } + if(!ps_global->ttyo) return(pre_screen_config_want_to(question, dflt, on_ctrl_C)); #ifdef _WINDOWS diff --git a/alpine/radio.h b/alpine/radio.h index ea18529f..6a58b197 100644 --- a/alpine/radio.h +++ b/alpine/radio.h @@ -68,6 +68,7 @@ typedef struct esckey { #define WT_NORM 0x00 /* flags modifying want_to */ #define WT_FLUSH_IN 0x01 /* discard pending input */ #define WT_SEQ_SENSITIVE 0x02 /* Sensitive to seq # changes */ +#define WT_DING 0x04 /* Question needs attention! */ /* exported prototypes */ -- cgit v1.2.3-54-g00ecf