emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Jumping to date in block agenda loses agenda view [7.5 (release_7.5.113.g9010a)]
@ 2011-03-25  3:31 Bernt Hansen
  2011-03-25  8:56 ` Bug: Jumping to date in custom agenda looses starting day of week Sébastien Vauban
  0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2011-03-25  3:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm finally getting around to trying block agendas and I've replaced
most of my custom agenda commands with a single block view.  Below is a
simplified block agenda view which demonstrates the problem.  I can move
forwards and backwards one day at a time with 'f' and 'b' and it works
great.  If however I want to jump to a specific date the block view is
lost and it reverts back to the regular calendar agenda view.

Steps to reproduce:

$ minimal-emacs

| Step | Key       | Details                |
|------+-----------+------------------------|
|    1 | C-c a x   | Load block agenda view |
|    2 | j 3-1 RET | Jump to March 1st      |

My original agenda view looks like this after step 1,

,----
| Week-agenda (W12):
| Monday     21 March 2011 W12
| Tuesday    22 March 2011
| Wednesday  23 March 2011
| Thursday   24 March 2011
| Friday     25 March 2011
| Saturday   26 March 2011
| Sunday     27 March 2011
| 
| ====================================================================================================
| Tasks to Refile
`----

and after step 2 it looks like this:

,----
| Week-agenda (W09):
| Monday     28 February 2011 W09
| Tuesday     1 March 2011
| Wednesday   2 March 2011
| Thursday    3 March 2011
| Friday      4 March 2011
| Saturday    5 March 2011
| Sunday      6 March 2011
`----

The block agenda with "Tasks to Refile" is gone.  I really want to keep
this block agenda view as my default agenda view.

~/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 $1
--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---

/tmp/test.el
--8<---------------cut here---------------start------------->8---
(setq org-agenda-custom-commands (quote (("x" "Weekly Review block agenda" ((agenda "" nil) (tags "LEVEL=1+REFILE" ((org-agenda-overriding-header "Notes and Tasks to Refile") (org-agenda-todo-ignore-with-date nil) (org-agenda-todo-ignore-deadlines nil) (org-agenda-todo-ignore-scheduled nil) (org-agenda-todo-ignore-timestamp nil) (org-agenda-overriding-header "Tasks to Refile"))))))))
(setq org-agenda-files '("/tmp/publish/org-scratch.org"))
--8<---------------cut here---------------end--------------->8---

/tmp/publish/org-scratch.org
--8<---------------cut here---------------start------------->8---
* Tasks
** TODO Do this
** TODO Do that
** TODO Do this other thing
** DONE Did that

--8<---------------cut here---------------end--------------->8---

Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-12-11 on raven, modified by Debian
Package: Org-mode version 7.5 (release_7.5.113.g9010a)
-- 
Bernt

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

* Bug: Jumping to date in custom agenda looses starting day of week
  2011-03-25  3:31 Bug: Jumping to date in block agenda loses agenda view [7.5 (release_7.5.113.g9010a)] Bernt Hansen
@ 2011-03-25  8:56 ` Sébastien Vauban
  2011-03-30 17:47   ` Matt Lundin
  0 siblings, 1 reply; 3+ messages in thread
From: Sébastien Vauban @ 2011-03-25  8:56 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bernt,

Bernt Hansen wrote:
> I can move forwards and backwards one day at a time with 'f' and 'b' and it
> works great. If however I want to jump to a specific date the block view is
> lost and it reverts back to the regular calendar agenda view.

In the same spirit, I would add another point: if you have a view with
starting day (of the week) on Monday:

--8<---------------cut here---------------start------------->8---
                ("C" "Weekly appointments"
                 agenda ""
                 ((org-agenda-ndays 7)
                  (org-agenda-start-on-weekday 1)
                  (org-agenda-time-grid nil)
                  (org-agenda-prefix-format "  %12:t ")
                  (org-agenda-include-all-todo nil)
                  (org-agenda-repeating-timestamp-show-all t)
                  (org-agenda-skip-function
                   '(org-agenda-skip-entry-if 'deadline 'scheduled))))
--8<---------------cut here---------------end--------------->8---

and jump to a Thursday, then the new 7-days view is beginning on Thursday
(which is my global setting), instead of keeping the Monday.

What I would find logical is to keep this setting active for the jump.

Best regards,
  Seb

-- 
Sébastien Vauban

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

* Re: Bug: Jumping to date in custom agenda looses starting day of week
  2011-03-25  8:56 ` Bug: Jumping to date in custom agenda looses starting day of week Sébastien Vauban
@ 2011-03-30 17:47   ` Matt Lundin
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Lundin @ 2011-03-30 17:47 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
writes:

> Hi Bernt,
>
> Bernt Hansen wrote:
>> I can move forwards and backwards one day at a time with 'f' and 'b' and it
>> works great. If however I want to jump to a specific date the block view is
>> lost and it reverts back to the regular calendar agenda view.
>
> In the same spirit, I would add another point: if you have a view with
> starting day (of the week) on Monday:
>
>                 ("C" "Weekly appointments"
>                  agenda ""
>                  ((org-agenda-ndays 7)
>                   (org-agenda-start-on-weekday 1)
>                   (org-agenda-time-grid nil)
>                   (org-agenda-prefix-format "  %12:t ")
>                   (org-agenda-include-all-todo nil)
>                   (org-agenda-repeating-timestamp-show-all t)
>                   (org-agenda-skip-function
>                    '(org-agenda-skip-entry-if 'deadline 'scheduled))))
>

[An aside: Setting org-agenda-entry-types to '(:timestamp :sexp) is
faster than using an org-agenda-skip-function here.]

> and jump to a Thursday, then the new 7-days view is beginning on Thursday
> (which is my global setting), instead of keeping the Monday.

I can confirm this. 

Moreover, I find that my custom settings for org-agenda-entry-types are
ignored and org-agenda-span are discarded when jumping to a date. The
following custom command displays a weekly calendar.

--8<---------------cut here---------------start------------->8---
	("cc" "Calendar" agenda ""
	 ((org-agenda-span 'week)
	  (org-agenda-start-on-weekday 0)		; start on Sunday
	  (org-agenda-time-grid nil)
	  (org-agenda-prefix-format " %-12:t ")
	  (org-deadline-warning-days 0)
	  (org-agenda-include-all-todo nil)
	  (org-agenda-repeating-timestamp-show-all t)
	  (org-agenda-filter-preset '("-nocal1"))
	  (org-agenda-hide-tags-regexp ".*")
	  ))
--8<---------------cut here---------------end--------------->8---

My default org-agenda-span is 'day.

If I jump to Thursday, I get a standard one-day agenda view, which
includes all the org-agenda-entry-types (deadline, schedule, etc.). 

If I then refresh the agenda view, the deadline and schedule items
disappear, but the agenda remains limited to the default span (day)
instead of the custom span (week).

> What I would find logical is to keep this setting active for the jump.

A quick check of the git history reveals that org-agenda-goto-date has
*always* been rather basic. It simply calls org-agenda-list for the date
in question. Unlike org-agenda-goto-today, it pays no attention to the
local settings for the current agenda.

Best,
Matt

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

end of thread, other threads:[~2011-03-30 19:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25  3:31 Bug: Jumping to date in block agenda loses agenda view [7.5 (release_7.5.113.g9010a)] Bernt Hansen
2011-03-25  8:56 ` Bug: Jumping to date in custom agenda looses starting day of week Sébastien Vauban
2011-03-30 17:47   ` Matt Lundin

Code repositories for project(s) associated with this 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).