summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-12-11 14:05:13 +0100
committerBastien Guerry <bzg@altern.org>2011-12-11 14:05:13 +0100
commit7a513b2c00e83f81c8bf1d3abe482d00a2946abc (patch)
tree141b2bfbbd4115516a773b5fbf5a41a53b298e84
parentc09b919630afd9b86f435071848f88122f87cc2c (diff)
downloadorg-mode-7a513b2c00e83f81c8bf1d3abe482d00a2946abc.tar.gz
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.
-rw-r--r--lisp/org-table.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 10c18df..6ea0727 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)))