From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stacey Marshall Subject: org-table-copy-down incrementor Date: Sat, 12 Apr 2014 12:56:50 +0100 Message-ID: <26CB62FB-01B3-49F6-A3E2-61FC25825493@oracle.com> Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYwYV-0008LK-Gv for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 07:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYwYO-0006xN-04 for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 07:57:07 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:22773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYwYN-0006x3-Pg for emacs-orgmode@gnu.org; Sat, 12 Apr 2014 07:56:59 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3CBuvpY006160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 12 Apr 2014 11:56:57 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3CBuuIu024400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 12 Apr 2014 11:56:56 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3CBuu1i024392 for ; Sat, 12 Apr 2014 11:56:56 GMT 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, I've been using org-mode for a little over a year, wish I had been using = it for far longer. I am not a member of this list... I discovered it via = , a link to the list there would = be helpful. I discovered org-table-copy-down and its ability to increment dates. I = would like to be able to specify the number to increment, and then = ideally increment by that number again. For example lets say I want to = create a table of Mondays.... =EF=BF=BC=EF=BF=BC| [2014-05-19 Mon] | | | | | | | | | [2014-05-26 Mon] | | | | | | | | | [2014-06-02 Mon] | | | | | | | | | [2014-06-09 Mon] | | | | | | | | Firstly, should I be using #+TBLFM: to fill in the table above... I = think that would only work if I was writing across columns, and would = require a calculation for each field... is that right? Hmm, is their a = repeat keyword..... I wonder if a simple solution might be to add a couple of custom = variables, say=20 org-table-copy-inc-count to hold the count, and for the time specific=20 org-table-copy-inc-by to specify what is being incremented, i.e. days, = hours, mins. For my use a simple integer would have sufficed, but a time element = would be more suitable for others uses. *** /opt/local/share/emacs/site-lisp/org/org-table.el Tue May 14 = 15:13:53 2013 --- /var/folders/6f/qt_5cdl91051fz5tbwrf8yy00000gn/T/ediff275HnR = Sat Apr 12 12:52:12 2014 *************** *** 224,229 **** --- 224,250 ---- :group 'org-table-calculation :type 'boolean) =20 + (defcustom org-table-copy-inc-count 1 + "Increment value used to increment field following copy by = \\[org-table-copy-down]." + :group 'org-table-calculation + :type 'integer) +=20 + (defcustom org-table-copy-inc-by 'day + "Measure in which to increment org-table-copy-inc-count value by = \\[org-table-copy-down]. + Possible values are: + day + month + year + minute + second" + :group 'org-table-calculation + :type '(choice + (const :tag "day" day) + (const :tag "month" month) + (const :tag "year" year) + (const :tag "minute" minute) + (const :tag "second" second))) +=20 (defcustom org-calc-default-modes '(calc-internal-prec 12 calc-float-format (float 8) *************** *** 1150,1156 **** (insert txt) (org-move-to-column col) (if (and org-table-copy-increment (org-at-timestamp-p t)) ! (org-timestamp-up-day) (org-table-maybe-recalculate-line)) (org-table-align) (org-move-to-column col)) --- 1171,1178 ---- (insert txt) (org-move-to-column col) (if (and org-table-copy-increment (org-at-timestamp-p t)) ! (org-timestamp-change org-table-copy-inc-count = org-table-copy-inc-by) ! ; (org-timestamp-up-day) (org-table-maybe-recalculate-line)) (org-table-align) (org-move-to-column col)) The above works for my needs, but perhaps someone has a more elegant = solution... Yours sincerely, Stacey