unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: dann@godzilla.ics.uci.edu, emacs-devel@gnu.org
Subject: Re: Info-search-isearch
Date: Fri, 25 Feb 2005 21:59:57 +0200	[thread overview]
Message-ID: <87ll9cl8aq.fsf@jurta.org> (raw)
In-Reply-To: <E1D4JSy-00018b-QZ@fencepost.gnu.org> (Richard Stallman's message of "Thu, 24 Feb 2005 08:55:44 -0500")

Currently multi-node isearch in Info ignores word search.  It searches
for a sequence of words only in the current node.  But it is useful to
search for words through multiple Info nodes.  I think search in Info
should support nonincremental and "half-incremental" word search.

Word search what I call "half-incremental" is an undocumented
feature that allows almost incremental search by typing
`C-s M-e C-w WORDS C-s', i.e. it starts as nonincremental search,
and after typing the second C-s in the minibuffer it continues
as incremental search.  I discovered this feature accidentally.
Perhaps, it should be documented in the Emacs manual?

Below is an implementation of word search for Info isearch which
duplicated in Lisp the C function `wordify' used by word search.

Index: lisp/info.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/info.el,v
retrieving revision 1.417
diff -u -r1.417 info.el
--- lisp/info.el	23 Feb 2005 17:03:17 -0000	1.417
+++ lisp/info.el	25 Feb 2005 19:55:18 -0000
@@ -1646,10 +1646,16 @@
   (Info-search regexp bound noerror count 'backward))
 
 (defun Info-isearch-search ()
-  (if (and Info-isearch-search (not isearch-word))
+  (if Info-isearch-search
       (lambda (string &optional bound noerror count)
 	(condition-case nil
-	    (progn
+	    (if isearch-word
+		(Info-search (concat "\\b" (replace-regexp-in-string
+					    "\\W+" "\\\\W+"
+					    (replace-regexp-in-string
+					     "^\\W+\\|\\W+$" "" string)) "\\b")
+			     bound noerror count
+			     (unless isearch-forward 'backward))
 	      (Info-search (if isearch-regexp string (regexp-quote string))
 			   bound noerror count
 			   (unless isearch-forward 'backward))
@@ -1659,7 +1665,7 @@
       (isearch-search-fun))))
 
 (defun Info-isearch-wrap ()
-  (when (and Info-isearch-search (not isearch-word))
+  (when Info-isearch-search
     (if isearch-forward (Info-top-node) (Info-final-node))
     (goto-char (if isearch-forward (point-min) (point-max)))))

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

  reply	other threads:[~2005-02-25 19:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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         ` Juri Linkov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ll9cl8aq.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=dann@godzilla.ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).