From: Magnus Henoch <magnus.henoch@gmail.com>
To: emacs-orgmode@gnu.org
Subject: 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 [thread overview]
Message-ID: <m2wrrcxp00.fsf@erlang-solutions.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 773 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1288 bytes --]
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))
[-- Attachment #3: Type: text/plain, Size: 3565 bytes --]
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))
)
[-- Attachment #4: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next reply other threads:[~2010-08-27 12:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-27 11:40 Magnus Henoch [this message]
2010-08-27 14:29 ` [Accepted] Bug: :step day doesn't work for agenda clockreport [7.01trans (release_7.01h.214.g7be6.dirty)] Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2wrrcxp00.fsf@erlang-solutions.com \
--to=magnus.henoch@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).