Re: ESS code-folding?
"Sparapani, Rodney via ESS-help" <[email protected]> Wed, 16 Aug 2023 19:06:47 +0000
| Newsgroups | gmane.emacs.ess.general |
|---|---|
| Message-ID | <CO6PR01MB7452386A3D79DB7B8F607507CB15A@CO6PR01MB7452.prod.exchangelabs.com> |
Hi Karlo: This is very interesting. But, I must not be doing it right. Do you have a simple example of how to use this to do case-folding? Thanks -- Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His Vice President, Wisconsin Chapter of the American Statistical Association Institute for Health and Equity, Division of Biostatistics Medical College of Wisconsin, Milwaukee Campus From: Karlo Guidoni Martins <[email protected]> Date: Wednesday, August 16, 2023 at 1:02 PM To: Sparapani, Rodney <[email protected]> Cc: ess-help ([email protected]) <[email protected]> Subject: Re: [ESS] ESS code-folding? ATTENTION: This email originated from a sender outside of MCW. Use caution when clicking on links or opening attachments. ________________________________ hi! this works fine for me: ;;; BEG ;;; outline-(minor)-mode (setq outline-minor-mode-highlight 'override) ; emacs28 (setq outline-minor-mode-cycle t) ;;; outline for ess-mode (add-hook 'ess-mode-hook #'(lambda () (outline-minor-mode) (setq-local outline-regexp "\\(^#\\{3,7\\} \\)\\|\\(^[a-zA-Z0-9_\.]+ ?<- ?function(.*{\\)") (setq-local outline-regexp "\\(^#\\{3,7\\} \\)") (defun outline-level () ;; ## continues only as a comment. (cond ((looking-at "^### ") 1) ; first level ((looking-at "^#### ") 2) ; second level ((looking-at "^##### ") 3) ; and so on... ((looking-at "^###### ") 4) ((looking-at "^####### ") 5) ((looking-at "^######## ") 6) ((looking-at "^[a-zA-Z0-9_\.]+ ?<- ?function(.*{") 3) (t 1000))) (outline-hide-body))) ;;; force outline height (custom-set-faces '(outline-1 ((t (:height 1.100 :weight bold)))) '(outline-2 ((t (:height 1.075 :weight bold)))) '(outline-3 ((t (:height 1.050 :weight bold)))) '(outline-4 ((t (:height 1.025 :weight bold)))) '(outline-5 ((t (:height 1.000 :weight bold)))) '(outline-6 ((t (:height 1.000 :weight bold)))) '(outline-7 ((t (:height 1.000 :weight bold)))) '(outline-8 ((t (:height 1.000 :weight bold)))) ) ;;; END On 16 Aug 2023 14:30:02, "Sparapani, Rodney via ESS-help" <[email protected]<mailto:[email protected]>> wrote: Hi Gang: One of my students asked this question. Any resources/knowledge on code folding? in RStudio #### creates a collapsible section. Came across hideshow-org<https://urldefense.com/v3/__https:/melpa.org/*/hideshow-org__;Iw!!H8mHWRdzp34!5RPr9v2ZhWFZvGqgU1l_SCB3m8RiGAGo3z3tOZJeYnGOEM1PJSipOO32pr70Qd7JRbtycMb_EwhMdNuJ$> but I dont want to only be able to use it in org mode. Something like Without code folding #### test #### test = c(1, 2) #### With code folding #### test #### #### Any ideas? -- Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His Vice President, Wisconsin Chapter of the American Statistical Association Institute for Health and Equity, Division of Biostatistics Medical College of Wisconsin, Milwaukee Campus [[alternative HTML version deleted]] ______________________________________________ [email protected]<mailto:[email protected]> mailing list https://stat.ethz.ch/mailman/listinfo/ess-help<https://urldefense.com/v3/__https:/stat.ethz.ch/mailman/listinfo/ess-help__;!!H8mHWRdzp34!6_FDWsoQA1JsKpSpQpyv2luWZb9KS5ZN7pEfO-2lbaa_6weoDg9aRoBLZOdVUd_7T1T4OSTpumBRkdnIkSngEUEJbg$> [[alternative HTML version deleted]] ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/ess-help