[ESS] ess-smart-underscore WAS: noweb file and assignment key

Martin Maechler maechler at stat.math.ethz.ch
Wed Oct 31 12:32:59 CET 2012


>>>>> Charles Berry <cberry at tajo.ucsd.edu>
>>>>>     on Tue, 30 Oct 2012 19:03:41 -0700 writes:

    > Sorry to take this off-list, but I seem to be having trouble
    > getting thru gmane to ess-help.

    > The problem Denis alludes to is that the call to
    > ess-inside-string-or-comment-p inside ess-smart-underscore is finding
    > the quote before the code chunk.

yes. 
    > Narrowing to the code chunk - see below - is needed.

yes, indeed. {and in fact needed in other ess commands as well,
     	      such as ess-eval-paragraph-...  !}
I have suggested such changes to the ESS core team only a few
days ago.

    > I think this works, but not tested thoroughly. In ess-smart-underscore:

    > (narrow-to-region (process-mark (get-ess-process)) (point-max))))
    > +        (and ess-noweb-mode
    > +         (noweb-in-code-chunk)
    > +         (noweb-narrow-to-chunk))
    > (if (or
        
    > HTH,

Indeed, it helped:  It was very close to the real solution:
(1. parentheses
 2. in ESS 12.09-1, all the ESS noweb functions are renamed from 
  noweb-foo to ess-noweb-foo,   as inside the Emacs sphere,
  there's another  noweb-*  version floating around.) :

Index: lisp/ess-s-l.el
===================================================================
690c690,693
<         (narrow-to-region (process-mark (get-ess-process)) (point-max))))
---
>         (narrow-to-region (process-mark (get-ess-process)) (point-max)))
>       (and ess-noweb-mode
>            (ess-noweb-in-code-chunk)
>            (ess-noweb-narrow-to-chunk)))


------------------------------------------------------------------------
r5277 | maechler | 2012-10-31 12:27:38 +0100 (Wed, 31 Oct 2012) | 1 line
Changed paths:
   M lisp/ess-s-l.el

fix (ess-smart-underscore) inside Rnw --- based on suggestion by Chuck Berry
------------------------------------------------------------------------


    > Chuck

    > -- 
    > Charles C. Berry                            Dept of Family/Preventive Medicine
    > cberry at ucsd edu			    UC San Diego
    > http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901



More information about the ESS-help mailing list