From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.help Subject: Teach isearch to open invisible only if visible search failed? Date: Sun, 05 Dec 2010 06:41:40 +0000 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291531342 2903 80.91.229.12 (5 Dec 2010 06:42:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Dec 2010 06:42:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 05 07:42:19 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PP8Ic-0006ex-Ig for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Dec 2010 07:42:18 +0100 Original-Received: from localhost ([127.0.0.1]:54799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PP8Ic-0002p1-5L for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Dec 2010 01:42:18 -0500 Original-Received: from [140.186.70.92] (port=50456 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PP8II-0002ov-2p for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 01:41:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PP8IH-0005Ys-1H for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 01:41:57 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:55533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PP8IG-0005YQ-RO for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 01:41:56 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PP8ID-0006XT-2I for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 07:41:53 +0100 Original-Received: from cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com ([86.9.122.85]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Dec 2010 07:41:53 +0100 Original-Received: from sdl.web by cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Dec 2010 07:41:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAElBMVEUAAAAAAP+LRRP0pGC+ vr7///+7mT1iAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMO DhglKe4AAAEsSURBVCjPbZNBboQwDEV/Cd4X9QJRThApmn0XYW+Jyf2v0m+HhqDBgiAe9rcTG7QH w/1Vn2Ar8gBb/ocywSN3qK9T3z4eFDB4eApocBpeBs1RSykoJd8gQcm8pGmHXFso3ajnmsqV0TnY DQkOfXUfN5NwaI7AWTVOyEhcu1aHmdWItHddUVUcUgUBCkitu8V6ditHVOVdqzl2EQ1ZVGTbdK0V 7cqn8vWzoU5Q/bF9Y/Y0cRU1xwkys5dJ+Dt6pBDWifcNQml8Gh2JVmPSoQzo7en0grswkxrUGYJ7 0hSxxAGr7ZMwYcHIzprpi7TENEE1xtiYxixRlCfPBsUUrwHD7uGIwATrbnODJcVrPpVn3hxiGloe m/S+z3CtuzUSMo83N4DPH+F0evwR3P4A2k+75838OKQAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.90 (Mac OS X 10.6.5) Cancel-Lock: sha1:c94r7Ef5Bfx68ZP8ZTKpDo53cLk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75502 Archived-At: Hello all Emacsen, I use C-s/r for navigating around text a lot and I have found it slows me down in large text shown in outline structure in outline or org mode etc. So I wonder how to set up isearch so that it only opens invisible text when search in the visible fails. My attempt is like this but it doesn't work as smoothly as I'd like. (setq search-invisible nil) (add-hook 'isearch-update-post-hook (lambda () (when (and (or (not isearch-success) isearch-error) ;; prevent infinite loop (not (eq search-invisible 'open))) (setq search-invisible 'open) (isearch-search) (isearch-update)))) (add-hook 'isearch-mode-end-hook (lambda () (setq search-invisible nil))) I wonder if someone familiar with isearch can propose a better setup. Thanks in advance. Leo