From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Error when push fils in MobileOrg Date: Fri, 04 Dec 2009 18:25:21 -0500 Message-ID: <10183.1259969121@alphaville.usa.hp.com> References: <5236d6f90912031356i7c98c48ay8d4c9494f4b55ec5@mail.gmail.com> <16227.1259878615@gamaville.dokosmarshall.org> <5236d6f90912041438t70c8cf42hc8b7337cb8028845@mail.gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGhXl-0006me-SU for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 18:26:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGhXg-0006hV-Sm for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 18:26:33 -0500 Received: from [199.232.76.173] (port=40946 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGhXg-0006hI-QH for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 18:26:28 -0500 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:37544) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGhXg-0001Cs-62 for emacs-orgmode@gnu.org; Fri, 04 Dec 2009 18:26:28 -0500 In-Reply-To: Message from Xin Shi of "Fri, 04 Dec 2009 17:38:57 EST." <5236d6f90912041438t70c8cf42hc8b7337cb8028845@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Xin Shi Cc: emacs-orgmode Xin Shi wrote: > Debugger entered--Lisp error: (wrong-type-argument listp "TODO") > cdr("TODO") > (mapcar (lambda (x) (if ... ... x)) (cdr entry)) > (setq kwds (mapcar (lambda ... ...) (cdr entry))) > (while (setq entry (pop def-todo)) (insert "#+READONLY\n") (setq kwds > (mapcar ... ...)) (insert "#+TODO: " (mapconcat ... kwds " ") "\n") (setq > dwds (member "|" kwds) twds (org-delete-all dwds kwds) todo-kwds > (org-delete-all twds todo-kwds) done-kwds (org-delete-all dwds done-kwds))) > (save-current-buffer (set-buffer temp-buffer) (while (setq entry ...) > (insert "#+READONLY\n") (setq kwds ...) (insert "#+TODO: " ... "\n") (setq > dwds ... twds ... todo-kwds ... done-kwds ...)) (when (or todo-kwds > done-kwds) (insert "#+TODO: " ... " | " ... "\n")) (setq def-tags (mapcar > ... def-tags)) (setq def-tags (delq nil def-tags)) (setq tags > (org-delete-all def-tags tags)) (setq tags (sort tags ...)) (setq tags > (append def-tags tags nil)) (insert "#+TAGS: " (mapconcat ... tags " ") > "\n") (insert "#+DRAWERS: " (mapconcat ... drawers " ") "\n") (insert > "#+ALLPRIORITIES: A B C" "\n") (when (file-exists-p ...) (insert "* [[file: > agendas.org][Agenda Views]]\n")) (while (setq entry ...) (setq file ... > link-name ...) (insert ...)) (push (cons org-mobile-index-file ...) > org-mobile-checksum-files)) > (with-current-buffer temp-buffer (while (setq entry ...) (insert > "#+READONLY\n") (setq kwds ...) (insert "#+TODO: " ... "\n") (setq dwds ... > twds ... todo-kwds ... done-kwds ...)) (when (or todo-kwds done-kwds) > (insert "#+TODO: " ... " | " ... "\n")) (setq def-tags (mapcar ... > def-tags)) (setq def-tags (delq nil def-tags)) (setq tags (org-delete-all > def-tags tags)) (setq tags (sort tags ...)) (setq tags (append def-tags tags > nil)) (insert "#+TAGS: " (mapconcat ... tags " ") "\n") (insert "#+DRAWERS: > " (mapconcat ... drawers " ") "\n") (insert "#+ALLPRIORITIES: A B C" "\n") > (when (file-exists-p ...) (insert "* [[file:agendas.org][Agenda Views]]\n")) > (while (setq entry ...) (setq file ... link-name ...) (insert ...)) (push > (cons org-mobile-index-file ...) org-mobile-checksum-files)) > (prog1 (with-current-buffer temp-buffer (while ... ... ... ... ...) (when > ... ...) (setq def-tags ...) (setq def-tags ...) (setq tags ...) (setq tags > ...) (setq tags ...) (insert "#+TAGS: " ... "\n") (insert "#+DRAWERS: " ... > "\n") (insert "#+ALLPRIORITIES: A B C" "\n") (when ... ...) (while ... ... > ...) (push ... org-mobile-checksum-files)) (with-current-buffer temp-buffer > (write-region nil nil temp-file nil 0))) > (unwind-protect (prog1 (with-current-buffer temp-buffer ... ... ... ... > ... ... ... ... ... ... ... ... ...) (with-current-buffer temp-buffer ...)) > (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) > (let ((temp-file ...) (temp-buffer ...)) (unwind-protect (prog1 ... ...) > (and ... ...))) > (with-temp-file (expand-file-name org-mobile-index-file > org-mobile-directory) (while (setq entry ...) (insert "#+READONLY\n") (setq > kwds ...) (insert "#+TODO: " ... "\n") (setq dwds ... twds ... todo-kwds ... > done-kwds ...)) (when (or todo-kwds done-kwds) (insert "#+TODO: " ... " | " > ... "\n")) (setq def-tags (mapcar ... def-tags)) (setq def-tags (delq nil > def-tags)) (setq tags (org-delete-all def-tags tags)) (setq tags (sort tags > ...)) (setq tags (append def-tags tags nil)) (insert "#+TAGS: " (mapconcat > ... tags " ") "\n") (insert "#+DRAWERS: " (mapconcat ... drawers " ") "\n") > (insert "#+ALLPRIORITIES: A B C" "\n") (when (file-exists-p ...) (insert "* > [[file:agendas.org][Agenda Views]]\n")) (while (setq entry ...) (setq file > ... link-name ...) (insert ...)) (push (cons org-mobile-index-file ...) > org-mobile-checksum-files)) > (let ((files-alist ...) (def-todo ...) (def-tags ...) file link-name > todo-kwds done-kwds tags drawers entry kwds dwds twds) > (org-prepare-agenda-buffers (mapcar ... files-alist)) (setq done-kwds > (org-uniquify org-done-keywords-for-agenda)) (setq todo-kwds (org-delete-all > done-kwds ...)) (setq drawers (org-uniquify org-drawers-for-agenda)) (setq > tags (org-uniquify ...)) (with-temp-file (expand-file-name > org-mobile-index-file org-mobile-directory) (while ... ... ... ... ...) > (when ... ...) (setq def-tags ...) (setq def-tags ...) (setq tags ...) (setq > tags ...) (setq tags ...) (insert "#+TAGS: " ... "\n") (insert "#+DRAWERS: " > ... "\n") (insert "#+ALLPRIORITIES: A B C" "\n") (when ... ...) (while ... > ... ...) (push ... org-mobile-checksum-files))) > org-mobile-create-index-file() > (save-window-excursion (org-mobile-check-setup) > (org-mobile-prepare-file-lists) (run-hooks (quote org-mobile-pre-push-hook)) > (message "Creating agendas...") (let (...) (org-mobile-create-sumo-agenda)) > (message "Creating agendas...done") (org-save-all-org-buffers) (message > "Copying files...") (org-mobile-copy-agenda-files) (message "Writing index > file...") (org-mobile-create-index-file) (message "Writing checksums...") > (org-mobile-write-checksums) (run-hooks (quote org-mobile-post-push-hook))) > (save-excursion (save-window-excursion (org-mobile-check-setup) > (org-mobile-prepare-file-lists) (run-hooks ...) (message "Creating > agendas...") (let ... ...) (message "Creating agendas...done") > (org-save-all-org-buffers) (message "Copying files...") > (org-mobile-copy-agenda-files) (message "Writing index file...") > (org-mobile-create-index-file) (message "Writing checksums...") > (org-mobile-write-checksums) (run-hooks ...))) > (let ((org-agenda-buffer-name "*SUMO*") (org-agenda-filter > org-agenda-filter) (org-agenda-redo-command org-agenda-redo-command)) > (save-excursion (save-window-excursion ... ... ... ... ... ... ... ... ... > ... ... ... ... ...))) > (let ((a-buffer ...)) (let (... ... ...) (save-excursion ...)) > (redraw-display) (when (and a-buffer ...) (if ... ... ...))) > org-mobile-push() > call-interactively(org-mobile-push nil nil) > >From the stacktrace, you can see that the problem arises in org-mobile-create-index-file, more specifically the following code in org-mobile.el (around line 349): ,---- | ... | (with-temp-file | (expand-file-name org-mobile-index-file org-mobile-directory) | (while (setq entry (pop def-todo)) | (insert "#+READONLY\n") | (setq kwds (mapcar (lambda (x) (if (string-match "(" x) | (substring x 0 (match-beginning 0)) | x)) | (cdr entry))) <<<<<<<<<<<<<<<<<<<<< BOOM! | (insert "#+TODO: " (mapconcat 'identity kwds " ") "\n") `---- entry seems to be the string "TODO", rather than a list or dotted pair, so cdr blows up on it. Since entry gets its value by looping over def-todo and since def-todo is initialized from (the default value of) org-todo-keywords, I suspect the latter is malformed. So do C-h v org-todo-keywords and tell us what it is. If you are initializing it somewhere in your .emacs, delete the initialization and see whether that fixes it. Note that it's the default value that's important not any buffer-local setting. In my case, this says: ,---- | org-todo-keywords is a variable defined in `org.el'. | Its value is | ((sequence "TODO" "DONE")) `---- The debugging advice I gave to Nate in an email earlier today also applies here: add a (debug) call and when you are dropped into the debugger, examine the state - e.g. change the above code to ,---- | ... | (with-temp-file | (expand-file-name org-mobile-index-file org-mobile-directory) | (while (setq entry (pop def-todo)) | (insert "#+READONLY\n") | (debug) | (setq kwds (mapcar (lambda (x) (if (string-match "(" x) | (substring x 0 (match-beginning 0)) | x)) | (cdr entry))) | (insert "#+TODO: " (mapconcat 'identity kwds " ") "\n") `---- and save the file. M-x load-file /path/to/org-mobile.el to pick up the modified definition and then call org-mobile-push. When the debugger is entered, say e entry e def-todo to examine the values of these symbols. HTH, Nick