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 /alpine | |
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.
Diffstat (limited to 'alpine')
-rw-r--r-- | alpine/confscroll.c | 14 | ||||
-rw-r--r-- | alpine/osdep/execview.c | 37 | ||||
-rw-r--r-- | alpine/setup.c | 1 |
3 files changed, 18 insertions, 34 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] |