[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Bug: :step day doesn't work for agenda clockreport [7.01trans
From: |
Magnus Henoch |
Subject: |
[Orgmode] Bug: :step day doesn't work for agenda clockreport [7.01trans (release_7.01h.214.g7be6.dirty)] |
Date: |
Fri, 27 Aug 2010 13:40:31 +0200 |
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
http://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------
I just tried adding :step day to org-agenda-clockreport-parameter-plist,
but then hitting R in the agenda caused a crash, since
org-clocktable-steps expects ts and te to be strings, though in fact
they are Gregorian day numbers.
This patch fixes the problem for me. It's quite ugly, so I don't expect
it to be committed in its current form :) but I hope it serves as
inspiration for someone to figure out the right way to solve this.
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 4fa0397..18a60c8 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1971,10 +1971,22 @@ the currently selected interval size."
(when block
(setq cc (org-clock-special-range block nil t)
ts (car cc) te (nth 1 cc) range-text (nth 2 cc)))
- (if ts (setq ts (org-float-time
- (apply 'encode-time (org-parse-time-string ts)))))
- (if te (setq te (org-float-time
- (apply 'encode-time (org-parse-time-string te)))))
+ (cond
+ ((numberp ts)
+ ;; If ts is a number, it's an absolute day number from org-agenda.
+ (destructuring-bind (month day year) (calendar-gregorian-from-absolute
ts)
+ (setq ts (time-to-seconds (encode-time 0 0 0 day month year)))))
+ (ts
+ (setq ts (org-float-time
+ (apply 'encode-time (org-parse-time-string ts))))))
+ (cond
+ ((numberp te)
+ ;; Likewise for te.
+ (destructuring-bind (month day year) (calendar-gregorian-from-absolute
te)
+ (setq te (time-to-seconds (encode-time 0 0 0 day month year)))))
+ (te
+ (setq te (org-float-time
+ (apply 'encode-time (org-parse-time-string te))))))
(setq p1 (plist-put p1 :header ""))
(setq p1 (plist-put p1 :step nil))
(setq p1 (plist-put p1 :block nil))
Emacs : GNU Emacs 24.0.50.2 (x86_64-apple-darwin10.4.0, NS
apple-appkit-1038.32)
of 2010-08-16 on Magnus-Henochs-MacBook-Pro.local
Package: Org-mode version 7.01trans (release_7.01h.214.g7be6.dirty)
current state:
==============
(setq
org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
org-agenda-clockreport-parameter-plist '(:link t :maxlevel 3 :step day)
org-agenda-files '("~/org/")
org-metaup-hook '(org-babel-load-in-session-maybe)
org-capture-templates '(("e" "dotemacs" entry
(file+headline "~/org/dotemacs.org" "Graduated
snippets")
"* %^{dotemacs snippet titled}\nAdded on
%U.\n#+BEGIN_SRC emacs-lisp\n %?\n#+END_SRC" :unnarrowed)
("t" "To do" entry (file "~/org/notes.org") "* TODO
%?\n%a" :prepend t)
("4" "New activity" entry (file "~/org/notes.org")
"* %^{New activity}\n%?\n%a" :prepend t :clock-in t)
("n" "Note" entry (clock) "* Notes %T\n%?"))
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
org-export-latex-format-toc-function 'org-export-latex-format-toc-default
org-export-preprocess-hook '(org-export-blocks-preprocess)
org-tab-first-hook '(org-hide-block-toggle-maybe
org-babel-hide-result-toggle-maybe)
org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
org-confirm-shell-link-function 'yes-or-no-p
org-export-first-hook '(org-beamer-initialize-open-trackers)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
org-use-speed-commands t
org-mode-hook '((lambda nil
(org-add-hook (quote change-major-mode-hook)
(quote org-babel-show-result-all) (quote append) (quote
local))
)
#[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook org-show-block-all
append local] 5]
#[nil "\300\301\302\303\304$\207"
[org-add-hook change-major-mode-hook
org-babel-show-result-all append local]
5]
org-babel-result-hide-spec org-babel-hide-all-hashes)
org-refile-targets '((org-agenda-files :maxlevel . 2))
org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
org-confirm-elisp-link-function 'yes-or-no-p
org-export-interblocks '((lob org-babel-exp-lob-one-liners)
(src org-babel-exp-inline-src-blocks))
org-occur-hook '(org-first-headline-recenter)
org-from-is-user-regexp "\\<Magnus Henoch\\>"
org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)
org-clock-report-include-clocking-task t
org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc
org-beamer-auto-fragile-frames
org-beamer-place-default-actions-for-lists)
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-export-blocks '((src org-babel-exp-src-blocks nil)
(comment org-export-blocks-format-comment t)
(ditaa org-export-blocks-format-ditaa nil)
(dot org-export-blocks-format-dot nil))
)
- [Orgmode] Bug: :step day doesn't work for agenda clockreport [7.01trans (release_7.01h.214.g7be6.dirty)],
Magnus Henoch <=