emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Inline tasks in agenda search
@ 2011-08-01 15:57 suvayu ali
  2011-08-01 16:49 ` suvayu ali
  0 siblings, 1 reply; 7+ messages in thread
From: suvayu ali @ 2011-08-01 15:57 UTC (permalink / raw)
  To: org-mode mailing list

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.

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

* Re: Inline tasks in agenda search
  2011-08-01 15:57 Inline tasks in agenda search suvayu ali
@ 2011-08-01 16:49 ` suvayu ali
  2011-08-03  1:32   ` suvayu ali
  0 siblings, 1 reply; 7+ messages in thread
From: suvayu ali @ 2011-08-01 16:49 UTC (permalink / raw)
  To: org-mode mailing list

On Mon, Aug 1, 2011 at 5:57 PM, suvayu ali <fatkasuvayu+linux@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.

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

* Re: Inline tasks in agenda search
  2011-08-01 16:49 ` suvayu ali
@ 2011-08-03  1:32   ` suvayu ali
  2011-08-05  8:53     ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: suvayu ali @ 2011-08-03  1:32 UTC (permalink / raw)
  To: org-mode mailing list

Hi again,

On Mon, Aug 1, 2011 at 6:49 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> On Mon, Aug 1, 2011 at 5:57 PM, suvayu ali <fatkasuvayu+linux@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.

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

* Re: Inline tasks in agenda search
  2011-08-03  1:32   ` suvayu ali
@ 2011-08-05  8:53     ` Nicolas Goaziou
  2011-08-05  9:29       ` Suvayu Ali
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2011-08-05  8:53 UTC (permalink / raw)
  To: suvayu ali; +Cc: org-mode mailing list

Hello,

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hi again,
>
> On Mon, Aug 1, 2011 at 6:49 PM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
>> On Mon, Aug 1, 2011 at 5:57 PM, suvayu ali <fatkasuvayu+linux@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

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

* Re: Inline tasks in agenda search
  2011-08-05  8:53     ` Nicolas Goaziou
@ 2011-08-05  9:29       ` Suvayu Ali
  2011-08-05 10:00         ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Suvayu Ali @ 2011-08-05  9:29 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode mailing list

Hi Nicolas,

Thanks a lot for your response.

On Fri, 05 Aug 2011 10:53:43 +0200
Nicolas Goaziou <n.goaziou@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.

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

* Re: Inline tasks in agenda search
  2011-08-05  9:29       ` Suvayu Ali
@ 2011-08-05 10:00         ` Nicolas Goaziou
  2011-08-05 11:23           ` suvayu ali
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2011-08-05 10:00 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: org-mode mailing list

Suvayu Ali <fatkasuvayu+linux@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

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

* Re: Inline tasks in agenda search
  2011-08-05 10:00         ` Nicolas Goaziou
@ 2011-08-05 11:23           ` suvayu ali
  0 siblings, 0 replies; 7+ messages in thread
From: suvayu ali @ 2011-08-05 11:23 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode mailing list

Hi Nicolas,

On Fri, Aug 5, 2011 at 12:00 PM, Nicolas Goaziou <n.goaziou@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.

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

end of thread, other threads:[~2011-08-05 11:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01 15:57 Inline tasks in agenda search suvayu ali
2011-08-01 16:49 ` suvayu ali
2011-08-03  1:32   ` suvayu ali
2011-08-05  8:53     ` Nicolas Goaziou
2011-08-05  9:29       ` Suvayu Ali
2011-08-05 10:00         ` Nicolas Goaziou
2011-08-05 11:23           ` suvayu ali

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