emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
@ 2010-12-22  4:09 Bernt Hansen
  2010-12-22  7:03 ` Noorul Islam K M
  0 siblings, 1 reply; 58+ messages in thread
From: Bernt Hansen @ 2010-12-22  4:09 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

If you are viewing the agenda with a time span of a week (or anything
larger than a day) and then use 'J' to jump to a new date the span
changes back to day.

I think the span should remain unchanged when moving to a new date.

Regards,
Bernt

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-11-03 on potassium, modified by Debian
Package: Org-mode version 7.4 (release_7.4.80.g0e5e5)

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2010-12-22  4:09 Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)] Bernt Hansen
@ 2010-12-22  7:03 ` Noorul Islam K M
  2010-12-22 12:29   ` Bernt Hansen
  0 siblings, 1 reply; 58+ messages in thread
From: Noorul Islam K M @ 2010-12-22  7:03 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Bernt Hansen <bernt@norang.ca> writes:

> Hi,
>
> If you are viewing the agenda with a time span of a week (or anything
> larger than a day) and then use 'J' to jump to a new date the span
> changes back to day.
>

For me, I have 'J' bound to (org-agenda-clock-goto) by default. I think
you are talking about 'j'.

> I think the span should remain unchanged when moving to a new date.

I think 'j' should not change the span. Or we can have 'C-u j' to keep
the span as it is.

Thanks and Regards 
Noorul

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2010-12-22  7:03 ` Noorul Islam K M
@ 2010-12-22 12:29   ` Bernt Hansen
  2011-01-14 12:34     ` Carsten Dominik
  0 siblings, 1 reply; 58+ messages in thread
From: Bernt Hansen @ 2010-12-22 12:29 UTC (permalink / raw)
  To: Noorul Islam K M; +Cc: emacs-orgmode

Noorul Islam K M <noorul@noorul.com> writes:

> Bernt Hansen <bernt@norang.ca> writes:
>
>> Hi,
>>
>> If you are viewing the agenda with a time span of a week (or anything
>> larger than a day) and then use 'J' to jump to a new date the span
>> changes back to day.
>>
>
> For me, I have 'J' bound to (org-agenda-clock-goto) by default. I think
> you are talking about 'j'.

Yes you are correct.  'j' jumps to a date and this is where the problem
shows up for me.

-Bernt

>
>> I think the span should remain unchanged when moving to a new date.
>
> I think 'j' should not change the span. Or we can have 'C-u j' to keep
> the span as it is.
>
> Thanks and Regards 
> Noorul

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2010-12-22 12:29   ` Bernt Hansen
@ 2011-01-14 12:34     ` Carsten Dominik
  2011-01-14 16:03       ` Bernt Hansen
  0 siblings, 1 reply; 58+ messages in thread
From: Carsten Dominik @ 2011-01-14 12:34 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode, Noorul Islam K M


On Dec 22, 2010, at 1:29 PM, Bernt Hansen wrote:

> Noorul Islam K M <noorul@noorul.com> writes:
>
>> Bernt Hansen <bernt@norang.ca> writes:
>>
>>> Hi,
>>>
>>> If you are viewing the agenda with a time span of a week (or  
>>> anything
>>> larger than a day) and then use 'J' to jump to a new date the span
>>> changes back to day.
>>>
>>
>> For me, I have 'J' bound to (org-agenda-clock-goto) by default. I  
>> think
>> you are talking about 'j'.
>
> Yes you are correct.  'j' jumps to a date and this is where the  
> problem
> shows up for me.


Has this been fixed?  Because I cannot reproduce this issue.

- Carsten

>
> -Bernt
>
>>
>>> I think the span should remain unchanged when moving to a new date.
>>
>> I think 'j' should not change the span. Or we can have 'C-u j' to  
>> keep
>> the span as it is.
>>
>> Thanks and Regards
>> Noorul
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-14 12:34     ` Carsten Dominik
@ 2011-01-14 16:03       ` Bernt Hansen
  2011-01-14 17:29         ` Carsten Dominik
  0 siblings, 1 reply; 58+ messages in thread
From: Bernt Hansen @ 2011-01-14 16:03 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Noorul Islam K M

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

> On Dec 22, 2010, at 1:29 PM, Bernt Hansen wrote:
>
>> Noorul Islam K M <noorul@noorul.com> writes:
>>
>>> Bernt Hansen <bernt@norang.ca> writes:
>>>
>>>> Hi,
>>>>
>>>> If you are viewing the agenda with a time span of a week (or
>>>> anything
>>>> larger than a day) and then use 'J' to jump to a new date the span
>>>> changes back to day.
>>>>
>>>
>>> For me, I have 'J' bound to (org-agenda-clock-goto) by default. I
>>> think
>>> you are talking about 'j'.
>>
>> Yes you are correct.  'j' jumps to a date and this is where the
>> problem
>> shows up for me.
>
>
> Has this been fixed?  Because I cannot reproduce this issue.
>
> - Carsten

Hi Carsten,

No this hasn't been fixed but it is related to some configuration I
have.  When I run with a minimal emacs I cannot reproduce it but when I
run with my regular setup I can.  I'll try to narrow down the cause of
this issue over the weekend.

Regards,
Bernt

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-14 16:03       ` Bernt Hansen
@ 2011-01-14 17:29         ` Carsten Dominik
  2011-01-14 17:42           ` Bernt Hansen
  0 siblings, 1 reply; 58+ messages in thread
From: Carsten Dominik @ 2011-01-14 17:29 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode, Noorul Islam K M


On Jan 14, 2011, at 5:03 PM, Bernt Hansen wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Dec 22, 2010, at 1:29 PM, Bernt Hansen wrote:
>>
>>> Noorul Islam K M <noorul@noorul.com> writes:
>>>
>>>> Bernt Hansen <bernt@norang.ca> writes:
>>>>
>>>>> Hi,
>>>>>
>>>>> If you are viewing the agenda with a time span of a week (or
>>>>> anything
>>>>> larger than a day) and then use 'J' to jump to a new date the span
>>>>> changes back to day.
>>>>>
>>>>
>>>> For me, I have 'J' bound to (org-agenda-clock-goto) by default. I
>>>> think
>>>> you are talking about 'j'.
>>>
>>> Yes you are correct.  'j' jumps to a date and this is where the
>>> problem
>>> shows up for me.
>>
>>
>> Has this been fixed?  Because I cannot reproduce this issue.
>>
>> - Carsten
>
> Hi Carsten,
>
> No this hasn't been fixed but it is related to some configuration I
> have.  When I run with a minimal emacs I cannot reproduce it but  
> when I
> run with my regular setup I can.  I'll try to narrow down the cause of
> this issue over the weekend.

Please do.  Thanks

- Carsten

>
> Regards,
> Bernt

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-14 17:29         ` Carsten Dominik
@ 2011-01-14 17:42           ` Bernt Hansen
  2011-01-17 14:27             ` Bernt Hansen
  0 siblings, 1 reply; 58+ messages in thread
From: Bernt Hansen @ 2011-01-14 17:42 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Noorul Islam K M

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

> On Jan 14, 2011, at 5:03 PM, Bernt Hansen wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>>> On Dec 22, 2010, at 1:29 PM, Bernt Hansen wrote:
>>>
>>>> Noorul Islam K M <noorul@noorul.com> writes:
>>>>
>>>>> Bernt Hansen <bernt@norang.ca> writes:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> If you are viewing the agenda with a time span of a week (or
>>>>>> anything
>>>>>> larger than a day) and then use 'J' to jump to a new date the span
>>>>>> changes back to day.
>>>>>>
>>>>>
>>>>> For me, I have 'J' bound to (org-agenda-clock-goto) by default. I
>>>>> think
>>>>> you are talking about 'j'.
>>>>
>>>> Yes you are correct.  'j' jumps to a date and this is where the
>>>> problem
>>>> shows up for me.
>>>
>>>
>>> Has this been fixed?  Because I cannot reproduce this issue.
>>>
>>> - Carsten
>>
>> Hi Carsten,
>>
>> No this hasn't been fixed but it is related to some configuration I
>> have.  When I run with a minimal emacs I cannot reproduce it but
>> when I
>> run with my regular setup I can.  I'll try to narrow down the cause of
>> this issue over the weekend.
>
> Please do.  Thanks
>
> - Carsten

Hi Carsten,

I think I found it.

