From 9ce4e04bc6e32a7f25831258a03251393b1804be Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 18 Aug 2016 11:14:22 -0700 Subject: [PATCH] Advise `magit-diff-visit-file` to show org context --- dotfiles/emacs.d/README.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index beda560c..e6151dc4 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2170,6 +2170,11 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab (use-package magit :commands magit-status :bind (("C-x g" . magit-status)) + :preface + (progn + (defun imalison:after-magit-visit-file (&rest args) + (when (derived-mode-p 'org-mode) + (org-show-context 'magit-goto)))) :config (progn (defvar-setq magit-last-seen-setup-instructions "1.4.0") @@ -2177,6 +2182,8 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab (when (bound-and-true-p imalison:gpg-key) (add-to-list 'magit-commit-arguments (format "--gpg-sign=%s" imalison:gpg-key))) + (add-to-list 'org-show-context-detail '(magit-goto . lineage)) + (advice-add 'magit-diff-visit-file :after 'imalison:after-magit-visit-file) (use-package magit-filenotify ;; Seems like OSX does not support filenotify. :disabled t