all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug: MobileOrg pull broken
@ 2016-07-31 17:58 Ian Dunn
  2016-08-07 22:15 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Dunn @ 2016-07-31 17:58 UTC (permalink / raw)
  To: emacs-orgmode


Emacs  : GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.6) of 2016-07-22
Package: Org-mode version 8.3.5 (release_8.3.5-1032-g9798da)

    For the past month or so (I don't know exactly when it started), I've been having problems with MobileOrg (Android if it helps).  When I'd pull changes from my phone to my computer, I'd always get "EXECUTION FAILED" messages, and nothing would work.

    I stepped through org-mobile-apply using Edebug and found that the problem is with "(eval cmd)" in org-mobile.el, line 889.  It fails with the error "(void-variable data)".  I don't know why this is happening, but I've included a simple fix for this that passes the `data', `old', and `new' variables as a lexical environment to `eval'.  This may not work if `org-mobile-action-alist' is modified.

    I tried using "(eval cmd t)", but that didn't work; I got the same "void-variable" error.  If someone more familiar with lexical binding can look into this, or at least explain why this is happening, I'd appreciate it.

    Thanks!

-- 
Ian Dunn

--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -886,7 +886,11 @@ If BEG and END are given, only do this in that region."
 	    (condition-case msg
 		(org-with-point-at id-pos
 		  (progn
-		    (eval cmd)
+		    ;; Using (eval cmd t) doesn't work here, so
+		    ;; specify each required variable by hand.
+		    (eval cmd `((data . ,data)
+		    		(old  . ,old)
+		    		(new  . ,new)))
 		    (unless (member data (list "delete" "archive" "archive-sibling" "addheading"))
 		      (if (member "FLAGGED" (org-get-tags))
 			  (add-to-list 'org-mobile-last-flagged-files

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

* Re: Bug: MobileOrg pull broken
  2016-07-31 17:58 Bug: MobileOrg pull broken Ian Dunn
@ 2016-08-07 22:15 ` Nicolas Goaziou
  2016-08-08  1:37   ` Ian Dunn
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2016-08-07 22:15 UTC (permalink / raw)
  To: Ian Dunn; +Cc: emacs-orgmode

Hello,

Ian Dunn <dunni@gnu.org> writes:

>     I stepped through org-mobile-apply using Edebug and found that the
> problem is with "(eval cmd)" in org-mobile.el, line 889. It fails with
> the error "(void-variable data)". I don't know why this is happening,
> but I've included a simple fix for this that passes the `data', `old',
> and `new' variables as a lexical environment to `eval'. This may not
> work if `org-mobile-action-alist' is modified.

Actually `org-mobile-action-alist' is not meant to be modified, per its
docstring. Anyway I replaced the action sexp with a function. Does it
solve the problem ?

Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: MobileOrg pull broken
  2016-08-07 22:15 ` Nicolas Goaziou
@ 2016-08-08  1:37   ` Ian Dunn
  2016-08-08  7:20     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Dunn @ 2016-08-08  1:37 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Ian Dunn <dunni@gnu.org> writes:
>
>>     I stepped through org-mobile-apply using Edebug and found that the
>> problem is with "(eval cmd)" in org-mobile.el, line 889. It fails with
>> the error "(void-variable data)". I don't know why this is happening,
>> but I've included a simple fix for this that passes the `data', `old',
>> and `new' variables as a lexical environment to `eval'. This may not
>> work if `org-mobile-action-alist' is modified.
>
> Actually `org-mobile-action-alist' is not meant to be modified, per its
> docstring. Anyway I replaced the action sexp with a function. Does it
> solve the problem ?
>
> Regards,

  It almost worked, but your change to `org-mobile-action-alist' doesn't need the function quote.

-- 
Ian Dunn

diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 93b1481..f7ae0a9 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -228,7 +228,7 @@ capture file `mobileorg.org' back to the WebDAV directory, for example
 using `rsync' or `scp'.")
 
 (defconst org-mobile-action-alist
-  '(("edit" . #'org-mobile-edit))
+  '(("edit" . org-mobile-edit))
   "Alist with flags and actions for mobile sync.
 When flagging an entry, MobileOrg will create entries that look like

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

* Re: Bug: MobileOrg pull broken
  2016-08-08  1:37   ` Ian Dunn
@ 2016-08-08  7:20     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2016-08-08  7:20 UTC (permalink / raw)
  To: Ian Dunn; +Cc: emacs-orgmode

Ian Dunn <dunni@gnu.org> writes:

>   It almost worked, but your change to `org-mobile-action-alist'
>   doesn't need the function quote.

Oops. Fixed. Thank you.


Regards,

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

end of thread, other threads:[~2016-08-08  7:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-31 17:58 Bug: MobileOrg pull broken Ian Dunn
2016-08-07 22:15 ` Nicolas Goaziou
2016-08-08  1:37   ` Ian Dunn
2016-08-08  7:20     ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.