Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Ross Boylan
On Thu, Mar 08, 2018 at 03:29:14PM +, Sparapani, Rodney wrote:
> Hi Ross:
> I agree with Rich and Vitalie.  This just works out of the box: no .emacs 
> fiddling.
> Perhaps, you are tripping over the recent tightening of the interface.  The 
> last bullet point
> in the New features section of 17.11 states…
> 
>   *   ESS[R] Namespaced evaluation is now automatically enabled only in the 
> R/directory. This way ESS will not attempt to update function definitions 
> from a package if you are working from e.g. a test file.
> http://ess.r-project.org/Manual/ess.html#New-features

Hmm, before I got the latest ESS updates, when I did code evaluation
commands in the .Rnw (vignette) file ESS evaluated the code in R.  Now, when
I did C-c C-r, it tried to build some tex files.  I think I was using
C-c C-n before, so I'm not sure if this is a change.  But it sounds as if
it might be related to the change you highlighted.

BTW, my intention was that the vignette code is evaluated at global scope.

> 
> So, are you opening source code from the R subdirectory of your package and
> submitting them with C-c C-p, C-c C-r, C-c C-b, etc.?

As reported in an earlier message (but after you asked that question),
C-c C-p seems to work, but C-c C-l does not.

> That is what this feature
> provides with respect to R package development and it is awesome!
> --
> Rodney Sparapani, PhD
> Assistant Professor of Biostatistics
> Medical College of Wisconsin, Milwaukee

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Ross Boylan
On Thu, Mar 08, 2018 at 04:22:04PM +0100, Vitalie Spinu wrote:
> 
> 
> >> On Wed, Mar 07 2018 18:29, Ross Boylan wrote:
> 
> > The file I opened initially, the one that sources all the others, is above 
> > the
> > package directory.  It sources files under the package directory.  When I
> > modified one of them I used C-c C-t C-s to disable the namespace before I 
> > did
> > C-c C-l.  This was on the theory that the source() commands earlier stuck
> > everything in the global namespace.
> 
> This sounds too complicated.

I was only doing it because of namespace locked errors, which now seem
to be gone.  I was trying to do everything in the global namespace.

> You don't need to source anything or use C-c C-t
> C-s as all ess eval commmands are executed automatically in the package
> directory. Even if the package is installed from CRAN you shouldn't see
> "namespaced locked" error. Just start R inside package directory and start
> eval-ing stuff as you normally do.

Do you mean that R must be launched from inside the package directory?
Or at least have the current working directory inside the package?  I
haven't been doing that.  ESS has seemed aware when a particular file
was in a package regardless of where R is running (I was using C-c C-t
C-s to put things in the global namespace; using the package namespace
was automatic).

> 
> As to the devtools integration, it's a breeze - C-c C-w i or C-c C-w l are
> pretty fast, surely not slow enough to interfere with the workflow.
> 
I haven't been using devtools, partly (as I recall) because they force
certain other tool choices.  But I might have another look.

Ross

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Developing R packages under ESS

2018-03-08 Thread Ross Boylan
On Wed, Mar 07, 2018 at 09:55:51PM -0500, Richard M. Heiberger wrote:
> My guess is that starting from outside the package misled ESS.
> Try this sequence.
> 
> library(mypackage)
> ## then open the R source in directory mypackage/R/
> ## modify the R files and C-c C-c revised functions.  They will go
> inside the namespace.
> 
That works!  Yay!  In particular, no complaints about a locked namespace.

However, doing C-c C-l does not work; if I modify the code and read in
the whole file, the old code seems to still be in force.

The particular way I found this out was that I inadvertently installed
the package with code that had a breakpoint in it.  When I removed the
breakpoint in the package source directory and did C-c C-l it remained
in force.  When I did C-c C-c on the function that had the breakpoint,
the breakpoint stopped firing.

Ross

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] Developing R packages under ESS

2018-03-07 Thread Ross Boylan
On Wed, Mar 07, 2018 at 08:52:39PM -0500, Richard M. Heiberger wrote:
> normally, it just works.  Do you have a recent ESS?

git tip as of yesterday.

> Try turning off
> your .emacs and see if that helps.
>
My .emacs file loads ESS.  I suppose I could try an .emacs file that
only does that.
Perhaps I'm not loading it in the right way.  My code is
(let ((mydir "~ross/ESS/lisp"))
  (if (file-readable-p mydir) ; true
(setq load-path (append load-path (list mydir)))
(load "ess-site")))
(setq inferior-julia-program-name "~ross/julia/julia")

(load "ess-site")

I have uninstalled the packed version of ESS (14.09) that comes with
my distribution (Debian).



> When you open .R files from a package, ESS knows about the package.
> When you C-c C-c revised files
> they go into the package namespace.

The file I opened initially, the one that sources all the others, is
above the package directory.  It sources files under the package
directory.  When I modified one of them I used C-c C-t C-s to disable
the namespace before I did C-c C-l.  This was on the theory that the
source() commands earlier stuck everything in the global namespace.

Ross

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] make problems with latest git

2018-03-06 Thread Ross Boylan
On Tue, Mar 06, 2018 at 10:18:13AM -0800, Ross Boylan wrote:
...
> have -no-init-file).  So I renamed it and tried again in the cloned ESS3.
> Results attached.  Lots of warnings, but again it seems to get through
> the ess-sas stuff that was a problem, only to fail with
> ess-r-xref.el:32:1:Error: Cannot open load file: no such file or
> directory, xref
>
Apparently xref is used in emacs 25; I'm running emacs 24.

