aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2005-02-23 17:03:17 +0000
committerJuri Linkov2005-02-23 17:03:17 +0000
commit98e77be59a28604574c196a4611d44d32aa8a895 (patch)
tree5e4e887e50ae12048afe7add506193184abc6f8c
parentb02c3eedd3a308731c59b048dd3837d132e0cef8 (diff)
downloademacs-98e77be59a28604574c196a4611d44d32aa8a895.tar.gz
emacs-98e77be59a28604574c196a4611d44d32aa8a895.zip
(Info-isearch-search): New defcustom.
(Info-isearch-search): Call the default isearch function when Info-isearch-search is nil. (Info-isearch-wrap): Use variable Info-isearch-search.
-rw-r--r--lisp/info.el37
1 files changed, 22 insertions, 15 deletions
diff --git a/lisp/info.el b/lisp/info.el
index e6f85d19fe1..4905bf0844e 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -201,6 +201,15 @@ a tab, a carriage return (control-M), a newline, and `]+'."
201 :type 'regexp 201 :type 'regexp
202 :group 'info) 202 :group 'info)
203 203
204(defcustom Info-isearch-search t
205 "*If non-nil, isearch invoked in Info mode uses `Info-search' function.
206This allows isearch to search through multiple nodes.
207When isearch fails, it wraps and restarts the search from the
208top/final node depending on search direction."
209 :version "22.1"
210 :type 'boolean
211 :group 'info)
212
204(defcustom Info-mode-hook 213(defcustom Info-mode-hook
205 ;; Try to obey obsolete Info-fontify settings. 214 ;; Try to obey obsolete Info-fontify settings.
206 (unless (and (boundp 'Info-fontify) (null Info-fontify)) 215 (unless (and (boundp 'Info-fontify) (null Info-fontify))
@@ -1637,23 +1646,21 @@ If DIRECTION is `backward', search in the reverse direction."
1637 (Info-search regexp bound noerror count 'backward)) 1646 (Info-search regexp bound noerror count 'backward))
1638 1647
1639(defun Info-isearch-search () 1648(defun Info-isearch-search ()
1640 (cond 1649 (if (and Info-isearch-search (not isearch-word))
1641 (isearch-word 1650 (lambda (string &optional bound noerror count)
1642 (if isearch-forward 'word-search-forward 'word-search-backward)) 1651 (condition-case nil
1643 (isearch-regexp 1652 (progn
1644 (lambda (regexp bound noerror) 1653 (Info-search (if isearch-regexp string (regexp-quote string))
1645 (condition-case nil 1654 bound noerror count
1646 (progn 1655 (unless isearch-forward 'backward))
1647 (Info-search regexp bound noerror nil 1656 (point))
1648 (unless isearch-forward 'backward)) 1657 (error nil)))
1649 (point)) 1658 (let ((isearch-search-fun-function nil))
1650 (error nil)))) 1659 (isearch-search-fun))))
1651 (t
1652 (if isearch-forward 'search-forward 'search-backward))))
1653 1660
1654(defun Info-isearch-wrap () 1661(defun Info-isearch-wrap ()
1655 (if isearch-regexp 1662 (when (and Info-isearch-search (not isearch-word))
1656 (if isearch-forward (Info-top-node) (Info-final-node)) 1663 (if isearch-forward (Info-top-node) (Info-final-node))
1657 (goto-char (if isearch-forward (point-min) (point-max))))) 1664 (goto-char (if isearch-forward (point-min) (point-max)))))
1658 1665
1659(defun Info-isearch-push-state () 1666(defun Info-isearch-push-state ()