From 7a513b2c00e83f81c8bf1d3abe482d00a2946abc Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 11 Dec 2011 14:05:13 +0100 Subject: [PATCH] New option `org-table-formula-field-format'. Format for fields which contain the result of a formula. For example, using \"~%s~\" will display the result within tilde characters. Beware that modifying the display can prevent the field from being used in another formula. Based on an idea of Dov Grobgeld. --- lisp/org-table.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 10c18df41..6ea072751 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -241,6 +241,14 @@ days." (symbol :tag "Hours " 'hours) (symbol :tag "Days " 'days))) +(defcustom org-table-formula-field-format "%s" + "Format for fields which contain the result of a formula. +For example, using \"~%s~\" will display the result within tilde +characters. Beware that modifying the display can prevent the +field from being used in another formula." + :group 'org-table-settings + :type 'string) + (defcustom org-table-formula-evaluate-inline t "Non-nil means TAB and RET evaluate a formula in current table field. If the current field starts with an equal sign, it is assumed to be a formula @@ -2572,7 +2580,8 @@ $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 org-table-formula-field-format + (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))) -- 2.11.4.GIT