emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/search.c


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/src/search.c
Date: Fri, 19 Nov 2004 14:44:09 -0500

Index: emacs/src/search.c
diff -c emacs/src/search.c:1.186 emacs/src/search.c:1.187
*** emacs/src/search.c:1.186    Wed Oct 27 10:59:20 2004
--- emacs/src/search.c  Fri Nov 19 19:38:26 2004
***************
*** 83,88 ****
--- 83,90 ----
  
  Lisp_Object Qinvalid_regexp;
  
+ Lisp_Object Vsearch_whitespace_regexp;
+ 
  static void set_search_regs ();
  static void save_search_regs ();
  static int simple_search ();
***************
*** 161,168 ****
--- 163,177 ----
    BLOCK_INPUT;
    old = re_set_syntax (RE_SYNTAX_EMACS
                       | (posix ? 0 : RE_NO_POSIX_BACKTRACKING));
+ 
+   re_set_whitespace_regexp (NILP (Vsearch_whitespace_regexp) ? NULL
+                           : SDATA (Vsearch_whitespace_regexp));
+ 
    val = (char *) re_compile_pattern ((char *)raw_pattern,
                                     raw_pattern_size, &cp->buf);
+ 
+   re_set_whitespace_regexp (NULL);
+ 
    re_set_syntax (old);
    UNBLOCK_INPUT;
    if (val)
***************
*** 1051,1057 ****
        return pos;
      }
  
!   if (RE && !trivial_regexp_p (string))
      {
        unsigned char *p1, *p2;
        int s1, s2;
--- 1060,1066 ----
        return pos;
      }
  
!   if (RE && !(trivial_regexp_p (string) && NILP (Vsearch_whitespace_regexp)))
      {
        unsigned char *p1, *p2;
        int s1, s2;
***************
*** 2998,3003 ****
--- 3007,3020 ----
    saved_last_thing_searched = Qnil;
    staticpro (&saved_last_thing_searched);
  
+   DEFVAR_LISP ("search-whitespace-regexp", &Vsearch_whitespace_regexp,
+       /* doc: Regexp to substitute for bunches of spaces in regexp search.
+ Some commands use this for user-specified regexps.
+ Spaces that occur inside character classes or repetition operators
+ or other such regexp constructs are not replaced with this.
+ A value of nil (which is the normal value) means treat spaces literally.  */);
+   Vsearch_whitespace_regexp = Qnil;
+ 
    defsubr (&Slooking_at);
    defsubr (&Sposix_looking_at);
    defsubr (&Sstring_match);




reply via email to

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