grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to grep/src/grep.c


From: Charles Levert
Subject: Changes to grep/src/grep.c
Date: Thu, 07 Jul 2005 01:32:32 -0400

Index: grep/src/grep.c
diff -u grep/src/grep.c:1.111 grep/src/grep.c:1.112
--- grep/src/grep.c:1.111       Wed Jun 22 01:47:43 2005
+++ grep/src/grep.c     Thu Jul  7 05:32:30 2005
@@ -79,9 +79,6 @@
 /* If nonzero, use grep_color marker.  */
 static int color_option;
 
-/* If nonzero, do pseudo-markup instead of actual colors.  */
-static int pseudo_markup;
-
 /* If nonzero, show only the part of a line matching the expression. */
 static int only_matching;
 
@@ -224,36 +221,12 @@
 static const char *
 color_cap_ne_fct(void)
 {
-  if (pseudo_markup)
-    return "makes no sense after the \"xm\" capability; ignored";
-
   sgr_start = "\33[%sm";
   sgr_end   = "\33[m";
 
   return NULL;
 }
 
-static const char *
-color_cap_xm_fct(void)
-{
-  /* This experimental feature should stay undocumented for now.  */
-  pseudo_markup = 1;
-
-  sgr_start = "<grep:%s>";
-  sgr_end   = "</grep:%s>";
-
-  /* The user can just redefine them to the empty string afterwards.  */
-  grep_color     = "matched-text";
-  filename_color = "filename";
-  line_num_color = "line-number";
-  byte_num_color = "byte-offset";
-  sep_color      = "separator";
-  mlines_color   = "matching-line";
-  context_color  = "context-line";
-
-  return NULL;
-}
-
 /* For GREP_COLORS.  */
 static struct color_cap color_dict[] =
   {
@@ -265,7 +238,6 @@
     { "ml", &mlines_color,     NULL },                 /* matching lines */
     { "cx", &context_color,    NULL },                 /* context lines */
     { "ne", NULL,              color_cap_ne_fct },     /* no EL on SGR_* */
-    { "xm", NULL,              color_cap_xm_fct },     /* pseudo-markup */
     { NULL, NULL,              NULL }
   };
 
@@ -818,12 +790,7 @@
        print_line_head(b, lim, SEP_CHAR_MATCH);
       else
        {
-         if (pseudo_markup >= 0)
-           {
-             PR_SGR_START(mlines_color);
-             if (pseudo_markup)
-               pseudo_markup = -1;
-           }
+         PR_SGR_START(mlines_color);
          fwrite (beg, sizeof (char), match_offset, stdout);
        }
 
@@ -857,15 +824,12 @@
 
   if (tail_size > 0)
     {
-      if (pseudo_markup >= 0)
-       PR_SGR_START(color);
+      PR_SGR_START(color);
       fwrite(beg, 1, tail_size, stdout);
       beg += tail_size;
+      PR_SGR_END(color);
     }
 
-  if (tail_size > 0 || pseudo_markup < 0)
-    PR_SGR_END(color);
-
   return beg;
 }
 
@@ -888,11 +852,6 @@
 
       if (!only_matching && *line_color);
        beg = print_line_tail(beg, lim, line_color);
-
-      /* This global is modified by print_line_middle()
-        and checked by print_line_tail().  Now reset it.  */
-      if (pseudo_markup < 0)
-       pseudo_markup = 1;
     }
 
   if (!only_matching && lim > beg)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]