Re: [O] [BUG] `org-agenda-sorting-strategy' does not work in `tags-todo'

2015-01-05 Thread Nick
Dear Seb and Bastien, 

Sebastien Vauban  writes:

> > I'd like to fix any problem in this area before 8.2.3,
> > which will go into Emacs 24.4.
> 
> That'd be pretty cool, indeed.

Did you get anywhere with this?
Thank you

Nick






Re: [O] [BUG] `org-agenda-sorting-strategy' does not work in `tags-todo'

2014-03-31 Thread Sebastien Vauban


Hi Bastien,

> Sebastien Vauban writes:
>
>> Though the "deadline-up" sorting does not work, as demo'ed in the
>> previous post.
>
> Can you point at that post again?

Here is the original post about the "deadline-up" sorting:

http://lists.gnu.org/archive/html/emacs-orgmode/2013-09/msg00518.html

> Also, the example in your previous email is quite complex.  If
> something does not work in `org-agenda-sorting-strategy' can you make
> the example minimal, with no special config or skip functions?

Simply eval this minimalistic custom command:

--8<---cut here---start->8---
  (add-to-list 'org-agenda-custom-commands
   '("B" "Today"
 tags-todo "DEADLINE<=\"\""
 ((org-agenda-overriding-header "Today")
  (org-agenda-sorting-strategy '(deadline-up t)
--8<---cut here---end--->8---

and then use `C-c a B' on your own Org agenda files.

If you use the "followup mode", you'll see that entries are sorted by
category, instead of being sorted by deadline date...

> I'd like to fix any problem in this area before 8.2.3,
> which will go into Emacs 24.4.

That'd be pretty cool, indeed.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] [BUG] `org-agenda-sorting-strategy' does not work in `tags-todo'

2014-03-21 Thread Bastien


Hi Sébastien,

"Sebastien Vauban" 
writes:

> Though the "deadline-up" sorting does not work, as demo'ed in the
> previous post.

Can you point at that post again?

Also, the example in your previous email is quite complex.
If something does not work in `org-agenda-sorting-strategy'
can you make the example minimal, with no special config
or skip functions?

I'd like to fix any problem in this area before 8.2.3,
which will go into Emacs 24.4.

Thanks in advance,

-- 
 Bastien




Re: [O] [BUG] `org-agenda-sorting-strategy' does not work in `tags-todo'

2014-02-13 Thread Sebastien Vauban
Hi Bastien,

Bastien wrote:
> Sebastien Vauban writes:
>
>>> Calendar for today
>>> 2013-09-12 Thu 
>>>  5 d ago  TODO 1Buy dog food
>>>  4 d ago  TODO 2Check weekend hours at the gym
>>>  3 d ago  TODO 3Do jogging
>>>  Deadline TODO 4Mail package to Susan
>>
>> Anybody having a hint on this?
>
> That's because deadline-up/down is active in "agenda" agenda views,
> not in tags view -- and "DEADLINE<=\"\"" ... is a tag search,
> not an "agenda" agenda view.
>
> I know the answer cannot be 100% satisfying, but sorting by date
> in this case would require to add a text property to each agenda
> entry, and would be certainly too time consuming (not tested.)

Though, not speaking of fundamental differences (such as: you have to
write specific code to skip different types of entries), going the
"agenda" agenda view approach is not (yet) satisfying.

Let's consider the following ecm.org file:

--8<---cut here---start->8---
* List of tasks

** TODO Pay electricity bill (before 18/02)
   DEADLINE: <2014-02-18 Tue -3d>

... but first wait for my pay of the first half of the month (15/02).

** TODO Renew newspaper subscription
   DEADLINE: <2014-02-19 Wed>

** TODO Subscribe to new gym club
   DEADLINE: <2014-03-01 Sat>

My goal is to begin in March.

** TODO Make dentist appointment
   DEADLINE: <2014-04-01 Tue -60d>

Call the dentist much time in advance, because she's got a very long waiting
list.
--8<---cut here---end--->8---

The 26-line "agenda" agenda view:

