From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rares Vernica Subject: Bug: Table formula does not copy time interval correctly [8.2.10 (release_8.2.10 @ /usr/share/emacs/25.0.94/lisp/org/)] Date: Mon, 4 Jul 2016 09:28:36 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a1149b5c404933d0536d1d4e2 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6jg-0005aO-Dj for emacs-orgmode@gnu.org; Mon, 04 Jul 2016 12:28:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK6jd-00079a-ND for emacs-orgmode@gnu.org; Mon, 04 Jul 2016 12:28:39 -0400 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:35381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6jd-00079V-HQ for emacs-orgmode@gnu.org; Mon, 04 Jul 2016 12:28:37 -0400 Received: by mail-qk0-x230.google.com with SMTP id u124so43746721qkh.2 for ; Mon, 04 Jul 2016 09:28:37 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --001a1149b5c404933d0536d1d4e2 Content-Type: multipart/alternative; boundary=001a1149b5c40493390536d1d4e0 --001a1149b5c40493390536d1d4e0 Content-Type: text/plain; charset=UTF-8 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. ------------------------------------------------------------------------ In the following table: | [2016-07-03 Sun]--[2016-07-04 Mon] | 1d | d | | [2016-07-03 Sun]--[2016-07-05 Tue] | 2d | 2 d | #+TBLFM: $3=$2 The second column is computed by pressing C-u C-c C-y. This sequence calculates the time difference between the time-stamps in the previous column and inserts the difference in the current column. This is fine. Now, for the third column, I insert the formula listed at the bottom of the table. Once applied, the result of the formula for the fist row is just "d" instead of "1d". So, it seems that the value is not copied correctly. This seems to work fine if the time-stamp range is greater than one day. Also, for the second row, the value is copied correctly but there is an extra " " inserted between the number and the "d" letter. This might not be desirable. Appending "D" at the end of the formula, yields the same result: | [2016-07-03 Sun]--[2016-07-04 Mon] | 1d | d | | [2016-07-03 Sun]--[2016-07-05 Tue] | 2d | 2 d | #+TBLFM: $3=$2;D I also tried appending "T" at the end of the formula: | [2016-07-03 Sun]--[2016-07-04 Mon] | 1d | 00:00:01 | | [2016-07-03 Sun]--[2016-07-05 Tue] | 2d | 00:00:02 | #+TBLFM: $3=$2;T The numeric value is copied correctly but the days are now changed to seconds. I attached a dribble file which allows you to reproduce the first row in the first table. Emacs : GNU Emacs 25.0.94.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.20.4) of 2016-05-18 Package: Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/25.0.94/lisp/org/) current state: ============== (setq org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-confirm-shell-link-function 'yes-or-no-p org-after-todo-state-change-hook '(org-clock-out-if-current) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[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-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-hide-inline-tasks org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) ) --001a1149b5c40493390536d1d4e0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Remember to cover the basics, that is, what you expect= ed to happen and
what in fact did happen.=C2=A0 You don't know how t= o make a good report?=C2=A0 See

=C2=A0=C2=A0=C2=A0=C2=A0 http://orgmode.org/manual= /Feedback.html#Feedback

Your bug report will be posted to the Or= g-mode mailing list.
---------------------------------------------------= ---------------------

In the following table:

| [2016-07-03 S= un]--[2016-07-04 Mon] | 1d | d=C2=A0=C2=A0 |
| [2016-07-03 Sun]--[2016-0= 7-05 Tue] | 2d | 2 d |
#+TBLFM: $3=3D$2

The second column is comp= uted by pressing C-u C-c C-y. This sequence
calculates the time differen= ce between the time-stamps in the previous
column and inserts the differ= ence in the current column. This is fine.

Now, for the third column,= I insert the formula listed at the bottom of
the table. Once applied, t= he result of the formula for the fist row is
just "d" instead = of "1d". So, it seems that the value is not copied
correctly.<= br>
This seems to work fine if the time-stamp range is greater than one<= br>day. Also, for the second row, the value is copied correctly but thereis an extra " " inserted between the number and the "d&quo= t; letter. This
might not be desirable.

