From: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
To: Alexander Vorobiev <alexander.vorobiev@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: OrgMobile problem: only three files in checksums.dat
Date: Mon, 19 Mar 2012 00:35:44 -0400 [thread overview]
Message-ID: <CAEWDx5e+nTz_xt_-1-zPhXfc6NHO+PSJn9bXw4YOj07j4anj3Q@mail.gmail.com> (raw)
In-Reply-To: <CAGOCFPUR+nRh1YYkq4jKBn=HPX9=2_pofKK29_QEP=Gy1DBULg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3848 bytes --]
I haven't had this issue with Org-Mobile specifically because I'm not using
it, however I found the same error when using el-get.
In my case at least the issue popped up because I was using zsh/bash via
cygwin for =shell-file-name= where =shell-quote-argument= expected it to be
cmdproxy.exe on Windows. I'm guessing you've got something similar since
it's using forward-slashes for sha1sum. It also fits because the only way
the final regexp gets applied is when the system is not ms-dos or
windows-nt along with a known Windows shell, which means cmd.exe,
command.com, cmdproxy and a couple others, cygwin shells are not on that
list.
The simplest solution would actually be to wrap your Org-mobile call in
(let ((shell-file-name (or (and (eq system-type 'windows-nt)
(executable-find "cmdproxy.exe"))
shell-file-name)))
{{{insert call here}}} )
Hope this helps,
Jonathan
On 18 March 2012 18:23, Alexander Vorobiev <alexander.vorobiev@gmail.com>wrote:
> I figured out what is wrong. I am on Windows 7 (with cygwin) where
> shell-quote-argument (defined in emacs' subr.el) seems to be broken,
> specifically it insists on escaping colons (as one of non-POSIX filename
> characters), so, for instance path to one of my files c:/Users/alex/org/
> gtd.org becomes c\\:/Users/alex/org/gtd.org.
> The result of that is org-mobile-copy-agenda-files which
> calls shell-quote-argument while generating command line to produce
> checksums, ends up with something like
>
> c:/cygwin/bin/sha1sum c\\:/Users/alex/org/gtd.org
>
> which inevitably fails. I am surprised nobody else with Windows machines
> noticed that, could there be anything I am doing wrong?
>
> The quick fix would be to redefine the shell-quote-argument to account for
> colons (added colon in the regex on the last line, see below). After that
> all my org files get added to checksum.dat and become visible on my Android
> phone.
>
> I temporarily put this definition to my cygwin-specific initialization
> file but I feel that there should be more elegant solutions:
>
> (defun shell-quote-argument (argument)
> "Quote ARGUMENT for passing as argument to an inferior shell."
> (if (or (eq system-type 'ms-dos)
> (and (eq system-type 'windows-nt) (w32-shell-dos-semantics)))
> ;; Quote using double quotes, but escape any existing quotes in
> ;; the argument with backslashes.
> (let ((result "")
> (start 0)
> end)
> (if (or (null (string-match "[^\"]" argument))
> (< (match-end 0) (length argument)))
> (while (string-match "[\"]" argument start)
> (setq end (match-beginning 0)
> result (concat result (substring argument start end)
> "\\" (substring argument end (1+ end)))
> start (1+ end))))
> (concat "\"" result (substring argument start) "\""))
> (if (equal argument "")
> "''"
> ;; Quote everything except POSIX filename characters.
> ;; This should be safe enough even for really weird shells.
> (replace-regexp-in-string "\n" "'\n'"
> (replace-regexp-in-string "[^-0-9a-zA-Z_./\n:]" "\\\\\\&"
> argument)))))
>
> Regards,
> Alex
>
> On Sat, Mar 17, 2012 at 10:50 PM, Alexander Vorobiev <
> alexander.vorobiev@gmail.com> wrote:
>
>> Hi,
>>
>> I have many files in the org-mobile-files list. On org-mobile-push all of
>> them are copied to my MobileOrg directory, syncronized via Dropbox to my
>> phone, etc. But the file checksums.dat always has only three lines - for
>> files index.org, mobileorg.org, and agendas.org.
>> The org-mobile-checksum-files variable also has the checksums for those
>> files only. Consequently, MobileOrg for Android only shows one line "Agenda
>> Views" and does not show any of my org files despite having all of them in
>> the same Dropbox directory.
>>
>> Thanks
>> Alex
>>
>
>
[-- Attachment #2: Type: text/html, Size: 6316 bytes --]
prev parent reply other threads:[~2012-03-19 4:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-18 3:50 OrgMobile problem: only three files in checksums.dat Alexander Vorobiev
2012-03-18 22:23 ` Alexander Vorobiev
2012-03-19 4:35 ` Jonathan Leech-Pepin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEWDx5e+nTz_xt_-1-zPhXfc6NHO+PSJn9bXw4YOj07j4anj3Q@mail.gmail.com \
--to=jonathan.leechpepin@gmail.com \
--cc=alexander.vorobiev@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).