emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: New keywords for org-agenda-sorting-strategy give "wrong type argument" error [8.0 (release_8.0-1-g5ef07d @ /home/rwl/src/org-mode/lisp/)]
@ 2013-04-20  1:23 Richard Lawrence
  2013-04-20  1:36 ` Richard Lawrence
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Lawrence @ 2013-04-20  1:23 UTC (permalink / raw)
  To: emacs-orgmode


Dear Org team,

I think I have found a bug related to the new agenda sorting strategies.
When I set:

(setq org-agenda-sorting-strategy '(deadline-up))
; or deadline-down, or timestamp-up/down, or scheduled-up/down, etc.
; the same problem occurs using the '((agenda deadline-up) ...) form

it results in the following error:

"org-entries-lessp: Wrong type argument: stringp, nil"

and no entries are displayed in the agenda.

Some crude debugging on my part suggests that this error is triggered
when org-entries-lessp tries to compare the "now" line (i.e., the agenda
item generated from org-agenda-current-time-string) against another
item.

I think the problem is actually in org-cmp-ts: string-match doesn't like
getting nil as an argument.  So maybe the problem is that the "now" line
doesn't have the text properties corresponding to deadlines, timestamps,
etc., such that get-text-property is returning nil?

Hope that's helpful!  Please let me know if I can help with further
debugging.

Best,
Richard


Emacs  : GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-01-08 on murphy, modified by Debian
Package: Org-mode version 8.0 (release_8.0-1-g5ef07d @ /home/rwl/src/org-mode/lisp/)

current state:
==============
(setq
 org-todo-keyword-faces '(("WAITING" . "orange"))
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-agenda-custom-commands '(("r" "Reading list" tags-todo "+reading") ("S" . "STUDY context searches") ("Sf" todo "FIND") ("Sp" todo "PRINT")
			      ("Sr" todo "READ") ("Sn" todo "NOTES") ("St" tags-todo "+STUDY") ("P" tags-todo "+CAMPUS") ("D" tags-todo "+COMPUTER")
			      ("H" tags-todo "+HOME") ("E" tags-todo "ERRAND|BUY") ("F" tags "+FREETIME") ("X" tags-todo "+EXERCISE"))
 org-agenda-files '("~/Documents/philosophy/dissertation/tasks.org" "~/org/school.org" "~/org/life.org" "~/org/beer.org" "~/org/food.org")
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-footnote-auto-label 'confirm
 org-list-empty-line-terminates-plain-lists t
 org-agenda-sorting-strategy '(deadline-up)  ;; and others
 org-capture-before-finalize-hook '((lambda nil (add-bibliographic-data)))
 org-export-preprocess-hook '(ignoreheading-org-export-preprocess-hook)
 org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-todo-keywords '((sequence "TODO" "INPROGRESS" "WAITING" "|" "DONE" "CANCELED") (sequence "FIND" "PRINT" "READ" "NOTES" "|" "DONE" "CANCELED")
		     (sequence "PRIMARY" "SECONDARY" "|" "BOTTLED"))
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-hide-inline-tasks org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
 org-agenda-span 1
 org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
		 #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-refile-targets '((nil :maxlevel . 4))
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-refile-use-outline-path t
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-occur-hook '(org-first-headline-recenter)
 org-from-is-user-regexp "\\<Richard Lawrence\\>"
 org-mobile-directory "/media/nexus/mobileorg"
 org-agenda-cmp-user-defined 'org-agenda-cmp-by-deadline
 org-modules '(org-habit org-w3m org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 )

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: New keywords for org-agenda-sorting-strategy give "wrong type argument" error [8.0 (release_8.0-1-g5ef07d @ /home/rwl/src/org-mode/lisp/)]
  2013-04-20  1:23 Bug: New keywords for org-agenda-sorting-strategy give "wrong type argument" error [8.0 (release_8.0-1-g5ef07d @ /home/rwl/src/org-mode/lisp/)] Richard Lawrence
@ 2013-04-20  1:36 ` Richard Lawrence
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Lawrence @ 2013-04-20  1:36 UTC (permalink / raw)
  To: emacs-orgmode

Indeed, the following patch seems to fix the issue for me, though I
don't know enough about the code to know if this is
clean/elegant/general enough:

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 631c6d0..c53c8c8 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6989,9 +6989,9 @@ or \"timestamp_ia\", compare within each of these type.
 When TYPE is the empty string, compare all timestamps
 without respect of their type."
   (let* ((def (if org-sort-agenda-notime-is-late 9901 -1))
-	 (ta (or (and (string-match type (get-text-property 1 'type a))
+	 (ta (or (and (string-match type (or (get-text-property 1 'type a) ""))
 		      (get-text-property 1 'ts-date a)) def))
-	 (tb (or (and (string-match type (get-text-property 1 'type b))
+	 (tb (or (and (string-match type (or (get-text-property 1 'type b) ""))
 		      (get-text-property 1 'ts-date b)) def)))
     (cond ((< ta tb) -1)
 	  ((< tb ta) +1))))

-- 
Best,
Richard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-20  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-20  1:23 Bug: New keywords for org-agenda-sorting-strategy give "wrong type argument" error [8.0 (release_8.0-1-g5ef07d @ /home/rwl/src/org-mode/lisp/)] Richard Lawrence
2013-04-20  1:36 ` Richard Lawrence

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).