emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Single Search Hit and Quick Jump
@ 2014-03-12  0:30 Esben Stien
  2014-03-12 16:27 ` Bastien
  2014-06-15 19:58 ` Sacha Chua
  0 siblings, 2 replies; 5+ messages in thread
From: Esben Stien @ 2014-03-12  0:30 UTC (permalink / raw)
  To: emacs-orgmode

I have a long tree, like this: 

* foo
** bar
*** baz
**** hukarz
**** qux
**** quux
*** corge
**** grault
text: corge
**** garply
text: corge
*** azerty
**** plugh
text: corge
**** ethud
corge

Now, If I f.ex do C-c a s corge, I get multiple hits, but I really only
search for level 3 items always. Is there any way to restrict the search
to only level 3 items?

Also, when I find a result, I want to jump to the last item in that
tree, so if I search for "corge", I want to end up with point on the
level 4 item "**** garply"

Any pointers as to how I can do this?

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Single Search Hit and Quick Jump
  2014-03-12  0:30 Single Search Hit and Quick Jump Esben Stien
@ 2014-03-12 16:27 ` Bastien
  2014-03-12 22:17   ` Esben Stien
  2014-06-15 19:58 ` Sacha Chua
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien @ 2014-03-12 16:27 UTC (permalink / raw)
  To: Esben Stien; +Cc: emacs-orgmode

Hi Esben,

Esben Stien <b0ef@esben-stien.name> writes:

> Now, If I f.ex do C-c a s corge, I get multiple hits, but I really only
> search for level 3 items always. Is there any way to restrict the search
> to only level 3 items?

You can have a custom agenda command like this one:

    (setq org-agenda-custom-commands
       '(("c" "Level 3 courge" tags "+LEVEL=3"
          ((org-agenda-regexp-filter-preset '("+corge"))))))

> Also, when I find a result, I want to jump to the last item in that
> tree, so if I search for "corge", I want to end up with point on the
> level 4 item "**** garply"

You can hack around `org-agenda-after-show-hook'.

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Single Search Hit and Quick Jump
  2014-03-12 16:27 ` Bastien
@ 2014-03-12 22:17   ` Esben Stien
  2014-03-13  8:41     ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Esben Stien @ 2014-03-12 22:17 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> You can have a custom agenda command like this one:
>
>     (setq org-agenda-custom-commands
>        '(("c" "Level 3 courge" tags "+LEVEL=3"
>           ((org-agenda-regexp-filter-preset '("+corge"))))))

Yeah, that works nicely;), but it's a hardcoded search string. How would
you pass a search string, like C-c a s? I looked at org-search-view, but
got lost pretty quick. 

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Single Search Hit and Quick Jump
  2014-03-12 22:17   ` Esben Stien
@ 2014-03-13  8:41     ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2014-03-13  8:41 UTC (permalink / raw)
  To: Esben Stien; +Cc: emacs-orgmode

Hi Esben,

Esben Stien <b0ef@esben-stien.name> writes:

> Bastien <bzg@gnu.org> writes:
>
>> You can have a custom agenda command like this one:
>>
>>     (setq org-agenda-custom-commands
>>        '(("c" "Level 3 courge" tags "+LEVEL=3"
>>           ((org-agenda-regexp-filter-preset '("+corge"))))))
>
> Yeah, that works nicely;), but it's a hardcoded search string. How would
> you pass a search string, like C-c a s?

I would not.  I would simply have a +LEVEL=3 agenda view and manually
do = search-string in the agenda buffer.

`=' is certainly not known enough as a filter agenda command.

> I looked at org-search-view, but got lost pretty quick.

Stay with us :)

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Single Search Hit and Quick Jump
  2014-03-12  0:30 Single Search Hit and Quick Jump Esben Stien
  2014-03-12 16:27 ` Bastien
@ 2014-06-15 19:58 ` Sacha Chua
  1 sibling, 0 replies; 5+ messages in thread
From: Sacha Chua @ 2014-06-15 19:58 UTC (permalink / raw)
  To: emacs-orgmode

Esben Stien <b0ef@esben-stien.name> writes:

Hello, Esben!

(Digging up old thread, sorry!)

> Now, If I f.ex do C-c a s corge, I get multiple hits, but I really only
> search for level 3 items always. Is there any way to restrict the search
> to only level 3 items?

Would you consider defining org-refile-targets and then using C-u M-x
org-refile (which you can bind to a handy keyboard shortcut, of
course)? org-refile-targets lets you specify the level or maxlevel to
consider, and C-u for org-refile jumps instead of refiling.

> Also, when I find a result, I want to jump to the last item in that
> tree, so if I search for "corge", I want to end up with point on the
> level 4 item "**** garply"

Something like (org-end-of-subtree) and (org-back-to-heading), maybe
in a custom function or in a hook?

Sacha

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-15 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12  0:30 Single Search Hit and Quick Jump Esben Stien
2014-03-12 16:27 ` Bastien
2014-03-12 22:17   ` Esben Stien
2014-03-13  8:41     ` Bastien
2014-06-15 19:58 ` Sacha Chua

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).