Explorar o código

Alter org-babel-number-p so that it recognises negative numbers

Dan Davison %!s(int64=16) %!d(string=hai) anos
pai
achega
dc66d84ac4
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lisp/org-babel.el

+ 1 - 1
lisp/org-babel.el

@@ -704,7 +704,7 @@ This is taken almost directly from `org-read-prop'."
 
 (defun org-babel-number-p (string)
   "Return t if STRING represents a number"
-  (if (and (string-match "^[[:digit:]]*\\.?[[:digit:]]*$" string)
+  (if (and (string-match "^-?[[:digit:]]*\\.?[[:digit:]]*$" string)
            (= (match-end 0) (length string)))
       (string-to-number string)))