summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Eglen <S.J.Eglen@damtp.cam.ac.uk>2011-02-07 15:29:28 +0000
committerBastien Guerry <bzg@altern.org>2011-02-08 16:54:53 +0100
commita598bd5a02e0c854358af278eaa0af83ef4105da (patch)
treecebc0c466b48752e8fc407544b801c8ae9e6240c
parent88b793946bef4df484071e3a34b287e70fb0c9b5 (diff)
downloadorg-mode-a598bd5a02e0c854358af278eaa0af83ef4105da.tar.gz
org-mhe-store-link alters window layout
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
-rw-r--r--lisp/org-mhe.el43
1 files changed, 22 insertions, 21 deletions
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."