diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-04-11 22:28:56 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-04-11 22:28:56 -0600 |
commit | 47206e18c8eec0c9c284cb71381ae85ce36b2a3a (patch) | |
tree | 9bd54b6d44a20deba364bce077059072f898b804 | |
parent | b50297779a4becb9ceca9c6b5b375d526fe3df78 (diff) | |
download | alpine-47206e18c8eec0c9c284cb71381ae85ce36b2a3a.tar.xz |
* Remove sleep of 5 seconds for mailcap programs that use the terminal
to display content. Suggested by Carl Edquist. In addition to remove
configurable process table command and it corresponding sleep time.
-rw-r--r-- | alpine/confscroll.c | 14 | ||||
-rw-r--r-- | alpine/osdep/execview.c | 37 | ||||
-rw-r--r-- | alpine/setup.c | 1 | ||||
-rwxr-xr-x | configure | 43 | ||||
-rw-r--r-- | configure.ac | 33 | ||||
-rw-r--r-- | include/config.h.in | 3 | ||||
-rw-r--r-- | pith/conf.c | 14 | ||||
-rw-r--r-- | pith/conf.h | 6 | ||||
-rw-r--r-- | pith/conftype.h | 1 | ||||
-rw-r--r-- | pith/pine.hlp | 57 | ||||
-rw-r--r-- | pith/state.h | 2 |
11 files changed, 23 insertions, 188 deletions
diff --git a/alpine/confscroll.c b/alpine/confscroll.c index 85e364d8..44c02ca5 100644 --- a/alpine/confscroll.c +++ b/alpine/confscroll.c @@ -1561,10 +1561,6 @@ text_toolit(struct pine *ps, int cmd, CONF_S **cl, unsigned int flags, int look_ lowrange = 1; hirange = MAX_FILLCOL; } - else if((*cl)->var == &ps->vars[V_SLEEP]){ - lowrange = 60; - hirange = 600; - } else if((*cl)->var == &ps->vars[V_OVERLAP] || (*cl)->var == &ps->vars[V_MARGIN]){ lowrange = 0; @@ -5262,16 +5258,6 @@ fix_side_effects(struct pine *ps, struct variable *var, int revert) else ps->viewer_overlap = old_value; } - else if(var == &ps->vars[V_SLEEP]){ - int old_value = ps->sleep; - - if(SVAR_SLEEP(ps, old_value, tmp_20k_buf, SIZEOF_20KBUF)){ - if(!revert) - q_status_message(SM_ORDER, 3, 5, tmp_20k_buf); - } - else - ps->sleep = old_value; - } #ifdef SMIME else if(smime_related_var(ps, var)){ smime_deinit(); diff --git a/alpine/osdep/execview.c b/alpine/osdep/execview.c index eb16e6f8..56730667 100644 --- a/alpine/osdep/execview.c +++ b/alpine/osdep/execview.c @@ -194,12 +194,17 @@ exec_mailcap_cmd(MCAP_CMD_S *mc_cmd, char *image_file, int needsterminal) char *cmd = mc_cmd->command; size_t l; - l = 32 + strlen(cmd) + (2*strlen(image_file)); + /* 32 is enough to contain "( ; sleep 5 ; rm -f ) &\n\0" */ + l = 32 + strlen(cmd) + strlen(image_file); p = command = (char *) fs_get((l+1) * sizeof(char)); - if(!needsterminal) /* put in background if it doesn't need terminal */ + + if(needsterminal) + snprintf(p, l+1-(p-command), "%s ; rm -f %s", cmd, image_file); + else{ *p++ = '('; + snprintf(p, l+1-(p-command), "%s ; sleep 5 ; rm -f %s", cmd, image_file); + } - snprintf(p, l+1-(p-command), "%s", cmd); p += strlen(p); if(!needsterminal){ if(p-command+2 < l+1){ @@ -246,7 +251,7 @@ exec_mailcap_cmd(MCAP_CMD_S *mc_cmd, char *image_file, int needsterminal) #else char *command = NULL, *result_file = NULL, - *p, *cmd, *q, *psef; + *p, *cmd; char **r_file_h; PIPE_S *syspipe; int mode; @@ -258,23 +263,17 @@ exec_mailcap_cmd(MCAP_CMD_S *mc_cmd, char *image_file, int needsterminal) else return; -#ifdef PSEFCMD - psef = fs_get((60 + strlen(PSEFCMD) + strlen(image_file))*sizeof(char)); - sprintf(psef, "PSEF=`%s | /bin/grep \"%s\" | /bin/grep -v grep`", PSEFCMD, image_file); - - q = fs_get((80 + 2*strlen(psef))*sizeof(char)); /* bigger than 62 */ - sprintf(q, "/bin/sh -c '(%s; while test -n \"$PSEF\" ; do %s ; sleep %d ; done)' ;", psef, psef, ps_global->sleep); - fs_give((void **) &psef); -#else - q = cpystr(""); -#endif /* PSEFCMD */ - - l = 45 + strlen(cmd) + 2*strlen(image_file) + strlen(q); + /* 32 is enough for "( ; sleep 5; rm -f ) &\n\0" */ + l = 32 + strlen(cmd) + strlen(image_file); p = command = (char *)fs_get((l+1) * sizeof(char)); - if(!needsterminal) /* put in background if it doesn't need terminal */ + + if(needsterminal) + snprintf(p, l+1-(p-command), "%s ; rm -f %s", cmd, image_file); + else { *p++ = '('; - snprintf(p, l+1-(p-command), "%s ; %s sleep 5 ; rm -f %s", cmd, q, image_file); - fs_give((void **)&q); + snprintf(p, l+1-(p-command), "%s ; sleep 5 ; rm -f %s", cmd, image_file); + } + command[l] = '\0'; p += strlen(p); if(!needsterminal && (p-command)+5 < l){ diff --git a/alpine/setup.c b/alpine/setup.c index 0a6a0458..cefd839c 100644 --- a/alpine/setup.c +++ b/alpine/setup.c @@ -339,7 +339,6 @@ option_screen(struct pine *ps, int edit_exceptions) } else{ if(vtmp == &ps->vars[V_FILLCOL] - || vtmp == &ps->vars[V_SLEEP] || vtmp == &ps->vars[V_QUOTE_SUPPRESSION] || vtmp == &ps->vars[V_OVERLAP] || vtmp == &ps->vars[V_MAXREMSTREAM] @@ -832,7 +832,6 @@ enable_dmalloc with_dmalloc_dir with_date_stamp with_host_stamp -with_ps_cmd with_localedir enable_osx_universal_binaries with_include_path @@ -1611,8 +1610,6 @@ Optional Packages: Default: output of `date` --with-host-stamp=HOST Set name of computer for compilation. Default: output of `hostname` - --with-ps-cmd="CMD" Use this command to check running commands. Default: - /bin/ps auxww --with-localedir=DIR Name of gettext locale directory --with-include-path=PATHS Colon-separated list of directories used for include @@ -15246,46 +15243,6 @@ fi ALPINE_HOSTSTAMP=$ALPINE_hoststamp -ALPINE_psefcmd="/bin/ps auxww" -ALPINE_psfailed="0" -ALPINE_PSTEST="-" - -# Check whether --with-ps-cmd was given. -if test "${with_ps_cmd+set}" = set; then : - withval=$with_ps_cmd; - if test "x$withval" = "xno" -o "x$withval" = "xyes" -o "x$withval" = "x" ; then - withval=$ALPINE_psefcmd - fi - ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP` - if test -n "$ALPINE_PSTEST" ; then - ALPINE_psefcmd="$withval" - else - ALPINE_psfailed="1" - if test "x$ALPINE_psefcmd" != "x$withval" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: failed command $withval. Trying $ALPINE_psefcmd" >&5 -$as_echo "$as_me: WARNING: failed command $withval. Trying $ALPINE_psefcmd" >&2;} - fi - fi - -fi - -if test "$ALPINE_psfailed" = "1" -o "$ALPINE_PSTEST" = "-" ; then - withval="$ALPINE_psefcmd" - ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP` - if test -z "$ALPINE_PSTEST" ; then - ALPINE_psfailed="1" - else - ALPINE_psfailed="0" - fi -fi -if test "$ALPINE_psfailed" = "0" ; then - -cat >>confdefs.h <<_ACEOF -#define PSEFCMD "$ALPINE_psefcmd" -_ACEOF - -fi - case $host in *apple-darwin*) if test -d /opt/local ; then diff --git a/configure.ac b/configure.ac index cc3f01ea..7a510710 100644 --- a/configure.ac +++ b/configure.ac @@ -106,39 +106,6 @@ AC_ARG_WITH(host-stamp, ]) AC_SUBST([ALPINE_HOSTSTAMP], $ALPINE_hoststamp) -dnl set ps command, this test is fragile, but it should mostly work -ALPINE_psefcmd="/bin/ps auxww" -ALPINE_psfailed="0" -ALPINE_PSTEST="-" -AC_ARG_WITH(ps-cmd, - AS_HELP_STRING([--with-ps-cmd="CMD"],[Use this command to check running commands. Default: /bin/ps auxww]), - [ - if test "x$withval" = "xno" -o "x$withval" = "xyes" -o "x$withval" = "x" ; then - withval=$ALPINE_psefcmd - fi - ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP` - if test -n "$ALPINE_PSTEST" ; then - ALPINE_psefcmd="$withval" - else - ALPINE_psfailed="1" - if test "x$ALPINE_psefcmd" != "x$withval" ; then - AC_MSG_WARN(failed command $withval. Trying $ALPINE_psefcmd) - fi - fi - ]) -if test "$ALPINE_psfailed" = "1" -o "$ALPINE_PSTEST" = "-" ; then - withval="$ALPINE_psefcmd" - ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP` - if test -z "$ALPINE_PSTEST" ; then - ALPINE_psfailed="1" - else - ALPINE_psfailed="0" - fi -fi -if test "$ALPINE_psfailed" = "0" ; then - AC_DEFINE_UNQUOTED([PSEFCMD], "$ALPINE_psefcmd", [ps command which outputs list of running commands]) -fi - dnl Set default locale dir. case $host in *apple-darwin*) diff --git a/include/config.h.in b/include/config.h.in index 19d7b34d..5ac7e65b 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -545,9 +545,6 @@ /* Default configuration value */ #undef POSTPONED_MSGS -/* ps command which outputs list of running commands */ -#undef PSEFCMD - /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE diff --git a/pith/conf.c b/pith/conf.c index dedeb1be..a3f50b39 100644 --- a/pith/conf.c +++ b/pith/conf.c @@ -349,8 +349,6 @@ CONF_TXT_T cf_text_stat_msg_delay[] = "The number of seconds to sleep after writ CONF_TXT_T cf_text_busy_cue_rate[] = "Number of times per-second to update busy cue messages"; -CONF_TXT_T cf_text_psleep[] = "UNIX ONLY (except MAC OSX): When an attachment is opened, this variable controls the number\n#of seconds to wait between checks if the user has ended viewing the attachment.\n#minimum value: 60 seconds, maximum value: 600 seconds (10 minutes). Default: 60 seconds"; - CONF_TXT_T cf_text_mailcheck[] = "The approximate number of seconds between checks for new mail"; CONF_TXT_T cf_text_mailchecknoncurr[] = "The approximate number of seconds between checks for new mail in folders\n# other than the current folder and inbox.\n# Default is same as mail-check-interval"; @@ -639,8 +637,6 @@ static struct variable variables[] = { NULL, cf_text_stat_msg_delay}, {"busy-cue-rate", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, NULL, cf_text_busy_cue_rate}, -{"mailcap-check-interval", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, - NULL, cf_text_psleep}, {"mail-check-interval", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, NULL, cf_text_mailcheck}, {"mail-check-interval-noncurrent", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, @@ -1659,7 +1655,6 @@ init_vars(struct pine *ps, void (*cmds_f) (struct pine *, char **)) GLO_LOCAL_FULLNAME = cpystr(DF_LOCAL_FULLNAME); GLO_LOCAL_ADDRESS = cpystr(DF_LOCAL_ADDRESS); GLO_OVERLAP = cpystr(DF_OVERLAP); - GLO_SLEEP = cpystr("60"); GLO_MAXREMSTREAM = cpystr(DF_MAXREMSTREAM); GLO_MARGIN = cpystr(DF_MARGIN); GLO_FILLCOL = cpystr(DF_FILLCOL); @@ -2141,13 +2136,6 @@ init_vars(struct pine *ps, void (*cmds_f) (struct pine *, char **)) } } - set_current_val(&vars[V_SLEEP], TRUE, TRUE); - ps->sleep = i = 60; - if(SVAR_SLEEP(ps, i, tmp_20k_buf, SIZEOF_20KBUF)) - init_error(ps, SM_ORDER | SM_DING, 3, 5, tmp_20k_buf); - else - ps->sleep = i; - set_current_val(&vars[V_OVERLAP], TRUE, TRUE); ps->viewer_overlap = i = atoi(DF_OVERLAP); if(SVAR_OVERLAP(ps, i, tmp_20k_buf, SIZEOF_20KBUF)) @@ -7835,8 +7823,6 @@ config_help(int var, int feature) return(h_config_incoming_second_interv); case V_INCCHECKLIST : return(h_config_incoming_list); - case V_SLEEP : - return(h_config_psleep); case V_OVERLAP : return(h_config_viewer_overlap); case V_MAXREMSTREAM : diff --git a/pith/conf.h b/pith/conf.h index 1ed1f90b..949e87f6 100644 --- a/pith/conf.h +++ b/pith/conf.h @@ -239,8 +239,6 @@ #define GLO_OPENING_SEP vars[V_OPENING_SEP].global_val.p #define VAR_ABOOK_FORMATS vars[V_ABOOK_FORMATS].current_val.l #define VAR_INDEX_FORMAT vars[V_INDEX_FORMAT].current_val.p -#define VAR_SLEEP vars[V_SLEEP].current_val.p -#define GLO_SLEEP vars[V_SLEEP].global_val.p #define VAR_OVERLAP vars[V_OVERLAP].current_val.p #define GLO_OVERLAP vars[V_OVERLAP].global_val.p #define VAR_MAXREMSTREAM vars[V_MAXREMSTREAM].current_val.p @@ -689,10 +687,6 @@ */ #define Q_SUPP_LIMIT (4) #define Q_DEL_ALL (-10) -#define SVAR_SLEEP(ps,n,e,el) strtoval((ps)->VAR_SLEEP, \ - &(n), 60, 120, 0, (e), \ - (el), \ - "Sleep-Interval-Length") #define SVAR_OVERLAP(ps,n,e,el) strtoval((ps)->VAR_OVERLAP, \ &(n), 0, 20, 0, (e), \ (el), \ diff --git a/pith/conftype.h b/pith/conftype.h index ca316189..88f479c1 100644 --- a/pith/conftype.h +++ b/pith/conftype.h @@ -111,7 +111,6 @@ typedef enum { V_PERSONAL_NAME = 0 , V_MARGIN , V_STATUS_MSG_DELAY , V_ACTIVE_MSG_INTERVAL - , V_SLEEP , V_MAILCHECK , V_MAILCHECKNONCURR , V_MAILDROPCHECK diff --git a/pith/pine.hlp b/pith/pine.hlp index 1f0de5be..b23eabad 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 417 2020-04-05 01:33:49 +Alpine Commit 418 2020-04-11 22:28:50 ============= h_news ================= <HTML> <HEAD> @@ -196,6 +196,10 @@ problems you find with this release. <LI> New variable system-certs-file that allows users to configure the location of a container of certificate authority (CA) certificates to be used to validate certificates of remote servers. + +<LI> Remove sleep of 5 seconds for mailcap programs that use the terminal + to display content. Suggested by Carl Edquist. In addition to remove + configurable process table command and it corresponding sleep time. </UL> <P> @@ -860,15 +864,6 @@ Bugs that have been addressed include: <LI> When writing the .pinerc file, lines were truncated if they were longer than 10,000 characters. This could cause data corruption, so now lines are allowed to be of any length. - <LI> In Unix Alpine (but not in MAC OSX) fix a problem that made Alpine - remove attachments before they were open by a mailcap viewer. It - requires that the user has an equivalent to a command such as "ps - auxww" to list the list of processes, and check if there is any - program using the attachment. The default is "/bin/ps auxww", but - it can be changed at compile time with the option --with-ps-cmd. - See the help of the variable - <a href="h_config_psleep"><!--#echo var="VAR_mailcap-check-interval"--></a> - for more information. <LI> S/MIME: signed messages that contained an attachment would not validate. <LI> S/MIME: signed and encrypted messages from Thunderbird would not validate. Thanks to Andreas Schamanek for testing, debugging and @@ -4603,7 +4598,6 @@ There are also additional details on <li><a href="h_config_image_viewer">OPTION: <!--#echo var="VAR_image-viewer"--></a> <li><a href="h_config_inbox_path">OPTION: <!--#echo var="VAR_inbox-path"--></a> <li><a href="h_config_archived_folders">OPTION: <!--#echo var="VAR_incoming-archive-folders"--></a> -<li><a href="h_config_psleep">OPTION: <!--#echo var="VAR_mailcap-check-interval"--></a> <li><a href="h_config_incoming_interv">OPTION: <!--#echo var="VAR_incoming-check-interval"--></a> <li><a href="h_config_incoming_second_interv">OPTION: <!--#echo var="VAR_incoming-check-interval-secondary"--></a> <li><a href="h_config_incoming_list">OPTION: <!--#echo var="VAR_incoming-check-list"--></a> @@ -21848,47 +21842,6 @@ give up and consider it a failed connection. <End of help on this topic> </BODY> </HTML> -====== h_config_psleep ====== -<HTML> -<HEAD> -<TITLE>OPTION: <!--#echo var="VAR_mailcap-check-interval"--> (UNIX Alpine only)</TITLE> -</HEAD> -<BODY> -<H1>OPTION: <!--#echo var="VAR_mailcap-check-interval"--> (UNIX Alpine only)</H1> - -<P> -In the good old days a mailcap viewer was used to examine an -attachment before saving it, and after viewing the attachment control -would return to the operating system when the viewer was closed. Therefore, -when the mailcap viewer returned control to the operating system, it -could be assumed that the user who opened the attachment was done -examining it, and the copy of the attachment that was used, could be removed. - -<P> -However, today this assumption is not longer valid. Some viewers return -control to the operating system before they actually read the attachment -to be examined. This causes Alpine to delete the attachment before it -is read by the viewer, causing the viewer to fail opening the attachment. - -<P> -In order to work around this problem, Alpine checks, after the viewer has -returned control to the operating system, if there is any process that is -using the attachment. This variable controls the number of seconds that -must elapse between checks. Once it is found that no process is using the -attachment, this is removed. - -<P> -The minimum value for this variable is 60 (checks will be made once per -minute), and the maximum value is 600 (checks will be made once every 10 -minutes). The default value is 60. - -<P> -<UL> -<LI><A HREF="h_finding_help">Finding more information and requesting help</A> -</UL><P> -<End of help on this topic> -</BODY> -</HTML> ====== h_config_incoming_interv ====== <HTML> <HEAD> diff --git a/pith/state.h b/pith/state.h index c0106b32..41ef1b43 100644 --- a/pith/state.h +++ b/pith/state.h @@ -320,8 +320,6 @@ struct pine { int tcp_query_timeout; - int sleep; - int inc_check_timeout; int inc_check_interval; /* for local and IMAP */ int inc_second_check_interval; /* for other */ |