From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Custom agenda -- running functions, not just setting vars Date: Wed, 09 Nov 2011 13:29:06 +0100 Message-ID: <80zkg5wkbx.fsf@somewhere.org> References: <87y5vpebfz.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Bernt, Bernt Hansen wrote: > Tommy Kelly 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 ""=20 > ((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=20 > > (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: =E2=94=8F=E2=94=81=E2=94=81=E2=94=81=E2=94=81=E2=94=AB C-h v org-agenda= -time-grid =E2=94=83 =E2=94=83 org-agenda-time-grid is a variable defined in `org-agenda.el'. =E2=94=83 Its value is ((daily today require-timed) =E2=94=83 "" =E2=94=83 (800 1000 1200 1400 1600 1800 2000 2200)) =E2=94=83=20 =E2=94=83 Original value was=20 =E2=94=83 ((daily today require-timed) =E2=94=83 "----------------" =E2=94=83 (800 1000 1200 1400 1600 1800 2000)) =E2=94=83=20 =E2=94=83=20 =E2=94=83 Documentation: =E2=94=83 The settings for time grid for agenda display. =E2=94=83 This is a list of three items. The first item is again a lis= t. It contains =E2=94=83 symbols specifying conditions when the grid should be display= ed: =E2=94=83=20 =E2=94=83 daily if the agenda shows a single day =E2=94=83 weekly if the agenda shows an entire week =E2=94=83 today show grid on current date, independent of dail= y/weekly display =E2=94=83 require-timed show grid only if at least one item has a time= specification =E2=94=83=20 =E2=94=83 The second item is a string which will be placed behind the g= rid time. =E2=94=83=20 =E2=94=83 The third item is a list of integers, indicating the times th= at should have =E2=94=83 a grid line. =E2=94=83=20 =E2=94=83 You can customize this variable. =E2=94=83=20 =E2=94=83 [back] =E2=94=97=E2=94=81=E2=94=81=E2=94=81=E2=94=81 However, that's not clear to me (yet) what's `remove-match'. Best regards, Seb --=20 Sebastien Vauban