emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/isearch.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/isearch.el [emacs-unicode-2]
Date: Wed, 08 Dec 2004 01:48:28 -0500

Index: emacs/lisp/isearch.el
diff -c emacs/lisp/isearch.el:1.221.2.9 emacs/lisp/isearch.el:1.221.2.10
*** emacs/lisp/isearch.el:1.221.2.9     Thu Oct 14 08:49:58 2004
--- emacs/lisp/isearch.el       Wed Dec  8 05:02:12 2004
***************
*** 109,120 ****
    :type 'boolean
    :group 'isearch)
  
! (defcustom search-whitespace-regexp "\\(?:\\s-+\\)"
    "*If non-nil, regular expression to match a sequence of whitespace chars.
  This applies to regular expression incremental search.
! You might want to use something like \"\\\\(?:[ \\t\\r\\n]+\\\\)\" instead.
! In the Customization buffer, that is `\\(?:[' followed by a space,
! a tab, a carriage return (control-M), a newline, and `]+\\)'."
    :type 'regexp
    :group 'isearch)
  
--- 109,122 ----
    :type 'boolean
    :group 'isearch)
  
! (defcustom search-whitespace-regexp "\\s-+"
    "*If non-nil, regular expression to match a sequence of whitespace chars.
  This applies to regular expression incremental search.
! When you put a space or spaces in the incremental regexp, it stands for
! this, unless it is inside of a regexp construct such as [...] or *, + or ?.
! You might want to use something like \"[ \\t\\r\\n]+\" instead.
! In the Customization buffer, that is `[' followed by a space,
! a tab, a carriage return (control-M), a newline, and `]+'."
    :type 'regexp
    :group 'isearch)
  
***************
*** 256,263 ****
      (define-key map "\r" 'isearch-exit)
      (define-key map "\C-j" 'isearch-printing-char)
      (define-key map "\t" 'isearch-printing-char)
-     (define-key map " " 'isearch-whitespace-chars)
-     (define-key map [?\S-\ ] 'isearch-whitespace-chars)
  
      (define-key map    "\C-w" 'isearch-yank-word-or-char)
      (define-key map "\M-\C-w" 'isearch-del-char)
--- 258,263 ----
***************
*** 481,487 ****
  Do incremental search forward for regular expression.
  With a prefix argument, do a regular string search instead.
  Like ordinary incremental search except that your input
! is treated as a regexp.  See \\[isearch-forward] for more info."
    (interactive "P\np")
    (isearch-mode t (null not-regexp) nil (not no-recursive-edit)))
  
--- 481,492 ----
  Do incremental search forward for regular expression.
  With a prefix argument, do a regular string search instead.
  Like ordinary incremental search except that your input
! is treated as a regexp.  See \\[isearch-forward] for more info.
! 
! In regexp incremental searches, a space or spaces normally matches
! any whitespace (the variable `search-whitespace-regexp' controls
! precisely what that means).  If you want to search for a literal space
! and nothing else, enter `[ ]'."
    (interactive "P\np")
    (isearch-mode t (null not-regexp) nil (not no-recursive-edit)))
  
***************
*** 1672,1682 ****
      ;; Assume character codes 0200 - 0377 stand for characters in some
      ;; single-byte character set, and convert them to Emacs
      ;; characters.
!     (and enable-multibyte-characters
!        (>= char ?\200)
!        (<= char ?\377)
!        (setq char (unibyte-char-to-multibyte char)))
!     (isearch-process-search-char char)))
  
  (defun isearch-return-char ()
    "Convert return into newline for incremental search.
--- 1677,1691 ----
      ;; Assume character codes 0200 - 0377 stand for characters in some
      ;; single-byte character set, and convert them to Emacs
      ;; characters.
!     (if (and isearch-regexp (= char ?\ ))
!       (if (subregexp-context-p isearch-string pos)
!           (isearch-process-search-string "[ ]" " ")
!         (isearch-process-search-char char))
!       (and enable-multibyte-characters
!          (>= char ?\200)
!          (<= char ?\377)
!          (setq char (unibyte-char-to-multibyte char)))
!       (isearch-process-search-char char))))
  
  (defun isearch-return-char ()
    "Convert return into newline for incremental search.
***************
*** 1700,1721 ****
          (isearch-process-search-multibyte-characters char)
        (isearch-process-search-char char)))))
  
- (defun isearch-whitespace-chars ()
-   "Match all whitespace chars, if in regexp mode.
- If you want to search for just a space, type 
\\<isearch-mode-map>\\[isearch-quote-char] SPC."
-   (interactive)
-   (if isearch-regexp
-       (if (and search-whitespace-regexp (not isearch-within-brackets)
-              (not isearch-invalid-regexp))
-         (isearch-process-search-string search-whitespace-regexp " ")
-       (isearch-printing-char))
-     (progn
-       ;; This way of doing word search doesn't correctly extend current 
search.
-       ;;      (setq isearch-word t)
-       ;;      (setq isearch-adjusted t)
-       ;;      (goto-char isearch-barrier)
-       (isearch-printing-char))))
- 
  (defun isearch-process-search-char (char)
    ;; Append the char to the search string, update the message and re-search.
    (isearch-process-search-string
--- 1709,1714 ----
***************
*** 1956,1961 ****
--- 1949,1955 ----
        (let ((inhibit-point-motion-hooks search-invisible)
            (inhibit-quit nil)
            (case-fold-search isearch-case-fold-search)
+           (search-spaces-regexp search-whitespace-regexp)
            (retry t))
        (if isearch-regexp (setq isearch-invalid-regexp nil))
        (setq isearch-within-brackets nil)
***************
*** 2369,2375 ****
  (defun isearch-lazy-highlight-search ()
    "Search ahead for the next or previous match, for lazy highlighting.
  Attempt to do the search exactly the way the pending isearch would."
!   (let ((case-fold-search isearch-case-fold-search))
      (funcall (isearch-search-fun)
               isearch-string
               (if isearch-forward
--- 2363,2370 ----
  (defun isearch-lazy-highlight-search ()
    "Search ahead for the next or previous match, for lazy highlighting.
  Attempt to do the search exactly the way the pending isearch would."
!   (let ((case-fold-search isearch-case-fold-search)
!       (search-spaces-regexp search-whitespace-regexp))
      (funcall (isearch-search-fun)
               isearch-string
               (if isearch-forward




reply via email to

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