top: remove those winflags which restricted 'x' toggle <=== port of newlib ef8d1cb6

______________________________ original newlib message

On occasion, even as the top author, I wonder why that
'x' toggle has stopped working. Of course, it actually
was working but a locate request ('L') or other filter
('O') operation was active and thus temporarily turned
if off. Such behavior is documented in top's man page.

Well, with this patch that 'x' suppression is no more.

[ the original justification, however, remains true. ]

[ but there's really only one character which causes ]
[ any potential trouble & i'm gonna' keep it secret. ]

[ besides, if a display is corrupted, there's always ]
[ that '=' key which restores things back to normal. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2022-06-15 00:00:00 -05:00 committed by Craig Small
parent 0ce9962269
commit d091a67854
4 changed files with 4 additions and 44 deletions

1
NEWS
View File

@ -9,6 +9,7 @@ procps-ng-NEXT
* top: added long versions of command line options * top: added long versions of command line options
* top: the time related fields can now be user scaled * top: the time related fields can now be user scaled
* top: added a 'start time' field (STARTED) * top: added a 'start time' field (STARTED)
* top: column highlighting allowed under 'L' or 'O'
procps-ng-3.3.17 procps-ng-3.3.17

View File

@ -1566,11 +1566,6 @@ The sort field might\fI not\fR be visible because:
1) there is insufficient\fI Screen Width \fR 1) there is insufficient\fI Screen Width \fR
2) the `f' \*(CI turned it \*F 2) the `f' \*(CI turned it \*F
\*(NT Whenever Searching and/or Other Filtering is active in a window,
column highlighting is temporarily disabled.
\*(XC notes at the end of topics 5d. SEARCHING and 5e. FILTERING for an
explanation why.
.TP 7 .TP 7
\ \ \ \fBy\fR\ \ :\fIRow-Highlight\fR toggle \fR \ \ \ \fBy\fR\ \ :\fIRow-Highlight\fR toggle \fR
Changes highlighting for "running" tasks. Changes highlighting for "running" tasks.
@ -2070,12 +2065,6 @@ could yet produce a successful `&' search.
The above \*(CIs are\fB always\fR available in \*(FM but\fB never\fR The above \*(CIs are\fB always\fR available in \*(FM but\fB never\fR
available in \*(AM if the \*(CW's \*(TD has been toggled \*F. available in \*(AM if the \*(CW's \*(TD has been toggled \*F.
\*(NT Whenever a Search is active in a window, \*(We will turn
column highlighting \*F to prevent false matches on internal non-display
escape sequences.
Such highlighting will be restored when a window's search string is empty.
\*(XC `x' \*(CI for additional information on sort column highlighting.
.\" ...................................................................... .\" ......................................................................
.SS 5e. FILTERING in a Window .SS 5e. FILTERING in a Window
.\" ---------------------------------------------------------------------- .\" ----------------------------------------------------------------------
@ -2245,14 +2234,6 @@ achieve the failed `9999' objective discussed above.
.fi .fi
.RS -3 .RS -3
\*(NT Whenever Other Filtering is active in a window, \*(We will turn
column highlighting \*F to prevent false matches on internal non-display
escape sequences.
Such highlighting will be restored when a window is no longer subject
to filtering.
\*(XC `x' \*(CI for additional information on sort column highlighting.
.RE
.\" ---------------------------------------------------------------------- .\" ----------------------------------------------------------------------
.SH 6. FILES .SH 6. FILES
.\" ---------------------------------------------------------------------- .\" ----------------------------------------------------------------------

View File

@ -3699,9 +3699,6 @@ static void osel_clear (WIN_t *q) {
} }
q->osel_tot = 0; q->osel_tot = 0;
q->osel_1st = NULL; q->osel_1st = NULL;
#ifndef USE_X_COLHDR
OFFw(q, NOHISEL_xxx);
#endif
} // end: osel_clear } // end: osel_clear
@ -4106,9 +4103,6 @@ static const char *configs_file (FILE *fp, const char *name, float *delay) {
if (&w->rc.fieldscur[n] != strrchr(w->rc.fieldscur, w->rc.fieldscur[n])) if (&w->rc.fieldscur[n] != strrchr(w->rc.fieldscur, w->rc.fieldscur[n]))
return p; return p;
} }
#ifndef USE_X_COLHDR
OFFw(w, NOHIFND_xxx | NOHISEL_xxx);
#endif
} // end: for (GROUPSMAX) } // end: for (GROUPSMAX)
// any new addition(s) last, for older rcfiles compatibility... // any new addition(s) last, for older rcfiles compatibility...
@ -4552,10 +4546,6 @@ static void win_reset (WIN_t *q) {
osel_clear(q); osel_clear(q);
q->findstr[0] = '\0'; q->findstr[0] = '\0';
#ifndef USE_X_COLHDR
// NOHISEL_xxx is redundant (already turned off by osel_clear)
OFFw(q, NOHIFND_xxx | NOHISEL_xxx);
#endif
q->rc.combine_cpus = 0; q->rc.combine_cpus = 0;
} // end: win_reset } // end: win_reset
@ -5114,10 +5104,6 @@ static void find_string (int ch) {
snprintf(Curwin->findstr, FNDBUFSIZ, "%s", str); snprintf(Curwin->findstr, FNDBUFSIZ, "%s", str);
Curwin->findlen = strlen(Curwin->findstr); Curwin->findlen = strlen(Curwin->findstr);
found = 0; found = 0;
#ifndef USE_X_COLHDR
if (Curwin->findstr[0]) SETw(Curwin, NOHIFND_xxx);
else OFFw(Curwin, NOHIFND_xxx);
#endif
} }
if (Curwin->findstr[0]) { if (Curwin->findstr[0]) {
SETw(Curwin, NOPRINT_xxx); SETw(Curwin, NOPRINT_xxx);
@ -5200,9 +5186,6 @@ static void other_filters (int ch) {
show_msg(p); show_msg(p);
return; return;
} }
#ifndef USE_X_COLHDR
SETw(w, NOHISEL_xxx);
#endif
break; break;
case kbd_CtrlO: case kbd_CtrlO:
if (VIZCHKw(w)) { if (VIZCHKw(w)) {
@ -5702,8 +5685,7 @@ static void keys_task (int ch) {
TOGw(w, Show_HICOLS); TOGw(w, Show_HICOLS);
capsmk(w); capsmk(w);
#else #else
if (ENUviz(w, w->rc.sortindx) if (ENUviz(w, w->rc.sortindx)) {
&& !CHKw(w, NOHIFND_xxx | NOHISEL_xxx)) {
TOGw(w, Show_HICOLS); TOGw(w, Show_HICOLS);
if (ENUpos(w, w->rc.sortindx) < w->begpflg) { if (ENUpos(w, w->rc.sortindx) < w->begpflg) {
if (CHKw(w, Show_HICOLS)) w->begpflg += 2; if (CHKw(w, Show_HICOLS)) w->begpflg += 2;
@ -6397,10 +6379,10 @@ static const char *task_show (const WIN_t *q, const int idx) {
switch (i) { switch (i) {
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
// these 2 aren't real procflgs, they're used in column highlighting! // these 2 aren't real procflgs, they're used in column highlighting!
case EU_XON:
case EU_XOF: case EU_XOF:
case EU_XON:
cp = NULL; cp = NULL;
if (!CHKw(q, NOPRINT_xxx | NOHIFND_xxx | NOHISEL_xxx)) { if (!CHKw(q, NOPRINT_xxx)) {
/* treat running tasks specially - entire row may get highlighted /* treat running tasks specially - entire row may get highlighted
so we needn't turn it on and we MUST NOT turn it off */ so we needn't turn it on and we MUST NOT turn it off */
if (!('R' == p->state && CHKw(q, Show_HIROWS))) if (!('R' == p->state && CHKw(q, Show_HIROWS)))

View File

@ -343,10 +343,6 @@ typedef struct CPU_t {
// these flag(s) have no command as such - they're for internal use // these flag(s) have no command as such - they're for internal use
#define NOPRINT_xxx 0x010000 // build task rows only (not for display) #define NOPRINT_xxx 0x010000 // build task rows only (not for display)
#define EQUWINS_xxx 0x000001 // rebalance all wins & tasks (off i,n,u/U) #define EQUWINS_xxx 0x000001 // rebalance all wins & tasks (off i,n,u/U)
#ifndef USE_X_COLHDR
#define NOHISEL_xxx 0x200000 // restrict Show_HICOLS for osel temporarily
#define NOHIFND_xxx 0x100000 // restrict Show_HICOLS for find temporarily
#endif
// Default flags if there's no rcfile to provide user customizations // Default flags if there's no rcfile to provide user customizations
#ifdef ORIG_TOPDEFS #ifdef ORIG_TOPDEFS