From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Egli Subject: Re: [WORG] How to ediff folded Org files? Date: Tue, 09 Apr 2013 09:29:28 +0200 Message-ID: <878v4sb1rb.fsf@sbs.ch> References: <87y5cwrnw9.fsf@gmail.com> <516083A6.9090305@ihm.name> <87k3ofwdka.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 ([208.118.235.92]:55604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPSzr-0000ud-Bn for emacs-orgmode@gnu.org; Tue, 09 Apr 2013 03:29:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPSzp-0007vA-G4 for emacs-orgmode@gnu.org; Tue, 09 Apr 2013 03:29:39 -0400 Received: from plane.gmane.org ([80.91.229.3]:57450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPSzp-0007uO-7V for emacs-orgmode@gnu.org; Tue, 09 Apr 2013 03:29:37 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UPSzn-0007iy-8V for emacs-orgmode@gnu.org; Tue, 09 Apr 2013 09:29:35 +0200 Received: from alouette.sbs.ch ([194.29.12.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Apr 2013 09:29:35 +0200 Received: from christian.egli by alouette.sbs.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Apr 2013 09:29:35 +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 Michael Brand writes: > But instead of the above I use this for ediff generally, it persists > in Org mode: > > #+BEGIN_SRC emacs-lisp > (add-hook 'ediff-prepare-buffer-hook 'f-ediff-prepare-buffer-hook-setup) > (defun f-ediff-prepare-buffer-hook-setup () > ;; specific modes > (cond ((eq major-mode 'org-mode) > (f-org-vis-mod-maximum)) > ;; room for more modes > ) > ;; all modes > (setq truncate-lines nil)) > (defun f-org-vis-mod-maximum () > "Visibility: Show the most possible." > (cond > ((eq major-mode 'org-mode) > (visible-mode 1) ; default 0 > (setq truncate-lines nil) ; no `org-startup-truncated' in hook > (setq org-hide-leading-stars t)) ; default nil > (t > (message "ERR: not in Org mode") > (ding)))) > > #+END_SRC I condensed this to the following since I don't use truncate-lines and org-hide-leading-stars ;; ediff for org-mode files (add-hook 'ediff-prepare-buffer-hook (lambda () (cond ((eq major-mode 'org-mode) (visible-mode 1))))) But now the problem now is that the visible-mode persists even when I quit ediff. I tried to find a hook which lets me undo the visible-mode but I couldn't find an obvious one. There is ediff-quit-hook but this is done in the ediff-control-buffer. Maybe after all it might be better to use ediff-select-hook and ediff-unselect-hook. Thanks Christian -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland