From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Different face for org-table fields with formulas Date: Tue, 06 Dec 2011 09:06:54 +0100 Message-ID: <4EDDCD1E.4090604@gmail.com> References: Reply-To: R.M.Krug@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXq3I-0005Kv-8u for emacs-orgmode@gnu.org; Tue, 06 Dec 2011 03:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXq3G-00085c-S3 for emacs-orgmode@gnu.org; Tue, 06 Dec 2011 03:07:00 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:44870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXq3G-00085T-J5 for emacs-orgmode@gnu.org; Tue, 06 Dec 2011 03:06:58 -0500 Received: by eekd1 with SMTP id d1so1060273eek.0 for ; Tue, 06 Dec 2011 00:06:57 -0800 (PST) In-Reply-To: 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: Dov Grobgeld Cc: emacs-orgmode -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/12/11 22:29, Dov Grobgeld wrote: > I had a look at the org-mode sources and found that this was quite > trivial to implement on the source level. E.g. the following patch > embeds the output of an org formula in ~~ to make it org-verbatim. > This is easily changed to another couple of characters that may > then be set in org-emphasis-alist to whatever formatting I fancy. > > index edcdbe1..9ad01d4 100644 --- a/lisp/org-table.el +++ > b/lisp/org-table.el @@ -2572,7 +2572,7 @@ $1-> %s\n" orig > formula form0 form)) (message ""))) (if (listp ev) (setq fmt nil ev > "#ERROR")) (org-table-justify-field-maybe - (if fmt (format fmt > (string-to-number ev)) ev)) + (format "~%s~" (if fmt (format > fmt (string-to-number ev)) ev))) (if (and down (> ndown 0) > (looking-at ".*\n[ \t]*|[^-]")) (call-interactively 'org-return) > (setq ndown 0))) > > I haven't tried it out, but I think that would be very nice as a standard feature in org. Cheers, Rainer > > On Sun, Dec 4, 2011 at 09:15, Dov Grobgeld > wrote: > > Has anyone hacked up the use of using a different face for > org-table fields with formulas. This would be useful for quickly > realizing what are inputs and outputs in a org spreadsheet. > Currently I do this by adding the formatting ";~%.4f~" to my > formulas. But it would be nicer if this was a settable property. > > Thanks! Dov > > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7dzR4ACgkQoYgNqgF2egoueACgiG4Cqjc97RyFZ+TzVsqBYkWU mZUAn3Npki29EerHBQ54y7qEzi2K7pEC =3eFu -----END PGP SIGNATURE-----