From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?R=C3=A9mi_Vanicat?= Subject: Re: [WORG] How to ediff folded Org files? Date: Thu, 01 Aug 2013 17:09:19 +0200 Message-ID: <87wqo5fnxc.dlv@debian.org> References: <87y5cwrnw9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4uVZ-0007hd-AB for emacs-orgmode@gnu.org; Thu, 01 Aug 2013 11:09:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4uVR-000380-RV for emacs-orgmode@gnu.org; Thu, 01 Aug 2013 11:09:41 -0400 Received: from plane.gmane.org ([80.91.229.3]:53394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4uVR-00037F-HF for emacs-orgmode@gnu.org; Thu, 01 Aug 2013 11:09:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V4uVP-0001Ov-9O for emacs-orgmode@gnu.org; Thu, 01 Aug 2013 17:09:31 +0200 Received: from 185.109.22.109.rev.sfr.net ([109.22.109.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Aug 2013 17:09:31 +0200 Received: from vanicat by 185.109.22.109.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Aug 2013 17:09:31 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Ratish Punnoose writes: > Thorsten Jolitz 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