From a469b6d935a52538acefc1268d1cd8814f289284 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 23 Mar 2014 17:11:25 -0400 Subject: Show Org context when visiting from Magit diff --- lisp/init-org.el | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- cgit v1.2.3