From mboxrd@z Thu Jan 1 00:00:00 1970 From: Muchenxuan Tong Subject: [PATCH] save-restriction in `org-mobile-push' Date: Fri, 19 Jul 2013 13:19:07 +0800 Message-ID: <1374211147-14958-1-git-send-email-demon386@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V03iV-0003YP-0x for emacs-orgmode@gnu.org; Fri, 19 Jul 2013 01:59:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V03iQ-0004nB-Eo for emacs-orgmode@gnu.org; Fri, 19 Jul 2013 01:58:58 -0400 Received: from [124.205.66.195] (port=51380 helo=TongmatoMacBook-Pro.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V03iP-0004mZ-Tc for emacs-orgmode@gnu.org; Fri, 19 Jul 2013 01:58:54 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Muchenxuan Tong * lisp/org-mobile.el (org-mobile-push): add `save-restriction' The fact that pushing org-file loses my narrow context annoys me. TINYCHANGE --- lisp/org-mobile.el | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index 7cdaf34..a43896b 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -319,23 +319,24 @@ create all custom agenda views, for upload to the mobile phone." (org-agenda-tag-filter org-agenda-tag-filter) (org-agenda-redo-command org-agenda-redo-command)) (save-excursion - (save-window-excursion - (run-hooks 'org-mobile-pre-push-hook) - (org-mobile-check-setup) - (org-mobile-prepare-file-lists) - (message "Creating agendas...") - (let ((inhibit-redisplay t) - (org-agenda-files (mapcar 'car org-mobile-files-alist))) - (org-mobile-create-sumo-agenda)) - (message "Creating agendas...done") - (org-save-all-org-buffers) ; to save any IDs created by this process - (message "Copying files...") - (org-mobile-copy-agenda-files) - (message "Writing index file...") - (org-mobile-create-index-file) - (message "Writing checksums...") - (org-mobile-write-checksums) - (run-hooks 'org-mobile-post-push-hook))) + (save-restriction + (save-window-excursion + (run-hooks 'org-mobile-pre-push-hook) + (org-mobile-check-setup) + (org-mobile-prepare-file-lists) + (message "Creating agendas...") + (let ((inhibit-redisplay t) + (org-agenda-files (mapcar 'car org-mobile-files-alist))) + (org-mobile-create-sumo-agenda)) + (message "Creating agendas...done") + (org-save-all-org-buffers) ; to save any IDs created by this process + (message "Copying files...") + (org-mobile-copy-agenda-files) + (message "Writing index file...") + (org-mobile-create-index-file) + (message "Writing checksums...") + (org-mobile-write-checksums) + (run-hooks 'org-mobile-post-push-hook)))) (setq org-agenda-buffer-name org-agenda-curbuf-name org-agenda-this-buffer-name org-agenda-curbuf-name)) (redraw-display) -- 1.8.3.2