]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/metar/metar.el
Merge commit '7371d05adf4e86f8c6c507d6a8177abac1680d06'
[gnu-emacs-elpa] / packages / metar / metar.el
index 9575313279cc3a478801e23ceacdce77ac6f8967..b6989ea7852d7f3d140b2990571e99b7746e37a0 100644 (file)
@@ -1,9 +1,9 @@
 ;;; metar.el --- Retrieve and decode METAR weather information
 
-;; Copyright (C) 2007, 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2014-2016  Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
-;; Version: 0.1
+;; Version: 0.2
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: comm
 
@@ -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