Ross

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] make problems with latest git

2018-03-06 Thread Ross Boylan
On Tue, Mar 06, 2018 at 02:48:27PM +, Sparapani, Rodney wrote:
> Hi Ross:
> 
> I can’t reproduce your problem here.  From your make
> error below, it seems that ess-sas-a.el might be tampered.
> Could you refresh that file from
> git and rebuild to check?
> 
> > [ess-sas-d:] require 'ess-sas-l ...
> > Source file `/home/ross/ESS/lisp/ess-sas-a.el' newer than
> > byte-compiled file
> > Symbol's value as variable is void: sas-program
> > Makefile:115: recipe for target 'ess-sas-d.elc' failed
> 
> --
> Rodney Sparapani, PhD
> Assistant Professor of Biostatistics
> Medical College of Wisconsin, Milwaukee
I deleted the file and then did git checkout -- ess-sas-a.el.  It
didn't seem to make a difference (see below).  I also did a clean
clone from git.  That also didn't work, though not in the same way--in
fact it seems to have gotten through the ess-sas stuff with only
warnings, while failing later on.  I've attached the script.

Here's the try in my existing tree:
ross@ross-node1:~/ESS$ make
cd etc; make all
make[1]: Entering directory '/home/ross/ESS/etc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ross/ESS/etc'
cd lisp; make all
make[1]: Entering directory '/home/ross/ESS/lisp'
emacs -batch -no-site-file -no-init-file -l ./ess-comp.el -f batch-byte-compile 
ess-custom.el
loading 'ess-compat ..
loading 'ess-custom ..
Source file `/home/ross/ESS/lisp/ess-custom.el' newer than byte-compiled file
loading 'ess ..
Source file `/home/ross/ESS/lisp/ess.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-utils.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-mode.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-inf.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-tracebug.el' newer than byte-compiled file
loading 'ess-site ..
Source file `/home/ross/ESS/lisp/ess-site.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-r-mode.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-help.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-s-lang.el' newer than byte-compiled file
[ess-s-lang:] (def** ) only ...
Source file `/home/ross/ESS/lisp/ess-roxy.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-r-completion.el' newer than byte-compiled 
file
Source file `/home/ross/ESS/lisp/ess-r-syntax.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-r-package.el' newer than byte-compiled file
[ess-r-mode:] (require 'ess-s-lang)
[ess-r-mode:] (autoload ..) & (def** ..)
Source file `/home/ross/ESS/lisp/ess-julia.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-dde.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-sas-d.el' newer than byte-compiled file
[ess-sas-d:] require 'comint & 'shell ...
[ess-sas-d:] require 'ess-sas-l ...
Source file `/home/ross/ESS/lisp/ess-sas-l.el' newer than byte-compiled file
Source file `/home/ross/ESS/lisp/ess-sas-a.el' newer than byte-compiled file
Symbol's value as variable is void: sas-program
Makefile:119: recipe for target 'ess-custom.elc' failed
make[1]: *** [ess-custom.elc] Error 255
make[1]: Leaving directory '/home/ross/ESS/lisp'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2
ross@ross-node1:~/ESS$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] make problems with latest git

2018-03-05 Thread Ross Boylan
Attempting to follow the installation instructions I tried to run
make.  It failed because EMACS=t when running a shell inside emacs
24.4.1.

The Makeconf file included by the Makefile in the lisp directory
includes the line
EMACS ?= emacs
which set EMACS = emacs unless it is already set (which it is, to t).

For now, I'll run make in a regular shell.  It would be nice if this
worked inside of emacs, but I'm not sure it's worth fixing.


ross@ross-node1:~/ESS$ git pull
remote: Counting objects: 28, done.
remote: Total 28 (delta 18), reused 18 (delta 18), pack-reused 10
Unpacking objects: 100% (28/28), done.
>From https://github.com/emacs-ess/ESS
e855572..c1a308e  master -> origin/master
Updating e855572..c1a308e
Fast-forward
doc/ess.texi  | 37 +
doc/newfeat.texi  |  5 +
lisp/ess-r-flymake.el | 15 +++
lisp/ess-r-package.el |  2 +-
4 files changed, 50 insertions(+), 9 deletions(-)
ross@ross-node1:~/ESS$ date; make
Mon Mar  5 10:07:44 PST 2018
cd etc; make all
make[1]: Entering directory '/home/ross/ESS/etc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/ross/ESS/etc'
cd lisp; make all
make[1]: Entering directory '/home/ross/ESS/lisp'
t -batch -no-site-file -no-init-file -l ./ess-comp.el -f batch-byte-compile 
ess-custom.el
make[1]: t: Command not found
Makefile:119: recipe for target 'ess-custom.elc' failed
make[1]: *** [ess-custom.elc] Error 127
make[1]: Leaving directory '/home/ross/ESS/lisp'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2
ross@ross-node1:~/ESS$ echo $EMACS
t


BTW, make in a regular BASH shell produced lots of warnings and at
least  one error, which seems to have come at the end (or maybe caused
the end?):
[ess-sas-d:] require 'ess-sas-l ...
Source file `/home/ross/ESS/lisp/ess-sas-a.el' newer than
byte-compiled file
Symbol's value as variable is void: sas-program
Makefile:115: recipe for target 'ess-sas-d.elc' failed
make[1]: *** [ess-sas-d.elc] Error 255
make[1]: Leaving directory '/home/ross/ESS/lisp'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help