emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [WORG] How to ediff folded Org files?


From: Rémi Vanicat
Subject: Re: [O] [WORG] How to ediff folded Org files?
Date: Thu, 01 Aug 2013 17:09:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Ratish Punnoose <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]