[ESS] Folding chunks in Sweave?
Gregor Gorjanc
gregor.gorjanc at bfro.uni-lj.si
Mon Jul 24 18:14:03 CEST 2006
Seth Falcon <sethfalcon <at> gmail.com> writes:
>
> Sebastian Luque <spluque <at> gmail.com> writes:
> > Have you looked at folding-mode? In Debian, it is included as part of the
> > emacs-goodies-el. I haven't used it, but think this might be possible
> > with it, from what I remember of its info pages.
>
> Thanks. I did find that during a web search. Looks like it will do
> what I want, but that I will have to add markers in the text to allow
> it to work. In theory, code chunks have enough markup to allow them
> to fold, but I'm sure this will require some customization.
I also interested in this application and took a look and found the
following in
the folding.el
;; Example: changing default fold marks
;;
;; In case you're not happy with the default folding marks, you
;; can change them easily. Here is an example
;;
;; (setq folding-load-hook 'my-folding-load-hook)
;;
;; (defun my-folding-load-hook ()
;; "Folding vars setup."
;; (let* ((ptr (assq 'text-mode folding-mode-marks-alist)))
;; (setcdr ptr (list "# {{{" "# }}}"))))
So this should be hacked to work with Sweave chunks. However I am a bit
sceptic about "enough markup". There surely is enough for the start i.e.
<<someRegExp>>=, but the end is only @. And this character also appears
in R code.
Can any lisp master handle this?
Gregor
More information about the ESS-help
mailing list