From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gerlach Subject: Re: Possible bug: Can not search for text in links - only description Date: Sat, 21 Mar 2015 20:08:48 -0400 Message-ID: References: <8980B71E-2016-4148-B1C7-75EEA276AB1C@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZTRi-0005bs-2f for emacs-orgmode@gnu.org; Sat, 21 Mar 2015 20:08:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZTRg-0000IZ-SK for emacs-orgmode@gnu.org; Sat, 21 Mar 2015 20:08:50 -0400 Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]:35170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZTRg-0000IV-Nq for emacs-orgmode@gnu.org; Sat, 21 Mar 2015 20:08:48 -0400 Received: by qcbkw5 with SMTP id kw5so120912105qcb.2 for ; Sat, 21 Mar 2015 17:08:48 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode On Sat, Mar 21, 2015 at 7:34 PM, Alexis wrote: > > On 2015-03-21T01:59:07+1100, Richard Lawrence > 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 wrote: > You *can* search in links without changing modes. > > 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 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.