unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Info-search-isearch
@ 2004-12-28  2:21 Juri Linkov
  2005-02-21 17:54 ` Info-search-isearch Dan Nicolaescu
  0 siblings, 1 reply; 18+ messages in thread
From: Juri Linkov @ 2004-12-28  2:21 UTC (permalink / raw)


Currently only regexp isearch invoked with M-C-s can use `Info-search'
and search through multiple Info nodes.  But it would be better if
normal C-s isearch searched through multiple nodes as well.

Maybe some users will not like this.  So a new user option could be
added to info.el with the default t:

Index: lisp/info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/info.el,v
retrieving revision 1.413
diff -u -r1.413 info.el
--- lisp/info.el	13 Dec 2004 19:31:32 -0000	1.413
+++ lisp/info.el	28 Dec 2004 02:17:19 -0000
@@ -197,6 +201,15 @@
   :type 'regexp
   :group 'info)
 
+(defcustom Info-search-isearch t
+  "*If non-nil, isearch invoked in Info mode uses `Info-search' function.
+This allows isearch to search through multiple nodes.
+When isearch fails, it wraps and restarts the search from the
+top/final node depending on search direction."
+  :version "21.4"
+  :type 'boolean
+  :group 'info)
+
 (defcustom Info-mode-hook
   ;; Try to obey obsolete Info-fontify settings.
   (unless (and (boundp 'Info-fontify) (null Info-fontify))
@@ -1632,23 +1646,24 @@
   (Info-search regexp bound noerror count 'backward))
 
 (defun Info-isearch-search ()
-  (cond
-   (isearch-word
-    (if isearch-forward 'word-search-forward 'word-search-backward))
-   (isearch-regexp
-    (lambda (regexp bound noerror)
-      (condition-case nil
-          (progn
-            (Info-search regexp bound noerror nil
-                         (unless isearch-forward 'backward))
-            (point))
-        (error nil))))
-   (t
-    (if isearch-forward 'search-forward 'search-backward))))
+  (if (and Info-search-isearch (not isearch-word))
+      (lambda (string &optional bound noerror count)
+	(condition-case nil
+	    (progn
+	      (Info-search (if isearch-regexp string (regexp-quote string))
+			   bound noerror count
+			   (unless isearch-forward 'backward))
+	      (point))
+	  (error nil)))
+    (let ((isearch-search-fun-function nil))
+      (isearch-search-fun))))
 
 (defun Info-isearch-wrap ()
-  (if isearch-regexp
-      (if isearch-forward (Info-top-node) (Info-final-node))
+  (when (and Info-search-isearch (not isearch-word))
+    (if isearch-forward (Info-top-node) (Info-final-node))
     (goto-char (if isearch-forward (point-min) (point-max)))))
 
 (defun Info-isearch-push-state ()

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2006-12-13  3:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-28  2:21 Info-search-isearch Juri Linkov
2005-02-21 17:54 ` Info-search-isearch Dan Nicolaescu
2005-02-21 18:24   ` Info-search-isearch Drew Adams
2005-02-21 23:47     ` Info-search-isearch Dan Nicolaescu
2005-02-22  0:42       ` Info-search-isearch Drew Adams
2005-02-22 18:11     ` Info-search-isearch Richard Stallman
2005-02-22 18:11   ` Info-search-isearch Richard Stallman
2005-02-23 17:34     ` Info-search-isearch Juri Linkov
2005-02-24 13:55       ` Info-search-isearch Richard Stallman
2005-02-25 19:59         ` Info-search-isearch Juri Linkov
2006-10-29 19:10           ` Info-search-isearch Drew Adams
2006-10-29 20:18             ` Info-search-isearch Juri Linkov
2006-10-30 19:17               ` Info-search-isearch Richard Stallman
2006-10-30 19:17               ` Info-search-isearch Richard Stallman
2006-11-01 23:33                 ` Info-search-isearch Juri Linkov
2006-11-02 21:47                   ` Info-search-isearch Richard Stallman
2006-12-12 16:30               ` word-search toggle for isearch [was: Info-search-isearch] Drew Adams
2006-12-13  3:37                 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).