[ESS] package loads without my request
Vitalie Spinu
@p|nuv|t @end|ng |rom gm@||@com
Sun Jul 16 14:09:24 CEST 2017
Hi Paul,
The pattern that you described is in the small minority. If your code is in a
packge it's very likely you want to develop it in the context of a package.
Use C-c C-t C-a and set package to *none* if you want to deactivate
"in-namespace" code evaluation.
Vitalie
>> On Fri, Jul 14 2017 09:26, Paul Johnson wrote:
> Today, I see a new problem I did not see before. It may have been like
> this all along, but I don't like it. If this is supposed to happen, I
> wonder what it is called and how to avoid it.
> The problem is that when I load a function in an R file that is in a
> package source code directory, something in ESS causes the package to
> be loaded when the function is read into R.
> The package gets loaded if I read in a function with the "Eval
> Function" button, or if I highlight a function and choose "Eval
> Region". It also happens if I hit the "Load File" button or cursor
> into a function and hit C-c C-c.
> The package does not load if I put cursor at top of a function and
> send each individual line to the session. This would be acceptable,
> except that hitting next a few 100 times is boring.
> I don't want the package to load, I'm trying to fix a problem in it by
> editing the R files. If the package loads, then the functions in the
> package become available and they frustrate my effort to fix the R
> files.
> Then I noticed that if I copy the R file into another folder, "/tmp"
> in this case, then I'm able to open the file in Emacs and the package
> never loads itself without my explicit request to do so. Hence, I
> conclude Emacs/ESS are noticing that I'm in a package directory and
> I'm getting an intended behavior.
> Turning off "Developer mode" in ESS does not change this.
> This is Ubuntu Emacs 24.5.1 with ESS 16.10. Here I notice I'm back in
> that same confusing situation where the system's ESS 16.10 is used,
> but in my ~/.emacs-d I have a newer MELPA version, but Emacs does not
> notice it. I'll leave that as a problem for another day.
> pj
> Opening file "/tmp/summarize.R", and doing nothing except "Load File"
> NULL
> NULL
> NULL
> NULL
> NULL
> Sourced file /tmp/summarize.R
>> sessionInfo()
> R version 3.4.1 (2017-06-30)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 17.04
> Matrix products: default
> BLAS: /usr/lib/libblas/libblas.so.3.7.0
> LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
> locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
> loaded via a namespace (and not attached):
> [1] compiler_3.4.1
>>
> However, doing the exact same thing with the exact same file, but
> within the R folder of the package:
> NULL
> NULL
> NULL
> NULL
> NULL
> [rockchalk] Sourced file
> /home/pauljohn/GIT/rockchalk/package/rockchalk/R/summarize.R
>> sessionInfo()
> R version 3.4.1 (2017-06-30)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 17.04
> Matrix products: default
> BLAS: /usr/lib/libblas/libblas.so.3.7.0
> LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
> locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
> other attached packages:
> [1] rockchalk_1.8.101
> loaded via a namespace (and not attached):
> [1] Rcpp_0.12.11 lattice_0.20-35 MASS_7.3-47 grid_3.4.1
> [5] MatrixModels_0.4-1 nlme_3.1-131 SparseM_1.77 minqa_1.2.4
> [9] nloptr_1.0.4 car_2.1-4 Matrix_1.2-10 splines_3.4.1
> [13] lme4_1.1-13 pbkrtest_0.4-7 parallel_3.4.1 compiler_3.4.1
> [17] mgcv_1.8-17 nnet_7.3-12 quantreg_5.33
>>
More information about the ESS-help
mailing list