bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19401: 25.0.50; metar.el (metar-convert-temperature) wrong type argu


From: Mark Oteiza
Subject: bug#19401: 25.0.50; metar.el (metar-convert-temperature) wrong type argument stringp nil
Date: Tue, 29 Dec 2015 15:26:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Wolfgang Jenkner <wjenkner@inode.at> writes:

> On Tue, Jan 13 2015, Wolfgang Jenkner wrote:
>
>> Please note that this patch assumes that the patch from (Bug#19582) has
>> been applied.
>
> Actually, the following patch (on top of the last one) might be enough
> for metar to avoid the need for that fix from bug#19582, and so to
> remain compatible with older (than the future trunk ;-) emacs versions.
>
>>From ad084a9b35e79f3524e4ef01137cf256c0509266 Mon Sep 17 00:00:00 2001
> From: Wolfgang Jenkner <wjenkner@inode.at>
> Date: Wed, 14 Jan 2015 02:31:01 +0100
> Subject: [PATCH] [metar] Add a work-around for bug#19582.
>
> * packages/metar/metar.el (metar-convert-unit): Rewrite expr if it
> starts with the `neg' operator.  Technically, this is wrong because
> various functions in calc-units expect already simplified
> expressions.  In practice, it should work around the above bug.
> ---
>  packages/metar/metar.el | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/packages/metar/metar.el b/packages/metar/metar.el
> index 9575313..a05a353 100644
> --- a/packages/metar/metar.el
> +++ b/packages/metar/metar.el
> @@ -249,6 +249,9 @@ It must have the signature of `math-convert-units', which 
> is the default."
>    (unless (symbolp new-unit)
>      (setq new-unit (intern new-unit)))
>    (let ((expr (math-simplify (math-read-expr value))))
> +    ;; Sneakily work around bug#19582.
> +    (when (eq (car-safe expr) 'neg)
> +      (setq expr `(* -1 ,(cadr expr))))
>      (cl-assert (or (math-zerop expr)
>                  (not (memq (math-single-units-in-expr-p expr) '(nil wrong))))
>              nil

It looks to me that the patch in bug#19401 that Wolfgang's patches
depend on has been applied some time ago. I find the issue in emacs 24
and 25 to be fixed with both metar.el patches applied.





reply via email to

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