소스 검색

Tables: Allow sorting inactive time stamps.

Hsui-Khuern Tang writes:

   I have a table where one column consists of inactive dates, such as
   this:

     | Date             | OK? |
     |------------------+-----|
     | [2009-01-30 Fri] | x   |
     | [2009-01-27 Tue] | x   |
     | [2009-01-28 Wed] | x   |

   I can't sort the table by that column.  If I change the dates to
   active, then sorting (by time) works fine.  Is this behavior
   intentional?

Yes, intentional, because the same routine also does sorting of
entries and should prefer active time stamps.  However, I realize that
we can still look for an inactive time stamp when no active one can be
found.   This is what this commit implements.
Carsten Dominik 16 년 전
부모
커밋
5f68200625
2개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      lisp/ChangeLog
  2. 2 1
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-02-06  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-do-sort): Also take an inactive timestamp if no
+	active one is found.
+
 	* org-colview-xemacs.el (org-columns-capture-view): Copy before
 	deleting duplicates.
 

+ 2 - 1
lisp/org.el

@@ -5889,7 +5889,8 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive."
      ((= dcst ?t)
       (setq extractfun
 	    (lambda (x)
-	      (if (string-match org-ts-regexp x)
+	      (if (or (string-match org-ts-regexp x)
+		      (string-match org-ts-regexp-both x))
 		  (time-to-seconds
 		   (org-time-string-to-time (match-string 0 x)))
 		0))