Ratish Punnoose <rat...@gmail.com> writes: > Thorsten Jolitz <tjolitz <at> gmail.com> writes: >
[...] > #+BEGIN_SRC emacs-lisp > ;; diff hooks for org mode > (add-hook 'ediff-select-hook 'f-ediff-org-unfold-tree-element) > (add-hook 'ediff-unselect-hook 'f-ediff-org-fold-tree) > ;; Check for org mode and existence of buffer > (defun f-ediff-org-showhide(buf command &rest cmdargs) > "If buffer exists and is orgmode then execute command" > (if buf > (if (eq (buffer-local-value 'major-mode (get-buffer buf)) 'org-mode) > (save-excursion (set-buffer buf) (apply command cmdargs))) > ) > ) > > (defun f-ediff-org-unfold-tree-element () > "Unfold tree at diff location" > (f-ediff-org-showhide ediff-buffer-A 'org-reveal) > (f-ediff-org-showhide ediff-buffer-B 'org-reveal) > (f-ediff-org-showhide ediff-buffer-C 'org-reveal) > ) > ;; > (defun f-ediff-org-fold-tree () > "Fold tree back to top level" > (f-ediff-org-showhide ediff-buffer-A 'hide-sublevels 1) > (f-ediff-org-showhide ediff-buffer-B 'hide-sublevels 1) > (f-ediff-org-showhide ediff-buffer-C 'hide-sublevels 1) > ) > #+END_SRC Thanks for sharing. Adding this to org-mode (at least in contrib, or worg) would be really cool. -- Rémi Vanicat