[ESS] R code folding with hideshow-org.el

Shane Celis shane at gnufoo.org
Sat Apr 4 06:38:21 CEST 2009


In fact hideshow-org uses 'hs-toggle-hiding.  It's not separate from  
hideshow; it works on top of hideshow.  And I respect your caution  
when it comes to messing with tab.  It remains to be seen whether it's  
workable.  It may be that C-tab or some other such key may be better  
appropriated.  Or that one might want to tab twice before it does  
folding.  I'm experimenting and happy to hear suggestions to see what  
works.

-Shane

On Apr 3, 2009, at 3:31 AM, Vitalie S. wrote:

> There is 'hs-toggle-hiding function in hs that does almost the same  
> thing. I am not sure that messing with tab indentation is such a  
> good idea.
>
> It would be extremely useful to have Org like tab-cycling for allout  
> (a good outliner for code: http://www.emacswiki.org/emacs/AllOut),which 
>  would work just on headings.
> Does anyone know a way to do that?
> On Thu, 02 Apr 2009 02:40:44 +0200, Short, Tom <TShort at epri.com>  
> wrote:
>
>> To make this work with R/ESS, I added this to my .emacs:
>>
>> (require 'hideshow)
>> (require 'hideshow-org)
>> (add-to-list 'hs-special-modes-alist
>>             '(ess-mode "{" "}" "/[*/]" nil
>> hs-c-like-adjust-block-beginning))
>> (global-set-key "\C-ch" 'hs-org/minor-mode) ;; toggles hideshow-org
>> (add-hook 'ess-mode-hook 'hs-org/minor-mode) ;; starts for ESS files
>
> Hideshowvis (http://www.emacswiki.org/emacs/hideshowvis.el) is a  
> nifty extension to hideshow which adds -+ and colored rectangle to  
> folded regions.I have this in my .emacs:
>
> (autoload 'hideshowvis-enable "hideshowvis" "Highlight foldable  
> regions")
> (dolist (hook (list 'emacs-lisp-mode-hook
>                   'ess-mode-hook))
> (add-hook hook 'hideshowvis-enable))
> (setq hs-special-modes-alist
>     (cons '(ess-mode "{" "}" "#" nil nil) hs-special-modes-alist))
>
> VS
>
>> ______________________________________________
>> ESS-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help




More information about the ESS-help mailing list