summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-05-22 15:28:48 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-05-22 15:28:48 +0200
commit61eb86e06c94c70b07a8263cbb72c157a75cb0db (patch)
treed47b0dabeff6d245a5e7a8a65bfad419a2f44f6b
parentc2f4eec5dcd2f7490aaedb41f5f7df64e42a572a (diff)
parent7f0391cfe0e6a9f82b222aeb2898849d5154c52f (diff)
downloadorg-mode-61eb86e06c94c70b07a8263cbb72c157a75cb0db.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-colview.el14
-rw-r--r--testing/lisp/test-org-colview.el10
2 files changed, 3 insertions, 21 deletions
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 168d5bb..5b00818 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -237,17 +237,9 @@ display, as a string."
"* "
(org-columns-compact-links value)))
(`(,_ ,_ ,_ ,_ nil) value)
- ;; If PRINTF is set, and we are displaying a number, obey to
- ;; it. Otherwise, raise an error.
- (`(,_ ,name ,_ ,_ ,printf)
- (when (or (not (string-match-p "[0-9]" value))
- (and (string-match-p "[1-9]" value)
- (= 0 (string-to-number value))))
- (user-error "Invalid value: %S. \
-Format string in operator implies column %S only contains numbers"
- value
- name))
- (format printf (string-to-number value)))
+ ;; If PRINTF is set, assume we are displaying a number and
+ ;; obey to the format string.
+ (`(,_ ,name ,_ ,_ ,printf) (format printf (string-to-number value)))
(_ (error "Invalid column specification format: %S" spec)))))
(defun org-columns--collect-values (&optional compiled-fmt)
diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el
index 7fb0116..35469ae 100644
--- a/testing/lisp/test-org-colview.el
+++ b/testing/lisp/test-org-colview.el
@@ -223,16 +223,6 @@
:END:"
(let ((org-columns-default-format "%A{+;%.1f}")) (org-columns))
(get-char-property (point) 'org-columns-value-modified))))
- ;; Raise an error when format strings are applied to non-numbers.
- (should-error
- (org-test-with-temp-text
- "* H
-** S1
-:PROPERTIES:
-:A: foo
-:END:"
- (let ((org-columns-default-format "%A{+;%.2f}")) (org-columns))
- (get-char-property (point) 'org-columns-value-modified)))
;; {:} sums times. Plain numbers are hours.
(should
(equal