From 0f826be93115a3e4f74d958a849b491bfd1b0066 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 13 Nov 2009 00:22:18 +0100 Subject: [PATCH] MobileOrg: Do not insert timestamp before mode/local variable line Patch by Charles Sebold. --- lisp/ChangeLog | 2 ++ lisp/org-mobile.el | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ca02ed72..c7c8c0bfa 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,8 @@ * org-mobile.el (org-mobile-write-checksums): Specify coding system. + (org-mobile-timestamp-buffer): Keep local variable/mode line at + beginning of buffer. * org-latex.el (org-latex-entities-regexp): Fix typo in regexp. diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index bb2b8452c..e1d89ea7d 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -739,10 +739,13 @@ If BEG and END are given, only do this in that region." (save-restriction (widen) (goto-char (point-min)) - (when (re-search-forward - "^\\([ \t]*\\)#\\+LAST_MOBILE_CHANGE:.*\n?" nil t) - (goto-char (match-end 1)) - (delete-region (point) (match-end 0))) + (if (re-search-forward + "^\\([ \t]*\\)#\\+LAST_MOBILE_CHANGE:.*\n?" nil t) + (progn + (goto-char (match-end 1)) + (delete-region (point) (match-end 0))) + (if (looking-at ".*?-\\*-.*-\\*-") + (forward-line 1))) (insert "#+LAST_MOBILE_CHANGE: " (format-time-string "%Y-%m-%d %T") "\n")))))