[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Teach isearch to open invisible only if visible search failed?
From: |
Thierry Volpiatto |
Subject: |
Re: Teach isearch to open invisible only if visible search failed? |
Date: |
Sun, 05 Dec 2010 08:32:57 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Hi Leo,
Leo <sdl.web@gmail.com> 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