On Sat, Mar 21, 2015 at 7:34 PM, Alexis <flexibe...@gmail.com> wrote:
> On 2015-03-21T01:59:07+1100, Richard Lawrence
> <richard.lawre...@berkeley.edu> said:
> RL> I am not sure if this counts as a bug or not, so someone else
> RL> should still address this question.  Maybe this is the desired
> RL> behavior, given that the link text is hidden?  Or maybe it's just
> RL> not possible to search in hidden text?
> Cf. the `search-invisible` variable:

`search-invisible' is less helpful that one might think.

I think that the difficulty arises from the fact that links use the
invisibility text property. Folded trees, OTOH, use an invisibility
overlay. Overlay invisibility is searched (and expanded for matches)
when `search-invisible' is set to `open' (the default). While you can
/search/ invisible text, AFAICT, isearch has no machinery to /show/
invisible text (just to "open" invisibility overlays). You can set
`search-invisible' to `t', but then your search is likely to end up on
the ellipses for a folded subtree (since it will no longer unfold).

With `search-invisible' set to `t', point does end up on (still
invisible) matches. I tried cobbling together a hack like:

(add-hook 'isearch-update-post-hook
          (lambda ()
            (if isearch-hidden
                (org-remove-from-invisibility-spec '(org-link))
              (add-to-invisibility-spec '(org-link)))))

(defun jg/isearch ()
  (let ((search-invisible t))

But besides not opening overlays, I think you'd need a similar
function on a couple more isearch hooks to make this work.

On Fri, Mar 20, 2015 at 2:06 PM, Charles C. Berry <ccbe...@ucsd.edu> wrote:
> You *can* search in links without changing modes.
> <menu-bar> <edit> <search> <search-forward> Exa RET
> runs nonincremental-search-forward on "Exa" and  finds Rainier's `*Example'
> if point preceeds it.

search-forward suffers from the same problem as setting
`search-invisible' to `t' - folded subtrees don't open. I suppose you
could expand the whole tree first and then use it.

> M-x occur RET Exa RET

This worked well for me.

On Sat, Mar 21, 2015 at 7:45 PM, Randomcoder <randomcod...@gmail.com> wrote:
> In terms of searching through all open buffers,
> here is what I use (helm and helm-multi-occur):
Can you comment on the capability to search invisible text (such as
the invisible path for an org link)? For the problem at hand, there's
no need to search multiple buffers, just to search the invisible text
in a given buffer.

For the (hopefully) infrequent case of finding a mistyped link,
`org-toggle-link-display' or M-x occur should be adequate.

Reply via email to