emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Different face for org-table fields with formulas


From: Dov Grobgeld
Subject: Re: [O] Different face for org-table fields with formulas
Date: Mon, 5 Dec 2011 23:29:41 +0200

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)))



On Sun, Dec 4, 2011 at 09:15, Dov Grobgeld <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]