From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] save-restriction in `org-mobile-push' Date: Thu, 8 Aug 2013 08:49:53 +0200 Message-ID: References: <1374211147-14958-1-git-send-email-demon386@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7K2v-0003Lp-IB for emacs-orgmode@gnu.org; Thu, 08 Aug 2013 02:50:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7K2n-0001dB-5P for emacs-orgmode@gnu.org; Thu, 08 Aug 2013 02:50:05 -0400 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:48836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7K2n-0001d7-0G for emacs-orgmode@gnu.org; Thu, 08 Aug 2013 02:49:57 -0400 Received: by mail-ea0-f176.google.com with SMTP id q16so1226218ead.35 for ; Wed, 07 Aug 2013 23:49:56 -0700 (PDT) In-Reply-To: <1374211147-14958-1-git-send-email-demon386@gmail.com> 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: Muchenxuan Tong Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On 19.7.2013, at 07:19, Muchenxuan Tong wrote: > * lisp/org-mobile.el (org-mobile-push): add `save-restriction' >=20 > The fact that pushing org-file loses my narrow context annoys me. >=20 > TINYCHANGE > --- > lisp/org-mobile.el | 35 ++++++++++++++++++----------------- > 1 file changed, 18 insertions(+), 17 deletions(-) >=20 > 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) > --=20 > 1.8.3.2 >=20 >=20