emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)]
@ 2009-11-25 18:54 Bernt Hansen
  2009-11-26  6:02 ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Bernt Hansen @ 2009-11-25 18:54 UTC (permalink / raw)
  To: emacs-orgmode


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

I have a function that excludes tasks in the agenda using / RET
(auto-exclude.)  This works in release_6.33f but is broken on the
current master.

One of the following commits breaks it:

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
c6186f49b361dcb2ef05bf769c9abf80307bd658
1a0e1a6f07303aa935a643863c7cb85264e73481

Excluding tasks by FILETAGS only breaks for me.

The tag 'MARK' is a

    #+FILETAGS: MARK

entry only in mark.org.  Auto Exclusion of the MARK tag no longer
works with the current master.

My auto exclude functions are inline below:

-Bernt

--8<---------------cut here---------------start------------->8---
(defun bh/weekday-p ()
  (let ((wday (nth 6 (decode-time))))
    (and (< wday 6)
	 (> wday 0))))

(defun bh/working-p ()
  (let ((hour (nth 2 (decode-time))))
    (and (bh/weekday-p)
	 (or (and (>= hour 8) (<= hour 11))
	     (and (>= hour 13) (<= hour 16))))))

(defun bh/mark-p ()
  (let ((hour (nth 2 (decode-time))))
    (or (and (bh/weekday-p)
	     (or (= hour 8)
		 (and (>= hour 16) (<= hour 20))))
	(and (not (bh/weekday-p))
	     (>= hour 9)
	     (<= hour 20)))))

(defun bh/org-auto-exclude-function (tag)
  (and (cond
	((string= tag "@home")
	 (bh/working-p))
	((string= tag "@office")
	 (not (bh/working-p)))
	((string= tag "MARK")
	 (not (bh/mark-p)))
	((or (string= tag "@errand") (string= tag "PHONE"))
	 (let ((hour (nth 2 (decode-time))))
	   (or (< hour 8) (> hour 21)))))
       (concat "-" tag)))

(setq org-agenda-auto-exclude-function 'bh/org-auto-exclude-function)
--8<---------------cut here---------------end--------------->8---




Emacs  : GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-11-09 on raven, modified by Debian
Package: Org-mode version 6.33trans (release_6.33f.34.gf806)

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

* Re: Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)]
  2009-11-25 18:54 Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)] Bernt Hansen
@ 2009-11-26  6:02 ` Carsten Dominik
  2009-11-26 10:55   ` Bernt Hansen
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-11-26  6:02 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


On Nov 25, 2009, at 7:54 PM, Bernt Hansen wrote:

