emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Custom agenda -- running functions, not just setting vars
@ 2011-11-09 11:32 Tommy Kelly
  2011-11-09 12:18 ` Bernt Hansen
  0 siblings, 1 reply; 7+ messages in thread
From: Tommy Kelly @ 2011-11-09 11:32 UTC (permalink / raw)
  To: emacs-orgmode

I'm trying to set up a custom agenda view such that when I enter my
agenda I get, automatically:

- daily view mode (for today)
- log file mode on
- grid on
- Follow mode on

I can see from the docs how to modify the various variables that
control some of how agendas look. But the above are controlled by
functions and I'm not sure how to have those invoked when I open an
agenda.

I've been messing with org-mode-agenda-hook and
org-agenda-after-show-hook, but I clearly don't know what I'm doing.

Any ideas?

thanks,
Tommy

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

* Re: Custom agenda -- running functions, not just setting vars
  2011-11-09 11:32 Custom agenda -- running functions, not just setting vars Tommy Kelly
@ 2011-11-09 12:18 ` Bernt Hansen
  2011-11-09 12:29   ` Sebastien Vauban
  2011-11-09 13:19   ` Tommy Kelly
  0 siblings, 2 replies; 7+ messages in thread
From: Bernt Hansen @ 2011-11-09 12:18 UTC (permalink / raw)
  To: Tommy Kelly; +Cc: emacs-orgmode

Tommy Kelly <tommy.kelly@verilab.com> writes:

> I'm trying to set up a custom agenda view such that when I enter my
> agenda I get, automatically:
>
> - daily view mode (for today)
> - log file mode on
> - grid on
> - Follow mode on
>
> I can see from the docs how to modify the various variables that
> control some of how agendas look. But the above are controlled by
> functions and I'm not sure how to have those invoked when I open an
> agenda.
>
> I've been messing with org-mode-agenda-hook and
> org-agenda-after-show-hook, but I clearly don't know what I'm doing.
>
> Any ideas?
>
> thanks,
> Tommy

Something like this:

