emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Error when push fils in MobileOrg
@ 2009-12-03 21:56 Xin Shi
  2009-12-03 22:16 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Xin Shi @ 2009-12-03 21:56 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 236 bytes --]

Hello Experts,

I'm using Emacs 23.1 with orgmode 6.33b.

When I use "Push Files and Views" in MobileOrg in Emacs, I got error
message:

Writing index file...
byte-code: Wrong type argument: listp, "TODO"

Any suggestions?

Thanks!
Xin

[-- Attachment #1.2: Type: text/html, Size: 319 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Error when push fils in MobileOrg
  2009-12-03 21:56 Error when push fils in MobileOrg Xin Shi
@ 2009-12-03 22:16 ` Nick Dokos
  2009-12-04 22:38   ` Xin Shi
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2009-12-03 22:16 UTC (permalink / raw)
  To: Xin Shi; +Cc: emacs-orgmode

Xin Shi <shixin111@gmail.com> wrote:

> Hello Experts,
> 
> I'm using Emacs 23.1 with orgmode 6.33b.
> 
> When I use "Push Files and Views" in MobileOrg in Emacs, I got error message:
> 
> Writing index file...
> byte-code: Wrong type argument: listp, "TODO"
> 
> Any suggestions?
> 

The topic is different but the suggestion still holds:

    http://thread.gmane.org/gmane.emacs.orgmode/20039/focus=20040

Nick

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

* Re: Error when push fils in MobileOrg
  2009-12-03 22:16 ` Nick Dokos
@ 2009-12-04 22:38   ` Xin Shi
  2009-12-04 23:25     ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Xin Shi @ 2009-12-04 22:38 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 6429 bytes --]

Hi Nick,

Thanks for your info.

I did what that page suggested and here is the debug info: (Emacs 23.1 and
Orgmode 6.33b)


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)

Thanks!

Xin


On Thu, Dec 3, 2009 at 5:16 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Xin Shi <shixin111@gmail.com> wrote:
>
> > Hello Experts,
> >
> > I'm using Emacs 23.1 with orgmode 6.33b.
> >
> > When I use "Push Files and Views" in MobileOrg in Emacs, I got error
> message:
> >
> > Writing index file...
> > byte-code: Wrong type argument: listp, "TODO"
> >
> > Any suggestions?
> >
>
> The topic is different but the suggestion still holds:
>
>    http://thread.gmane.org/gmane.emacs.orgmode/20039/focus=20040
>
> Nick
>

[-- Attachment #1.2: Type: text/html, Size: 7979 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Error when push fils in MobileOrg
  2009-12-04 22:38   ` Xin Shi
@ 2009-12-04 23:25     ` Nick Dokos
  2009-12-05  4:34       ` Xin Shi
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2009-12-04 23:25 UTC (permalink / raw)
  To: Xin Shi; +Cc: emacs-orgmode

Xin Shi <shixin111@gmail.com> 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 <RET> /path/to/org-mobile.el <RET> to pick up the modified
definition

and then call org-mobile-push. When the debugger is entered, say

e entry <RET>
e def-todo <RET>

to examine the values of these symbols.

HTH,
Nick

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

* Re: Error when push fils in MobileOrg
  2009-12-04 23:25     ` Nick Dokos
@ 2009-12-05  4:34       ` Xin Shi
  0 siblings, 0 replies; 5+ messages in thread
From: Xin Shi @ 2009-12-05  4:34 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 9046 bytes --]

Hi Nick,

Thanks for your detailed explanation! After deleting the set todo in my
.emacs file, it's working now!

Now, the remaining question for me is that the generated "agenda.org" file
is empty even when there is agenda there. And I don't know if there is a way
to display the agenda in the MobileOrg in the iphone/ipod touch.

Xin



On Fri, Dec 4, 2009 at 6:25 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Xin Shi <shixin111@gmail.com> 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 <RET> /path/to/org-mobile.el <RET> to pick up the modified
> definition
>
> and then call org-mobile-push. When the debugger is entered, say
>
> e entry <RET>
> e def-todo <RET>
>
> to examine the values of these symbols.
>
> HTH,
> Nick
>
>

[-- Attachment #1.2: Type: text/html, Size: 11434 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2009-12-05  4:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 21:56 Error when push fils in MobileOrg Xin Shi
2009-12-03 22:16 ` Nick Dokos
2009-12-04 22:38   ` Xin Shi
2009-12-04 23:25     ` Nick Dokos
2009-12-05  4:34       ` Xin Shi

Code repositories for project(s) associated with this public 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).