From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: A simple way to search only headlines Date: Wed, 12 Jun 2013 01:55:59 +0200 Message-ID: <8738sop5gw.fsf@gmail.com> References: <86k3mae2mo.fsf@somewhere.org> <87mwr1egjr.fsf@berkeley.edu> <87ip1pkwco.fsf@pierrot.dokosmarshall.org> <86bo7e4dww.fsf@somewhere.org> <87d2ruktd0.fsf@pierrot.dokosmarshall.org> <86txl60zy5.fsf@somewhere.org> <87bo7di7zf.fsf@pierrot.dokosmarshall.org> <20130611122757.GB18792@kuru.dyndns-at-home.com> <87zjuwhfor.fsf@gmail.com> <20130611220112.GB30597@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmYQN-0005D7-BP for emacs-orgmode@gnu.org; Tue, 11 Jun 2013 19:56:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmYQA-0006dp-B7 for emacs-orgmode@gnu.org; Tue, 11 Jun 2013 19:56:27 -0400 Received: from plane.gmane.org ([80.91.229.3]:45343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmYQA-0006dc-2F for emacs-orgmode@gnu.org; Tue, 11 Jun 2013 19:56:14 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UmYQ8-0002jf-8k for emacs-orgmode@gnu.org; Wed, 12 Jun 2013 01:56:12 +0200 Received: from g231227170.adsl.alicedsl.de ([92.231.227.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Jun 2013 01:56:12 +0200 Received: from tjolitz by g231227170.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Jun 2013 01:56:12 +0200 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: emacs-orgmode@gnu.org Suvayu Ali writes: Hi Suvayu, > On Tue, Jun 11, 2013 at 04:42:28PM +0200, Thorsten Jolitz wrote: >> Suvayu Ali 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