babel: number checking no longer fooled by strings ending in newlines

* contrib/babel/lisp/org-babel.el (org-babel-number-p): number
  checking is no longer fooled by strings ending in single newlines
This commit is contained in:
Eric Schulte 2010-06-07 17:59:58 -07:00
parent ef931fcd3a
commit efbb07fe12
1 changed files with 3 additions and 1 deletions

View File

@ -1289,7 +1289,9 @@ 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 "^-?[0-9]*\\.?[0-9]*$" string)
(= (match-end 0) (length string)))
(= (length (substring string (match-beginning 0)
(match-end 0)))
(length string)))
(string-to-number string)))
(defun org-babel-import-elisp-from-file (file-name)