]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-isearch-search): Implement lax version of
authorJuri Linkov <juri@jurta.org>
Fri, 19 Dec 2008 00:20:48 +0000 (00:20 +0000)
committerJuri Linkov <juri@jurta.org>
Fri, 19 Dec 2008 00:20:48 +0000 (00:20 +0000)
incremental word search in Info.
(Info-isearch-start): Set Info-isearch-initial-node to the
current node when search is nonincremental to not stop at the
initial node in this case.
(Info-mode-map): Unbind "\M-s" from `Info-search'.

lisp/ChangeLog
lisp/info.el

index a07cbbc5eb93d1f81349e1c574c5e6d466e3eea2..e43cacea51f5bfb575541e5066d62fba6b4b071c 100644 (file)
@@ -1,3 +1,12 @@
+2008-12-19  Juri Linkov  <juri@jurta.org>
+
+       * info.el (Info-isearch-search): Implement lax version of
+       incremental word search in Info.
+       (Info-isearch-start): Set Info-isearch-initial-node to the
+       current node when search is nonincremental to not stop at the
+       initial node in this case.
+       (Info-mode-map): Unbind "\M-s" from `Info-search'.
+
 2008-12-18  Juanma Barranquero  <lekktu@gmail.com>
 
        * textmodes/rst.el (rst-promote-region): Reflow docstring.
index b120d3d737983ead11cba1f377d714b40d1bad3f..f45aa41de30f7ccdd77b1434b47d63b13b239676 100644 (file)
@@ -1815,7 +1815,12 @@ If DIRECTION is `backward', search in the reverse direction."
                                        (replace-regexp-in-string
                                         "^\\W+\\|\\W+$" "" string)
                                        nil t)
-                                "\\b")
+                                ;; Lax version of word search
+                                (if (or isearch-nonincremental
+                                        (eq (length string)
+                                            (length (isearch-string-state
+                                                     (car isearch-cmds)))))
+                                    "\\b"))
                         bound noerror count
                         (unless isearch-forward 'backward))
          (Info-search (if isearch-regexp string (regexp-quote string))
@@ -1845,7 +1850,10 @@ If DIRECTION is `backward', search in the reverse direction."
       (progn (Info-find-node file node) (sit-for 0))))
 
 (defun Info-isearch-start ()
-  (setq Info-isearch-initial-node nil))
+  (setq Info-isearch-initial-node
+       ;; Don't stop at initial node for nonincremental search.
+       ;; Otherwise this variable is set after first search failure.
+       (and isearch-nonincremental Info-current-node)))
 
 (defun Info-isearch-filter-predicate (beg-found found)
   "Skip invisible text, node header line and Tag Table node."
@@ -3241,8 +3249,6 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
     (define-key map "r" 'Info-history-forward)
     (define-key map "s" 'Info-search)
     (define-key map "S" 'Info-search-case-sensitively)
-    ;; For consistency with Rmail.
-    (define-key map "\M-s" 'Info-search)
     (define-key map "\M-n" 'clone-buffer)
     (define-key map "t" 'Info-top-node)
     (define-key map "T" 'Info-toc)