From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Baumann Subject: Re: org-mhe-store-link alters window layout Date: Tue, 08 Feb 2011 16:44:23 +0100 Message-ID: References: <1337.1297074568@maps> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=60454 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmpkE-00008q-AN for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 10:44:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmpkB-0007pZ-3U for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 10:44:45 -0500 Received: from lo.gmane.org ([80.91.229.12]:45202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmpkA-0007pA-QD for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 10:44:43 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pmpk9-00044u-35 for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 16:44:41 +0100 Received: from pd95529e3.dip.t-dialin.net ([217.85.41.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Feb 2011 16:44:41 +0100 Received: from dtbaumann by pd95529e3.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Feb 2011 16:44:41 +0100 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@gnu.org Cc: Carsten Dominik Looks good to me, thank you for bringing this up. Carsten, could you please check the patch in? Thanks again Thomas Stephen Eglen writes: > If I run M-x org-store-link when my current emacs frame is just showing > one MH-E window (and nothing else in the frame), e.g. the "show-+inbox" > buffer, then the link to that email is created okay, but the window > frames are altered so that the +inbox summary window is also shown. > In general, the previous window contents are forgotten. I suggest > adding a 'save-window-excursion' into org-mhe-store-link so that the > window arrangement is preserved on exit from the function. > > Patch below is long just because of the extra indentation. > > Stephen > > diff --git a/lisp/org-mhe.el b/lisp/org-mhe.el > index c384062..c9b0481 100644 > --- a/lisp/org-mhe.el > +++ b/lisp/org-mhe.el > @@ -83,27 +83,28 @@ supported by MH-E." > "Store a link to an MH-E folder or message." > (when (or (equal major-mode 'mh-folder-mode) > (equal major-mode 'mh-show-mode)) > - (let* ((from (org-mhe-get-header "From:")) > - (to (org-mhe-get-header "To:")) > - (message-id (org-mhe-get-header "Message-Id:")) > - (subject (org-mhe-get-header "Subject:")) > - (date (org-mhe-get-header "Date:")) > - (date-ts (and date (format-time-string > - (org-time-stamp-format t) (date-to-time date)))) > - (date-ts-ia (and date (format-time-string > - (org-time-stamp-format t t) > - (date-to-time date)))) > - link desc) > - (org-store-link-props :type "mh" :from from :to to > - :subject subject :message-id message-id) > - (when date > - (org-add-link-props :date date :date-timestamp date-ts > - :date-timestamp-inactive date-ts-ia)) > - (setq desc (org-email-link-description)) > - (setq link (org-make-link "mhe:" (org-mhe-get-message-real-folder) "#" > - (org-remove-angle-brackets message-id))) > - (org-add-link-props :link link :description desc) > - link))) > + (save-window-excursion > + (let* ((from (org-mhe-get-header "From:")) > + (to (org-mhe-get-header "To:")) > + (message-id (org-mhe-get-header "Message-Id:")) > + (subject (org-mhe-get-header "Subject:")) > + (date (org-mhe-get-header "Date:")) > + (date-ts (and date (format-time-string > + (org-time-stamp-format t) (date-to-time date)))) > + (date-ts-ia (and date (format-time-string > + (org-time-stamp-format t t) > + (date-to-time date)))) > + link desc) > + (org-store-link-props :type "mh" :from from :to to > + :subject subject :message-id message-id) > + (when date > + (org-add-link-props :date date :date-timestamp date-ts > + :date-timestamp-inactive date-ts-ia)) > + (setq desc (org-email-link-description)) > + (setq link (org-make-link "mhe:" (org-mhe-get-message-real-folder) "#" > + (org-remove-angle-brackets message-id))) > + (org-add-link-props :link link :description desc) > + link)))) > > (defun org-mhe-open (path) > "Follow an MH-E message link specified by PATH." > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode