From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: org-mode + xemacs + patch Date: Thu, 11 May 2006 11:44:18 +0200 Message-ID: <90785fd311b9fde1939238e19f34ae9d@science.uva.nl> References: <7uejz3tgzd.fsf@horizonsemi.com> <30cf789d7cbc5c3caf7b6eea1a1e08f8@science.uva.nl> <7u7j4utjj8.fsf@horizonsemi.com> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fe7iV-0006nF-NL for emacs-orgmode@gnu.org; Thu, 11 May 2006 05:44:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fe7iT-0006n0-75 for emacs-orgmode@gnu.org; Thu, 11 May 2006 05:44:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fe7iT-0006mx-2j for emacs-orgmode@gnu.org; Thu, 11 May 2006 05:44:17 -0400 Received: from [194.134.35.144] (helo=smtp04.wanadoo.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fe7jw-0002V4-R6 for emacs-orgmode@gnu.org; Thu, 11 May 2006 05:45:49 -0400 In-Reply-To: <7u7j4utjj8.fsf@horizonsemi.com> 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: chgreg692000@yahoo.com Cc: emacs-orgmode@gnu.org On May 10, 2006, at 9:40, chgreg692000@yahoo.com wrote: > Look at the following example: > > |---+-------------------+---------+----------| > | | scan | scan_in | scan_out | > | | | witdh | width | > |---+-------------------+---------+----------| > | ! | | 0 | 0 | > | # | "SCAN_IN0[12:0]" | 13 | 0 | > | # | "SCAN_IN1[3:0]" | 17 | 0 | > | # | "SCAN_OUT0[15:0]" | 17 | 16 | > | # | "SCAN_IN2[22:0]" | 40 | 16 | > | # | "SCAN_OUT1[44:0]" | 40 | 61 | > | # | "SCAN_IN3[5:0]" | 46 | 61 | > |---+-------------------+---------+----------| > #+TBLFM: $3='(number-to-string (if (string-match > "SCAN_IN.*\\[\\([0-9]+\\):\\([0-9]+\\)\\]" $2) (+ (string-to-number > (match-string 1 $2)) 1 &1) &1))::$4='(number-to-string (if > (string-match "SCAN_OUT.*\\[\\([0-9]+\\):\\([0-9]+\\)\\]" $2) (+ > (string-to-number (match-string 1 $2)) 1 &1) &1)) > OK, I have also taken this part, this is a great new feature for the tables. A few remarks: - Note that you don't have to use "SCAN_IN3[5:0]" with quotes in the table field - you can leave off the quotes here and put them into the lisp form, like "$2". - I am also allowing a lisp form to return a number - number-to-string will then be automatically applied. - Finally, I am also allowing a format after a semicolon, just like in calc formulas. So you can write '(+ $1 15.3);%10.3f Thanks again. - Carsten