]> git.eshelyaron.com Git - emacs.git/commitdiff
Use Isearch lax whitespace mode in Info.
authorJuri Linkov <juri@jurta.org>
Wed, 12 Sep 2012 20:51:46 +0000 (23:51 +0300)
committerJuri Linkov <juri@jurta.org>
Wed, 12 Sep 2012 20:51:46 +0000 (23:51 +0300)
http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00811.html

* lisp/info.el (Info-search): Don't check for isearch-mode and
isearch-regexp before let-binding search-spaces-regexp to
Info-search-whitespace-regexp.
(Info-isearch-search): Let-bind Info-search-whitespace-regexp to
search-whitespace-regexp if isearch-lax-whitespace or
isearch-regexp-lax-whitespace is non-nil.
(Info-mode): Don't set local variable search-whitespace-regexp.

lisp/ChangeLog
lisp/info.el

index 549b70a1de1fc5ad7d8b644baf4bf6e68e31a8b1..ecb110bc30e9e210a2b2d47d8953022736c5c084 100644 (file)
@@ -1,3 +1,14 @@
+2012-09-12  Juri Linkov  <juri@jurta.org>
+
+       * info.el (Info-search): Don't check for isearch-mode and
+       isearch-regexp before let-binding search-spaces-regexp to
+       Info-search-whitespace-regexp.
+       (Info-isearch-search): Let-bind Info-search-whitespace-regexp to
+       search-whitespace-regexp if isearch-lax-whitespace or
+       isearch-regexp-lax-whitespace is non-nil.
+       (Info-mode): Don't set local variable search-whitespace-regexp.
+       http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00811.html
+
 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/debug.el (debugger-outer-unread-command-char, debug)
index fe4afd7216321db226012007511665be7b7cf960..5862e5e850fbf614c492416749e6572ae85197d8 100644 (file)
@@ -1882,9 +1882,7 @@ If DIRECTION is `backward', search in the reverse direction."
          (while (and (not give-up)
                      (or (null found)
                          (not (funcall isearch-filter-predicate beg-found found))))
-           (let ((search-spaces-regexp
-                  (if (or (not isearch-mode) isearch-regexp)
-                      Info-search-whitespace-regexp)))
+           (let ((search-spaces-regexp Info-search-whitespace-regexp))
              (if (if backward
                      (re-search-backward regexp bound t)
                    (re-search-forward regexp bound t))
@@ -1904,9 +1902,7 @@ If DIRECTION is `backward', search in the reverse direction."
          (if (null Info-current-subfile)
              (if isearch-mode
                  (signal 'search-failed (list regexp "end of manual"))
-               (let ((search-spaces-regexp
-                      (if (or (not isearch-mode) isearch-regexp)
-                          Info-search-whitespace-regexp)))
+               (let ((search-spaces-regexp Info-search-whitespace-regexp))
                  (if backward
                      (re-search-backward regexp)
                    (re-search-forward regexp))))
@@ -1964,9 +1960,7 @@ If DIRECTION is `backward', search in the reverse direction."
                (while (and (not give-up)
                            (or (null found)
                                (not (funcall isearch-filter-predicate beg-found found))))
-                 (let ((search-spaces-regexp
-                        (if (or (not isearch-mode) isearch-regexp)
-                            Info-search-whitespace-regexp)))
+                 (let ((search-spaces-regexp Info-search-whitespace-regexp))
                    (if (if backward
                            (re-search-backward regexp nil t)
                          (re-search-forward regexp nil t))
@@ -2034,21 +2028,26 @@ If DIRECTION is `backward', search in the reverse direction."
 (defun Info-isearch-search ()
   (if Info-isearch-search
       (lambda (string &optional bound noerror count)
-       (Info-search
-        (cond
-         (isearch-word
-          ;; Lax version of word search
-          (let ((lax (not (or isearch-nonincremental
-                              (eq (length string)
-                                  (length (isearch--state-string
-                                           (car isearch-cmds))))))))
-            (if (functionp isearch-word)
-                (funcall isearch-word string lax)
-              (word-search-regexp string lax))))
-         (isearch-regexp string)
-         (t (regexp-quote string)))
-        bound noerror count
-        (unless isearch-forward 'backward))
+       (let ((Info-search-whitespace-regexp
+              (if (if isearch-regexp
+                      isearch-regexp-lax-whitespace
+                    isearch-lax-whitespace)
+                  search-whitespace-regexp)))
+         (Info-search
+          (cond
+           (isearch-word
+            ;; Lax version of word search
+            (let ((lax (not (or isearch-nonincremental
+                                (eq (length string)
+                                    (length (isearch--state-string
+                                             (car isearch-cmds))))))))
+              (if (functionp isearch-word)
+                  (funcall isearch-word string lax)
+                (word-search-regexp string lax))))
+           (isearch-regexp string)
+           (t (regexp-quote string)))
+          bound noerror count
+          (unless isearch-forward 'backward)))
        (point))
     (isearch-search-fun-default)))
 
@@ -4157,8 +4156,6 @@ Advanced commands:
        'Info-isearch-push-state)
   (set (make-local-variable 'isearch-filter-predicate)
        'Info-isearch-filter)
-  (set (make-local-variable 'search-whitespace-regexp)
-       Info-search-whitespace-regexp)
   (set (make-local-variable 'revert-buffer-function)
        'Info-revert-buffer-function)
   (Info-set-mode-line)