* 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.
(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