1

Is there a way to search in org mode in emacs in a certain subtree without narrowing or "narrowing" and "widening" the way to go?

4
  • 1
    Why do you believe there is any need to narrow when searching in org-mode? How about using: org-search-view, org-tags-view and org-agenda-list? See also the manual describing advanced searching techniques: orgmode.org/worg/org-tutorials/advanced-searching.html
    – lawlist
    Nov 12 '20 at 23:04
  • but i want to search in a special tree @lawlist
    – David
    Nov 12 '20 at 23:29
  • 1
    @David - Would you provide an example please? I'm not sure what you're searching for or the reason for the search. There might be a really easy way to do exactly what you want but I need some additional information.
    – Melioratus
    Nov 13 '20 at 0:40
  • I have different trees in org mode like *test *notes. And under each note there is some writing, but i want to just search in the writing under *test, but not from *notes
    – David
    Nov 13 '20 at 1:28
1

Can you easily select a tree that you want to search? I don't use Org, but I imagine there are commands to do that kind of thing: select specific subtrees etc.

If you use Isearch+ (code: isearch+.el) then you can limit isearch to within the active region - you need not narrow to the region.

That lets you continue to see the surrounding context. (You can optionally dim it a bit, to concentrate on the text you're searching.)

You can also limit isearch to a multi-region, that is, to a set of zones (which are easy to define, either interactively or programmatically) or its complement. For this, you also need library Zones or library isearch-prop.el.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.