Subject: org-mobile checksum stuff supressing errors and using inconsistent checksum

From: Taylor Sutton <[email-masked]>
Date: Fri, 5 Sep 2014 14:00:29 -0400

Two related bugs. As far as I understand, in org-mobile.el, part of
the org-mobile code is writing checksums of the files to be sync'd to
checksums.dat, and the checksum function is (supposed to be) governed by
the custom variable org-mobile-checksum-binary. However, for the index
file, the agenda file, and the capture file, the checksums are always
computed with the elisp md5 function instead. I am not sure if this
particular part should actually be considered a bug. But it affected the
next part.

If the custom org-mobile-checksum-binary is set wrong (in my case, I did
not quote the filepath which has spaces in it) then in the function
'org-mobile-copy-agenda-files, after running the
'shell-command-to-string, the output which was, for me on windows,

'c:/program' is not recognized as an internal or external command,
operable program or batch file

and that did not satisfy the when statement's string-match, and so the
checksums of my files were not written to checksums.dat - but there was
no message of any kind indiciating this to me as a user, and I didn't
realize what was happening until I delved into org-mobile.el. It was
especially confusing because some checksums were being written due to
the hard-coded checksum function described above.

Anyway so, in sum (haha) if there are any issues running the
shell-command-to-string inside of org-mobile-copy-agenda-files, those
issues seem to be silently suppressed, leading to checksums not being
written and files not syncing WITHOUT any indication of what's going
on. Expected behavior is that I get some indication of what happened so
I can fix it.

-Taylor Sutton [email-masked]

The data below was included by report-emacs-bug

In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)
 of 2013-03-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-gcc (4.7) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Org

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<mouse-1> C-k C-k C-x C-s C-n C-n C-n C-n k C-/ C-x
C-s C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k
C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k
C-x C-s M-x C-g C-x C-f C-g C-h f m o b i l e SPC -
SPC <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> o r g SPC m b o
<backspace> <backspace> o b i l e SPC p u s SPC <return>
C-x o C-n C-f <return> C-x r j a C-x r b a <return>
C-s m o b i l e C-g C-s c h e c k s u m - f i l e s
C-s C-s C-s <return> C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-r b u f f e r <tab> - s r <backspace>
<backspace> <tab> C-g C-n C-g C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-s C-g C-r m d 5 C-s C-s C-s C-s
C-s C-s C-s C-s C-s C-s C-s C-g <help-echo> <wheel-up>
<double-wheel-up> <wheel-up> <wheel-up> <wheel-up>
<wheel-up> <double-wheel-up> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>
<triple-wheel-up> <help-echo> M-x e r r r <backspace>
<backspace> <backspace> <backspace> b u g SPC SPC r
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> SPC
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> C-g C-x 4 b t o
d o <return> M-x r e p o r t SPC b u <backspace> <backspace>
e m SPC b SPC <return>

Recent messages:
(No changes need to be saved)
Saving file c:/Users/taylors/Dropbox/todo.org...
Wrote c:/Users/taylors/Dropbox/todo.org
Quit [2 times]
Type C-x 1 to delete the help window.
jump-to-register: Register doesn't contain a buffer position or
configuration
Quit
Mark saved where search started [2 times]
Quit [3 times]
byte-code: Beginning of buffer [4 times]
Quit

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
misearch multi-isearch bookmark pp help-mode org-archive org-id tabify
diary-lib diary-loaddefs cal-iso org-mobile org-wl org-w3m org-vm
org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp
ob-exp org-exp-blocks org-agenda org-info org-gnus gnus-util org-docview
org-bibtex bibtex org-bbdb org byte-opt warnings bytecomp byte-compile
cconv advice help-fns cl-lib advice-preload ob-tangle ob-ref ob-lob
ob-table org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete
comint ansi-color ring org-list org-faces org-entities noutline outline
easy-mmode org-version ob-emacs-lisp ob org-compat org-macs ob-eval
org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs ido
haskell-mode-autoloads edmacro kmacro imenu info easymenu package
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process w32 multi-tty emacs)