From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Sebold Subject: Bug: EOL needs to be converted to Unix for MobileOrg files [7.5 (release_7.5.125.g70fe)] Date: Fri, 1 Apr 2011 15:12:22 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001636988d4e1e145f049fe10701 Return-path: Received: from [140.186.70.92] (port=46613 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5khm-0007n0-Eb for emacs-orgmode@gnu.org; Fri, 01 Apr 2011 16:12:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5khk-0003qC-Oa for emacs-orgmode@gnu.org; Fri, 01 Apr 2011 16:12:26 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:49165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5khk-0003q5-Jc for emacs-orgmode@gnu.org; Fri, 01 Apr 2011 16:12:24 -0400 Received: by iwg8 with SMTP id 8so5063074iwg.0 for ; Fri, 01 Apr 2011 13:12:22 -0700 (PDT) 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: emacs-orgmode --001636988d4e1e145f049fe10701 Content-Type: text/plain; charset=ISO-8859-1 Sorry, I first sent this from an account that isn't subscribed to the list. This has been a problem for me for some time, but I only just now had the chance to find the problem. I primarily use Org-mode on Windows, and my org files mostly have DOS line endings. A while back a patch from me was accepted to convert the checksum file to Unix EOLs (and Richard updated the iOS app to be agnostic about it, I think, at the same time), which saved a lot of syncing because the checksum file never looked right to MobileOrg. However, the files themselves are irritating because they appear to have double line feeds when they are viewed on the iOS device, and edits from MobileOrg never sync because stray ^Ms creep in. This patch makes all files pushed to MobileOrg into Unix files as far as line endings go. It's not a very elegant solution and my feelings won't be hurt if a better way is proposed. Diff is here, followed by the bug report data dump (edited to remove things that don't need to be public, and I wonder if it would be a good idea to modify the bug report to automatically leave out encryption passwords and the like?). ------------------------------------------------------------------------ diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 83462f0..fa1d4f4 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -472,6 +472,12 @@ agenda view showing the flagged items." target-file) (org-mobile-cleanup-encryption-tempfile)))) +(defun org-mobile-copy-file (file newname) + "Copy file, converting to Unix line endings." + (with-temp-file newname + (set-buffer-file-coding-system 'undecided-unix nil) + (insert-file-contents file))) + (defun org-mobile-copy-agenda-files () "Copy all agenda files to the stage or WebDAV directory." (let ((files-alist org-mobile-files-alist) @@ -485,7 +491,7 @@ agenda view showing the flagged items." (make-directory target-dir 'parents)) (if org-mobile-use-encryption (org-mobile-encrypt-and-move file target-path) - (copy-file file target-path 'ok-if-exists)) + (org-mobile-copy-file file target-path)) (setq check (shell-command-to-string (concat org-mobile-checksum-binary " " (shell-quote-argument (expand-file-name file))))) @@ -710,12 +716,15 @@ encryption program does not understand them." (defun org-mobile-encrypt-file (infile outfile) "Encrypt INFILE to OUTFILE, using `org-mobile-encryption-password'." - (shell-command - (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s" - (shell-quote-argument (concat "pass:" - (org-mobile-encryption-password))) - (shell-quote-argument (expand-file-name infile)) - (shell-quote-argument (expand-file-name outfile))))) + (let ((tempfile (make-temp-file "orgmobile"))) + (org-mobile-copy-file infile tempfile) + (shell-command + (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s" + (shell-quote-argument (concat "pass:" + (org-mobile-encryption-password))) + (shell-quote-argument (expand-file-name tempfile)) + (shell-quote-argument (expand-file-name outfile)))) + (delete-file tempfile))) (defun org-mobile-decrypt-file (infile outfile) "Decrypt INFILE to OUTFILE, using `org-mobile-encryption-password'." ------------------------------------------------------------------------ Emacs : GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-03-29 on CT-SEBOLDCR-T4C Package: Org-mode version 7.5 (release_7.5.125.g70fe) current state: ============== (setq org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-agenda-custom-commands '(("z" tags "memorize&daily|odd|thursday|memday31") ("A" "Full Agenda" ((agenda ""))) ("7" "Full Weekly Agenda" ((agenda "" ((org-agenda-span (quote week)))))) ("h" . "HOME + tag/TODO searches") ("ha" "Full Agenda + Next Actions" ((agenda) (todo "INBOX") (todo "NEXTACTION") (todo "TODO"))) ("hn" "Next Actions" ((todo "INBOX") (todo "NEXTACTION") (todo "TODO"))) ("ht" "Non-LCMS Tasks" ((tags-todo "-lcms"))) ("hp" "All Projects" ((todo "PROJECT") (todo "PROJWAITING") (todo "PROJVERIFY"))) ("R" "TeamMania tasks" ((tags-todo "+work+teammania"))) ("w" . "LCMS + tag/TODO searches") ("wo" "LCMS Servicewise Open Tickets" ((tags "+servicewise+ticket-status=\"Closed\""))) ("wt" "LCMS tasks" ((tags-todo "+work+lcms"))) ("wn" "LCMS Next Actions" ((agenda) (todo "INBOX") (todo "NEXTACTION") (tags "+servicewise+ticket-status=\"Closed\"") (todo "TODO")) ((org-agenda-files (quote ("~/org/lcms"))))) ("wp" "LCMS Unfinished Projects" ((todo "PROJECT") (todo "PROJWAITING") (todo "PROJVERIFY")) ((org-agenda-files (quote ("~/org/lcms"))))) ("ws" "SQL tasks" ((tags-todo "+work+sql"))) ("g" agenda "non-LCMS Agenda" ((org-agenda-files (quote ("~/org/gtd.org"))))) ("wd" agenda "LCMS Daily Agenda" ((org-agenda-files (quote ("~/org/lcms"))))) ) org-agenda-files '("~/org" "~/org/fiction" "~/org/reference" "~/org/personal" "~/org/gaming" "~/org/lcms") org-src-fontify-natively t org-babel-load-languages '((R) (clojure . t) (C) (ditaa . t) (dot) (emacs-lisp . t) (gnuplot) (haskell) (latex) (ocaml) (org . t) (perl) (python) (ruby) (screen) (sh) (sql . t) (sqlite)) org-metaup-hook '(org-babel-load-in-session-maybe) org-after-todo-state-change-hook '(org-clock-out-if-current) org-babel-tangle-lang-exts '(("clojure" . "clj") ("emacs-lisp" . "el")) org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup) org-deadline-warning-days 5 org-export-latex-format-toc-function 'org-export-latex-format-toc-default org-agenda-skip-scheduled-if-done t org-stuck-projects '("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") ("info") "") org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-confirm-shell-link-function 'yes-or-no-p org-reveal-start-hook '(org-decrypt-entry) org-export-first-hook '(org-beamer-initialize-open-trackers) org-todo-keywords '((sequence "INBOX(i)" "TICKLER(t!)" "|" "FILE(f@)" "CANCELED(k@)") (sequence "TODO" "NEXTACTION(n)" "WAITING" "VERIFY" "|" "DONE" "REASSIGNED") (sequence "DAILY(d)" "|" "DONEDLY" "UNSCHEDDLY(D)") (sequence "WEEKLY(e)" "|" "DONEWKLY" "UNSCHEDWKLY(E)") (sequence "MONTHLY(m)" "|" "DONEMNTHLY" "UNSCHEDMNTHLY(M)") (sequence "QUARTERLY(q)" "|" "DONEQUARTERLY" "UNSCHEDQUTRLY") (sequence "REQUEST(r!)" "REQWAITING(w@/!)" "REQVERIFY(v)" "|" "REQCLOSED(c!)" "REQREASSIGNED(a@)") (sequence "PROJECT(P!)" "PROJWAITING(W@/!)" "PROJVERIFY(V)" "|" "PROJCLOSED(C!)" "PROJREASSIGNED(A@)") ) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-default-notes-file "~/org//process.org" org-directory "~/org/" org-babel-pre-tangle-hook '(save-buffer) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers) org-agenda-span 'day org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-use-fast-todo-selection 'prefix org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-log-into-drawer t org-agenda-mode-hook '(hl-line-mode) org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src org-babel-exp-inline-src-blocks)) org-agenda-skip-deadline-if-done t org-occur-hook '(org-first-headline-recenter) org-from-is-user-regexp nil org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code) org-mobile-use-encryption t org-agenda-use-time-grid nil org-mobile-checksum-binary "sha1sum" org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc org-beamer-auto-fragile-frames org-beamer-place-default-actions-for-lists) org-metadown-hook '(org-babel-pop-to-session-maybe) org-export-blocks '((src org-babel-exp-src-block nil) (comment org-export-blocks-format-comment t) (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil)) ) -- Charles Sebold Ego delendus sum --001636988d4e1e145f049fe10701 Content-Type: application/octet-stream; name="orgmobile-eol.diff" Content-Disposition: attachment; filename="orgmobile-eol.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_glzjty7v0 Q2hhbmdlcyBpbiBtYXN0ZXINCglNb2RpZmllZCBsaXNwL29yZy1tb2JpbGUuZWwNCmRpZmYgLS1n aXQgYS9saXNwL29yZy1tb2JpbGUuZWwgYi9saXNwL29yZy1tb2JpbGUuZWwNCmluZGV4IDgzNDYy ZjAuLmZhMWQ0ZjQgMTAwNjQ0DQotLS0gYS9saXNwL29yZy1tb2JpbGUuZWwNCisrKyBiL2xpc3Av b3JnLW1vYmlsZS5lbA0KQEAgLTQ3Miw2ICs0NzIsMTIgQEAgYWdlbmRhIH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