emacs-calfw
emacs-calfw copied to clipboard
Add example of calfw opening for org-agenda-custom-commands
In org-mode, org-agenda-custom-commands allows customizing the kind of org agenda views to display.
I think it should be great to add to calfw-org's documentation an example on how this could be done.
I'm no emacs lisper but I've hacked the following which seems to work :
(defun open-calfw-agenda-org (coin) (interactive) (cfw:open-org-calendar) )
(setq org-agenda-custom-commands '(
("G" "Graphical display in calfw" open-calfw-agenda-org )
) )
There's probably a cleaner way to do the same.
Hope this helps.
Hi Olivier, Thank you for your advice! While I'm not using org-agenda so much, I think that your code which is integrated org-agenda tightly looks smarter. After my studying org-agenda integration, I will add your example code to the calf-org document.
Note: you can also set org-agenda-skip-function and it'll be used by calfw (doesn't seem like org-agenda-overriding-header nor org-agenda-include-diary are respected though). Here's the one I use:
(defun cfw:open-org-calendar-nonwork (&args)
(interactive)
(let ((org-agenda-skip-function 'org-agenda-skip-work))
(cfw:open-org-calendar)))
(setq org-agenda-custom-commands
'(;; …
("c" "calfw, non-work"
cfw:open-org-calendar-nonwork)))
(where the skip-function can exclude certain tags or files or subtrees that I don't want in my non-work calendar)
Hi,
When I display calfw, I get all the TODO entries of all my org-agenda files in the current day, regardless of their due date. Is there a way to display the TODO entries only on the days they are due (scheduled or deadline). In org-mode I use a custom agenda command which is like this:
("D" "Daily Action List" ((agenda "" ((org-agenda-ndays 1) (org-agenda-sorting-strategy (quote ((agenda time-up priority-down tag-up)))) (org-deadline-warning-days 0)))) nil)
Thanks for your help!
Jordi
inglada [email protected] writes:
Hi,
When I display calfw, I get all the TODO entries of all my org-agenda files in the current day, regardless of their due date. Is there a way to display the TODO entries only on the days they are due (scheduled or deadline). In org-mode I use a custom agenda command which is like this:
("D" "Daily Action List" ((agenda "" ((org-agenda-ndays 1) (org-agenda-sorting-strategy (quote ((agenda time-up priority-down tag-up)))) (org-deadline-warning-days 0)))) nil)
Does
(let ((org-agenda-sorting-strategy (quote ((agenda time-up priority-down tag-up)))) (org-deadline-warning-days 0)) (cfw:open-org-calendar))
work?
@unhammer
Thanks for your answer, but there is no difference using your code snippet.
OK. I found a way. I have to use (setq org-deadline-warning-days 0) globally on my .emacs and it works. I don't think this is a good general solution, but it's OK for me. Thanks!
Hi @inglada and @unhammer, I'm sorry for my late response.
Because I'm not a heavy orgmode, your advices are very helpful!
If org-deadline-warning-days=0
is needed for calfw-org for everyone, I would add the code.
Will you tell me some advice for this issue?
Create your own cfw:open-org-calendar function to be called as a custom command and and make sure (cfw:open-org-calendar) is called with org-deadline-warning-days set to 0 by explicitely binding it to 0 before calling it. Then, assuming the (cfw:open-org-calendar) switches to the calendar buffer (which it does for now in 1.3+git20111208-1). Set the variables you want remembered local in its buffer. Its works for me.
(defun konix/cfw:open-org-calendar (&rest args) (interactive) (let ( ;; do not duplicate deadlines (org-deadline-warning-days 0) ) (cfw:open-org-calendar) ) ;; set the org variables to remember (set (make-variable-buffer-local 'org-agenda-skip-function) org-agenda-skip-function) (set (make-variable-buffer-local 'org-deadline-warning-days) org-deadline-warning-days) )
I forgot to mention the remembering of the variable is useful for the configuration to remain when you update the calendar with "r"
@Konubinix Thank you for your comment!
This is a bit old, but I could not find a really convincing answer to this question: how could I generate different calfw-calendars with own functions in which
- I select some org files
- I restrict the headlines to some TODO keywords OR to some tag?