Re: [O] Single Search Hit and Quick Jump

2014-06-15 Thread Sacha Chua
Esben Stien  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




Re: [O] Single Search Hit and Quick Jump

2014-03-13 Thread Bastien
Hi Esben,

Esben Stien  writes:

> Bastien  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



Re: [O] Single Search Hit and Quick Jump

2014-03-12 Thread Esben Stien
Bastien  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 tn m
  irc://irc.  b  -  i  .   e/%23contact
   sip:b0ef@   e e 
   jid:b0ef@n n



Re: [O] Single Search Hit and Quick Jump

2014-03-12 Thread Bastien
Hi Esben,

Esben Stien  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



[O] Single Search Hit and Quick Jump

2014-03-11 Thread Esben Stien
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 tn m
  irc://irc.  b  -  i  .   e/%23contact
   sip:b0ef@   e e 
   jid:b0ef@n n