Appending "D" a= t the end of the formula, yields the same result:

| [2016-07-03 Sun]= --[2016-07-04 Mon] | 1d | d=C2=A0=C2=A0 |
| [2016-07-03 Sun]--[2016-07-0= 5 Tue] | 2d | 2 d |
#+TBLFM: $3=3D$2;D

I also tried appending &qu= ot;T" at the end of the formula:

| [2016-07-03 Sun]--[2016-07-0= 4 Mon] | 1d | 00:00:01 |
| [2016-07-03 Sun]--[2016-07-05 Tue] | 2d | 00:= 00:02 |
#+TBLFM: $3=3D$2;T

The numeric value is copied correctly = but the days are now changed to seconds.

I attached a dribble file w= hich allows you to reproduce the first row in
the first table.

Em= acs=C2=A0 : GNU Emacs 25.0.94.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.20= .4)
=C2=A0of 2016-05-18
Package: Org-mode version 8.2.10 (release_8.2= .10 @ /usr/share/emacs/25.0.94/lisp/org/)

current state:
=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(setq
=C2=A0org-tab-first-hook &= #39;(org-hide-block-toggle-maybe
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 org-src-native-tab-command-maybe
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 org-babel-hi= de-result-toggle-maybe
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 org-babel-header-arg-expand)
=C2=A0org-speed-comma= nd-hook '(org-speed-command-default-hook
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 org-babel-speed-command-hook)
=C2= =A0org-occur-hook '(org-first-headline-recenter)
=C2=A0org-metaup-ho= ok '(org-babel-load-in-session-maybe)
=C2=A0org-confirm-shell-link-f= unction 'yes-or-no-p
=C2=A0org-after-todo-state-change-hook '(or= g-clock-out-if-current)
=C2=A0org-src-mode-hook '(org-src-babel-conf= igure-edit-buffer
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0=C2=A0 org-src-mode-configure-edit-buffer)
=C2=A0org-agenda-before-wr= ite-hook '(org-agenda-add-entry-text)
=C2=A0org-babel-pre-tangle-hoo= k '(save-buffer)
=C2=A0org-mode-hook '(#[nil "\300\301\302\= 303\304$\207"
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 [o= rg-add-hook change-major-mode-hook org-show-block-all
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 append local]
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 5]
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0#[nil "\300\301\302\303\304$\207"
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 [org-add-hook change-major-mode-hook
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 org-babel-show-result= -all append local]
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 5]=
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0org-babel-result-hide-spec = org-babel-hide-all-hashes)
=C2=A0org-ctrl-c-ctrl-c-hook '(org-babel-= hash-at-point
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0 org-babel-execute-safely-maybe)
=C2=A0org-cycle-hook '(org-cy= cle-hide-archived-subtrees org-cycle-hide-drawers
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0 org-cycle-hide-inline-tasks org-cycle-show-empty-lin= es
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 org-optimize-window-afte= r-visibility-change)
=C2=A0org-confirm-elisp-link-function 'yes-or-n= o-p
=C2=A0org-metadown-hook '(org-babel-pop-to-session-maybe)
=C2= =A0org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
=C2=A0)=

--001a1149b5c40493390536d1d4e0-- --001a1149b5c404933d0536d1d4e2 Content-Type: application/octet-stream; name="org-copy-bug.dribble" Content-Disposition: attachment; filename="org-copy-bug.dribble" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iq88qmy60 IDB4ODAwMDA3OG9yZy1tb2RlPHJldHVybj58IAMhPHJldHVybj4tLQMhWzIwMTYtMDctMDRdPHJl dHVybj4gfCAVAxk8cmlnaHQ+PHJpZ2h0PjxyaWdodD48cmlnaHQ+ID0kMjx0YWI+GAM= --001a1149b5c404933d0536d1d4e2--