--8<---cut here---start->8---
(add-to-list 'org-agenda-custom-commands
 `("x" "Future tasks (by due date) -- AGENDA VIEW"
   ((agenda ""
((org-agenda-overriding-header "This week")
 (org-agenda-skip-function
  '(my-skip-entry-unless-deadline-in-n-days-or-more 
1))
 (org-deadline-warning-days 7)))
(agenda ""
((org-agenda-format-date "")
 (org-agenda-overriding-header "Following 3 weeks")
 (org-agenda-skip-function
  '(my-skip-entry-unless-deadline-in-n-days-or-more 
7))
 (org-deadline-warning-days 28
   ((org-agenda-clockreport-mode nil)
(org-agenda-format-date "")
(org-agenda-span 'day)
(org-agenda-sorting-strategy '(deadline-up))
(org-agenda-use-time-grid nil))) t)

(defun my-skip-entry-unless-deadline-in-n-days-or-more (n)
  "Skip entries that have no deadline, or that have a deadline earlier than 
in N days."
  (let* ((dl (org-entry-get nil "DEADLINE")))
(if (or (not dl)
(equal dl "")
(org-time< dl (+ (org-time-today) (* n 86400
(progn (outline-next-heading) (point)
--8<---cut here---end--->8---

displays:

--8<---cut here---start->8---
This week:
 In 6 d   TODO Renew newspaper subscription
 In 47 d  TODO Make dentist appointment

Following 3 weeks:
 In 16 d  TODO Subscribe to new gym club
 In 47 d  TODO Make dentist appointment
--8<---cut here---end--->8---

This is wrong for 2 tasks:

- "Make dentist appointment" (with a -60d "warning" specifier) appears in both
  "this week" and "following 3 weeks" lists, while it shouldn't appear at all,
  as its deadline doesn't fall within the search ranges.

- "Pay electricity bill" (with a -3d "warning" specifier) doesn't appear in
  "this week" list, while it should.

The 8-line "tags" agenda view:

--8<---cut here---start->8---
(add-to-list 'org-agenda-custom-commands
 `("x" "Future tasks (by due date) -- TODO-TAGS VIEW"
   ((tags-todo "DEADLINE>\"<+0d>\"+DEADLINE<=\"<+7d>\""
   ((org-agenda-overriding-header "This week")))
(tags-todo "DEADLINE>\"<+7d>\"+DEADLINE<=\"<+28d>\""
   ((org-agenda-overriding-header "Following 3 
weeks"
   ((org-agenda-skip-function '(org-agenda-skip-entry-if 
'notdeadline))
(org-agenda-sorting-strategy '(deadline-up t)
--8<---cut here---end--->8---

does output the right tasks:

--8<---cut here---start->8---
This week:
 ecm: TODO Pay electricity bill (before 18/02)
 ecm: TODO Renew newspaper subscription

Following 3 weeks:
 ecm: TODO Subscribe to new gym club
--8<---cut here---end--->8---

Though the "d

Re: [O] [BUG] `org-agenda-sorting-strategy' does not work in `tags-todo'

2013-11-06 Thread Bastien


Hi Sébastien,

"Sebastien Vauban" 
writes:

>> Calendar for today
>> 2013-09-12 Thu 
>>  5 d ago  TODO 1Buy dog food
>>  4 d ago  TODO 2Check weekend hours at the gym
>>  3 d ago  TODO 3Do jogging
>>  Deadline TODO 4Mail package to Susan
>
> Anybody having a hint on this?

That's because deadline-up/down is active in "agenda" agenda views,
not in tags view -- and "DEADLINE<=\"\"" ... is a tag search,
not an "agenda" agenda view.

I know the answer cannot be 100% satisfying, but sorting by date
in this case would require to add a text property to each agenda
entry, and would be certainly too time consuming (not tested.)

-- 
 Bastien




Re: [O] [BUG] `org-agenda-sorting-strategy' does not work in `tags-todo'

2013-10-21 Thread Sebastien Vauban
Hello,

"Sebastien Vauban" wrote:
> The following agenda view is supposed to display the tasks by ascending
> _DEADLINE timestamp_.
>
> #+begin_src emacs-lisp
>   (add-to-list 'org-agenda-custom-commands
>'("B" "Today"
>  tags-todo "DEADLINE<=\"\""
>  ((org-agenda-overriding-header "Today")
>   (org-agenda-sorting-strategy '(deadline-up t)
> #+end_src
>
> However, as you can see with the following ECM:
>
> #+begin_src org
> * Health
>   :PROPERTIES:
>   :CATEGORY: Health
>   :END:
>
> ** TODO 3Do jogging
>DEADLINE: <2013-09-09 Mon>
>
> ** TODO 2Check weekend hours at the gym
>DEADLINE: <2013-09-08 Sun>
>
> * Personal
>   :PROPERTIES:
>   :CATEGORY: Personal
>   :END:
>
> ** TODO 4Mail package to Susan
>DEADLINE: <2013-09-12 Thu>
>
> * Shopping
>   :PROPERTIES:
>   :CATEGORY: Shopping
>   :END:
>
> ** TODO 1Buy dog food
>DEADLINE: <2013-09-07 Sat>
> #+end_src
>
> it sorts the list by _category_, instead!
>
> Today (4)
>Health: TODO 3Do jogging
>Health: TODO 2Check weekend hours at the gym
>Personal:   TODO 4Mail package to Susan
>Shopping:   TODO 1Buy dog food
>
> The same sorting criteria, applied on an `agenda' view, does work.
>
> #+begin_src emacs-lisp
>   (add-to-list 'org-agenda-custom-commands
>'("G" "Agenda deadline-up"
>  agenda ""
>  ((org-agenda-span 'day)
>   (org-agenda-time-grid nil)
>   (org-agenda-sorting-strategy '(deadline-up t)
> #+end_src
> Calendar for today
> 2013-09-12 Thu 
>  5 d ago  TODO 1Buy dog food
>  4 d ago  TODO 2Check weekend hours at the gym
>  3 d ago  TODO 3Do jogging
>  Deadline TODO 4Mail package to Susan

Anybody having a hint on this?

Best regards,
  Seb

-- 
Sebastien Vauban




[O] [BUG] `org-agenda-sorting-strategy' does not work in `tags-todo'

2013-09-12 Thread Sebastien Vauban
Hello,

The following agenda view is supposed to display the tasks by ascending
_DEADLINE timestamp_.

#+begin_src emacs-lisp
  (add-to-list 'org-agenda-custom-commands
   '("B" "Today"
 tags-todo "DEADLINE<=\"\""
 ((org-agenda-overriding-header "Today")
  (org-agenda-sorting-strategy '(deadline-up t)
#+end_src

However, as you can see with the following ECM:

#+begin_src org
* Health
  :PROPERTIES:
  :CATEGORY: Health
  :END:

** TODO 3Do jogging
   DEADLINE: <2013-09-09 Mon>

** TODO 2Check weekend hours at the gym
   DEADLINE: <2013-09-08 Sun>

* Personal
  :PROPERTIES:
  :CATEGORY: Personal
  :END:

** TODO 4Mail package to Susan
   DEADLINE: <2013-09-12 Thu>

* Shopping
  :PROPERTIES:
  :CATEGORY: Shopping
  :END:

** TODO 1Buy dog food
   DEADLINE: <2013-09-07 Sat>
#+end_src

it sorts the list by _category_, instead!

--8<---cut here---start->8---
Today (4)
   Health: TODO 3Do jogging
   Health: TODO 2Check weekend hours at the gym
   Personal:   TODO 4Mail package to Susan
   Shopping:   TODO 1Buy dog food
--8<---cut here---end--->8---

The same sorting criteria, applied on an `agenda' view, does work.

#+begin_src emacs-lisp
  (add-to-list 'org-agenda-custom-commands
   '("G" "Agenda deadline-up"
 agenda ""
 ((org-agenda-span 'day)
  (org-agenda-time-grid nil)
  (org-agenda-sorting-strategy '(deadline-up t)
#+end_src

--8<---cut here---start->8---
Calendar for today
2013-09-12 Thu 
 5 d ago  TODO 1Buy dog food
 4 d ago  TODO 2Check weekend hours at the gym
 3 d ago  TODO 3Do jogging
 Deadline TODO 4Mail package to Susan
--8<---cut here---end--->8---

Best regards,
  Seb

-- 
Sebastien Vauban