>
> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?   
> See
>
>     http://orgmode.org/manual/Feedback.html#Feedback
>
> Your bug report will be posted to the Org-mode mailing list.
> ------------------------------------------------------------------------
>
> I have a function that excludes tasks in the agenda using / RET
> (auto-exclude.)  This works in release_6.33f but is broken on the
> current master.
>
> One of the following commits breaks it:
>
> There are only 'skip'ped commits left to test.
> The first bad commit could be any of:
> c6186f49b361dcb2ef05bf769c9abf80307bd658
> 1a0e1a6f07303aa935a643863c7cb85264e73481
>
> Excluding tasks by FILETAGS only breaks for me.
>
> The tag 'MARK' is a
>
>    #+FILETAGS: MARK
>
> entry only in mark.org.  Auto Exclusion of the MARK tag no longer
> works with the current master.
>
> My auto exclude functions are inline below:
>
> -Bernt
>
> --8<---------------cut here---------------start------------->8---
> (defun bh/weekday-p ()
>  (let ((wday (nth 6 (decode-time))))
>    (and (< wday 6)
> 	 (> wday 0))))
>
> (defun bh/working-p ()
>  (let ((hour (nth 2 (decode-time))))
>    (and (bh/weekday-p)
> 	 (or (and (>= hour 8) (<= hour 11))
> 	     (and (>= hour 13) (<= hour 16))))))
>
> (defun bh/mark-p ()
>  (let ((hour (nth 2 (decode-time))))
>    (or (and (bh/weekday-p)
> 	     (or (= hour 8)
> 		 (and (>= hour 16) (<= hour 20))))
> 	(and (not (bh/weekday-p))
> 	     (>= hour 9)
> 	     (<= hour 20)))))
>
> (defun bh/org-auto-exclude-function (tag)
>  (and (cond
> 	((string= tag "@home")
> 	 (bh/working-p))
> 	((string= tag "@office")
> 	 (not (bh/working-p)))
> 	((string= tag "MARK")
> 	 (not (bh/mark-p)))
> 	((or (string= tag "@errand") (string= tag "PHONE"))
> 	 (let ((hour (nth 2 (decode-time))))
> 	   (or (< hour 8) (> hour 21)))))
>       (concat "-" tag)))
>
> (setq org-agenda-auto-exclude-function 'bh/org-auto-exclude-function)

Hi Bernt,

do you get it back to when when replacing "MARK" with "mark" and
"PHONE" wiht "phone"?

- Carsten

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

* Re: Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)]
  2009-11-26  6:02 ` Carsten Dominik
@ 2009-11-26 10:55   ` Bernt Hansen
  2009-11-26 11:03     ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Bernt Hansen @ 2009-11-26 10:55 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Nov 25, 2009, at 7:54 PM, Bernt Hansen wrote:
>
>>
>> My auto exclude functions are inline below:
>>
>> (defun bh/org-auto-exclude-function (tag)
>>  (and (cond
>> 	((string= tag "@home")
>> 	 (bh/working-p))
>> 	((string= tag "@office")
>> 	 (not (bh/working-p)))
>> 	((string= tag "MARK")
>> 	 (not (bh/mark-p)))
>> 	((or (string= tag "@errand") (string= tag "PHONE"))
>> 	 (let ((hour (nth 2 (decode-time))))
>> 	   (or (< hour 8) (> hour 21)))))
>>       (concat "-" tag)))
>>
>
> do you get it back to when when replacing "MARK" with "mark" and
> "PHONE" wiht "phone"?

Yes.  When I make the tags lowercase in the function above it works
again.

Thanks!

-Bernt

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

* Re: Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)]
  2009-11-26 10:55   ` Bernt Hansen
@ 2009-11-26 11:03     ` Carsten Dominik
  2009-11-26 11:21       ` Bernt Hansen
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-11-26 11:03 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


On Nov 26, 2009, at 11:55 AM, Bernt Hansen wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Nov 25, 2009, at 7:54 PM, Bernt Hansen wrote:
>>
>>>
>>> My auto exclude functions are inline below:
>>>
>>> (defun bh/org-auto-exclude-function (tag)
>>> (and (cond
>>> 	((string= tag "@home")
>>> 	 (bh/working-p))
>>> 	((string= tag "@office")
>>> 	 (not (bh/working-p)))
>>> 	((string= tag "MARK")
>>> 	 (not (bh/mark-p)))
>>> 	((or (string= tag "@errand") (string= tag "PHONE"))
>>> 	 (let ((hour (nth 2 (decode-time))))
>>> 	   (or (< hour 8) (> hour 21)))))
>>>      (concat "-" tag)))
>>>
>>
>> do you get it back to when when replacing "MARK" with "mark" and
>> "PHONE" wiht "phone"?
>
> Yes.  When I make the tags lowercase in the function above it works
> again.

The docstring of org-agenda-auto-exclude-function does mention this,
but it is indeed a change from John's original code - so it was not in  
the docstring when you wrote this function..

- Carsten

>
> Thanks!
>
> -Bernt

- Carsten

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

* Re: Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)]
  2009-11-26 11:03     ` Carsten Dominik
