From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Info-search-isearch Date: Fri, 25 Feb 2005 21:59:57 +0200 Organization: JURTA Message-ID: <87ll9cl8aq.fsf@jurta.org> References: <87brcfds60.fsf@jurta.org> <200502211754.j1LHs9AH027463@scanner2.ics.uci.edu> <878y5fqix8.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1109362164 14338 80.91.229.2 (25 Feb 2005 20:09:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 25 Feb 2005 20:09:24 +0000 (UTC) Cc: dann@godzilla.ics.uci.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 25 21:09:24 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D4lln-0001Sy-OL for ged-emacs-devel@m.gmane.org; Fri, 25 Feb 2005 21:09:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D4m3c-0006gY-7f for ged-emacs-devel@m.gmane.org; Fri, 25 Feb 2005 15:27:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D4m3P-0006fW-KG for emacs-devel@gnu.org; Fri, 25 Feb 2005 15:27:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D4m3M-0006dy-CX for emacs-devel@gnu.org; Fri, 25 Feb 2005 15:27:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D4m3M-0006dt-63 for emacs-devel@gnu.org; Fri, 25 Feb 2005 15:27:12 -0500 Original-Received: from [194.126.101.98] (helo=MXR-4.estpak.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D4lpF-0002md-25; Fri, 25 Feb 2005 15:12:37 -0500 Original-Received: from mail.neti.ee (80-235-33-67-dsl.mus.estpak.ee [80.235.33.67]) by MXR-4.estpak.ee (Postfix) with ESMTP id D38AD129FC5; Fri, 25 Feb 2005 22:12:33 +0200 (EET) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Thu, 24 Feb 2005 08:55:44 -0500") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33811 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33811 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/