,----[ ~/bin/minimal-emacs
| #!/bin/sh
| TESTEL=
| TESTFILE=/tmp/test.el
| if test -e $TESTFILE
| then
|   TESTEL="-l /tmp/test.el"
| fi
| emacs -q -l ~/minimal.emacs $TESTEL 
`----

,----[ ~/minimal.emacs ]
| (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
| (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
| (require 'org-install)
| 
| (global-set-key "\C-cl" 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| (global-set-key "\C-cb" 'org-iswitchb)
`----

,----[ /tmp/test.el ]
| (setq org-agenda-ndays 1)
`----

$ ~/bin/minimal-emacs

| Keys     | Description                     |
|----------+---------------------------------|
| C-c a a  | Start agenda (shows today only) |
| w        | Show agenda for the week        |
| j 12 RET | Jump to the 12th of the month   |

And we're back to a day view again.  Setting 'org-agenda-ndays' to 1
seems to be the cause of this issue.

Regards,
Bernt

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-14 17:42           ` Bernt Hansen
@ 2011-01-17 14:27             ` Bernt Hansen
  2011-01-17 14:39               ` Carsten Dominik
  0 siblings, 1 reply; 58+ messages in thread
From: Bernt Hansen @ 2011-01-17 14:27 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Noorul Islam K M

Bernt Hansen <bernt@norang.ca> writes:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Jan 14, 2011, at 5:03 PM, Bernt Hansen wrote:
>>
>>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>>
>>>> On Dec 22, 2010, at 1:29 PM, Bernt Hansen wrote:
>>>>
>>>>> Noorul Islam K M <noorul@noorul.com> writes:
>>>>>
>>>>>> Bernt Hansen <bernt@norang.ca> writes:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> If you are viewing the agenda with a time span of a week (or
>>>>>>> anything
>>>>>>> larger than a day) and then use 'j' to jump to a new date the span
>>>>>>> changes back to day.
>>>>>>>
>>>>>>
>>>>
>>>>
>>>> Has this been fixed?  Because I cannot reproduce this issue.
>>>>
>>>> - Carsten
>>>
>>> Hi Carsten,
>>>
>>> No this hasn't been fixed but it is related to some configuration I
>>> have.  When I run with a minimal emacs I cannot reproduce it but
>>> when I
>>> run with my regular setup I can.  I'll try to narrow down the cause of
>>> this issue over the weekend.
>>
>> Please do.  Thanks
>>
>> - Carsten

So I thought I would try to 'fix' this the easy way by removing my
customization for org-agenda-ndays but that makes it worse.  After
removing the customization and restarting emacs the '.' key in the
agenda goes to Saturday (today is Monday).  I have my week starting on
Saturday for the agenda display - when viewing a single day it jumps to
the first day of the week instead of today.

I've reinstated my org-agenda-ndays variable setting as shown in the
minimal emacs setup that follows.

Regards,
Bernt


>
> Hi Carsten,
>
> I think I found it.
>
> ,----[ ~/bin/minimal-emacs
> | #!/bin/sh
> | TESTEL=
> | TESTFILE=/tmp/test.el
> | if test -e $TESTFILE
> | then
> |   TESTEL="-l /tmp/test.el"
> | fi
> | emacs -q -l ~/minimal.emacs $TESTEL 
> `----
>
> ,----[ ~/minimal.emacs ]
> | (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
> | (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
> | (require 'org-install)
> | 
> | (global-set-key "\C-cl" 'org-store-link)
> | (global-set-key "\C-ca" 'org-agenda)
> | (global-set-key "\C-cb" 'org-iswitchb)
> `----
>
> ,----[ /tmp/test.el ]
> | (setq org-agenda-ndays 1)
> `----
>
> $ ~/bin/minimal-emacs
>
> | Keys     | Description                     |
> |----------+---------------------------------|
> | C-c a a  | Start agenda (shows today only) |
> | w        | Show agenda for the week        |
> | j 12 RET | Jump to the 12th of the month   |
>
> And we're back to a day view again.  Setting 'org-agenda-ndays' to 1
> seems to be the cause of this issue.
>
> Regards,
> Bernt
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 14:27             ` Bernt Hansen
@ 2011-01-17 14:39               ` Carsten Dominik
  2011-01-17 15:08                 ` Julien Danjou
  0 siblings, 1 reply; 58+ messages in thread
From: Carsten Dominik @ 2011-01-17 14:39 UTC (permalink / raw)
  To: Julien Danjou, Bernt Hansen; +Cc: Org Mode, Noorul Islam K M

Hi Julien,

have you been following this thread?  I think this has to do with your  
rewrite of the dagenda span stuff.  Maybe you can find out better and  
faster that I why this goes wrong?  Please read the entire thread.

- Carsten

On Jan 17, 2011, at 3:27 PM, Bernt Hansen wrote:

> Bernt Hansen <bernt@norang.ca> writes:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>>> On Jan 14, 2011, at 5:03 PM, Bernt Hansen wrote:
>>>
>>>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>>>
>>>>> On Dec 22, 2010, at 1:29 PM, Bernt Hansen wrote:
>>>>>
>>>>>> Noorul Islam K M <noorul@noorul.com> writes:
>>>>>>
>>>>>>> Bernt Hansen <bernt@norang.ca> writes:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> If you are viewing the agenda with a time span of a week (or
>>>>>>>> anything
>>>>>>>> larger than a day) and then use 'j' to jump to a new date the  
>>>>>>>> span
>>>>>>>> changes back to day.
>>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>> Has this been fixed?  Because I cannot reproduce this issue.
>>>>>
>>>>> - Carsten
>>>>
>>>> Hi Carsten,
>>>>
>>>> No this hasn't been fixed but it is related to some configuration I
>>>> have.  When I run with a minimal emacs I cannot reproduce it but
>>>> when I
>>>> run with my regular setup I can.  I'll try to narrow down the  
>>>> cause of
>>>> this issue over the weekend.
>>>
>>> Please do.  Thanks
>>>
>>> - Carsten
>
> So I thought I would try to 'fix' this the easy way by removing my
> customization for org-agenda-ndays but that makes it worse.  After
> removing the customization and restarting emacs the '.' key in the
> agenda goes to Saturday (today is Monday).  I have my week starting on
> Saturday for the agenda display - when viewing a single day it jumps  
> to
> the first day of the week instead of today.
>
> I've reinstated my org-agenda-ndays variable setting as shown in the
> minimal emacs setup that follows.
>
> Regards,
> Bernt
>
>
>>
>> Hi Carsten,
>>
>> I think I found it.
>>
>> ,----[ ~/bin/minimal-emacs
>> | #!/bin/sh
>> | TESTEL=
>> | TESTFILE=/tmp/test.el
>> | if test -e $TESTFILE
>> | then
>> |   TESTEL="-l /tmp/test.el"
>> | fi
>> | emacs -q -l ~/minimal.emacs $TESTEL
>> `----
>>
>> ,----[ ~/minimal.emacs ]
>> | (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
>> | (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\) 
>> $" . org-mode))
>> | (require 'org-install)
>> |
>> | (global-set-key "\C-cl" 'org-store-link)
>> | (global-set-key "\C-ca" 'org-agenda)
>> | (global-set-key "\C-cb" 'org-iswitchb)
>> `----
>>
>> ,----[ /tmp/test.el ]
>> | (setq org-agenda-ndays 1)
>> `----
>>
>> $ ~/bin/minimal-emacs
>>
>> | Keys     | Description                     |
>> |----------+---------------------------------|
>> | C-c a a  | Start agenda (shows today only) |
>> | w        | Show agenda for the week        |
>> | j 12 RET | Jump to the 12th of the month   |
>>
>> And we're back to a day view again.  Setting 'org-agenda-ndays' to 1
>> seems to be the cause of this issue.
>>
>> Regards,
>> Bernt
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 14:39               ` Carsten Dominik
@ 2011-01-17 15:08                 ` Julien Danjou
  2011-01-17 16:34                   ` Julien Danjou
                                     ` (3 more replies)
  0 siblings, 4 replies; 58+ messages in thread
From: Julien Danjou @ 2011-01-17 15:08 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


[-- Attachment #1.1.1: Type: text/plain, Size: 524 bytes --]

On Mon, Jan 17 2011, Carsten Dominik wrote:

> have you been following this thread?  I think this has to do with your
> rewrite of the dagenda span stuff.  Maybe you can find out better and
> faster that I why this goes wrong?  Please read the entire thread.

I've followed but not sure I understood what the bug is. But from my
various tries, I found a bug: when pressing 'j', the current span is
discarded.

Attached is a patch that should fix that, even for future use of
`org-agenda-list' with the span unspecified. :)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-Fix-agenda-span-on-date-jump.patch --]
[-- Type: text/x-diff, Size: 1158 bytes --]

From 9dd2fe6650b858a4083ebc083bb8d10a0d6ac7f2 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Mon, 17 Jan 2011 16:05:28 +0100
Subject: [PATCH] Fix agenda span on date jump

* org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
possible default span if it is set.

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/org-agenda.el |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 0cd620c..0d695b5 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3450,7 +3450,10 @@ given in `org-agenda-start-on-weekday'."
   (setq org-agenda-last-arguments (list include-all start-day span))
   (org-compile-prefix-format 'agenda)
   (org-set-sorting-strategy 'agenda)
-  (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
+  (let* ((span (org-agenda-ndays-to-span (or span
+					     org-agenda-current-span
+					     org-agenda-ndays
+					     org-agenda-span)))
 	 (today (org-today))
 	 (sd (or start-day today))
 	 (ndays (org-agenda-span-to-ndays span sd))
-- 
1.7.2.3


[-- Attachment #1.1.3: Type: text/plain, Size: 53 bytes --]


-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 15:08                 ` Julien Danjou
@ 2011-01-17 16:34                   ` Julien Danjou
  2011-01-17 16:43                     ` Carsten Dominik
  2011-01-17 16:47                   ` Bernt Hansen
                                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 58+ messages in thread
From: Julien Danjou @ 2011-01-17 16:34 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


[-- Attachment #1.1: Type: text/plain, Size: 546 bytes --]

On Mon, Jan 17 2011, Julien Danjou wrote:

> Attached is a patch that should fix that, even for future use of
> `org-agenda-list' with the span unspecified. :)

This patch has a side effect for me: my org-agenda-span is set to 14,
and I've no way to reset it without quitting the agenda and requesting
it again.

I think we miss a keybinding to reset org-agenda-current-span to nil so
org-agenda-span get used again.

What do you think? Which key would be fine to reset the span?

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 16:34                   ` Julien Danjou
@ 2011-01-17 16:43                     ` Carsten Dominik
  2011-01-17 16:46                       ` Julien Danjou
  0 siblings, 1 reply; 58+ messages in thread
From: Carsten Dominik @ 2011-01-17 16:43 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


On Jan 17, 2011, at 5:34 PM, Julien Danjou wrote:

> On Mon, Jan 17 2011, Julien Danjou wrote:
>
>> Attached is a patch that should fix that, even for future use of
>> `org-agenda-list' with the span unspecified. :)
>
> This patch has a side effect for me: my org-agenda-span is set to 14,
> and I've no way to reset it without quitting the agenda and requesting
> it again.
>
> I think we miss a keybinding to reset org-agenda-current-span to nil  
> so
> org-agenda-span get used again.
>
> What do you think? Which key would be fine to reset the span?

This should not be done with a key, but automatically in a clever  
way.  It used to work.

- Carsten

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 16:43                     ` Carsten Dominik
@ 2011-01-17 16:46                       ` Julien Danjou
  2011-01-18  9:43                         ` Carsten Dominik
  0 siblings, 1 reply; 58+ messages in thread
From: Julien Danjou @ 2011-01-17 16:46 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


[-- Attachment #1.1: Type: text/plain, Size: 387 bytes --]

On Mon, Jan 17 2011, Carsten Dominik wrote:

> This should not be done with a key, but automatically in a clever way.  It
> used to work.

Well, it used to work very bad, that's why I rewrote that thing
initially. It was resetting too often to the default without any reason.

So could you define the "clever way" to me? :-)

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 15:08                 ` Julien Danjou
  2011-01-17 16:34                   ` Julien Danjou
@ 2011-01-17 16:47                   ` Bernt Hansen
  2011-01-17 16:54                     ` Julien Danjou
  2011-01-17 17:11                     ` Julien Danjou
  2011-01-28 15:18                   ` Julien Danjou
  2011-02-01 11:52                   ` [Accepted] " Bastien Guerry
  3 siblings, 2 replies; 58+ messages in thread
From: Bernt Hansen @ 2011-01-17 16:47 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Org Mode, Noorul Islam K M, Carsten Dominik

Julien Danjou <julien@danjou.info> writes:

> On Mon, Jan 17 2011, Carsten Dominik wrote:
>
>> have you been following this thread?  I think this has to do with your
>> rewrite of the dagenda span stuff.  Maybe you can find out better and
>> faster that I why this goes wrong?  Please read the entire thread.
>
> I've followed but not sure I understood what the bug is. But from my
> various tries, I found a bug: when pressing 'j', the current span is
> discarded.
>
> Attached is a patch that should fix that, even for future use of
> `org-agenda-list' with the span unspecified. :)

Hi Julien,

Thanks for this patch.  I think this fixes the issue I was having with
'j' in the agenda switching from week-view back to single-day view when
org-agenda-ndays is set to 1.

There is still a (new?) problem with jumping to today.

Set the following variable

(setq org-agenda-start-on-weekday 6)

| Key Sequence | Notes                                          |
|--------------+------------------------------------------------|
| C-c a a      | Display weekly agenda                          |
| f            | Go forward a week                              |
| d            | Display day agenda                             |
| .            | Go to to day - but it goes to Saturday instead |

This should go to today and not the first day of the week.

Regards,
Bernt


>
>
> From 9dd2fe6650b858a4083ebc083bb8d10a0d6ac7f2 Mon Sep 17 00:00:00 2001
> From: Julien Danjou <julien@danjou.info>
> Date: Mon, 17 Jan 2011 16:05:28 +0100
> Subject: [PATCH] Fix agenda span on date jump
>
> * org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
> possible default span if it is set.
>
> Signed-off-by: Julien Danjou <julien@danjou.info>
> ---
>  lisp/org-agenda.el |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 0cd620c..0d695b5 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -3450,7 +3450,10 @@ given in `org-agenda-start-on-weekday'."
>    (setq org-agenda-last-arguments (list include-all start-day span))
>    (org-compile-prefix-format 'agenda)
>    (org-set-sorting-strategy 'agenda)
> -  (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
> +  (let* ((span (org-agenda-ndays-to-span (or span
> +					     org-agenda-current-span
> +					     org-agenda-ndays
> +					     org-agenda-span)))
>  	 (today (org-today))
>  	 (sd (or start-day today))
>  	 (ndays (org-agenda-span-to-ndays span sd))
> -- 
> 1.7.2.3

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 16:47                   ` Bernt Hansen
@ 2011-01-17 16:54                     ` Julien Danjou
  2011-01-17 17:00                       ` Bernt Hansen
  2011-01-17 17:01                       ` Carsten Dominik
  2011-01-17 17:11                     ` Julien Danjou
  1 sibling, 2 replies; 58+ messages in thread
From: Julien Danjou @ 2011-01-17 16:54 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Org Mode, Noorul Islam K M, Carsten Dominik


[-- Attachment #1.1: Type: text/plain, Size: 230 bytes --]

On Mon, Jan 17 2011, Bernt Hansen wrote:

> This should go to today and not the first day of the week.

It does go on today. I cannot reproduce this problem (git version).

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 16:54                     ` Julien Danjou
@ 2011-01-17 17:00                       ` Bernt Hansen
  2011-01-17 17:04                         ` Julien Danjou
  2011-01-17 17:01                       ` Carsten Dominik
  1 sibling, 1 reply; 58+ messages in thread
From: Bernt Hansen @ 2011-01-17 17:00 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Org Mode, Noorul Islam K M, Carsten Dominik

Julien Danjou <julien@danjou.info> writes:

> On Mon, Jan 17 2011, Bernt Hansen wrote:
>
>> This should go to today and not the first day of the week.
>
> It does go on today. I cannot reproduce this problem (git version).

This consistently does not work for me with the following setup:

~/bin/minimal.emacs
--8<---------------cut here---------------start------------->8---
#!/bin/sh
TESTEL=
TESTFILE=/tmp/test.el
if test -e $TESTFILE
then
  TESTEL="-l /tmp/test.el"
fi
emacs -q -l ~/minimal.emacs $TESTEL 
--8<---------------cut here---------------end--------------->8---

/tmp/test.el
--8<---------------cut here---------------start------------->8---
(setq org-agenda-start-on-weekday 6)
--8<---------------cut here---------------end--------------->8---

~/minimal.emacs
--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org-install)

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
--8<---------------cut here---------------end--------------->8---

Key sequence

$ minimal-emacs
| Key     |
|---------|
| C-c a a |
| f       |
| d       |
| .       |

Gives me

,----
| Day-agenda (W02):
| Saturday   15 January 2011
`----

Org-mode version 7.4 (release_7.4.203.g970db)
GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11
on raven, modified by Debian

Regards,
Bernt

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 16:54                     ` Julien Danjou
  2011-01-17 17:00                       ` Bernt Hansen
@ 2011-01-17 17:01                       ` Carsten Dominik
  1 sibling, 0 replies; 58+ messages in thread
From: Carsten Dominik @ 2011-01-17 17:01 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


On Jan 17, 2011, at 5:54 PM, Julien Danjou wrote:

> On Mon, Jan 17 2011, Bernt Hansen wrote:
>
>> This should go to today and not the first day of the week.
>
> It does go on today. I cannot reproduce this problem (git version).

Bent has set org-agenda-start-on-weekday to 6

- Carsten

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 17:00                       ` Bernt Hansen
@ 2011-01-17 17:04                         ` Julien Danjou
  0 siblings, 0 replies; 58+ messages in thread
From: Julien Danjou @ 2011-01-17 17:04 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Org Mode, Noorul Islam K M, Carsten Dominik


[-- Attachment #1.1: Type: text/plain, Size: 256 bytes --]

On Mon, Jan 17 2011, Bernt Hansen wrote:

> This consistently does not work for me with the following setup:

Ok, with org-agenda-span set to 'week, I've a strange behavior too.
I'll try to debug.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 16:47                   ` Bernt Hansen
  2011-01-17 16:54                     ` Julien Danjou
@ 2011-01-17 17:11                     ` Julien Danjou
  2011-01-17 17:14                       ` Bernt Hansen
  2011-01-17 18:27                       ` [Accepted] " Bastien Guerry
  1 sibling, 2 replies; 58+ messages in thread
From: Julien Danjou @ 2011-01-17 17:11 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: Org Mode, Noorul Islam K M, Carsten Dominik


[-- Attachment #1.1.1: Type: text/plain, Size: 856 bytes --]

On Mon, Jan 17 2011, Bernt Hansen wrote:
>
> Thanks for this patch.  I think this fixes the issue I was having with
> 'j' in the agenda switching from week-view back to single-day view when
> org-agenda-ndays is set to 1.
>
> There is still a (new?) problem with jumping to today.
>
> Set the following variable
>
> (setq org-agenda-start-on-weekday 6)
>
> | Key Sequence | Notes                                          |
> |--------------+------------------------------------------------|
> | C-c a a      | Display weekly agenda                          |
> | f            | Go forward a week                              |
> | d            | Display day agenda                             |
> | .            | Go to to day - but it goes to Saturday instead |
>
> This should go to today and not the first day of the week.

Attached is a fix for that.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-Fix-org-agenda-goto-today-not-respecting-the-current.patch --]
[-- Type: text/x-diff, Size: 1095 bytes --]

From f566a5612560f997f4760144ca850dda5c06bc5e Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Mon, 17 Jan 2011 18:09:30 +0100
Subject: [PATCH] Fix org-agenda-goto-today not respecting the current span.

* org-agenda.el (org-agenda-goto-today): Respect current span.

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/org-agenda.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 0d695b5..241ed30 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6104,7 +6104,7 @@ Negative selection means regexp must not match for selection of an entry."
      (tdpos (goto-char tdpos))
      ((eq org-agenda-type 'agenda)
       (let* ((sd (org-agenda-compute-starting-span
-		  (org-today) (or org-agenda-ndays org-agenda-span)))
+		  (org-today) (or org-agenda-current-span org-agenda-ndays org-agenda-span)))
 	     (org-agenda-overriding-arguments org-agenda-last-arguments))
 	(setf (nth 1 org-agenda-overriding-arguments) sd)
 	(org-agenda-redo)
-- 
1.7.2.3


[-- Attachment #1.1.3: Type: text/plain, Size: 53 bytes --]


-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 17:11                     ` Julien Danjou
@ 2011-01-17 17:14                       ` Bernt Hansen
  2011-01-17 18:27                       ` [Accepted] " Bastien Guerry
  1 sibling, 0 replies; 58+ messages in thread
From: Bernt Hansen @ 2011-01-17 17:14 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Org Mode, Noorul Islam K M, Carsten Dominik

Julien Danjou <julien@danjou.info> writes:

> On Mon, Jan 17 2011, Bernt Hansen wrote:
>>
>> Thanks for this patch.  I think this fixes the issue I was having with
>> 'j' in the agenda switching from week-view back to single-day view when
>> org-agenda-ndays is set to 1.
>>
>> There is still a (new?) problem with jumping to today.
>>
>> Set the following variable
>>
>> (setq org-agenda-start-on-weekday 6)
>>
>> | Key Sequence | Notes                                          |
>> |--------------+------------------------------------------------|
>> | C-c a a      | Display weekly agenda                          |
>> | f            | Go forward a week                              |
>> | d            | Display day agenda                             |
>> | .            | Go to to day - but it goes to Saturday instead |
>>
>> This should go to today and not the first day of the week.
>
> Attached is a fix for that.

Thanks Julien,

I think that fixes this issue for me.

Regards,
Bernt

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

* [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 17:11                     ` Julien Danjou
  2011-01-17 17:14                       ` Bernt Hansen
@ 2011-01-17 18:27                       ` Bastien Guerry
  1 sibling, 0 replies; 58+ messages in thread
From: Bastien Guerry @ 2011-01-17 18:27 UTC (permalink / raw)
  To: emacs-orgmode

Patch 544 (http://patchwork.newartisans.com/patch/544/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3Csa3mxmzv4k0.fsf%40cigue.easter-eggs.fr%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [Orgmode] Re: Bug: Jumping to a date in the agenda changes view back
> 	to 'day' [7.4 (release_7.4.80.g0e5e5)]
> Date: Mon, 17 Jan 2011 22:11:11 -0000
> From: Julien Danjou <julien@danjou.info>
> X-Patchwork-Id: 544
> Message-Id: <sa3mxmzv4k0.fsf@cigue.easter-eggs.fr>
> To: Bernt Hansen <bernt@norang.ca>
> Cc: Org Mode <emacs-orgmode@gnu.org>, Noorul Islam K M <noorul@noorul.com>, 
> 	Carsten Dominik <carsten.dominik@gmail.com>
> 
> On Mon, Jan 17 2011, Bernt Hansen wrote:
> >
> > Thanks for this patch.  I think this fixes the issue I was having with
> > 'j' in the agenda switching from week-view back to single-day view when
> > org-agenda-ndays is set to 1.
> >
> > There is still a (new?) problem with jumping to today.
> >
> > Set the following variable
> >
> > (setq org-agenda-start-on-weekday 6)
> >
> > | Key Sequence | Notes                                          |
> > |--------------+------------------------------------------------|
> > | C-c a a      | Display weekly agenda                          |
> > | f            | Go forward a week                              |
> > | d            | Display day agenda                             |
> > | .            | Go to to day - but it goes to Saturday instead |
> >
> > This should go to today and not the first day of the week.
> 
> Attached is a fix for that.
> 
> 
> >From f566a5612560f997f4760144ca850dda5c06bc5e Mon Sep 17 00:00:00 2001
> From: Julien Danjou <julien@danjou.info>
> Date: Mon, 17 Jan 2011 18:09:30 +0100
> Subject: [PATCH] Fix org-agenda-goto-today not respecting the current span.
> 
> * org-agenda.el (org-agenda-goto-today): Respect current span.
> 
> Signed-off-by: Julien Danjou <julien@danjou.info>
> ---
>  lisp/org-agenda.el |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 0d695b5..241ed30 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -6104,7 +6104,7 @@ Negative selection means regexp must not match for selection of an entry."
>       (tdpos (goto-char tdpos))
>       ((eq org-agenda-type 'agenda)
>        (let* ((sd (org-agenda-compute-starting-span
> -		  (org-today) (or org-agenda-ndays org-agenda-span)))
> +		  (org-today) (or org-agenda-current-span org-agenda-ndays org-agenda-span)))
>  	     (org-agenda-overriding-arguments org-agenda-last-arguments))
>  	(setf (nth 1 org-agenda-overriding-arguments) sd)
>  	(org-agenda-redo)
> -- 
> 1.7.2.3
> 
> 

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 16:46                       ` Julien Danjou
@ 2011-01-18  9:43                         ` Carsten Dominik
  2011-01-18 10:00                           ` Julien Danjou
  0 siblings, 1 reply; 58+ messages in thread
From: Carsten Dominik @ 2011-01-18  9:43 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


On Jan 17, 2011, at 5:46 PM, Julien Danjou wrote:

> On Mon, Jan 17 2011, Carsten Dominik wrote:
>
>> This should not be done with a key, but automatically in a clever  
>> way.  It
>> used to work.
>
> Well, it used to work very bad, that's why I rewrote that thing
> initially. It was resetting too often to the default without any  
> reason.

I am not sure if I understand this part of the issue.  The old
code was certainly bad in the sense that it changed custom variables.
However, it generally did not reset to a default value (in fact, the
default value was lost due to the explicit changes org org-agenda- 
ndays).

Otherwise, if would continue to use whatever value you set with your
latest view change and keep this until you change it again.


So what was your issue with this part?

> So agenda-ndays you define the "clever way" to me? :-)

I guess I misformulated here.  In fact, the current code
does behave cleverly already.  You implementation does in
fact switch back to the default number of days whenever I
issue a new agenda command.  For example if I set
org-agenda-span to 3,` C-c a a' gives me three days.
Then I use a custom command which does the agenda with
2 days, and that sticks through `f' and `b' and `g'
commands, as it should.  But when I do `C-c a a' again,
I get back to the default span of 3 days.  I like that.
So there you have your command to go back to the default
span.

If you think we do need an extra command for this, you
could do that under the "v" dispatcher in the agenda.
Maybe "v SPACE"?

- Carsten

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-18  9:43                         ` Carsten Dominik
@ 2011-01-18 10:00                           ` Julien Danjou
  2011-01-18 10:15                             ` Carsten Dominik
  0 siblings, 1 reply; 58+ messages in thread
From: Julien Danjou @ 2011-01-18 10:00 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


[-- Attachment #1.1.1: Type: text/plain, Size: 818 bytes --]

On Tue, Jan 18 2011, Carsten Dominik wrote:

> Otherwise, if would continue to use whatever value you set with your
> latest view change and keep this until you change it again.
>
>
> So what was your issue with this part?

My issue is that I use a default value of 14 days (you know I'm weird).
If I change the current span by pressing `d', `w', `m', I've only one
way to go back to my default 14 days view: close the agenda and reopen
it.


[…]

> So there you have your command to go back to the default
> span.

Yes, but:

> If you think we do need an extra command for this, you
> could do that under the "v" dispatcher in the agenda.
> Maybe "v SPACE"?

This is exactly what I meant! :-)
I'd like to not to have to do `C-a a' once again to reset my view.

Here's a patch for that.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-org-agenda-add-a-binding-to-reset-the-view.patch --]
[-- Type: text/x-diff, Size: 1909 bytes --]

From f48b89a683f9ff36d164b20c1df44ca6e6aefd7e Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Tue, 18 Jan 2011 10:59:13 +0100
Subject: [PATCH] org-agenda: add a binding to reset the view

* org-agenda.el (org-agenda-reset-view): New function.
(org-agenda-view-mode-dispatch): Bind space to org-agenda-reset-view.

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/org-agenda.el |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 241ed30..138165f 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6157,11 +6157,12 @@ With prefix ARG, go backward that many times the current span."
 (defun org-agenda-view-mode-dispatch ()
   "Call one of the view mode commands."
   (interactive)
-  (message "View: [d]ay [w]eek [m]onth [y]ear                         [q]uit/abort
+  (message "View: [d]ay [w]eek [m]onth [y]ear    [space]reset    [q]uit/abort
       time[G]rid     [[]inactive [f]ollow [l]og [L]og-all   [E]ntryText
       [a]rch-trees   [A]rch-files    clock[R]eport   include[D]iary")
   (let ((a (read-char-exclusive)))
     (case a
+      (?  (call-interactively 'org-agenda-reset-view))
       (?d (call-interactively 'org-agenda-day-view))
       (?w (call-interactively 'org-agenda-week-view))
       (?m (call-interactively 'org-agenda-month-view))
@@ -6183,6 +6184,10 @@ With prefix ARG, go backward that many times the current span."
       (?q (message "Abort"))
       (otherwise (error "Invalid key" )))))
 
+(defun org-agenda-reset-view ()
+  "Switch to default view for agenda."
+  (interactive)
+  (org-agenda-change-time-span (or org-agenda-ndays org-agenda-span)))
 (defun org-agenda-day-view (&optional day-of-year)
   "Switch to daily view for agenda.
 With argument DAY-OF-YEAR, switch to that day of the year."
-- 
1.7.2.3


[-- Attachment #1.1.3: Type: text/plain, Size: 53 bytes --]


-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-18 10:00                           ` Julien Danjou
@ 2011-01-18 10:15                             ` Carsten Dominik
  0 siblings, 0 replies; 58+ messages in thread
From: Carsten Dominik @ 2011-01-18 10:15 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


On Jan 18, 2011, at 11:00 AM, Julien Danjou wrote:

> On Tue, Jan 18 2011, Carsten Dominik wrote:
>
>> Otherwise, if would continue to use whatever value you set with your
>> latest view change and keep this until you change it again.
>>
>>
>> So what was your issue with this part?
>
> My issue is that I use a default value of 14 days (you know I'm  
> weird).
> If I change the current span by pressing `d', `w', `m', I've only one
> way to go back to my default 14 days view: close the agenda and reopen
> it.
>
>
> […]
>
>> So there you have your command to go back to the default
>> span.
>
> Yes, but:
>
>> If you think we do need an extra command for this, you
>> could do that under the "v" dispatcher in the agenda.
>> Maybe "v SPACE"?
>
> This is exactly what I meant! :-)
> I'd like to not to have to do `C-a a' once again to reset my view.
>
> Here's a patch for that.

I applied the patch, with minor modifications and added documentation.
Thanks.

- Carsten

> From f48b89a683f9ff36d164b20c1df44ca6e6aefd7e Mon Sep 17 00:00:00 2001
> From: Julien Danjou <julien@danjou.info>
> Date: Tue, 18 Jan 2011 10:59:13 +0100
> Subject: [PATCH] org-agenda: add a binding to reset the view
>
> * org-agenda.el (org-agenda-reset-view): New function.
> (org-agenda-view-mode-dispatch): Bind space to org-agenda-reset-view.
>
> Signed-off-by: Julien Danjou <julien@danjou.info>
> ---
> lisp/org-agenda.el |    7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 241ed30..138165f 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -6157,11 +6157,12 @@ With prefix ARG, go backward that many times  
> the current span."
> (defun org-agenda-view-mode-dispatch ()
>   "Call one of the view mode commands."
>   (interactive)
> -  (message "View: [d]ay [w]eek [m]onth  
> [y]ear                         [q]uit/abort
> +  (message "View: [d]ay [w]eek [m]onth [y]ear    [space]reset     
> [q]uit/abort
>       time[G]rid     [[]inactive [f]ollow [l]og [L]og-all    
> [E]ntryText
>       [a]rch-trees   [A]rch-files    clock[R]eport   include[D]iary")
>   (let ((a (read-char-exclusive)))
>     (case a
> +      (?  (call-interactively 'org-agenda-reset-view))
>       (?d (call-interactively 'org-agenda-day-view))
>       (?w (call-interactively 'org-agenda-week-view))
>       (?m (call-interactively 'org-agenda-month-view))
> @@ -6183,6 +6184,10 @@ With prefix ARG, go backward that many times  
> the current span."
>       (?q (message "Abort"))
>       (otherwise (error "Invalid key" )))))
>
> +(defun org-agenda-reset-view ()
> +  "Switch to default view for agenda."
> +  (interactive)
> +  (org-agenda-change-time-span (or org-agenda-ndays org-agenda- 
> span)))
> (defun org-agenda-day-view (&optional day-of-year)
>   "Switch to daily view for agenda.
> With argument DAY-OF-YEAR, switch to that day of the year."
> -- 
> 1.7.2.3
>
>
> -- 
> Julien Danjou
> ❱ http://julien.danjou.info

- Carsten

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 15:08                 ` Julien Danjou
  2011-01-17 16:34                   ` Julien Danjou
  2011-01-17 16:47                   ` Bernt Hansen
@ 2011-01-28 15:18                   ` Julien Danjou
  2011-01-28 15:43                     ` Giovanni Ridolfi
  2011-02-01 11:52                   ` [Accepted] " Bastien Guerry
  3 siblings, 1 reply; 58+ messages in thread
From: Julien Danjou @ 2011-01-28 15:18 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M


[-- Attachment #1.1: Type: text/plain, Size: 1688 bytes --]

On Mon, Jan 17 2011, Julien Danjou wrote:

This patch has not been installed, and it should be since the problem is
still here.

> I've followed but not sure I understood what the bug is. But from my
> various tries, I found a bug: when pressing 'j', the current span is
> discarded.
>
> Attached is a patch that should fix that, even for future use of
> `org-agenda-list' with the span unspecified. :)
>
>
> From 9dd2fe6650b858a4083ebc083bb8d10a0d6ac7f2 Mon Sep 17 00:00:00 2001
> From: Julien Danjou <julien@danjou.info>
> Date: Mon, 17 Jan 2011 16:05:28 +0100
> Subject: [PATCH] Fix agenda span on date jump
>
> * org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
> possible default span if it is set.
>
> Signed-off-by: Julien Danjou <julien@danjou.info>
> ---
>  lisp/org-agenda.el |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 0cd620c..0d695b5 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -3450,7 +3450,10 @@ given in `org-agenda-start-on-weekday'."
>    (setq org-agenda-last-arguments (list include-all start-day span))
>    (org-compile-prefix-format 'agenda)
>    (org-set-sorting-strategy 'agenda)
> -  (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
> +  (let* ((span (org-agenda-ndays-to-span (or span
> +					     org-agenda-current-span
> +					     org-agenda-ndays
> +					     org-agenda-span)))
>  	 (today (org-today))
>  	 (sd (or start-day today))
>  	 (ndays (org-agenda-span-to-ndays span sd))
> -- 
> 1.7.2.3

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-28 15:18                   ` Julien Danjou
@ 2011-01-28 15:43                     ` Giovanni Ridolfi
  2011-01-28 16:10                       ` Julien Danjou
  0 siblings, 1 reply; 58+ messages in thread
From: Giovanni Ridolfi @ 2011-01-28 15:43 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Bernt Hansen, Org Mode, Noorul Islam K M, Bastien

Julien Danjou <julien@danjou.info> writes:

> On Mon, Jan 17 2011, Julien Danjou wrote:
>
> This patch has not been installed, and it should be since the problem is
> still here.
>
It is patch number 543:
http://patchwork.newartisans.com/patch/543/

and it has been rejected
(see:
http://patchwork.newartisans.com/project/org-mode/list/?state=4&archive=true 
)

I suppose that Bastien made a mistake, since there were two patches
with the same "subject" one after the other, and the newest patch
has been accepted.

Cheers,
Giovanni


>> From 9dd2fe6650b858a4083ebc083bb8d10a0d6ac7f2 Mon Sep 17 00:00:00 2001
>> From: Julien Danjou <julien@danjou.info>
>> Date: Mon, 17 Jan 2011 16:05:28 +0100
>> Subject: [PATCH] Fix agenda span on date jump
>>
>> * org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
>> possible default span if it is set.
>>
>> Signed-off-by: Julien Danjou <julien@danjou.info>
>> ---
>>  lisp/org-agenda.el |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
>> index 0cd620c..0d695b5 100644
>> --- a/lisp/org-agenda.el
>> +++ b/lisp/org-agenda.el
>> @@ -3450,7 +3450,10 @@ given in `org-agenda-start-on-weekday'."
>>    (setq org-agenda-last-arguments (list include-all start-day span))
>>    (org-compile-prefix-format 'agenda)
>>    (org-set-sorting-strategy 'agenda)
>> -  (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
>> +  (let* ((span (org-agenda-ndays-to-span (or span
>> +					     org-agenda-current-span
>> +					     org-agenda-ndays
>> +					     org-agenda-span)))
>>  	 (today (org-today))
>>  	 (sd (or start-day today))
>>  	 (ndays (org-agenda-span-to-ndays span sd))
>> -- 
>> 1.7.2.3

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-28 15:43                     ` Giovanni Ridolfi
@ 2011-01-28 16:10                       ` Julien Danjou
  2011-02-01 11:52                         ` Bastien
  0 siblings, 1 reply; 58+ messages in thread
From: Julien Danjou @ 2011-01-28 16:10 UTC (permalink / raw)
  To: Giovanni Ridolfi
  Cc: Bernt Hansen, Bastien, Org Mode, Noorul Islam K M,
	Carsten Dominik


[-- Attachment #1.1: Type: text/plain, Size: 422 bytes --]

On Fri, Jan 28 2011, Giovanni Ridolfi wrote:

> I suppose that Bastien made a mistake, since there were two patches
> with the same "subject" one after the other, and the newest patch
> has been accepted.

Probably. I unarchived it and set it state to 'New' again, since it
seems I have the right to do that in the interface.
I hope it's the good thing to do.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-17 15:08                 ` Julien Danjou
                                     ` (2 preceding siblings ...)
  2011-01-28 15:18                   ` Julien Danjou
@ 2011-02-01 11:52                   ` Bastien Guerry
  2011-02-05  1:20                     ` Matt Lundin
  3 siblings, 1 reply; 58+ messages in thread
From: Bastien Guerry @ 2011-02-01 11:52 UTC (permalink / raw)
  To: emacs-orgmode

Patch 543 (http://patchwork.newartisans.com/patch/543/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3Csa3ei8b1sbv.fsf%40cigue.easter-eggs.fr%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [Orgmode] Re: Bug: Jumping to a date in the agenda changes view back
> 	to 'day' [7.4 (release_7.4.80.g0e5e5)]
> Date: Mon, 17 Jan 2011 20:08:04 -0000
> From: Julien Danjou <julien@danjou.info>
> X-Patchwork-Id: 543
> Message-Id: <sa3ei8b1sbv.fsf@cigue.easter-eggs.fr>
> To: Carsten Dominik <carsten.dominik@gmail.com>
> Cc: Bernt Hansen <bernt@norang.ca>, Org Mode <emacs-orgmode@gnu.org>,
> 	Noorul Islam K M <noorul@noorul.com>
> 
> On Mon, Jan 17 2011, Carsten Dominik wrote:
> 
> > have you been following this thread?  I think this has to do with your
> > rewrite of the dagenda span stuff.  Maybe you can find out better and
> > faster that I why this goes wrong?  Please read the entire thread.
> 
> I've followed but not sure I understood what the bug is. But from my
> various tries, I found a bug: when pressing 'j', the current span is
> discarded.
> 
> Attached is a patch that should fix that, even for future use of
> `org-agenda-list' with the span unspecified. :)
> 
> 
> >From 9dd2fe6650b858a4083ebc083bb8d10a0d6ac7f2 Mon Sep 17 00:00:00 2001
> From: Julien Danjou <julien@danjou.info>
> Date: Mon, 17 Jan 2011 16:05:28 +0100
> Subject: [PATCH] Fix agenda span on date jump
> 
> * org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
> possible default span if it is set.
> 
> Signed-off-by: Julien Danjou <julien@danjou.info>
> ---
>  lisp/org-agenda.el |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 0cd620c..0d695b5 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -3450,7 +3450,10 @@ given in `org-agenda-start-on-weekday'."
>    (setq org-agenda-last-arguments (list include-all start-day span))
>    (org-compile-prefix-format 'agenda)
>    (org-set-sorting-strategy 'agenda)
> -  (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
> +  (let* ((span (org-agenda-ndays-to-span (or span
> +					     org-agenda-current-span
> +					     org-agenda-ndays
> +					     org-agenda-span)))
>  	 (today (org-today))
>  	 (sd (or start-day today))
>  	 (ndays (org-agenda-span-to-ndays span sd))
> -- 
> 1.7.2.3
> 
> 

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

* Re: Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-01-28 16:10                       ` Julien Danjou
@ 2011-02-01 11:52                         ` Bastien
  0 siblings, 0 replies; 58+ messages in thread
From: Bastien @ 2011-02-01 11:52 UTC (permalink / raw)
  To: Giovanni Ridolfi
  Cc: Bernt Hansen, Org Mode, Noorul Islam K M, Carsten Dominik

Julien Danjou <julien@danjou.info> writes:

> On Fri, Jan 28 2011, Giovanni Ridolfi wrote:
>
>> I suppose that Bastien made a mistake, since there were two patches
>> with the same "subject" one after the other, and the newest patch
>> has been accepted.

Yes, my bad.

> Probably. I unarchived it and set it state to 'New' again, since it
> seems I have the right to do that in the interface.
> I hope it's the good thing to do.

It is, thanks for this.

I've applied this patch now.

Thanks,

-- 
 Bastien

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-01 11:52                   ` [Accepted] " Bastien Guerry
@ 2011-02-05  1:20                     ` Matt Lundin
  2011-02-05  8:56                       ` Julien Danjou
                                         ` (2 more replies)
  0 siblings, 3 replies; 58+ messages in thread
From: Matt Lundin @ 2011-02-05  1:20 UTC (permalink / raw)
  To: Bastien Guerry, Julien Danjou; +Cc: emacs-orgmode

Bastien Guerry <bzg@altern.org> writes:

> Patch 543 (http://patchwork.newartisans.com/patch/543/) is now "Accepted".

>> * org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
>> possible default span if it is set.
>> 
>> Signed-off-by: Julien Danjou <julien@danjou.info>
>> ---
>>  lisp/org-agenda.el |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>> 
>> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
>> index 0cd620c..0d695b5 100644
>> --- a/lisp/org-agenda.el
>> +++ b/lisp/org-agenda.el
>> @@ -3450,7 +3450,10 @@ given in `org-agenda-start-on-weekday'."
>>    (setq org-agenda-last-arguments (list include-all start-day span))
>>    (org-compile-prefix-format 'agenda)
>>    (org-set-sorting-strategy 'agenda)
>> -  (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
>> +  (let* ((span (org-agenda-ndays-to-span (or span
>> +					     org-agenda-current-span
>> +					     org-agenda-ndays
>> +					     org-agenda-span)))
>>  	 (today (org-today))
>>  	 (sd (or start-day today))
>>  	 (ndays (org-agenda-span-to-ndays span sd))
>> -- 

This patch breaks custom commands --- i.e., if one binds org-agenda-span
in a custom command, it seems to be overridden by the span of whatever
agenda command one last called (i.e., org-agenda-current-span).

Steps to replicate:

1. (setq org-agenda-span 'day)

2. M-x org-agenda-list

3. Check the value of org-agenda-current-span => day

4. Call the following custom command:

(setq org-agenda-custom-commands
      '(("c" "Calendar" agenda ""
	 ((org-agenda-span 'week)
	  (org-agenda-start-on-weekday 0)	
	  (org-agenda-time-grid nil)
	  (org-agenda-entry-types '(:timestamp :sexp))
	  (org-agenda-prefix-format " %-12:t ")
	  (org-deadline-warning-days 0)
	  (org-agenda-include-all-todo nil)
	  (org-agenda-repeating-timestamp-show-all t)
	  ))))

This results in only a day view because org-agenda-current-span is still
'day.

Best,
Matt

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-05  1:20                     ` Matt Lundin
@ 2011-02-05  8:56                       ` Julien Danjou
  2011-02-07 11:39                       ` Julien Danjou
  2011-02-24 14:38                       ` Matt Lundin
  2 siblings, 0 replies; 58+ messages in thread
From: Julien Danjou @ 2011-02-05  8:56 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Bastien Guerry, emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1097 bytes --]

On Sat, Feb 05 2011, Matt Lundin wrote:

> This patch breaks custom commands --- i.e., if one binds org-agenda-span
> in a custom command, it seems to be overridden by the span of whatever
> agenda command one last called (i.e., org-agenda-current-span).
>
> Steps to replicate:
>
> 1. (setq org-agenda-span 'day)
>
> 2. M-x org-agenda-list
>
> 3. Check the value of org-agenda-current-span => day
>
> 4. Call the following custom command:
>
> (setq org-agenda-custom-commands
>       '(("c" "Calendar" agenda ""
> 	 ((org-agenda-span 'week)
> 	  (org-agenda-start-on-weekday 0)	
> 	  (org-agenda-time-grid nil)
> 	  (org-agenda-entry-types '(:timestamp :sexp))
> 	  (org-agenda-prefix-format " %-12:t ")
> 	  (org-deadline-warning-days 0)
> 	  (org-agenda-include-all-todo nil)
> 	  (org-agenda-repeating-timestamp-show-all t)
> 	  ))))
>
> This results in only a day view because org-agenda-current-span is still
> 'day.

Yes, this has already been reported, I just did not had the time to find
a proper fix.

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-05  1:20                     ` Matt Lundin
  2011-02-05  8:56                       ` Julien Danjou
@ 2011-02-07 11:39                       ` Julien Danjou
  2011-02-08 17:05                         ` [Accepted] " Bastien Guerry
  2011-02-09 16:37                         ` Bastien
  2011-02-24 14:38                       ` Matt Lundin
  2 siblings, 2 replies; 58+ messages in thread
From: Julien Danjou @ 2011-02-07 11:39 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Bastien Guerry, emacs-orgmode


[-- Attachment #1.1.1: Type: text/plain, Size: 403 bytes --]

On Sat, Feb 05 2011, Matt Lundin wrote:

> This results in only a day view because org-agenda-current-span is still
> 'day.

Here's a proposal fix.

I could have setq org-agenda-current-span to nil as a work around, but
it seems more logical to just kill all the local variables. That is, a
custom agenda view would not keep any of the local variable of the
previous agenda, which seems logical to me.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-org-agenda-kill-local-variables-in-agenda-view.patch --]
[-- Type: text/x-diff, Size: 1136 bytes --]

From b48fc7c395dffea60df20c23b26e362ac0354b01 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Mon, 7 Feb 2011 12:36:42 +0100
Subject: [PATCH] org-agenda: kill local variables in agenda view

* org-agenda.el (org-agenda): Kill all local variables. This
assures we are not keeping buffer variable from an old agenda view
when switching to a new custom agenda.

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/org-agenda.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index d146f83..9a3d953 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2161,6 +2161,8 @@ Pressing `<' twice means to restrict to the current subtree or region
       (put 'org-agenda-redo-command 'org-lprops nil)
       ;; Remember where this call originated
       (setq org-agenda-last-dispatch-buffer (current-buffer))
+      ;; Remove all local variables
+      (kill-all-local-variables)
       (unless keys
 	(setq ans (org-agenda-get-restriction-and-command prefix-descriptions)
 	      keys (car ans)
-- 
1.7.2.3


[-- Attachment #1.1.3: Type: text/plain, Size: 53 bytes --]


-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* [Accepted] Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-07 11:39                       ` Julien Danjou
@ 2011-02-08 17:05                         ` Bastien Guerry
  2011-02-09 16:37                         ` Bastien
  1 sibling, 0 replies; 58+ messages in thread
From: Bastien Guerry @ 2011-02-08 17:05 UTC (permalink / raw)
  To: emacs-orgmode

Patch 587 (http://patchwork.newartisans.com/patch/587/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C87sjvzaezr.fsf%40keller.adm.naquadah.org%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [Orgmode] Re: [Accepted] Re: Bug: Jumping to a date in the agenda
> 	changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
> Date: Mon, 07 Feb 2011 16:39:17 -0000
> From: Julien Danjou <julien@danjou.info>
> X-Patchwork-Id: 587
> Message-Id: <87sjvzaezr.fsf@keller.adm.naquadah.org>
> To: Matt Lundin <mdl@imapmail.org>
> Cc: Bastien Guerry <bzg@altern.org>, emacs-orgmode@gnu.org
> 
> On Sat, Feb 05 2011, Matt Lundin wrote:
> 
> > This results in only a day view because org-agenda-current-span is still
> > 'day.
> 
> Here's a proposal fix.
> 
> I could have setq org-agenda-current-span to nil as a work around, but
> it seems more logical to just kill all the local variables. That is, a
> custom agenda view would not keep any of the local variable of the
> previous agenda, which seems logical to me.
> 
> 
> >From b48fc7c395dffea60df20c23b26e362ac0354b01 Mon Sep 17 00:00:00 2001
> From: Julien Danjou <julien@danjou.info>
> Date: Mon, 7 Feb 2011 12:36:42 +0100
> Subject: [PATCH] org-agenda: kill local variables in agenda view
> 
> * org-agenda.el (org-agenda): Kill all local variables. This
> assures we are not keeping buffer variable from an old agenda view
> when switching to a new custom agenda.
> 
> Signed-off-by: Julien Danjou <julien@danjou.info>
> ---
>  lisp/org-agenda.el |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index d146f83..9a3d953 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -2161,6 +2161,8 @@ Pressing `<' twice means to restrict to the current subtree or region
>        (put 'org-agenda-redo-command 'org-lprops nil)
>        ;; Remember where this call originated
>        (setq org-agenda-last-dispatch-buffer (current-buffer))
> +      ;; Remove all local variables
> +      (kill-all-local-variables)
>        (unless keys
>  	(setq ans (org-agenda-get-restriction-and-command prefix-descriptions)
>  	      keys (car ans)
> -- 
> 1.7.2.3
> 
> 

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-07 11:39                       ` Julien Danjou
  2011-02-08 17:05                         ` [Accepted] " Bastien Guerry
@ 2011-02-09 16:37                         ` Bastien
  2011-02-10  9:20                           ` Carsten Dominik
  1 sibling, 1 reply; 58+ messages in thread
From: Bastien @ 2011-02-09 16:37 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode

Julien Danjou <julien@danjou.info> writes:

> On Sat, Feb 05 2011, Matt Lundin wrote:
>
>> This results in only a day view because org-agenda-current-span is still
>> 'day.
>
> Here's a proposal fix.

I applied it to early, I made the error of not testing it 
with a bare "emacs -q".

The fix is not okay.  Let's find a better solution.

Thanks,

-- 
 Bastien

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-09 16:37                         ` Bastien
@ 2011-02-10  9:20                           ` Carsten Dominik
  2011-02-10 10:51                             ` Julien Danjou
  2011-02-10 11:18                             ` Michael Brand
  0 siblings, 2 replies; 58+ messages in thread
From: Carsten Dominik @ 2011-02-10  9:20 UTC (permalink / raw)
  To: Bastien; +Cc: Matt Lundin, emacs-orgmode


On Feb 9, 2011, at 5:37 PM, Bastien wrote:

> Julien Danjou <julien@danjou.info> writes:
> 
>> On Sat, Feb 05 2011, Matt Lundin wrote:
>> 
>>> This results in only a day view because org-agenda-current-span is still
>>> 'day.
>> 
>> Here's a proposal fix.
> 
> I applied it to early, I made the error of not testing it 
> with a bare "emacs -q".
> 
> The fix is not okay.  Let's find a better solution.

I am not sure if I know exactly what the remaining problem is.
Could someone summarize this - I'd be happy to take a look and see if I can fix it.

- Carsten

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10  9:20                           ` Carsten Dominik
@ 2011-02-10 10:51                             ` Julien Danjou
  2011-02-10 11:50                               ` Carsten Dominik
  2011-02-10 11:18                             ` Michael Brand
  1 sibling, 1 reply; 58+ messages in thread
From: Julien Danjou @ 2011-02-10 10:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode, Bastien


[-- Attachment #1.1: Type: text/plain, Size: 807 bytes --]

On Thu, Feb 10 2011, Carsten Dominik wrote:

> I am not sure if I know exactly what the remaining problem is.
> Could someone summarize this - I'd be happy to take a look and see if I can fix it.

The problem is that org-agenda-list, when called use as span either:
 (or span org-agenda-current-span org-agenda-span)

Or, when defining a custom agenda view, and calling it, the Agenda
buffer is reused. Therefore, if your agenda view locally bind
org-agenda-span to 'day, whereas org-agenda-current-span was previously
set to 'week, it does not work.

This is why I've added a kill-local-variable in custom agenda view,
which seems quite a good thing. Bastien says it does not work with
emacs -q, but I don't why unfortunately. Bastien?

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10  9:20                           ` Carsten Dominik
  2011-02-10 10:51                             ` Julien Danjou
@ 2011-02-10 11:18                             ` Michael Brand
  2011-02-10 11:55                               ` Carsten Dominik
  1 sibling, 1 reply; 58+ messages in thread
From: Michael Brand @ 2011-02-10 11:18 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Hi Carsten

On Thu, Feb 10, 2011 at 10:20, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
> I am not sure if I know exactly what the remaining problem is.
> Could someone summarize this - I'd be happy to take a look and see if I can fix it.

Not the summary you asked for but a related issue, could you please
also consider the following?

* test case: `d g' in custom agenda view
  1) emacs -q --eval "(progn \
         (global-set-key (kbd \"C-c a\") 'org-agenda) \
         (setq org-agenda-custom-commands \
             '((\"x\" \"test\" ((agenda))))))"
  2) C-c a a d g: `g' stays in "view day" like expected
  3) C-c a x d g: `g' changes back to "view week" but I expect it to
     stay in "view day" like above

  This is described as "issue part 1)" in this post/thread
  http://thread.gmane.org/gmane.emacs.orgmode/35403/focus=36776
  and like described there was introduced with the commit
  http://orgmode.org/w/org-mode.git/commitdiff/0d0edd6d21ade8e8617c51e3594ea4e87040e05f

* test case: `w f d g' in custom agenda view
  1) emacs -q --eval "(progn \
         (global-set-key (kbd \"C-c a\") 'org-agenda) \
         (setq org-agenda-custom-commands \
             '((\"x\" \"test\" ((agenda))))))"
  2) C-c a a f d g: `g' stays on the day of the next week like
     expected
  3) C-c a x f d g: `g' does not stay on the day of the next week but
     is expected to do like above

  This is described as "issue part 2)" also in this post/thread
  http://thread.gmane.org/gmane.emacs.orgmode/35403/focus=36776
  (unlike the above this is not related with the commit mentioned above)

Michael

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10 10:51                             ` Julien Danjou
@ 2011-02-10 11:50                               ` Carsten Dominik
  2011-02-10 12:00                                 ` Julien Danjou
  0 siblings, 1 reply; 58+ messages in thread
From: Carsten Dominik @ 2011-02-10 11:50 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Matt Lundin, emacs-orgmode, Bastien


On Feb 10, 2011, at 11:51 AM, Julien Danjou wrote:

> On Thu, Feb 10 2011, Carsten Dominik wrote:
> 
>> I am not sure if I know exactly what the remaining problem is.
>> Could someone summarize this - I'd be happy to take a look and see if I can fix it.
> 
> The problem is that org-agenda-list, when called use as span either:
> (or span org-agenda-current-span org-agenda-span)
> 
> Or, when defining a custom agenda view, and calling it, the Agenda
> buffer is reused. Therefore, if your agenda view locally bind
> org-agenda-span to 'day, whereas org-agenda-current-span was previously
> set to 'week, it does not work.
> 
> This is why I've added a kill-local-variable in custom agenda view,
> which seems quite a good thing. Bastien says it does not work with
> emacs -q, but I don't why unfortunately. Bastien?

No, I believe you did kill-all-local-variables, which is a very bad
idea.  Org uses local variables to remember settings when refreshing.
And apparently this call was executed in an innocent org
buffer, reverting its major mode to fundamental mode. :)

But maybe you can just delocalize that one variable instead,
using kill-local-variable?

- Carsten

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10 11:18                             ` Michael Brand
@ 2011-02-10 11:55                               ` Carsten Dominik
  0 siblings, 0 replies; 58+ messages in thread
From: Carsten Dominik @ 2011-02-10 11:55 UTC (permalink / raw)
  To: Michael Brand; +Cc: emacs-orgmode

Hi Michael,

thanks.

- Carsten

On Feb 10, 2011, at 12:18 PM, Michael Brand wrote:

> Hi Carsten
> 
> On Thu, Feb 10, 2011 at 10:20, Carsten Dominik
> <carsten.dominik@gmail.com> wrote:
>> I am not sure if I know exactly what the remaining problem is.
>> Could someone summarize this - I'd be happy to take a look and see if I can fix it.
> 
> Not the summary you asked for but a related issue, could you please
> also consider the following?
> 
> * test case: `d g' in custom agenda view
>  1) emacs -q --eval "(progn \
>         (global-set-key (kbd \"C-c a\") 'org-agenda) \
>         (setq org-agenda-custom-commands \
>             '((\"x\" \"test\" ((agenda))))))"
>  2) C-c a a d g: `g' stays in "view day" like expected
>  3) C-c a x d g: `g' changes back to "view week" but I expect it to
>     stay in "view day" like above
> 
>  This is described as "issue part 1)" in this post/thread
>  http://thread.gmane.org/gmane.emacs.orgmode/35403/focus=36776
>  and like described there was introduced with the commit
>  http://orgmode.org/w/org-mode.git/commitdiff/0d0edd6d21ade8e8617c51e3594ea4e87040e05f
> 
> * test case: `w f d g' in custom agenda view
>  1) emacs -q --eval "(progn \
>         (global-set-key (kbd \"C-c a\") 'org-agenda) \
>         (setq org-agenda-custom-commands \
>             '((\"x\" \"test\" ((agenda))))))"
>  2) C-c a a f d g: `g' stays on the day of the next week like
>     expected
>  3) C-c a x f d g: `g' does not stay on the day of the next week but
>     is expected to do like above
> 
>  This is described as "issue part 2)" also in this post/thread
>  http://thread.gmane.org/gmane.emacs.orgmode/35403/focus=36776
>  (unlike the above this is not related with the commit mentioned above)
> 
> Michael

- Carsten

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10 11:50                               ` Carsten Dominik
@ 2011-02-10 12:00                                 ` Julien Danjou
  2011-02-10 14:35                                   ` Bastien
  0 siblings, 1 reply; 58+ messages in thread
From: Julien Danjou @ 2011-02-10 12:00 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode, Bastien


[-- Attachment #1.1: Type: text/plain, Size: 741 bytes --]

On Thu, Feb 10 2011, Carsten Dominik wrote:

> No, I believe you did kill-all-local-variables, which is a very bad
> idea.  Org uses local variables to remember settings when refreshing.
> And apparently this call was executed in an innocent org
> buffer, reverting its major mode to fundamental mode. :)

That explains everything! My bad!

> But maybe you can just delocalize that one variable instead,
> using kill-local-variable?

It's a possibility, but I think it's more logical to "reset" every local
variable.

I think this call should be used in the appropriate buffer, the agenda
one, then. I'll try to send a patch later, but if you have time please
do so. :)

-- 
Julien Danjou
❱ http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10 12:00                                 ` Julien Danjou
@ 2011-02-10 14:35                                   ` Bastien
  2011-02-10 21:21                                     ` Michael Brand
  2011-02-17 13:57                                     ` Carsten Dominik
  0 siblings, 2 replies; 58+ messages in thread
From: Bastien @ 2011-02-10 14:35 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode

Julien Danjou <julien@danjou.info> writes:

>> But maybe you can just delocalize that one variable instead,
>> using kill-local-variable?
>
> It's a possibility, but I think it's more logical to "reset" every local
> variable.

I just pushed a (temporary) fix, following Carsten's suggestion of using
kill-local-variable.  I tested this with "emacs -q" and things work back
as usual.

Matt and Michael, please report any problem.

Michael, thanks for the detailed step-by-step way of reproducing the
problem with a bare emacs!  Quite useful.

Julien: I've pushed this (temporary) fix so that you don't feel too much
pressure about finding a more general solution.

Thanks!

-- 
 Bastien

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10 14:35                                   ` Bastien
@ 2011-02-10 21:21                                     ` Michael Brand
  2011-02-17 13:57                                     ` Carsten Dominik
  1 sibling, 0 replies; 58+ messages in thread
From: Michael Brand @ 2011-02-10 21:21 UTC (permalink / raw)
  To: Bastien; +Cc: Matt Lundin, emacs-orgmode, Carsten Dominik

Hi Bastien

On Thu, Feb 10, 2011 at 15:35, Bastien <bastien.guerry@wikimedia.fr> wrote:
> Matt and Michael, please report any problem.

The two test cases `d g' and `w f d g' in custom agenda view that I
described above do still not work like I expect.

> Michael, thanks for the detailed step-by-step way of reproducing the
> problem with a bare emacs!  Quite useful.

I have put my reply to this into a new thread called "automatic
regression test (again)":
http://thread.gmane.org/gmane.emacs.orgmode/37402

Michael

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-10 14:35                                   ` Bastien
  2011-02-10 21:21                                     ` Michael Brand
@ 2011-02-17 13:57                                     ` Carsten Dominik
  2011-02-17 14:43                                       ` Bastien
  2011-02-18 14:19                                       ` Bastien
  1 sibling, 2 replies; 58+ messages in thread
From: Carsten Dominik @ 2011-02-17 13:57 UTC (permalink / raw)
  To: Bastien, Julien Danjou; +Cc: Gábor Melis, Org Mode List

Hi Bastien, hi Julien,

For what it is worth, and for the record, I still do not
believe that this is the correct solution to the problem.
I believe it causes the issue reported in

    http://thread.gmane.org/gmane.emacs.orgmode/37673

But unfortunately I have not had time to study the issue
in more detail.  I hope to do this before the next release.

Kind regards.

- Carsten

On Feb 10, 2011, at 3:35 PM, Bastien wrote:

> Julien Danjou <julien@danjou.info> writes:
> 
>>> But maybe you can just delocalize that one variable instead,
>>> using kill-local-variable?
>> 
>> It's a possibility, but I think it's more logical to "reset" every local
>> variable.
> 
> I just pushed a (temporary) fix, following Carsten's suggestion of using
> kill-local-variable.  I tested this with "emacs -q" and things work back
> as usual.
> 
> Matt and Michael, please report any problem.
> 
> Michael, thanks for the detailed step-by-step way of reproducing the
> problem with a bare emacs!  Quite useful.
> 
> Julien: I've pushed this (temporary) fix so that you don't feel too much
> pressure about finding a more general solution.
> 
> Thanks!
> 
> -- 
> Bastien

- Carsten

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-17 13:57                                     ` Carsten Dominik
@ 2011-02-17 14:43                                       ` Bastien
  2011-02-18 14:19                                       ` Bastien
  1 sibling, 0 replies; 58+ messages in thread
From: Bastien @ 2011-02-17 14:43 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Julien Danjou, Gábor Melis, Org Mode List

Hi Carsten,

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

> For what it is worth, and for the record, I still do not
> believe that this is the correct solution to the problem.
> I believe it causes the issue reported in
>
>     http://thread.gmane.org/gmane.emacs.orgmode/37673
>
> But unfortunately I have not had time to study the issue
> in more detail.  I hope to do this before the next release.

thanks for the heads up -- this is on top of my priority list, 
hopefully I'll fix this soon.

Best,

-- 
 Bastien

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-17 13:57                                     ` Carsten Dominik
  2011-02-17 14:43                                       ` Bastien
@ 2011-02-18 14:19                                       ` Bastien
  2011-02-18 14:46                                         ` Gábor Melis
  2011-02-18 16:42                                         ` Carsten Dominik
  1 sibling, 2 replies; 58+ messages in thread
From: Bastien @ 2011-02-18 14:19 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Julien Danjou, Gábor Melis, Org Mode List

Hi Carsten and all,

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

> For what it is worth, and for the record, I still do not
> believe that this is the correct solution to the problem.

I've finally push a fix for this problem.  

The issue appeared when trying to redo a block agenda command,
where previous restrictions were not taking into account.

I tested the fix on various agenda custom views, with the tests 
provided by Michael (thanks!) and it looks fine.

Please report any problem, this issue is pretty essential.

Special thanks to Matt and Michael for their reports!

-- 
 Bastien

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-18 14:19                                       ` Bastien
@ 2011-02-18 14:46                                         ` Gábor Melis
  2011-02-18 16:42                                         ` Carsten Dominik
  1 sibling, 0 replies; 58+ messages in thread
From: Gábor Melis @ 2011-02-18 14:46 UTC (permalink / raw)
  To: Bastien; +Cc: Julien Danjou, Org Mode List, Carsten Dominik

Bastien <bastien.guerry@wikimedia.fr> writes:

> Hi Carsten and all,
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> For what it is worth, and for the record, I still do not
>> believe that this is the correct solution to the problem.
>
> I've finally push a fix for this problem.  
>
> The issue appeared when trying to redo a block agenda command,
> where previous restrictions were not taking into account.
>
> I tested the fix on various agenda custom views, with the tests 
> provided by Michael (thanks!) and it looks fine.
>
> Please report any problem, this issue is pretty essential.
>
> Special thanks to Matt and Michael for their reports!

I confirm that it's working as expected.

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-18 14:19                                       ` Bastien
  2011-02-18 14:46                                         ` Gábor Melis
@ 2011-02-18 16:42                                         ` Carsten Dominik
  2011-02-19  9:36                                           ` Bastien
  1 sibling, 1 reply; 58+ messages in thread
From: Carsten Dominik @ 2011-02-18 16:42 UTC (permalink / raw)
  To: Bastien; +Cc: Julien Danjou, Gábor Melis, Org Mode List

Hi Bastien,

On Feb 18, 2011, at 3:19 PM, Bastien wrote:

> Hi Carsten and all,
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> For what it is worth, and for the record, I still do not
>> believe that this is the correct solution to the problem.
>
> I've finally push a fix for this problem.
>
> The issue appeared when trying to redo a block agenda command,
> where previous restrictions were not taking into account.
>
> I tested the fix on various agenda custom views, with the tests
> provided by Michael (thanks!) and it looks fine.

wow, you found your way through the agenda code maze.
Looks good to me!  Thanks for getting this fixed, so
that Juliens cleaner implementation can stay the basis
for time span setting.

- Carsten

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-18 16:42                                         ` Carsten Dominik
@ 2011-02-19  9:36                                           ` Bastien
  0 siblings, 0 replies; 58+ messages in thread
From: Bastien @ 2011-02-19  9:36 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Julien Danjou, Gábor Melis, Org Mode List

Hi Carsten,

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

> wow, you found your way through the agenda code maze.

Yeah, the trip in the code was really a-mazing :)

> Looks good to me!  Thanks for getting this fixed, so
> that Juliens cleaner implementation can stay the basis
> for time span setting.

This basis is quite an improvement, so it deserved the time 
spent to fix this bug (and to learn the code)...

-- 
 Bastien

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-05  1:20                     ` Matt Lundin
  2011-02-05  8:56                       ` Julien Danjou
  2011-02-07 11:39                       ` Julien Danjou
@ 2011-02-24 14:38                       ` Matt Lundin
  2011-02-24 15:01                         ` Matt Lundin
  2 siblings, 1 reply; 58+ messages in thread
From: Matt Lundin @ 2011-02-24 14:38 UTC (permalink / raw)
  To: Bastien Guerry; +Cc: Julien Danjou, emacs-orgmode

Matt Lundin <mdl@imapmail.org> writes:

> Bastien Guerry <bzg@altern.org> writes:
>
>> Patch 543 (http://patchwork.newartisans.com/patch/543/) is now "Accepted".
>
>>> * org-agenda.el (org-agenda-list): Use org-agenda-current-span as a
>>> possible default span if it is set.

> This patch breaks custom commands --- i.e., if one binds org-agenda-span
> in a custom command, it seems to be overridden by the span of whatever
> agenda command one last called (i.e., org-agenda-current-span).
>
> Steps to replicate:
>
> 1. (setq org-agenda-span 'day)
>
> 2. M-x org-agenda-list
>
> 3. Check the value of org-agenda-current-span => day
>
> 4. Call the following custom command:
>
> (setq org-agenda-custom-commands
>       '(("c" "Calendar" agenda ""
> 	 ((org-agenda-span 'week)
> 	  (org-agenda-start-on-weekday 0)	
> 	  (org-agenda-time-grid nil)
> 	  (org-agenda-entry-types '(:timestamp :sexp))
> 	  (org-agenda-prefix-format " %-12:t ")
> 	  (org-deadline-warning-days 0)
> 	  (org-agenda-include-all-todo nil)
> 	  (org-agenda-repeating-timestamp-show-all t)
> 	  ))))
>
> This results in only a day view because org-agenda-current-span is still
> 'day.
>

Has there been any progress on this issue? I am finding that the local
span bindings in the custom command above still do not have any effect.
My default agenda span is a day. If I call the custom command above, it
displays only one day, despite the local setting.

Best,
Matt

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-24 14:38                       ` Matt Lundin
@ 2011-02-24 15:01                         ` Matt Lundin
  2011-02-25  0:11                           ` Bastien
  2011-03-06 15:40                           ` Bastien
  0 siblings, 2 replies; 58+ messages in thread
From: Matt Lundin @ 2011-02-24 15:01 UTC (permalink / raw)
  To: Bastien Guerry; +Cc: Julien Danjou, emacs-orgmode

Matt Lundin <mdl@imapmail.org> writes:
>
> Has there been any progress on this issue? I am finding that the local
> span bindings in the custom command above still do not have any effect.
> My default agenda span is a day. If I call the custom command above, it
> displays only one day, despite the local setting.

I think I know what's happening. The custom agenda commands had been
working properly until this commit on Feb 18, which brought back the
behavior described above:

c6dbde1babaa0b2efa278d75a6ec82f91ef59d5e

Thanks,
Matt

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-24 15:01                         ` Matt Lundin
@ 2011-02-25  0:11                           ` Bastien
  2011-02-25  0:15                             ` Bastien
  2011-03-06 15:40                           ` Bastien
  1 sibling, 1 reply; 58+ messages in thread
From: Bastien @ 2011-02-25  0:11 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Julien Danjou, emacs-orgmode

Hi Matt,

Matt Lundin <mdl@imapmail.org> writes:

> Matt Lundin <mdl@imapmail.org> writes:
>>
>> Has there been any progress on this issue? I am finding that the local
>> span bindings in the custom command above still do not have any effect.
>> My default agenda span is a day. If I call the custom command above, it
>> displays only one day, despite the local setting.
>
> I think I know what's happening. The custom agenda commands had been
> working properly until this commit on Feb 18, which brought back the
> behavior described above:
>
> c6dbde1babaa0b2efa278d75a6ec82f91ef59d5e

This commit should have fixed the issue - not brought it back :/

I'm not able to reproduce your problem with emacs -q and the minimal
configuration you proposed.  Can I ask you to check again?

Thanks,

-- 
 Bastien

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-25  0:11                           ` Bastien
@ 2011-02-25  0:15                             ` Bastien
  0 siblings, 0 replies; 58+ messages in thread
From: Bastien @ 2011-02-25  0:15 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Julien Danjou, emacs-orgmode

Hi Matt,

Bastien <bzg@altern.org> writes:

> I'm not able to reproduce your problem with emacs -q and the minimal
> configuration you proposed.  Can I ask you to check again?

Forget my message - I *can* reproduce your issue, I will investigate
this tomorrow.

Thanks for your patience,

-- 
 Bastien

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-02-24 15:01                         ` Matt Lundin
  2011-02-25  0:11                           ` Bastien
@ 2011-03-06 15:40                           ` Bastien
  2011-03-06 16:47                             ` Michael Brand
  2011-03-07 18:26                             ` Matt Lundin
  1 sibling, 2 replies; 58+ messages in thread
From: Bastien @ 2011-03-06 15:40 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Julien Danjou, emacs-orgmode

Hi Matt,

Matt Lundin <mdl@imapmail.org> writes:

> Matt Lundin <mdl@imapmail.org> writes:
>>
>> Has there been any progress on this issue? I am finding that the local
>> span bindings in the custom command above still do not have any effect.
>> My default agenda span is a day. If I call the custom command above, it
>> displays only one day, despite the local setting.
>
> I think I know what's happening. The custom agenda commands had been
> working properly until this commit on Feb 18, which brought back the
> behavior described above:
>
> c6dbde1babaa0b2efa278d75a6ec82f91ef59d5e

I finally fixed this bug.  Please confirm when you can.  And I *really*
hope this time the saga is over :)

-- 
 Bastien

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-03-06 15:40                           ` Bastien
@ 2011-03-06 16:47                             ` Michael Brand
  2011-03-06 17:15                               ` Bastien
  2011-03-07 18:26                             ` Matt Lundin
  1 sibling, 1 reply; 58+ messages in thread
From: Michael Brand @ 2011-03-06 16:47 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien

On Sun, Mar 6, 2011 at 16:40, Bastien <bzg@altern.org> wrote:
> I finally fixed this bug.  Please confirm when you can.  And I *really*
> hope this time the saga is over :)

I just tested your latest change and found an issue which has not been
mentioned in my test cases described earlier in this thread, either
because it was not an issue or I did not take notice of it:

* test case: open custom agenda view
  1) emacs -q --eval '(progn
         (global-set-key (kbd "C-c a") (quote org-agenda))
         (setq org-agenda-custom-commands
             (quote (("x" "test" ((agenda)))))))'
  2) C-c a a: point is on today like expected
  3) C-c a x: point is not on today but is expected to be like above

Michael

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-03-06 16:47                             ` Michael Brand
@ 2011-03-06 17:15                               ` Bastien
  2011-03-06 18:26                                 ` Michael Brand
  0 siblings, 1 reply; 58+ messages in thread
From: Bastien @ 2011-03-06 17:15 UTC (permalink / raw)
  To: Michael Brand; +Cc: emacs-orgmode

Hi Michael,

thanks for the test.

Michael Brand <michael.ch.brand@gmail.com> writes:

> I just tested your latest change and found an issue which has not been
> mentioned in my test cases described earlier in this thread, either
> because it was not an issue or I did not take notice of it:
>
> * test case: open custom agenda view
>   1) emacs -q --eval '(progn
>          (global-set-key (kbd "C-c a") (quote org-agenda))
>          (setq org-agenda-custom-commands
>              (quote (("x" "test" ((agenda)))))))'

Note that block agendas are useful in case you want multiple agenda
views.  In the custom command above, agenda should be enough.

>   2) C-c a a: point is on today like expected
>   3) C-c a x: point is not on today but is expected to be like above

Block agenda can be a mix of todo, todo-tags, agenda, etc.  So while I
agree you expect the point on today for your specific block agenda, I
think leaving the cursor at the beginning of the block agenda buffer is
generally a good thing.

Thanks,

-- 
 Bastien

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-03-06 17:15                               ` Bastien
@ 2011-03-06 18:26                                 ` Michael Brand
  2011-03-06 18:35                                   ` Bastien
  0 siblings, 1 reply; 58+ messages in thread
From: Michael Brand @ 2011-03-06 18:26 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien

On Sun, Mar 6, 2011 at 18:15, Bastien <bzg@altern.org> wrote:
> Block agenda can be a mix of todo, todo-tags, agenda, etc.  So while I
> agree you expect the point on today for your specific block agenda, I
> think leaving the cursor at the beginning of the block agenda buffer is
> generally a good thing.

At least when there is not any agenda block or the first block is not
an agenda. But when there is an agenda block at first position
followed by other blocks? Do you put up with `C-c a x d' going to
2011-02-28 Mon instead of today's 2011-03-06 Sun?

But the most important still is: Both my earlier test cases `d g' and
`w f d g' in custom agenda view work like expected now. Thank you very
much for looking into this.

Michael

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

* Re: Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-03-06 18:26                                 ` Michael Brand
@ 2011-03-06 18:35                                   ` Bastien
  0 siblings, 0 replies; 58+ messages in thread
From: Bastien @ 2011-03-06 18:35 UTC (permalink / raw)
  To: Michael Brand; +Cc: emacs-orgmode

Hi Michael,

Michael Brand <michael.ch.brand@gmail.com> writes:

> At least when there is not any agenda block or the first block is not
> an agenda. But when there is an agenda block at first position
> followed by other blocks? Do you put up with `C-c a x d' going to
> 2011-02-28 Mon instead of today's 2011-03-06 Sun?

I might look into this later on, sure.

> But the most important still is: Both my earlier test cases `d g' and
> `w f d g' in custom agenda view work like expected now. Thank you very
> much for looking into this.

Thanks to *you* for the tests and patience.

-- 
 Bastien

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

* Re: [Accepted] Re: Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)]
  2011-03-06 15:40                           ` Bastien
  2011-03-06 16:47                             ` Michael Brand
@ 2011-03-07 18:26                             ` Matt Lundin
  1 sibling, 0 replies; 58+ messages in thread
From: Matt Lundin @ 2011-03-07 18:26 UTC (permalink / raw)
  To: Bastien; +Cc: Julien Danjou, emacs-orgmode

Hi Bastien,

Bastien <bzg@altern.org> writes:


> Matt Lundin <mdl@imapmail.org> writes:
>
>> Matt Lundin <mdl@imapmail.org> writes:
>>>
>>> Has there been any progress on this issue? I am finding that the local
>>> span bindings in the custom command above still do not have any effect.
>>> My default agenda span is a day. If I call the custom command above, it
>>> displays only one day, despite the local setting.
>>
>> I think I know what's happening. The custom agenda commands had been
>> working properly until this commit on Feb 18, which brought back the
>> behavior described above:
>>
>> c6dbde1babaa0b2efa278d75a6ec82f91ef59d5e
>
> I finally fixed this bug.  Please confirm when you can.  And I *really*
> hope this time the saga is over :)

Yes, I can confirm that it is fixed. Thanks a lot!

- Matt

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

end of thread, other threads:[~2011-03-07 18:26 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-22  4:09 Bug: Jumping to a date in the agenda changes view back to 'day' [7.4 (release_7.4.80.g0e5e5)] Bernt Hansen
2010-12-22  7:03 ` Noorul Islam K M
2010-12-22 12:29   ` Bernt Hansen
2011-01-14 12:34     ` Carsten Dominik
2011-01-14 16:03       ` Bernt Hansen
2011-01-14 17:29         ` Carsten Dominik
2011-01-14 17:42           ` Bernt Hansen
2011-01-17 14:27             ` Bernt Hansen
2011-01-17 14:39               ` Carsten Dominik
2011-01-17 15:08                 ` Julien Danjou
2011-01-17 16:34                   ` Julien Danjou
2011-01-17 16:43                     ` Carsten Dominik
2011-01-17 16:46                       ` Julien Danjou
2011-01-18  9:43                         ` Carsten Dominik
2011-01-18 10:00                           ` Julien Danjou
2011-01-18 10:15                             ` Carsten Dominik
2011-01-17 16:47                   ` Bernt Hansen
2011-01-17 16:54                     ` Julien Danjou
2011-01-17 17:00                       ` Bernt Hansen
2011-01-17 17:04                         ` Julien Danjou
2011-01-17 17:01                       ` Carsten Dominik
2011-01-17 17:11                     ` Julien Danjou
2011-01-17 17:14                       ` Bernt Hansen
2011-01-17 18:27                       ` [Accepted] " Bastien Guerry
2011-01-28 15:18                   ` Julien Danjou
2011-01-28 15:43                     ` Giovanni Ridolfi
2011-01-28 16:10                       ` Julien Danjou
2011-02-01 11:52                         ` Bastien
2011-02-01 11:52                   ` [Accepted] " Bastien Guerry
2011-02-05  1:20                     ` Matt Lundin
2011-02-05  8:56                       ` Julien Danjou
2011-02-07 11:39                       ` Julien Danjou
2011-02-08 17:05                         ` [Accepted] " Bastien Guerry
2011-02-09 16:37                         ` Bastien
2011-02-10  9:20                           ` Carsten Dominik
2011-02-10 10:51                             ` Julien Danjou
2011-02-10 11:50                               ` Carsten Dominik
2011-02-10 12:00                                 ` Julien Danjou
2011-02-10 14:35                                   ` Bastien
2011-02-10 21:21                                     ` Michael Brand
2011-02-17 13:57                                     ` Carsten Dominik
2011-02-17 14:43                                       ` Bastien
2011-02-18 14:19                                       ` Bastien
2011-02-18 14:46                                         ` Gábor Melis
2011-02-18 16:42                                         ` Carsten Dominik
2011-02-19  9:36                                           ` Bastien
2011-02-10 11:18                             ` Michael Brand
2011-02-10 11:55                               ` Carsten Dominik
2011-02-24 14:38                       ` Matt Lundin
2011-02-24 15:01                         ` Matt Lundin
2011-02-25  0:11                           ` Bastien
2011-02-25  0:15                             ` Bastien
2011-03-06 15:40                           ` Bastien
2011-03-06 16:47                             ` Michael Brand
2011-03-06 17:15                               ` Bastien
2011-03-06 18:26                                 ` Michael Brand
2011-03-06 18:35                                   ` Bastien
2011-03-07 18:26                             ` Matt Lundin

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