(setq org-agenda-custom-commands
      (quote (( "x" "Test Agenda" agenda "" 
		((org-agenda-start-with-follow-mode t)
		 (org-agenda-span 'day)
		 (org-agenda-start-with-log-mode t))))))

but it doesn't handle the grid - I have that on by default by setting 

(setq org-agenda-time-grid (quote ((daily today remove-match)
				   #("----------------" 0 16 (org-heading t))
				   (830 1000 1200 1300 1500 1700))))

which you can probably add to the above agenda definition but I didn't
bother.  If there are no items to display on the agenda there is a bug
where the grid is not shown but otherwise I think this works.

Regards,
Bernt

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

* Re: Custom agenda -- running functions, not just setting vars
  2011-11-09 12:18 ` Bernt Hansen
@ 2011-11-09 12:29   ` Sebastien Vauban
  2011-11-09 12:47     ` Sebastien Vauban
  2011-11-09 20:49     ` Sebastien Vauban
  2011-11-09 13:19   ` Tommy Kelly
  1 sibling, 2 replies; 7+ messages in thread
From: Sebastien Vauban @ 2011-11-09 12:29 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bernt,

Bernt Hansen wrote:
> Tommy Kelly <tommy.kelly-ABZRMiVa18FBDgjK7y7TUQ@public.gmane.org> writes:
>> I'm trying to set up a custom agenda view such that when I enter my
>> agenda I get, automatically:
>>
>> - daily view mode (for today)
>> - log file mode on
>> - grid on
>> - Follow mode on
>>
>> I can see from the docs how to modify the various variables that
>> control some of how agendas look. But the above are controlled by
>> functions and I'm not sure how to have those invoked when I open an
>> agenda.
>>
>> I've been messing with org-mode-agenda-hook and
>> org-agenda-after-show-hook, but I clearly don't know what I'm doing.
>
> Something like this:
>
> (setq org-agenda-custom-commands
>       (quote (( "x" "Test Agenda" agenda "" 
> 		((org-agenda-start-with-follow-mode t)
> 		 (org-agenda-span 'day)
> 		 (org-agenda-start-with-log-mode t))))))
>
> but it doesn't handle the grid - I have that on by default by setting 
>
> (setq org-agenda-time-grid (quote ((daily today remove-match)
> 				   #("----------------" 0 16 (org-heading t))
> 				   (830 1000 1200 1300 1500 1700))))
>
> which you can probably add to the above agenda definition but I didn't
> bother.  If there are no items to display on the agenda there is a bug
> where the grid is not shown but otherwise I think this works.

I don't think that's a bug: this seems to be handled -- see parameter
`require-timed' in the doc:

    ┏━━━━┫ C-h v org-agenda-time-grid ┃
    ┃ org-agenda-time-grid is a variable defined in `org-agenda.el'.
    ┃ Its value is ((daily today require-timed)
    ┃  ""
    ┃  (800 1000 1200 1400 1600 1800 2000 2200))
    ┃ 
    ┃ Original value was 
    ┃ ((daily today require-timed)
    ┃  "----------------"
    ┃  (800 1000 1200 1400 1600 1800 2000))
    ┃ 
    ┃ 
    ┃ Documentation:
    ┃ The settings for time grid for agenda display.
    ┃ This is a list of three items.  The first item is again a list.  It contains
    ┃ symbols specifying conditions when the grid should be displayed:
    ┃ 
    ┃  daily         if the agenda shows a single day
    ┃  weekly        if the agenda shows an entire week
    ┃  today         show grid on current date, independent of daily/weekly display
    ┃  require-timed show grid only if at least one item has a time specification
    ┃ 
    ┃ The second item is a string which will be placed behind the grid time.
    ┃ 
    ┃ The third item is a list of integers, indicating the times that should have
    ┃ a grid line.
    ┃ 
    ┃ You can customize this variable.
    ┃ 
    ┃ [back]
    ┗━━━━

However, that's not clear to me (yet) what's `remove-match'.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Custom agenda -- running functions, not just setting vars
  2011-11-09 12:29   ` Sebastien Vauban
@ 2011-11-09 12:47     ` Sebastien Vauban
  2011-11-09 20:49     ` Sebastien Vauban
  1 sibling, 0 replies; 7+ messages in thread
From: Sebastien Vauban @ 2011-11-09 12:47 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Answering to myself:

> However, that's not clear to me (yet) what's `remove-match'.

               8:00...... 
  @refile:    10:00-11:00 Do this
              12:00...... 
              14:00...... 
              16:00...... 
  Life:       17:20-17:30 Contact
              18:00...... 
              20:00...... 

instead of:

               8:00...... 
              10:00...... 
  @refile:    10:00-11:00 Do this
              12:00...... 
              14:00...... 
              16:00...... 
  Life:       17:20-17:30 Contact
              18:00...... 
              20:00...... 

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Custom agenda -- running functions, not just setting vars
  2011-11-09 12:18 ` Bernt Hansen
  2011-11-09 12:29   ` Sebastien Vauban
@ 2011-11-09 13:19   ` Tommy Kelly
  1 sibling, 0 replies; 7+ messages in thread
From: Tommy Kelly @ 2011-11-09 13:19 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

Excellent, that works. Thanks.
Tommy

On Wed, Nov 9, 2011 at 12:18 PM, Bernt Hansen <bernt@norang.ca> wrote:
> Tommy Kelly <tommy.kelly@verilab.com> writes:
>
>> I'm trying to set up a custom agenda view such that when I enter my
>> agenda I get, automatically:
>>
>> - daily view mode (for today)
>> - log file mode on
>> - grid on
>> - Follow mode on
>>
>> I can see from the docs how to modify the various variables that
>> control some of how agendas look. But the above are controlled by
>> functions and I'm not sure how to have those invoked when I open an
>> agenda.
>>
>> I've been messing with org-mode-agenda-hook and
>> org-agenda-after-show-hook, but I clearly don't know what I'm doing.
>>
>> Any ideas?
>>
>> thanks,
>> Tommy
>
> Something like this:
>
> (setq org-agenda-custom-commands
>      (quote (( "x" "Test Agenda" agenda ""
>                ((org-agenda-start-with-follow-mode t)
>                 (org-agenda-span 'day)
>                 (org-agenda-start-with-log-mode t))))))
>
> but it doesn't handle the grid - I have that on by default by setting
>
> (setq org-agenda-time-grid (quote ((daily today remove-match)
>                                   #("----------------" 0 16 (org-heading t))
>                                   (830 1000 1200 1300 1500 1700))))
>
> which you can probably add to the above agenda definition but I didn't
> bother.  If there are no items to display on the agenda there is a bug
> where the grid is not shown but otherwise I think this works.
>
> Regards,
> Bernt
>



-- 
Tommy Kelly
+1 (512) 289-8262
http://www.verilab.com

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

* Re: Custom agenda -- running functions, not just setting vars
  2011-11-09 12:29   ` Sebastien Vauban
  2011-11-09 12:47     ` Sebastien Vauban
@ 2011-11-09 20:49     ` Sebastien Vauban
  2011-11-09 21:00       ` Sebastien Vauban
  1 sibling, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2011-11-09 20:49 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bernt,

> Bernt Hansen wrote:
>> Tommy Kelly <tommy.kelly-ABZRMiVa18FBDgjK7y7TUQ@public.gmane.org> writes:
>> (setq org-agenda-custom-commands
>>       (quote (( "x" "Test Agenda" agenda "" 
>> 		((org-agenda-start-with-follow-mode t)
>> 		 (org-agenda-span 'day)
>> 		 (org-agenda-start-with-log-mode t))))))
>>
>> but it doesn't handle the grid - I have that on by default by setting 
>>
>> (setq org-agenda-time-grid (quote ((daily today remove-match)
>> 				   #("----------------" 0 16 (org-heading t))
>> 				   (830 1000 1200 1300 1500 1700))))
>>
>> which you can probably add to the above agenda definition but I didn't
>> bother.  If there are no items to display on the agenda there is a bug
>> where the grid is not shown but otherwise I think this works.
>
> I don't think that's a bug: this seems to be handled -- see parameter
> `require-timed' in the doc:

The problem is well that, if you force the timegrid even when there is no
timed event to show, you'll always have it.

It's nice for the daily agenda view, where one could want it, with or without
timed event foreseen.

It's much less nice for a block view where you have a couple of sub-agendas
(one with appointments only, one with deadlines only, one with scheduled
entries only: you get the timegrid displayed 3 times).

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: Custom agenda -- running functions, not just setting vars
  2011-11-09 20:49     ` Sebastien Vauban
@ 2011-11-09 21:00       ` Sebastien Vauban
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastien Vauban @ 2011-11-09 21:00 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

>> Bernt Hansen wrote:
>>> Tommy Kelly <tommy.kelly-ABZRMiVa18FBDgjK7y7TUQ@public.gmane.org> writes:
>>> (setq org-agenda-custom-commands
>>>       (quote (( "x" "Test Agenda" agenda "" 
>>> 		((org-agenda-start-with-follow-mode t)
>>> 		 (org-agenda-span 'day)
>>> 		 (org-agenda-start-with-log-mode t))))))
>>>
>>> but it doesn't handle the grid - I have that on by default by setting 
>>>
>>> (setq org-agenda-time-grid (quote ((daily today remove-match)
>>> 				   #("----------------" 0 16 (org-heading t))
>>> 				   (830 1000 1200 1300 1500 1700))))
>>>
>>> which you can probably add to the above agenda definition but I didn't
>>> bother.  If there are no items to display on the agenda there is a bug
>>> where the grid is not shown but otherwise I think this works.
>>
>> I don't think that's a bug: this seems to be handled -- see parameter
>> `require-timed' in the doc:
>
> The problem is well that, if you force the timegrid even when there is no
> timed event to show, you'll always have it.
>
> It's nice for the daily agenda view, where one could want it, with or without
> timed event foreseen.
>
> It's much less nice for a block view where you have a couple of sub-agendas
> (one with appointments only, one with deadlines only, one with scheduled
> entries only: you get the timegrid displayed 3 times).

... then one need to locally set org-agenda-time-grid to nil in the definition
of the custom agenda view.

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2011-11-09 21:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-09 11:32 Custom agenda -- running functions, not just setting vars Tommy Kelly
2011-11-09 12:18 ` Bernt Hansen
2011-11-09 12:29   ` Sebastien Vauban
2011-11-09 12:47     ` Sebastien Vauban
2011-11-09 20:49     ` Sebastien Vauban
2011-11-09 21:00       ` Sebastien Vauban
2011-11-09 13:19   ` Tommy Kelly

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