From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: Teach isearch to open invisible only if visible search failed? Date: Sun, 05 Dec 2010 08:32:57 +0100 Message-ID: <87ipz8ad3q.fsf@tux.homenetwork> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291534493 12382 80.91.229.12 (5 Dec 2010 07:34:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Dec 2010 07:34:53 +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 08:34:49 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 1PP97P-0001C8-QC for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Dec 2010 08:34:48 +0100 Original-Received: from localhost ([127.0.0.1]:42638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PP97P-0005qt-84 for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Dec 2010 02:34:47 -0500 Original-Received: from [140.186.70.92] (port=40178 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PP973-0005qk-Ki for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 02:34:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PP972-0007X1-Hn for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 02:34:25 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:55922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PP972-0007Wo-6S for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 02:34:24 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PP970-00016S-Vt for help-gnu-emacs@gnu.org; Sun, 05 Dec 2010 08:34:22 +0100 Original-Received: from 35.77.197-77.rev.gaoland.net ([77.197.77.35]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Dec 2010 08:34:22 +0100 Original-Received: from thierry.volpiatto by 35.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 05 Dec 2010 08:34:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 35.77.197-77.rev.gaoland.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFz UkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAABJQ TFRFBwQEXyQQT0tD2k0bqUEftLCW5J1oDQAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAl2cEFnAAAA MAAAADAAzu6MVwAAAZdJREFUOMt1U0FywyAMFLQPQLZ6N7R9gAO9F6N8wBP//ytdcDqNa6JDHO9K yyLJRL9hp4ks9SJMJ2hHQoe5E+EuemI+W8mwfvKRsLuYOEnt/ePrOu8KIayVYIlIMOaW5TrZvcIB sTzGmqlsSBR/zNu2bQ5PLvGChzKifBMxiFs9JLQKq1piLpHfPApWVJAfa4VojPF70K+bLOvGHgyk YKsAz5X3C4dpEFxBSkNAOJqsE3bB4jRnpKWa9otghl2TJdXUeo9mlRzxRAFpFnBMjw0pECS+EMwk dyBQacb0p/0b73hvdob/vS2Ll6PIPQbPvjdA63Xo4a/XpIxVOREvJc1kO4T9EA5rb1F85mC048po RJuW1p6jWzSvJJ2M5iU8FpjaV40zZu31oSnGc9aZy/yqiknPf4SIlMySacz6SJBCKWudrOqhwegT i8AvDtN8cGY0RWiw6nEg+8ZEueq/gZCpRJLlfPux7hjTOXD3lDs4/MQujg+AuzhxfkKUWTbXI8ao 9QvqnC2lu1iG+67gqb+JNvMTuwf8BxNSRJN3OGcZAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEwLTEx LTI2VDA4OjI0OjQxKzAxOjAw3lS1DwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMC0xMS0yNFQxMDo1 NDo1MiswMTowMDvcFUsAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:hRFIxO96nee0hLAULN8eQlx349s= 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:75505 Archived-At: Hi Leo, Leo writes: > 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. I have no setting for isearch as i don't use it or really few (i use only ioccur) but why not always opening all headers with `show-all' like ioccur does? > 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 > > > -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997