From: Leo <sdl.web@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Teach isearch to open invisible only if visible search failed?
Date: Sun, 05 Dec 2010 06:41:40 +0000 [thread overview]
Message-ID: <m1oc90bu1n.fsf@cam.ac.uk> (raw)
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
next reply other threads:[~2010-12-05 6:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-05 6:41 Leo [this message]
2010-12-05 6:52 ` Teach isearch to open invisible only if visible search failed? Suvayu Ali
2010-12-05 7:01 ` Leo
2010-12-05 7:32 ` Thierry Volpiatto
2010-12-05 7:43 ` Leo
2010-12-05 11:52 ` Thien-Thi Nguyen
2010-12-05 12:45 ` Leo
2010-12-05 15:19 ` Drew Adams
2010-12-05 17:29 ` Leo
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1oc90bu1n.fsf@cam.ac.uk \
--to=sdl.web@gmail.com \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.