Browse Source

org-table.el (org-table-copy-down): Fix bug

* org-table.el (org-table-copy-down): When the text above does
not contain a number, fall back on incrementing by one.
Bastien Guerry 11 years ago
parent
commit
66db8836b5
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/org-table.el

+ 4 - 2
lisp/org-table.el

@@ -1183,8 +1183,10 @@ to a number.  In the case of a timestamp, increment by days."
 			      (- (org-time-string-to-absolute txt)
 				 (org-time-string-to-absolute txt-up)))
 			     ((string-match org-ts-regexp3 txt) 1)
-			     (t (- (string-to-number txt)
-				   (string-to-number txt-up)))))
+			     ((string-match "^[0-9]+\\(\.[0-9]+\\)?" txt-up)
+			      (- (string-to-number txt)
+				 (string-to-number (match-string 0 txt-up))))
+			     (t 1)))
 	       (t 1)))
     (if (not txt)
 	(user-error "No non-empty field found")