From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: property constants in elisp formulas Date: Tue, 23 Oct 2007 07:10:54 +0200 Message-ID: <0B360E2E-8D16-4FDA-883E-8A245EEB9848@science.uva.nl> References: <175b171f1e8865fc51f80ff2a09b7fb7@science.uva.nl> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IkD04-00068b-31 for emacs-orgmode@gnu.org; Tue, 23 Oct 2007 02:12:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IkD03-00068N-15 for emacs-orgmode@gnu.org; Tue, 23 Oct 2007 02:12:23 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IkD02-00068H-OS for emacs-orgmode@gnu.org; Tue, 23 Oct 2007 02:12:22 -0400 Received: from ug-out-1314.google.com ([66.249.92.169]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IkD02-0001pm-9v for emacs-orgmode@gnu.org; Tue, 23 Oct 2007 02:12:22 -0400 Received: by ug-out-1314.google.com with SMTP id a2so76018ugf for ; Mon, 22 Oct 2007 23:12:19 -0700 (PDT) In-Reply-To: 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: Eddward DeVilla Cc: org-mode list I believe you can, yes. Why don;y you just try and watch the effect by turning on formula debugging? BTW, 5.13d omits the parenthesis in Lisp formula interpolation... - Carsten On Oct 19, 2007, at 10:32 PM, Eddward DeVilla wrote: > Now, just as a stupid question, if I put a lisp expression into a > property, can I use it in a formula? > > ===== sample ======== > * top > :PROPERTIES: > :fives: (0 8 16) > :fours: (2 18 58) > :threes: (6 11 33) > :twos: (3 13 36) > :ones: (0 13 59) > :zeros: (0 6 23) > :null: (17 8 59) > :END: > > *** test 1 > | | day | hour | minute | > |---+-----+------+--------| > | # | 0 | 8 | 16 | > | # | 2 | 18 | 58 | > | # | 6 | 11 | 33 | > | # | 3 | 13 | 36 | > | # | 0 | 13 | 59 | > | # | 0 | 6 | 23 | > | # | 17 | 8 | 59 | > #+TBLFM: @2$2='(car '$PROP_fives)::@2$3='(cadr > '$PROP_fives)::@2$4='(caddr '$PROP_fives)::@3$2='(car > '$PROP_fours)::@3$3='(cadr '$PROP_fours)::@3$4='(caddr > '$PROP_fours)::@4$2='(car '$PROP_threes)::@4$3='(cadr > '$PROP_threes)::@4$4='(caddr '$PROP_threes)::@5$2='(car > '$PROP_twos)::@5$3='(cadr '$PROP_twos)::@5$4='(caddr > '$PROP_twos)::@6$2='(car '$PROP_ones)::@6$3='(cadr > '$PROP_ones)::@6$4='(caddr '$PROP_ones)::@7$2='(car > '$PROP_zeros)::@7$3='(cadr '$PROP_zeros)::@7$4='(caddr > '$PROP_zeros)::@8$2='(car '$PROP_null)::@8$3='(cadr > '$PROP_null)::@8$4='(caddr '$PROP_null) > > ========================== > > Also, in the above example, the property values were aligned for me. > In my previous example, that didn't happen. It seems that the > alignment code does like underscores in names > > ===== sample ====== > * top > :PROPERTIES: > :fives: 0 8 16 > :d_5: 0 > :fours: 2 18 58 > :END: > > ================= > > Lastly, since I'm whining, there's a bug in the formula editor that > I'm not sure if I've mentioned before. Edit the table below with C-c > '. The '(@-I$2..$2) will become '(@-I$2..B&) which causes #ERRORs. > > ====== sample ======= > * top > :PROPERTIES: > :fives: 0 8 16 > :fours: 2 18 58 > :threes: 6 11 33 > :twos: 3 13 36 > :ones: 0 13 59 > :zeros: 0 6 23 > :null: 17 8 59 > :END: > > *** test 2 > | | day | | > |---+-----+----| > | # | 0 | 0 | > | # | 2 | 2 | > | # | 6 | 8 | > | # | 3 | 11 | > | # | 0 | 11 | > | # | 0 | 11 | > | # | 17 | 28 | > #+TBLFM: $3='(apply '+ '(@-I$2..$2));N::@2$2='(car > '$PROP_fives)::@3$2='(car '$PROP_fours)::@4$2='(car > '$PROP_threes)::@5$2='(car '$PROP_twos)::@6$2='(car > '$PROP_ones)::@7$2='(car '$PROP_zeros)::@8$2='(car '$PROP_null) > > ==================== > > Edd > > On 10/19/07, Carsten Dominik wrote: >> You are right, there should be no parenthesis in Lisp interpolation. >> Will be fixed in 5.14. >> >> - Carsten >> >> On Oct 19, 2007, at 0:06, Eddward DeVilla wrote: >> >>> Hi, >>> >>> Is there a better way to do this? >>> >>> ===== sample file ===== >>> * top >>> :PROPERTIES: >>> :d_5: 0 >>> :h_5: 8 >>> :m_5: 16 >>> :d_4: 2 >>> :h_4: 18 >>> :m_4: 58 >>> :d_3: 6 >>> :h_3: 11 >>> :m_3: 33 >>> :d_2: 3 >>> :h_2: 13 >>> :m_2: 36 >>> :d_1: 0 >>> :h_1: 13 >>> :m_1: 59 >>> :d_0: 0 >>> :h_0: 6 >>> :m_0: 23 >>> :d_n: 17 >>> :h_n: 8 >>> :m_n: 59 >>> :END: >>> >>> *** test >>> | | day | hour | minute | >>> |---+-----+------+--------| >>> | # | 0 | 8 | 16 | >>> | # | 2 | 18 | 58 | >>> | # | 6 | 11 | 33 | >>> | # | 3 | 13 | 36 | >>> | # | 0 | 13 | 59 | >>> | # | 0 | 6 | 23 | >>> | # | 17 | 8 | 59 | >>> #+TBLFM: @2$2='(car '$PROP_d_5)::@2$3='(car '$PROP_h_5)::@2$4='(car >>> '$PROP_m_5)::@3$2='(car '$PROP_d_4)::@3$3='(car >>> '$PROP_h_4)::@3$4='(car '$PROP_m_4)::@4$2='(car >>> '$PROP_d_3)::@4$3='(car '$PROP_h_3)::@4$4='(car >>> '$PROP_m_3)::@5$2='(car '$PROP_d_2)::@5$3='(car >>> '$PROP_h_2)::@5$4='(car '$PROP_m_2)::@6$2='(car >>> '$PROP_d_1)::@6$3='(car '$PROP_h_1)::@6$4='(car >>> '$PROP_m_1)::@7$2='(car '$PROP_d_0)::@7$3='(car >>> '$PROP_h_0)::@7$4='(car '$PROP_m_0)::@8$2='(car >>> '$PROP_d_n)::@8$3='(car '$PROP_h_n)::@8$4='(car '$PROP_m_n) >>> >>> ==================== >>> >>> Specifically, is there a better way to get at a property constant >>> with >>> an elisp formula? It seems the value is automatically put in parens >>> such that $h_3 is (11) which is a little awkward. On the other >>> hand, >>> maybe I can use that to store a list in a property. >>> >>> Edd >>> >>> >>> _______________________________________________ >>> Emacs-orgmode mailing list >>> Remember: use `Reply All' to send replies to the list. >>> Emacs-orgmode@gnu.org >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>> >>> >> >> -- >> Carsten Dominik >> Sterrenkundig Instituut "Anton Pannekoek" >> Universiteit van Amsterdam >> Kruislaan 403 >> NL-1098SJ Amsterdam >> phone: +31 20 525 7477 >> >> >