emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: columnview times don't accumulate properly [7.8.03 (release_7.8.03.576.gbeb02)]
@ 2012-03-13 12:00 Myles English
  2012-03-16  2:56 ` Myles English
  0 siblings, 1 reply; 5+ messages in thread
From: Myles English @ 2012-03-13 12:00 UTC (permalink / raw)
  To: emacs-orgmode Mode

[-- Attachment #1: Type: text/plain, Size: 2330 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.
------------------------------------------------------------------------

1. start with emacs -q
2. find file test-sums.org (attached)
3. adjust paths in the source block at the top of the file and evaluate
   (execute?) it with C-c
4. goto the columnview block and C-c

I would expect a table like this to be inserted:

| ITEM                                        |  Sum |
|---------------------------------------------+------|
| * Introduction                              | 5:40 |
|---------------------------------------------+------|
| ** test sums                                | 0:30 |
|---------------------------------------------+------|
| ** Getting warmed up                        | 5:10 |
|---------------------------------------------+------|
| *** Nitty gritty                            | 5:10 |
| *************** TODO Do something fantastic | 5:00 |
| *************** END                         |      |
|---------------------------------------------+------|
| **** This is not added                      | 0:10 |
| *************** TODO Do something else      | 0:10 |
| *************** END                         |      |

Hoever, the table looks like this:

| ITEM                                        |  Sum |
|---------------------------------------------+------|
| * Introduction                              | 5:30 |
|---------------------------------------------+------|
| ** test sums                                | 0:30 |
|---------------------------------------------+------|
| ** Getting warmed up                        | 5:00 |
|---------------------------------------------+------|
| *** Nitty gritty                            | 5:00 |
| *************** TODO Do something fantastic | 5:00 |
| *************** END                         |      |
|---------------------------------------------+------|
| **** This is not added                      | 0:10 |
| *************** TODO Do something else      | 0:10 |
| *************** END                         |      |

i.e. the 0:10 is not being picked up in the accumulation.


[-- Attachment #2: test-sums.org --]
[-- Type: text/plain, Size: 1664 bytes --]

#+COLUMNS: %50ITEM %5Effort(Sum){:}
#+BEGIN_SRC emacs-lisp
(setq load-path (cons "~/.emacs.d/plugins/org-mode/lisp" load-path))
(require 'org-install)
(require 'org-inlinetask)
(require 'org)
(load "~/.emacs.d/plugins/org-mode/lisp/org.el")
#+END_SRC

#+results:
: t

(emacs-version) = "GNU Emacs 23.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.9)
 of 2012-02-01 on shirley.hoetzel.info"

(org-version) = "Org-mode version 7.8.03 (release_7.8.03.576.gbeb02)"

* Introduction

** test sums
   :PROPERTIES:
   :Effort:   0:30
   :END:

#+BEGIN: columnview :hlines 5 :id global
| ITEM                                        |  Sum |
|---------------------------------------------+------|
| * Introduction                              | 5:30 |
|---------------------------------------------+------|
| ** test sums                                | 0:30 |
|---------------------------------------------+------|
| ** Getting warmed up                        | 5:00 |
|---------------------------------------------+------|
| *** Nitty gritty                            | 5:00 |
| *************** TODO Do something fantastic | 5:00 |
| *************** END                         |      |
|---------------------------------------------+------|
| **** This is not added                      | 0:10 |
| *************** TODO Do something else      | 0:10 |
| *************** END                         |      |
#+END:

** Getting warmed up
*** Nitty gritty
*************** TODO Do something fantastic
:PROPERTIES:
:Effort: 5:00
:END:
*************** END

**** This is not added

*************** TODO Do something else
:PROPERTIES:
:Effort: 0:10
:END:
*************** END

[-- Attachment #3: Type: text/plain, Size: 3766 bytes --]


Myles

Emacs  : GNU Emacs 23.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.9)
 of 2012-02-01 on shirley.hoetzel.info
Package: Org-mode version 7.8.03 (release_7.8.03.576.gbeb02)

current state:
==============
(setq
 org-export-preprocess-before-backend-specifics-hook '(org-inlinetask-export-handler)
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-link-frame-setup '((vm . vm-visit-folder-other-frame) (gnus . org-gnus-no-new-news)
			(file . find-file-other-window) (wl . wl-other-frame))
 org-structure-template-alist '(("s" "#+begin_src ?\n\n#+end_src" "<src lang=\"?\">\n\n</src>")
				("e" "#+begin_example\n?\n#+end_example" "<example>\n?\n</example>")
				("q" "#+begin_quote\n?\n#+end_quote" "<quote>\n?\n</quote>")
				("v" "#+begin_verse\n?\n#+end_verse" "<verse>\n?\n/verse>")
				("c" "#+begin_center\n?\n#+end_center" "<center>\n?\n/center>")
				("l" "#+begin_latex\n?\n#+end_latex"
				 "<literal style=\"latex\">\n?\n</literal>")
				("L" "#+latex: " "<literal style=\"latex\">?</literal>")
				("h" "#+begin_html\n?\n#+end_html"
				 "<literal style=\"html\">\n?\n</literal>")
				("H" "#+html: " "<literal style=\"html\">?</literal>")
				("a" "#+begin_ascii\n?\n#+end_ascii") ("A" "#+ascii: ")
				("i" "#+index: ?" "#+index: ?")
				("I" "#+include %file ?" "<include file=%file markup=\"?\">"))
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 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-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-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-blank-before-new-entry nil
 org-babel-pre-tangle-hook '(save-buffer)
 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-mode-hook '((lambda nil
		  (org-add-hook (quote change-major-mode-hook) (quote org-show-block-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-font-lock-hook '(org-inlinetask-fontify)
 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-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-drawers '("PROPERTIES" "CLOCK" "LOGBOOK")
 org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
 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-block nil) (comment org-export-blocks-format-comment t)
		     (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil))
 )

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: columnview times don't accumulate properly [7.8.03 (release_7.8.03.576.gbeb02)]
  2012-03-13 12:00 Bug: columnview times don't accumulate properly [7.8.03 (release_7.8.03.576.gbeb02)] Myles English
@ 2012-03-16  2:56 ` Myles English
  2012-03-16  3:08   ` mylesenglish
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Myles English @ 2012-03-16  2:56 UTC (permalink / raw)
  To: Myles English, emacs-orgmode Mode

[-- Attachment #1: Type: text/plain, Size: 2414 bytes --]


>> On Tue, 13 Mar 2012 12:00:07 +0000, Myles English said:

> 1. start with emacs -q
> 2. find file test-sums.org (attached)
> 3. adjust paths in the source block at the top of the file and evaluate
>    (execute?) it with C-c
> 4. goto the columnview block and C-c

> I would expect a table like this to be inserted:

> | ITEM                                        |  Sum |
> |---------------------------------------------+------|
> | * Introduction                              | 5:40 |
> |---------------------------------------------+------|
> | ** test sums                                | 0:30 |
> |---------------------------------------------+------|
> | ** Getting warmed up                        | 5:10 |
> |---------------------------------------------+------|
> | *** Nitty gritty                            | 5:10 |
> | *************** TODO Do something fantastic | 5:00 |
> | *************** END                         |      |
> |---------------------------------------------+------|
> | **** This is not added                      | 0:10 |
> | *************** TODO Do something else      | 0:10 |
> | *************** END                         |      |

> Hoever, the table looks like this:

> | ITEM                                        |  Sum |
> |---------------------------------------------+------|
> | * Introduction                              | 5:30 |
> |---------------------------------------------+------|
> | ** test sums                                | 0:30 |
> |---------------------------------------------+------|
> | ** Getting warmed up                        | 5:00 |
> |---------------------------------------------+------|
> | *** Nitty gritty                            | 5:00 |
> | *************** TODO Do something fantastic | 5:00 |
> | *************** END                         |      |
> |---------------------------------------------+------|
> | **** This is not added                      | 0:10 |
> | *************** TODO Do something else      | 0:10 |
> | *************** END                         |      |

> i.e. the 0:10 is not being picked up in the accumulation.

The attached patch produces the expected output, for the same test file:

I am an elisp novice so please would someone check this before I tag it
as a [PATCH].  In particular, something I am not sure about is the
"(require 'org-inlinetask)" which obviously introduces a dependency.


[-- Attachment #2: org-inlinetask.el.diff --]
[-- Type: text/plain, Size: 2237 bytes --]

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 04d2b62..5645ed3 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -931,6 +931,7 @@ Don't set this, this is meant for dynamic scoping.")
 (defun org-columns-compute (property)
   "Sum the values of property PROPERTY hierarchically, for the entire buffer."
   (interactive)
+  (require 'org-inlinetask)
   (let* ((re org-outline-regexp-bol)
 	 (lmax 30) ; Does anyone use deeper levels???
 	 (lvals (make-vector lmax nil))
@@ -942,7 +943,8 @@ Don't set this, this is meant for dynamic scoping.")
 	 (fun (nth 6 ass))
 	 (calc (or (nth 7 ass) 'identity))
 	 (beg org-columns-top-level-marker)
-	 last-level val valflag flag end sumpos sum-alist sum str str1 useval)
+	 (last-level org-inlinetask-min-level)
+	 val valflag flag end sumpos sum-alist sum str str1 useval)
     (save-excursion
       ;; Find the region to compute
       (goto-char beg)
@@ -951,16 +953,24 @@ Don't set this, this is meant for dynamic scoping.")
       ;; Walk the tree from the back and do the computations
       (while (re-search-backward re beg t)
 	(setq sumpos (match-beginning 0)
-	      last-level level
+	      last-level (if (and (not (equal level 0) )
+				  (not (equal level org-inlinetask-min-level)))
+			     level last-level)
 	      level (org-outline-level)
 	      val (org-entry-get nil property)
 	      valflag (and val (string-match "\\S-" val)))
 	(cond
 	 ((< level last-level)
 	  ;; put the sum of lower levels here as a property
-	  (setq sum (when (aref lvals last-level)
+	  (setq sum (when (and
+			   (not (equal last-level org-inlinetask-min-level))
+			   (aref lvals last-level))
 		      (apply fun (aref lvals last-level)))
-		flag (aref lflag last-level) ; any valid entries from children?
+		sum2 (when (aref lvals org-inlinetask-min-level)
+		       (apply fun (aref lvals org-inlinetask-min-level)))
+		sum (+ (or sum 0) (or sum2 0))
+		flag (or (aref lflag last-level) ; any valid entries from children?
+			 (aref lflag org-inlinetask-min-level)) ; or inline tasks?
 		str (org-columns-number-to-string sum format printf)
 		str1 (org-add-props (copy-sequence str) nil 'org-computed t 'face 'bold)
 		useval (if flag str1 (if valflag val ""))

[-- Attachment #3: Type: text/plain, Size: 17 bytes --]


Thanks,

Myles


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Bug: columnview times don't accumulate properly [7.8.03 (release_7.8.03.576.gbeb02)]
  2012-03-16  2:56 ` Myles English
