From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Henoch 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 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=37894 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ooy8Z-0002dV-Eg for emacs-orgmode@gnu.org; Fri, 27 Aug 2010 08:34:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OoxsY-0002c6-KF for emacs-orgmode@gnu.org; Fri, 27 Aug 2010 08:17:55 -0400 Received: from server88-208-246-34.live-servers.net ([88.208.246.34]:37989 helo=zimbra.erlangsystems.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OoxsY-0002bu-7d for emacs-orgmode@gnu.org; Fri, 27 Aug 2010 08:17:54 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.erlangsystems.com (Postfix) with ESMTP id DD94F53A00B for ; Fri, 27 Aug 2010 12:40:42 +0100 (BST) Received: from zimbra.erlangsystems.com ([127.0.0.1]) by localhost (zimbra.erlangsystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 36KsPAFkioFT for ; Fri, 27 Aug 2010 12:40:38 +0100 (BST) Received: from Magnus-Henochs-MacBook-Pro.local (c-f893e255.56-4-64736c14.cust.bredbandsbolaget.se [85.226.147.248]) by zimbra.erlangsystems.com (Postfix) with ESMTP id 5673C53A00B for ; Fri, 27 Aug 2010 12:40:36 +0100 (BST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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 "\\" 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)) ) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--