From f6519aa1448e62a757d43e57cabd081ab594dfb1 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sat, 17 Apr 2021 20:26:24 -0600 Subject: * Add new hidden feature "Enable Delete Before Writing" that makes Alpine delete a line before overwriting it. It is meant to work around bugs in terminals that need it. Work in collaboration with professor Martin Trusler. --- alpine/addrbook.c | 4 ++++ alpine/mailindx.c | 2 ++ alpine/mailpart.c | 4 +++- alpine/mailview.c | 12 ++++++++++++ alpine/osdep/termin.gen.c | 2 ++ pith/conf.c | 2 ++ pith/conftype.h | 1 + pith/pine.hlp | 34 ++++++++++++++++++++++++++++++++++ 8 files changed, 60 insertions(+), 1 deletion(-) diff --git a/alpine/addrbook.c b/alpine/addrbook.c index 2b13ba0b..2860e885 100644 --- a/alpine/addrbook.c +++ b/alpine/addrbook.c @@ -374,11 +374,15 @@ display_book(int start_disp, int cur_line, int old_line, int redraw, Pos *start_ if(cur_line != old_line){ /*--- Repaint old position to erase "cursor" ---*/ + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(old_line + HEADER_ROWS(ps_global)); paint_line(old_line + HEADER_ROWS(ps_global), as.top_ent + old_line, 0, &sp); } /*--- paint the position with the cursor ---*/ + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(cur_line + HEADER_ROWS(ps_global)); paint_line(cur_line + HEADER_ROWS(ps_global), as.top_ent + cur_line, 1, &sp); if(start_pos) diff --git a/alpine/mailindx.c b/alpine/mailindx.c index 6e6feeb1..63f92772 100644 --- a/alpine/mailindx.c +++ b/alpine/mailindx.c @@ -1846,6 +1846,8 @@ paint_index_line(ICE_S *argice, int line, long int msgno, IndexColType sfld, do_arrow = (afld != iNothing); MoveCursor(HEADER_ROWS(ps_global) + line, 0); + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + CleartoEOLN(); /* find the base color for the whole line */ if(cur && !ac && !do_arrow){ diff --git a/alpine/mailpart.c b/alpine/mailpart.c index c5947652..3261c63a 100644 --- a/alpine/mailpart.c +++ b/alpine/mailpart.c @@ -1006,6 +1006,8 @@ attachment_screen_updater(struct pine *ps, ATDISP_S *current, ATT_SCREEN_S *scre if(!(!screen->current || ctmp == screen->current || ctmp == current)) continue; + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(dline + HEADER_ROWS(ps)); if(ctmp && ctmp->dstring){ char *p = tmp_20k_buf; int i, col, x = 0, totlen; @@ -1061,7 +1063,7 @@ attachment_screen_updater(struct pine *ps, ATDISP_S *current, ATT_SCREEN_S *scre && !(F_ON(F_FORCE_LOW_SPEED,ps) || ps->low_speed)) EndInverse(); } - else + else if(F_OFF(F_ENABLE_DEL_WHEN_WRITING, ps_global)) ClearLine(dline + HEADER_ROWS(ps)); } diff --git a/alpine/mailview.c b/alpine/mailview.c index dd4c6a38..1265b051 100644 --- a/alpine/mailview.c +++ b/alpine/mailview.c @@ -4431,6 +4431,8 @@ scroll_scroll_text(long int new_top_line, HANDLE_S *handle, int redraw) if(st->parms->text.src == FileStar) l -= new_top_line; + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(top + lp->where.row); PutLine0n8b(top + lp->where.row, 0, st->text_lines[l], st->line_lengths[l], handle); } @@ -4448,6 +4450,8 @@ scroll_scroll_text(long int new_top_line, HANDLE_S *handle, int redraw) if(st->parms->text.src == FileStar) l -= new_top_line; + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(top + lp->where.row); PutLine0n8b(top + lp->where.row, 0, st->text_lines[l], st->line_lengths[l], handle); } @@ -4507,6 +4511,8 @@ scroll_scroll_text(long int new_top_line, HANDLE_S *handle, int redraw) if(st->parms->text.src == FileStar) l -= new_top_line; + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(top + lp->where.row); PutLine0n8b(top + lp->where.row, 0, st->text_lines[l], st->line_lengths[l], handle); } @@ -4521,6 +4527,8 @@ scroll_scroll_text(long int new_top_line, HANDLE_S *handle, int redraw) : st->top_text_line + num_display_lines; if(l < st->num_lines){ + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(st->screen.start_line + num_display_lines - 1); PutLine0n8b(st->screen.start_line + num_display_lines - 1, 0, st->text_lines[l], st->line_lengths[l], handle ? handle : st->parms->text.handles); @@ -4549,6 +4557,8 @@ scroll_scroll_text(long int new_top_line, HANDLE_S *handle, int redraw) l = (st->parms->text.src == FileStar) ? st->top_text_line - new_top_line : st->top_text_line; + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(st->screen.start_line); PutLine0n8b(st->screen.start_line, 0, st->text_lines[l], st->line_lengths[l], handle ? handle : st->parms->text.handles); @@ -4574,6 +4584,8 @@ scroll_scroll_text(long int new_top_line, HANDLE_S *handle, int redraw) for(lp = handle->loc; lp; lp = lp->next) if(lp->where.row >= st->top_text_line && lp->where.row < st->top_text_line + st->screen.length){ + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(st->screen.start_line + (lp->where.row - st->top_text_line)); PutLine0n8b(st->screen.start_line + (lp->where.row - st->top_text_line), 0, st->text_lines[lp->where.row], diff --git a/alpine/osdep/termin.gen.c b/alpine/osdep/termin.gen.c index 99cdb4ce..b8d01b15 100644 --- a/alpine/osdep/termin.gen.c +++ b/alpine/osdep/termin.gen.c @@ -432,6 +432,8 @@ optionally_enter(char *utf8string, int y_base, int x_base, int utf8string_size, draw_keymenu(km, bitmap, cols, 1-FOOTER_ROWS(ps_global), 0, FirstMenu); } + if(F_ON(F_ENABLE_DEL_WHEN_WRITING, ps_global)) + ClearLine(real_y_base); if(pico_usingcolor() && VAR_PROMPT_FORE_COLOR && VAR_PROMPT_BACK_COLOR && pico_is_good_color(VAR_PROMPT_FORE_COLOR) && diff --git a/pith/conf.c b/pith/conf.c index 44854f48..e8904e45 100644 --- a/pith/conf.c +++ b/pith/conf.c @@ -3386,6 +3386,8 @@ feature_list(int index) F_DISABLE_SHARED_NAMESPACES, h_config_disable_shared, PREF_HIDDEN, 0}, {"disable-signature-edit-cmd", NULL, F_DISABLE_SIGEDIT_CMD, h_config_disable_signature_edit, PREF_HIDDEN, 0}, + {"enable-delete-before-writing", NULL, + F_ENABLE_DEL_WHEN_WRITING, h_config_delete_before_writing, PREF_HIDDEN, 0}, {"new-thread-on-blank-subject", "New Thread on Blank Subject", F_NEW_THREAD_ON_BLANK_SUBJECT, h_config_new_thread_blank_subject, PREF_HIDDEN, 1}, {"quell-personal-name-prompt", NULL, diff --git a/pith/conftype.h b/pith/conftype.h index 439ed887..c563126e 100644 --- a/pith/conftype.h +++ b/pith/conftype.h @@ -374,6 +374,7 @@ typedef enum { F_DISABLE_UPDATE_CMD, F_DISABLE_KBLOCK_CMD, F_DISABLE_SIGEDIT_CMD, + F_ENABLE_DEL_WHEN_WRITING, F_DISABLE_ROLES_SETUP, F_DISABLE_ROLES_SIGEDIT, F_DISABLE_ROLES_TEMPLEDIT, diff --git a/pith/pine.hlp b/pith/pine.hlp index 2e7326ee..060a897a 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -183,6 +183,16 @@ it for you. Please take some time to read it and understand it. Since the Privacy Policy could be amended to take into consideration new additions to Alpine, please check it periodically. +

These changes were added after the release of version . + +

+New features include: +

+

The changes in version are as follows:

@@ -4688,6 +4698,7 @@ There are also additional details on

  • FEATURE:
  • FEATURE:
  • FEATURE: +
  • FEATURE:
  • FEATURE:
  • FEATURE:
  • FEATURE: @@ -34521,6 +34532,29 @@ the Setup/Config screen. <End of help on this topic> +====== h_config_delete_before_writing ===== + + +FEATURE: <!--#echo var="FEAT_enable-delete-before-writing"--> + + +

    FEATURE:

    + +This feature controls a behavior of Alpine intended to workaround problems in +terminals where the marker for the end of inverse video cannot be overwritten, +but must be deleted, as a way to start inverse video again. + +

    +When this feature is enabled, Alpine will delete a line before writing it, +therefore deleting the end of reverse video. Modern terminals do not require +to enable this feature, but some old terminals might require it. +

    +

    +<End of help on this topic> + + ====== h_config_disable_roles_templateedit ===== -- cgit v1.2.3-54-g00ecf