Suvayu Ali <fatkasuvayu+li...@gmail.com> writes: Hi Suvayu,
> On Tue, Jun 11, 2013 at 04:42:28PM +0200, Thorsten Jolitz wrote: >> Suvayu Ali <fatkasuvayu+li...@gmail.com> writes: >> >> > I wonder if semantic search can be leveraged to achieve the same. It >> > might open other possibilities: searching only links, list items, source >> > blocks, ... I think you get the point. :-p >> >> navi-mode.el works for Org-mode buffers too, e.g. using > > I think you misunderstood somewhat what I was suggesting. > > As far as I understand, navi-mode uses an interface like occur; it > presents a separate buffer with the results which you can then use to > navigate to the results. Am I correct? yes, it works on top of occur-mode in a separate buffer, but *Navi* buffer are permanent, and there can exist many of them at the same time. > What I was suggesting (and how I understood the OPs question) was, to > restrict regular (i)search to headlines. [...] > As far as I know, functionality like this exists for traditional source > code buffers using semantic search. I was wondering if it is possible > to leverage that mechanism to get the behaviour described above. If it > is indeed possible, it could be hacked to work for other Org syntax > elements like links, lists, source blocks, drawers, etc. > > Hopefully I didn't misunderstand your post and I was clearer expressing > myself this time. I think I more or less understood what the thread was about, but thanks anyway for the clarification. Of course navi-mode does not offer "semantic search" within an Org-mode buffer. But for practical purposes it might be worth mentioning that typing one digit between 1 and 8 and then C-s or C-r in the *Navi* buffer lets you already search easily only in the headlines of an Org file. And many other views on a file are possible, that can then be searched by standard commands. With keyboard macros and switching between original buffer and *Navi* buffer (and using org-mark-element e.g.), a lot can be achieved without the need of writing any elisp code. -- Cheers, Thorsten