> Le 4 mai 2017 à 22:49, Paul Johnson <pauljoh...@gmail.com> a écrit : > > Please raise your hand if you have EVER used # to document R code in > the way mentioned on the LISP coding standards page.
I do, all the time ever since I (more or less by accident) discovered the functionality. Actually, all the code I distribute to my students is commented this way; see e.g. https://github.com/vigou3/introduction-programmation-r/blob/master/bases.R It should be noted that this commenting style also works in LaTeX mode (granted, a single % somewhere on the right being less useful with text). For me, it just makes more sense that the higher the number of comment markers, the stronger the emphasis (or vice versa). Call me an old timer ;-), but I would vote against a change to the *default* behaviour. I see this commenting style as pure Emacsism and would expect any programming mode (Markdown excepted for obvious reasons) to respect it by default. Furthermore, I think ESS does not have to play catch up or to adapt to RStudio. Now, that said, I'm all in favour to have an easy to toggle ESS option to change Emacs/lisp commenting style to Markdown style (since that's what we're talking about) if someone wants to provide the patch. v. > pj > > On Thu, May 4, 2017 at 10:52 AM, Brahm, David > <david.br...@geodecapital.com> wrote: >> Since we're on the topic, is there a style to make the # comments >> right-justified against >> "fill-column" (which is 97 for me, as that makes printouts look good) and/or >> the window >> width? So as you type the comment, it marches leftward. E.g.: >> >> x <- y + z # This >> comment ends on column 97 >> 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 >> >> -- David Brahm (br...@alum.mit.edu) >> >> >> -----Original Message----- >> From: ESS-help [mailto:ess-help-boun...@r-project.org] On Behalf Of Charles >> C. Berry >> Sent: Thursday, May 04, 2017 11:38 AM >> To: Ista Zahn >> Cc: Stephen Eglen; ess-help >> Subject: Re: [ESS] Ever consider changing indentation on #? >> >> On Thu, 4 May 2017, Ista Zahn wrote: >> >>> On Thu, May 4, 2017 at 10:25 AM, Lionel Henry <lionel....@gmail.com> wrote: >>>> >>>>> On 4 mai 2017, at 16:22, Paul Johnson <pauljoh...@gmail.com> wrote: >>>>> >>>>> I understand I can fix my init.el go avoid this, but it would be nicer >>>>> for my purpose >>>>> if this were in ESS itself, because I keep telling students to use it >>>>> and they are put off/discouraged >>>>> by this. >>>> >>>> Emacs is for people willing to put the effort into customisation. >>>> Your students are probably better off with RStudio. That said >>>> I agree that good defaults are important. >>> >> >> And there are a bunch of styles from which to choose a personal default. >> See below. >> >>> Yes, IMO Emacs/ESS isn't going to compete with Rstudio on >>> out-of-the-box convenience. But we can compete on features! Put this >>> in your config file >>> >>> (add-hook 'ess-mode-hook >>> (lambda() >>> ;; don't indent comments >>> (setq ess-indent-with-fancy-comments nil) >>> ;; turn on outline mode >>> (setq-local outline-regexp "[# ]+") >>> (outline-minor-mode t))) >>> >>> and not only will single # comments not be aligned at comment-column, >>> but code folder will work too! >>> >>> >> >> There are `off-the-shelf' styles like `Rstudio' that might satisfy Paul's >> student. >> >> Setting `ess-default-style' to `Rstudio' gives these settings: >> >> (RStudio >> (ess-indent-offset . 2) >> (ess-offset-arguments . open-delim) >> (ess-offset-arguments-newline . prev-line) >> (ess-offset-block . prev-line) >> (ess-offset-continued . straight) >> (ess-align-nested-calls) >> (ess-align-arguments-in-calls "function[ ]*(") >> (ess-align-continuations-in-calls) >> (ess-align-blocks) >> (ess-indent-from-lhs arguments) >> (ess-indent-from-chain-start . t) >> (ess-indent-with-fancy-comments)) >> >> >> Or one can customize the `OWN' style and select it. See the >> `ess-style-alist' docstring for more details. >> >> HTH, >> >> Chuck >> >> ______________________________________________ >> ESSemail@example.com mailing list >> https://stat.ethz.ch/mailman/listinfo/ess-help >> >> ______________________________________________ >> ESSfirstname.lastname@example.org mailing list >> https://stat.ethz.ch/mailman/listinfo/ess-help > > > > -- > Paul E. Johnson http://pj.freefaculty.org > Director, Center for Research Methods and Data Analysis http://crmda.ku.edu > > To write to me directly, please address me at pauljohn at ku.edu. > > ______________________________________________ > ESSemail@example.com mailing list > https://stat.ethz.ch/mailman/listinfo/ess-help ______________________________________________ ESSfirstname.lastname@example.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help