emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: right-alignment fails in column view [9.0.7 (release_9.0.7-


From: Nicolas Goaziou
Subject: Re: [O] Bug: right-alignment fails in column view [9.0.7 (release_9.0.7-439-g2906e5 @ /home/tews/src/org-mode/lisp/)]
Date: Mon, 22 May 2017 14:02:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hello,

Hendrik Tews <address@hidden> writes:

> I am not sure I understand the check
>
>        (when (or (not (string-match-p "[0-9]" value))
>                  (and (string-match-p "[1-9]" value)
>                       (= 0 (string-to-number value))))
>
> before the error message. Wouldn't it be good enough to apply the
> format on the result of string-to-number? This would permit to
> have markers "TODO" or "XXX" without getting an error.

The point is that format strings in summary operators are reserved for
numbers. There is no point to have a "TODO" or a "XXX" value in a column
that is summarized with {+;%.2f}.

The intent of the check is to warn the user that a columns contains
invalid values. Applying `string-to-number' unconditionally could give
strange results for example, with {mean,%.2f}.

> Moreover, the test is wrong for legitimate numbers such as "0e3"
> while it permits non-numbers such as "1XX".

I genuinely thought this would return "0". 

Anyway, the difficulty is to properly check we're applying the format
string on numbers. It may not be possible to do so in the general case,
so yes, we may fall-back to unconditional `string-to-number'.

Regards,

-- 
Nicolas Goaziou



reply via email to

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