summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-03-23 17:11:25 -0400
committerKyle Meyer <kyle@kyleam.com>2014-03-23 17:11:25 -0400
commita469b6d935a52538acefc1268d1cd8814f289284 (patch)
treeb70d3700fd59bc3d8bf5d695199b529666954011
parent99797f4fd7c5d68015349ff6e0c22cd2bfa60cac (diff)
downloademacs.d-a469b6d935a52538acefc1268d1cd8814f289284.tar.gz
Show Org context when visiting from Magit diff
-rw-r--r--lisp/init-org.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el
index f2f459d..fada768 100644
--- a/lisp/init-org.el
+++ b/lisp/init-org.el
@@ -133,6 +133,15 @@ Before running `org-tree-to-indirect-buffer',
(when (eq major-mode 'org-mode)
(org-show-context))))
+(defadvice magit-visit-item
+ (after magit-visit-show-org-context activate)
+ "Show context if visiting Org buffer.
+This is an improvement, but still not great. It requires the
+point be on or under a heading in the Magit diff. If above, the
+context will be shown for above heading."
+ (when (eq major-mode 'org-mode)
+ (org-show-context)))
+
;;; Agenda
(defadvice org-agenda-list (around org-agenda-fullscreen activate)