@ 2012-03-16  3:08   ` mylesenglish
  2012-03-16 18:03   ` Achim Gratz
  2012-03-23 21:38   ` Bastien
  2 siblings, 0 replies; 5+ messages in thread
From: mylesenglish @ 2012-03-16  3:08 UTC (permalink / raw)
  To: emacs-orgmode Mode; +Cc: Myles English


The patch I just sent should be named org-colview.el.diff instead of org-inlinetasks.el.diff

Myles

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: columnview times don't accumulate properly [7.8.03 (release_7.8.03.576.gbeb02)]
  2012-03-16  2:56 ` Myles English
  2012-03-16  3:08   ` mylesenglish
@ 2012-03-16 18:03   ` Achim Gratz
  2012-03-23 21:38   ` Bastien
  2 siblings, 0 replies; 5+ messages in thread
From: Achim Gratz @ 2012-03-16 18:03 UTC (permalink / raw)
  To: emacs-orgmode

Myles English <mylesenglish@gmail.com> writes:
> I am an elisp novice so please would someone check this before I tag it
> as a [PATCH].  In particular, something I am not sure about is the
> "(require 'org-inlinetask)" which obviously introduces a dependency.

What problem were you trying to solve when you added it?  It doesn't
appear to be needed at runtime (org-inlinetask-min-level is an
autoloaded symbol).  If you need it during compilation, it should be
wrapped into an eval-when-compile at the beginning of the source file.


HTH,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug: columnview times don't accumulate properly [7.8.03 (release_7.8.03.576.gbeb02)]
  2012-03-16  2:56 ` Myles English
  2012-03-16  3:08   ` mylesenglish
  2012-03-16 18:03   ` Achim Gratz
@ 2012-03-23 21:38   ` Bastien
  2 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2012-03-23 21:38 UTC (permalink / raw)
  To: emacs-orgmode Mode; +Cc: Myles English

Hi Myles,

Myles English <mylesenglish@gmail.com> writes:

>> i.e. the 0:10 is not being picked up in the accumulation.
>
> The attached patch produces the expected output, for the same test
> file:

I applied a slightly modified version of your patch.

Thanks a lot!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-23 21:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 12:00 Bug: columnview times don't accumulate properly [7.8.03 (release_7.8.03.576.gbeb02)] Myles English
2012-03-16  2:56 ` Myles English
2012-03-16  3:08   ` mylesenglish
2012-03-16 18:03   ` Achim Gratz
2012-03-23 21:38   ` Bastien

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).