Re: [O] Inline tasks in agenda search

2011-08-05 Thread Nicolas Goaziou
Hello,

suvayu ali fatkasuvayu+li...@gmail.com writes:

 Hi again,

 On Mon, Aug 1, 2011 at 6:49 PM, suvayu ali fatkasuvayu+li...@gmail.com 
 wrote:
 On Mon, Aug 1, 2011 at 5:57 PM, suvayu ali fatkasuvayu+li...@gmail.com 
 wrote:
 Hi Orgers,

 Is there any way to ignore the END entries in inline tasks in agenda
 search results?

 Strangely now this works! Don't know what I changed.


 I was mistaken, the problem is still there. The second search simply
 didn't have the END entries which I mistakenly thought the problem was
 resolved. Let me try to outline the issue clearly again. Lets say I have
 this subtree:


 ** Bs⁰ mass :mass:

 Bs⁰ mass is reconstructed for
 + Bs⁰-Dsπ using the π mass hypothesis
 + Bs⁰-DsK using both the K and π mass hypothesis

 _Questions_:
 *** π hypothesis:Qn:
   Why π hypothesis is considered only for DsK, and why
   not K hypothesis for Dsπ?
 *** END


 Now if I search for the tag mass (C-c a m mass RET), I get a search
 result like this:


 analysis: Bs⁰ mass  :mass:
 analysis: π hypothesis  :mass::Qn:
 analysis: END  :mass::


 The first 2 results are just what I expect. But the END from the inline
 task shows up in the agenda too! Is there anyway to get rid of that?

You could add the following test, which will return a non-nil value for
the closing of an inline-task, in `org-agenda-skip-function':

#+begin_src org
(and (featurep 'org-inlinetask)
 (let ((case-fold-search t))
   (org-looking-at-p (concat (org-inlinetask-outline-regexp) end[ 
\t]*$
#+end_src

Regards,

-- 
Nicolas Goaziou



Re: [O] Inline tasks in agenda search

2011-08-05 Thread Suvayu Ali
Hi Nicolas,

Thanks a lot for your response.

On Fri, 05 Aug 2011 10:53:43 +0200
Nicolas Goaziou n.goaz...@gmail.com wrote:

 #+begin_src org
 (and (featurep 'org-inlinetask)
  (let ((case-fold-search t))
(org-looking-at-p (concat (org-inlinetask-outline-regexp)
 end[ \t]*$ #+end_src

I tried this:

(setq org-agenda-skip-function '(and (featurep 'org-inlinetask)
 (let ((case-fold-search t))
   (org-looking-at-p (concat 
(org-inlinetask-outline-regexp) end[ \t]*$)


But performing a search where an END entry would otherwise show up
causes the following error. A search without END in the result
completes cleanly though.


Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p t)
  org-agenda-skip()
  byte-code(..)
  org-scan-tags(agenda (and (progn (setq org-cached-props nil) (member Dsh 
tags-list)) t) nil)
  byte-code(..)
  org-tags-view(nil)
  call-interactively(org-tags-view)
  byte-code(..)
  org-agenda(nil)
  call-interactively(org-agenda nil nil)


-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Inline tasks in agenda search

2011-08-05 Thread Nicolas Goaziou
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 I tried this:

 (setq org-agenda-skip-function '(and (featurep 'org-inlinetask)
(let ((case-fold-search t))
  (org-looking-at-p (concat 
 (org-inlinetask-outline-regexp) end[ \t]*$)


 But performing a search where an END entry would otherwise show up
 causes the following error. A search without END in the result
 completes cleanly though.

It's because I only gave you a part of the required function. Also, if
you look at the doc-string, you'll see that:
 1. it should return the position to continue the search from;
 2. you should set `org-agenda-skip-function-global' instead.

So, you can try:

#+begin_src org
(setq org-agenda-skip-function-global
  (lambda ()
(when (and (featurep 'org-inlinetask)
   (let ((case-fold-search t))
 (org-looking-at-p (concat (org-inlinetask-outline-regexp)
   end[ \t]*$
  (or (save-excursion (outline-next-heading)) (point-max)
#+end_src

Regards,

-- 
Nicolas Goaziou



Re: [O] Inline tasks in agenda search

2011-08-05 Thread suvayu ali
Hi Nicolas,

On Fri, Aug 5, 2011 at 12:00 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 It's because I only gave you a part of the required function. Also, if
 you look at the doc-string, you'll see that:
  1. it should return the position to continue the search from;

That was extremely dense of me. I wasn't thinking properly.

  2. you should set `org-agenda-skip-function-global' instead.


Yes, I tried that first but it didn't work (obviously because of not
using the lambda!), so I tried the normal one.

Thanks a lot, works great now.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Inline tasks in agenda search

2011-08-02 Thread suvayu ali
Hi again,

On Mon, Aug 1, 2011 at 6:49 PM, suvayu ali fatkasuvayu+li...@gmail.com wrote:
 On Mon, Aug 1, 2011 at 5:57 PM, suvayu ali fatkasuvayu+li...@gmail.com 
 wrote:
 Hi Orgers,

 Is there any way to ignore the END entries in inline tasks in agenda
 search results?

 Strangely now this works! Don't know what I changed.


I was mistaken, the problem is still there. The second search simply
didn't have the END entries which I mistakenly thought the problem was
resolved. Let me try to outline the issue clearly again. Lets say I have
this subtree:


** Bs⁰ mass :mass:

Bs⁰ mass is reconstructed for
+ Bs⁰-Dsπ using the π mass hypothesis
+ Bs⁰-DsK using both the K and π mass hypothesis

_Questions_:
*** π hypothesis  :Qn:
Why π hypothesis is considered only for DsK, and why
not K hypothesis for Dsπ?
*** END


Now if I search for the tag mass (C-c a m mass RET), I get a search
result like this:


analysis: Bs⁰ mass  :mass:
analysis: π hypothesis  :mass::Qn:
analysis: END  :mass::


The first 2 results are just what I expect. But the END from the inline
task shows up in the agenda too! Is there anyway to get rid of that?

Thanks a lot for any ideas.

-- 
Suvayu

Open source is the future. It sets us free.



[O] Inline tasks in agenda search

2011-08-01 Thread suvayu ali
Hi Orgers,

Is there any way to ignore the END entries in inline tasks in agenda
search results?

To give you an example the following entry:

*** Detector effects:Qn:
1. How is the Gaussian used for smearing of proper
   time resolution derived?
2. Why is the proper time error PDF needed? Why is
   smearing of time resolution not enough?
*** END

shows up in an agenda tag search for Qn (C-c a m Qn RET) as below.

analysis: Detector effects  :Qn:
analysis: END   :Qn:

My question is how do I ignore the entry END in the search results?

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Inline tasks in agenda search

2011-08-01 Thread suvayu ali
On Mon, Aug 1, 2011 at 5:57 PM, suvayu ali fatkasuvayu+li...@gmail.com wrote:
 Hi Orgers,

 Is there any way to ignore the END entries in inline tasks in agenda
 search results?

Strangely now this works! Don't know what I changed.

-- 
Suvayu

Open source is the future. It sets us free.