[ESS-bugs] Re^2: Re: Patch: correctly indent #! and recognize Rscript

Martin Maechler maechler at stat.math.ethz.ch
Mon Apr 12 18:26:22 CEST 2010


>>>>> "JA" == Jeffrey Arnold <jarnold7 at mail.rochester.edu>
>>>>>     on Mon, 12 Apr 2010 12:08:25 -0400 writes:

    JA> The problem was that rev 4288 didn't update
    JA> ess-indent-line to handle the shebang. Since TAB is
    JA> bound to ess-indent-command and ess-indent-command calls
    JA> ess-indent-line and not S-indent-line or the current
    JA> indent-line-function, nothing was happening.  The patch
    JA> I attached fixes ess-indent-line. I hope this patch get
    JA> everything working.

so do I.

I'm sorry I forgot to mention "first round" that your patch
partially failed (or it failed for me) for ess-mode.el and hence
was missing in the commit
[ Because of "intermediately being distracted" (working at home,
  over the weekend), I forgot to first ask Jeffrey (about a new
  patch) before asking everyone else for feedback.
  (the lisp/ChangeLog already mentioned ess-mode.el ...) ]
Exuse that..

I have now committed rev 4289 .. which - as Jeff said - should
fix the remaining extraneous indenting.

I'll be glad for confirmation, Seb.
Martin


    JA> On Sun, Apr 11, 2010 at 1:05 PM, Sebastian P. Luque
    JA> <spluque at gmail.com>wrote:

    >> On Sat, 10 Apr 2010 20:55:44 +0200, Martin Maechler
    >> <maechler at stat.math.ethz.ch> wrote:
    >> 
    >> >>>>>> "MM" == Martin Maechler
    >> <maechler at stat.math.ethz.ch> on Fri, 9 >>>>>> Apr 2010
    >> 15:31:29 +0200 writes:
    >> 
    MM> This was accidentally sent to ESS-bugs-owner at ...  the
    MM> mailbox of the ESS-bugs mailing list manager; not
    MM> something I read daily.
    >> 
    MM> The patch looks fairly comprehensive, but as I'm not
    MM> using "#!... Rscript or "littler" scripts, I'd be happy
    MM> for someone else to test this.
    >> 
    >> > I would still be.  But only now I've tried to *apply*
    >> the patch to the > current sources "started at it" a bit,
    >> use 'make' and for possible > byte compiler warnings, and
    >> then committed it.  I'm not 100% sure if > the patch
    >> applied correctly.
    >> 
    >> > Jeffrey, can you try using the ESS development version
    >> from the > https://svn.r-project.org/ESS/trunk/ or any
    >> other "littler" or > "Rscript" script writers among us?
    >> 
    >> I just tried this, given that I regularly write littler
    >> scripts.  After upgrading my SVN copy, running make, and
    >> then after 'emacs -Q':
    >> 
    >> (load "~/.emacs.d/site-lisp/ess/lisp/ess-site")
    >> 
    >> opening a *.r script having the shebang line:
    >> 
    >> #! /usr/bin/env r
    >> 
    >> and hitting TAB (`ess-indent-command') on that line
    >> indented it as a '#' comment, i.e. it went from starting
    >> in the first column to starting in the 40th column.  So
    >> it seems as if the patch didn't work/apply correctly.
    >> 
    >> 
    >> --
    >> Seb
    >> 
    JA> The problem was that rev 4288 didn't update
    JA> ess-indent-line to handle the shebang. Since TAB is
    JA> bound to ess-indent-command and ess-indent-command calls
    JA> ess-indent-line and not S-indent-line or the current
    JA> indent-line-function, nothing was happening.  The patch
    JA> I attached fixes ess-indent-line. I hope this patch get
    JA> everything working.   <br> <br>Jeff<br><br><div
    JA> class="gmail_quote">On Sun, Apr 11, 2010 at 1:05 PM,
    JA> Sebastian P. Luque <span dir="ltr"><<a
    JA> href="mailto:spluque at gmail.com">spluque at gmail.com</a>></span>
    JA> wrote:<br><blockquote class="gmail_quote" style="margin:
    JA> 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204,
    JA> 204); padding-left: 1ex;"> <div class="im">On Sat, 10
    JA> Apr 2010 20:55:44 +0200,<br> Martin Maechler <<a
    JA> href="mailto:maechler at stat.math.ethz.ch">maechler at stat.math.ethz.ch</a>>
    JA> wrote:<br> <br> >>>>>> "MM"
    JA> == Martin Maechler <<a
    JA> href="mailto:maechler at stat.math.ethz.ch">maechler at stat.math.ethz.ch</a>>
    JA> on Fri, 9<br> >>>>>> Apr 2010 15:31:29
    JA> +0200 writes:<br> <br> </div>MM> This was
    JA> accidentally sent to ESS-bugs-owner at ...  the mailbox of
    JA> the<br> MM> ESS-bugs mailing list manager; not
    JA> something I read daily.<br> <br> MM> The patch looks
    JA> fairly comprehensive, but as I'm not using<br>
    JA> MM> "#!... Rscript or "littler"
    JA> scripts, I'd be happy for someone else<br> MM> to
    JA> test this.<br> <div class="im"><br> > I would still
    JA> be.  But only now I've tried to *apply* the patch to
    JA> the<br> > current sources "started at it" a
    JA> bit, use 'make' and for possible<br> > byte
    JA> compiler warnings, and then committed it.  I'm not
    JA> 100% sure if<br> > the patch applied correctly.<br>
    JA> <br> > Jeffrey, can you try using the ESS development
    JA> version from the<br> > <a
    JA> href="https://svn.r-project.org/ESS/trunk/"
    JA> target="_blank">https://svn.r-project.org/ESS/trunk/</a>
    JA> or any other "littler" or<br> >
    JA> "Rscript" script writers among us?<br> <br>
    JA> </div>I just tried this, given that I regularly write
    JA> littler scripts.  After<br> upgrading my SVN copy,
    JA> running make, and then after 'emacs -Q':<br>
    JA> <br> (load
    JA> "~/.emacs.d/site-lisp/ess/lisp/ess-site")<br>
    JA> <br> opening a *.r script having the shebang line:<br>
    JA> <br> #! /usr/bin/env r<br> <br> and hitting TAB
    JA> (`ess-indent-command') on that line indented it as a
    JA> '#'<br> comment, i.e. it went from starting in
    JA> the first column to starting in<br> the 40th column.  So
    JA> it seems as if the patch didn't work/apply<br>
    JA> correctly.<br> <font color="#888888"><br> <br> --<br>
    JA> Seb<br> </font></blockquote></div><br> Content-Type:
    JA> text/x-patch; charset=US-ASCII;
    JA> name="ess-rscript-patch2.diff" Content-Disposition:
    JA> attachment; filename="ess-rscript-patch2.diff"
    JA> Content-ID:
    JA> <19395.18510.128329.10340 at lynne.math.ethz.ch>
    JA> Content-Transfer-Encoding: binary

    JA> [Deleted text/x-patch] [Saved to
    JA> /u/maechler/emacs/ess/JeffA-patch-2 on
    JA> lynne.math.ethz.ch]



More information about the ESS-bugs mailing list