emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Possible bug: Can not search for text in links - only descriptio


From: Jacob Gerlach
Subject: Re: [O] Possible bug: Can not search for text in links - only description
Date: Sat, 21 Mar 2015 20:08:48 -0400

On Sat, Mar 21, 2015 at 7:34 PM, Alexis <address@hidden> wrote:
>
> On 2015-03-21T01:59:07+1100, Richard Lawrence
> <address@hidden> 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 ()
  (interactive)
  (let ((search-invisible t))
    (isearch-forward)))

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 <address@hidden> 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 <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]