@ 2009-11-26 11:21       ` Bernt Hansen
  2009-11-26 11:26         ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Bernt Hansen @ 2009-11-26 11:21 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Nov 26, 2009, at 11:55 AM, Bernt Hansen wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>>> On Nov 25, 2009, at 7:54 PM, Bernt Hansen wrote:
>>>
>>>>
>>>> My auto exclude functions are inline below:
>>>>
>>>> (defun bh/org-auto-exclude-function (tag)
>>>> (and (cond
>>>> 	((string= tag "@home")
>>>> 	 (bh/working-p))
>>>> 	((string= tag "@office")
>>>> 	 (not (bh/working-p)))
>>>> 	((string= tag "MARK")
>>>> 	 (not (bh/mark-p)))
>>>> 	((or (string= tag "@errand") (string= tag "PHONE"))
>>>> 	 (let ((hour (nth 2 (decode-time))))
>>>> 	   (or (< hour 8) (> hour 21)))))
>>>>      (concat "-" tag)))
>>>>
>>>
>>> do you get it back to when when replacing "MARK" with "mark" and
>>> "PHONE" wiht "phone"?
>>
>> Yes.  When I make the tags lowercase in the function above it works
>> again.
>
> The docstring of org-agenda-auto-exclude-function does mention this,
> but it is indeed a change from John's original code - so it was not in
> the docstring when you wrote this function..

Ah!  Oops.  I was bad and didn't read the contents of commit c6186f4
(Check all represented tags in agenda for auto-exclusion, 2009-11-20)
before submitting the bug report.  I'll try to remember to do that next
time.

This change should probably be described in the upcoming release notes
just so anyone else that already has the function defined won't get
caught by it but I'm sure you're already planning to do that :)
I can't find anything in the Changelog mentioning the case change.

Thanks for the clarification!

Bernt

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

* Re: Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)]
  2009-11-26 11:21       ` Bernt Hansen
@ 2009-11-26 11:26         ` Carsten Dominik
  2009-11-26 11:28           ` Bernt Hansen
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-11-26 11:26 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode


On Nov 26, 2009, at 12:21 PM, Bernt Hansen wrote:
>>
>> The docstring of org-agenda-auto-exclude-function does mention this,
>> but it is indeed a change from John's original code - so it was not  
>> in
>> the docstring when you wrote this function..
>
> Ah!  Oops.  I was bad and didn't read the contents of commit c6186f4
> (Check all represented tags in agenda for auto-exclusion, 2009-11-20)
> before submitting the bug report.  I'll try to remember to do that  
> next
> time.
>
> This change should probably be described in the upcoming release notes
> just so anyone else that already has the function defined won't get
> caught by it but I'm sure you're already planning to do that :)

Yes, it will be in the release notes, in the "incompatible changes"  
section.

> I can't find anything in the Changelog mentioning the case change.

So it is me who is bad... :-)

>
> Thanks for the clarification!
>
> Bernt

- Carsten

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

* Re: Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)]
  2009-11-26 11:26         ` Carsten Dominik
@ 2009-11-26 11:28           ` Bernt Hansen
  0 siblings, 0 replies; 7+ messages in thread
From: Bernt Hansen @ 2009-11-26 11:28 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Nov 26, 2009, at 12:21 PM, Bernt Hansen wrote:
>>>
> Yes, it will be in the release notes, in the "incompatible changes"
> section.

Great! :)

>> I can't find anything in the Changelog mentioning the case change.
>
> So it is me who is bad... :-)

Well... no :)  I didn't read the Changelog until today either... :-P

I'll gladly take the blame -- sorry for the noise. :)

-Bernt

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

end of thread, other threads:[~2009-11-26 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-25 18:54 Bug: / RET filter no longer auto-excludes FILETAGS [6.33trans (release_6.33f.34.gf806)] Bernt Hansen
2009-11-26  6:02 ` Carsten Dominik
2009-11-26 10:55   ` Bernt Hansen
2009-11-26 11:03     ` Carsten Dominik
2009-11-26 11:21       ` Bernt Hansen
2009-11-26 11:26         ` Carsten Dominik
2009-11-26 11:28           ` Bernt Hansen

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