Browse Source

Column View: Catch it when a date property does not have allowed values defined.

When a property for column view is supposed to contain a date, not
defining allowed values could lead to an obscure error message.  This
is now improved.

Reported by Charles Cave.
Carsten Dominik 16 years ago
parent
commit
b95178f38e
3 changed files with 12 additions and 2 deletions
  1. 10 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-colview-xemacs.el
  3. 1 1
      lisp/org-colview.el

+ 10 - 0
lisp/ChangeLog

@@ -1,3 +1,13 @@
+2009-01-16  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-colview.el (org-colview-construct-allowed-dates): Better
+	error catching when a date/time property does not have allowed
+	values defined.
+
+	* org-colview-xemacs.el (org-colview-construct-allowed-dates):
+	Better error catching when a date/time property does not have
+	allowed values defined.
+
 2009-01-14  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-map-entries): Restore point and restriction after

+ 1 - 1
lisp/org-colview-xemacs.el

@@ -790,7 +790,7 @@ an integer, select that value."
 This respects the format of the time stamp in S, active or non-active,
 and also including time or not.  S must be just a time stamp, no text
 around it."
-  (when (string-match (concat "^" org-ts-regexp3 "$") s)
+  (when (and s (string-match (concat "^" org-ts-regexp3 "$") s))
     (let* ((time (org-parse-time-string s 'nodefaults))
 	   (active (equal (string-to-char s) ?<))
 	   (fmt (funcall (if (nth 1 time) 'cdr 'car) org-time-stamp-formats))

+ 1 - 1
lisp/org-colview.el

@@ -594,7 +594,7 @@ an integer, select that value."
 This respects the format of the time stamp in S, active or non-active,
 and also including time or not.  S must be just a time stamp, no text
 around it."
-  (when (string-match (concat "^" org-ts-regexp3 "$") s)
+  (when (and s (string-match (concat "^" org-ts-regexp3 "$") s))
     (let* ((time (org-parse-time-string s 'nodefaults))
 	   (active (equal (string-to-char s) ?<))
 	   (fmt (funcall (if (nth 1 time) 'cdr 'car) org-time-stamp-formats))