emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jacob Gerlach <jacobgerlach@gmail.com>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Possible bug: Can not search for text in links - only description
Date: Sat, 21 Mar 2015 20:08:48 -0400	[thread overview]
Message-ID: <CAA6UvuGnyhEZLh1sH3qwd1sdz2ZTL=CmqAu7jEVXDv=foa0CzQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.OSX.2.00.1503201057030.492@charles-berrys-macbook.local>

On Sat, Mar 21, 2015 at 7:34 PM, Alexis <flexibeast@gmail.com> wrote:
>
> On 2015-03-21T01:59:07+1100, Richard Lawrence
> <richard.lawrence@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 ()
  (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 <ccberry@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 <randomcoder1@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	other threads:[~2015-03-22  0:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 13:44 Possible bug: Can not search for text in links - only description Rainer M Krug
2015-03-20 14:59 ` Richard Lawrence
2015-03-20 15:20   ` Sebastien Vauban
2015-03-21 23:34   ` Alexis
2015-03-20 15:38 ` Jacob Gerlach
2015-03-20 16:50   ` Ken Mankoff
2015-03-20 18:06     ` Charles C. Berry
2015-03-22  0:08       ` Jacob Gerlach [this message]
2015-03-23 12:42       ` Rainer M Krug
2015-03-23 14:37         ` Achim Gratz
2015-03-23 16:56           ` Rainer M Krug
2015-03-23 12:40   ` Rainer M Krug
2015-03-20 17:53 ` Samuel Wales
2015-03-20 17:57   ` Jacob Gerlach
2015-03-31 13:46   ` Ken Mankoff
2015-03-31 20:07     ` Samuel Wales
2015-03-21 23:45 ` Randomcoder
2015-03-23 12:45 ` Rainer M Krug
2015-03-23 12:57   ` Jacob Gerlach

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA6UvuGnyhEZLh1sH3qwd1sdz2ZTL=CmqAu7jEVXDv=foa0CzQ@mail.gmail.com' \
    --to=jacobgerlach@gmail.com \
    --cc=emacs-orgmode@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).