Re: [ESS] TWITTER API environment variables

2020-04-09 Thread Patrick Connolly via ESS-help
G'day Ista,

Thanks for setting me straight on that.  I was misled by the fact that
my username on this machine is pat.  Something led me to believe that
the twitter environment would be TWITTER_WORK but I don't have remote
access to check (and be disabused of that notion).

In any case, the problem seems to have vanished.  I'm a bit
uncomfortable not understanding why the problem arose and disappeared
with no error message.  I've wasted hours on this issue.

Best

Patrick


On Thu, 09-Apr-2020 at 10:32AM -0400, Ista Zahn wrote:

|> Hi Patrick,
|> 
|> Are you sure you've diagnosed the issue correctly? From what I can see
|> the name of the environment variable is always TWITTER_PAT, at least
|> in the current rtweet release (0.7.0). get_tokens calls twitter_pat
|> (https://github.com/ropensci/rtweet/blob/v0.7.0/R/tokens.R#L120) and
|> twitter_pat hard-codes TWITTER_PAT
|> (https://github.com/ropensci/rtweet/blob/v0.7.0/R/tokens.R#L371). In
|> short I don't see anything suggesting that the name of the environment
|> variable includes a user name at all.
|> 
|> Best,
|> Ista
|> 
|> On Wed, Apr 8, 2020 at 7:22 PM Patrick Connolly via ESS-help
|>  wrote:
|> >
|> >
|> > I'm using the rtweet package which makes use of the Twitter API which
|> > requires a token alluded to by an environment variable.
|> >
|> > That environment variable is automatically set up from the Twitter web
|> > site and takes the name TWITTER_ (where  is the
|> > name of the user in block letters).  That worked fine on my work
|> > computer where my username is 'work'.  When I copied that working
|> > directory to my home computer, the environment variable became
|> > TWITTER_HOME but the rtweet package was looking for
|> > TWITTER_WORK. There was no error message: just a null result from the
|> > search_users() function.
|> >
|> > I tried editing the ~/.Renviron entry to
|> > TWITTER_WORK=/home/home/.rtweet_token.rds
|> >
|> > That worked for a short time but soon ceased working.  Then I noticed
|> > a new entry had been automatically added to ~/.Renviron
|> >
|> > TWITTER_HOME=/home/home/.rtweet_token1.rds
|> >
|> > So now I had two environment variables which also worked for a short
|> > time.
|> >
|> > No such problem arises if R is run from the bash prompt or Rstudio,
|> > but editing functions is so clunky that way.  I've used ESS for more
|> > than 20 years and find it preferable.
|> >
|> > R-3.6.3, ESS 17.11
|> >
|> > Any ideas what could be causing the token connexion being lost
|> > appreciated.
|> >
|> > --
|> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
|> >___Patrick Connolly
|> >  {~._.~}   Great minds discuss ideas
|> >  _( Y )_ Average minds discuss events
|> > (:_~*~_:)  Small minds discuss people
|> >  (_)-(_)  . Eleanor Roosevelt
|> >
|> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
|> >
|> > __
|> > ESS-help@r-project.org mailing list
|> > https://stat.ethz.ch/mailman/listinfo/ess-help

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


[ESS] TWITTER API environment variables

2020-04-08 Thread Patrick Connolly via ESS-help


I'm using the rtweet package which makes use of the Twitter API which
requires a token alluded to by an environment variable.

That environment variable is automatically set up from the Twitter web
site and takes the name TWITTER_ (where  is the
name of the user in block letters).  That worked fine on my work
computer where my username is 'work'.  When I copied that working
directory to my home computer, the environment variable became
TWITTER_HOME but the rtweet package was looking for
TWITTER_WORK. There was no error message: just a null result from the
search_users() function.

I tried editing the ~/.Renviron entry to
TWITTER_WORK=/home/home/.rtweet_token.rds

That worked for a short time but soon ceased working.  Then I noticed
a new entry had been automatically added to ~/.Renviron

TWITTER_HOME=/home/home/.rtweet_token1.rds

So now I had two environment variables which also worked for a short
time.

No such problem arises if R is run from the bash prompt or Rstudio,
but editing functions is so clunky that way.  I've used ESS for more
than 20 years and find it preferable.

R-3.6.3, ESS 17.11

Any ideas what could be causing the token connexion being lost
appreciated.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [ESS] How to type an underscore "_" in emacs with ESS in a SAS program

2019-04-14 Thread Patrick Connolly via ESS-help
On Thu, 11-Apr-2019 at 11:58AM -0600, Karen Taves via ESS-help wrote:

|> I am new to using ESS and am using ESS 18.10.2 and trying to type
|> an underscore "_" in emacs in a SAS program and am getting the
|> following error message: Symbol's function definition is void:
|> ess-smart-S-assign

I don't know about SAS, but in R, typing a second underscore bypasses
what normally happens, i.e. makes an assignment, i.e. " <- " (without
the quotes).

HTH

|> 
|> I suspect that I need to add something to my .emacs file. 
|> My .emacs file as the following 2 lines (and I don’t understand the format 
of this file so need specific instruction):
|> (add-to-list 'load-path "/home/scripts/ess-18.10.2/lisp")
|> (load "ess-autoloads”)
|> 
|> Thank you,
|> Karen
|> 
|> 
|> 
|> 
|>  [[alternative HTML version deleted]]
|> 
|> __
|> ESS-help@r-project.org mailing list
|> https://stat.ethz.ch/mailman/listinfo/ess-help

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [ESS] ess-insert-function-outline

2018-05-05 Thread Patrick Connolly
On Fri, 04-May-2018 at 10:23AM +0200, Lionel Henry wrote:

|> 
|> 
|> > On 4 mai 2018, at 10:05, Patrick Connolly <p_conno...@slingshot.co.nz> 
wrote:
|> > 
|> > That's the same as what's in my lisp/old directory.  What am I to
|> > learn from that?
|> 
|> You can copy-paste its contents into your emacs configuration file.
|> 
.

Many thanks, Lionel.  It works fine now.

And apologies for my ignorance.  

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [ESS] ess-insert-function-outline

2018-05-04 Thread Patrick Connolly
Thanks Lionel.

On Thu, 03-May-2018 at 11:14AM +0200, Lionel Henry wrote:

|> 
|> 

|> > On 3 mai 2018, at 10:54, Patrick Connolly
|> > <p_conno...@slingshot.co.nz> wrote:

|> > What could be the thinking behind that?
|> 
|> This function is strictly less useful than the alternatives mentioned by
|> Alex (yasnippet is an excellent package). You can copy the old definition
|> in your configuration file if you'd like to continue using it.

Which configuration file are you referring to?  Not the
function-outline.S in etc/ because it's already there.  Something in
the lisp/ directory?  Anything that contains reference to
function-outline seems to be the same.  I'm pretty ignorant of how the
idea of .el and .elc files in lisp works.  I just use emacs to write R
code.

 The yasnippet package would take me ages to get my head around, and I
 don't have use for most of what it seems to do.


|> 
|> https://github.com/emacs-ess/ESS/blob/master/lisp/old/ess-old-s.el

That's the same as what's in my lisp/old directory.  What am I to
learn from that?

best

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [ESS] ess-insert-function-outline

2018-05-03 Thread Patrick Connolly
G'day Alex,

On Wed, 02-May-2018 at 09:19AM -0500, Alex Branham wrote:

[...]

|> 
|> It looks like ess-insert-function-outline was retired to the old/
|> directory, so it isn't defined in newer ESS versions. 

What could be the thinking behind that?  The outline file is still
there in the etc/ directory, so I never would have imagined dumping
ess-insert-function-outline into the old/ directory.

|> I'm guessing you updated ESS while tinkering with .emacs/.Rprofile?

Good guess.

|> 
|> I never used it myself, but it looks like it's supposed to insert a
|> function skeleton? If that's the case, there are a few replacements you
|> can use, including the builtin skeleton.el or yasnippet, available on
|> ELPA.

How do I use that?  There's /usr/share/emacs/24.3/lisp/skeleton.elc
that I could copy to the lisp/ directory or make a link from there to
it.  Would that make sense?

If not, I'll just stick with an older version that works fine.
There's nothing new that makes it worth forgoing the function
skeleton.

Thanks for your help.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


[ESS] ess-insert-function-outline

2018-05-02 Thread Patrick Connolly
After many years of loyal service, ess-insert-function-outline has
stopped working.  I get the message:

Symbol's function definition is void: ess-insert-function-outline

During my recent issue with the R dump function (not an ESS issue as
it turns out) I might have inadvertantly modified something, but only
.emacs and .Rprofile were involved AFAIR and I don't notice anything
when comparing old versions of those files.  It might be a coincidence
that I had been dealing with the buffer created by
ess-dump-object-into-edit-buffer but with nothing else to go on, it appears
slightly more likely to be the source of the problem.


I have the function-outline.S file in $ESS-HOME/etc/ directory where
it has always worked.  What conveys the instructions to 'insert' it?
If I try the same in an Emacs window that has been running for several
weeks, i.e. before I tinkered with .emacs and .Rprofile, it works as
it has always done.  What does that fact tell us?

TIA
-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


[ESS] SOLVED Re: ess-dump-object-into-edit-buffer

2018-04-26 Thread Patrick Connolly
x1On Tue, 24-Apr-2018 at 10:38PM -0400, Ista Zahn wrote:

[...]

|> >
|> > Well, I thought I did that with what I posted on 16/4/18, though I did
|> > neglect to give the system information:
|> 
|> I cannot reproduce it, which means either that you didn't give clear
|> reproduction steps, or that I failed to follow them.

As it turns out, there are more than those two possibilities.  There
is a difference between the set ups, and that difference is not in the
.emacs file.  In fact, there is a ~/.Rprofile which I'd forgotten
about.  The discussion in this thread about the R function dump() led
me find an addition to that file I made centuries ago.

options(deparse.max.lines = 4)

IIRC That was to deal with an issue with the browser() function that
would spew out all the code adjacent to where browser() appeared in
the function.  There was a lot of superflous code filling up screen
real-estate.

I don't understand how that change didn't lead to the current issue at
the time, but removing that line in .Rprofile is the answer to my
question.

Many thanks to all the contributors to this thread,


-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [ESS] ess-dump-object-into-edit-buffer

2018-04-24 Thread Patrick Connolly
On Tue, 24-Apr-2018 at 08:20AM -0400, Ista Zahn wrote:

|> On Tue, Apr 24, 2018 at 4:13 AM, Patrick Connolly
|> <p_conno...@slingshot.co.nz> wrote:
|> > On Mon, 16-Apr-2018 at 09:02AM -0400, Ista Zahn wrote:
|> >
|> > [...]
|> >
|> > |> This suggests to me that you did _not_ start with emacs -q, so indeed
|> > |> you should start looking at your configuration to see where the
|> > |> problem is. Did you try commenting out the 'ess-source-directory'
|> > |> setting to see if that is the problem?
|> >
|> > I tried that, half-expecting it to make the difference.  But it didn't
|> > -- which was only half-unexpected.  However, I *still* get the problem
|> > even starting with emacs -q.  That was completely unexpected since it
|> > would indicate that the problem is not with my .emacs file.
|> >
|> > Where else is there to investigate?  It's getting curiouser and
|> > curiouser.
|> 
|> Hi Patrick,
|> 
|> What I've been trying to tell you is that we need explicit
|> step-by-step instructions for reproducing the problem, as well as the
|> details of your set up such as operating system and emacs and ess
|> versions. Basically, please provide a standard, reproducible, and
|> complete bugreport.

Well, I thought I did that with what I posted on 16/4/18, though I did
neglect to give the system information:

GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8)
 of 2017-09-20 on lcy01-35, modified by Debian

ess-17.11 

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

Matrix products: default
BLAS: /home/pat/local/R-3.4.4/lib/libRblas.so
LAPACK: /home/pat/local/R-3.4.4/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_NZ.UTF-8   LC_NUMERIC=C  
 [3] LC_TIME=en_NZ.UTF-8LC_COLLATE=en_NZ.UTF-8
 [5] LC_MONETARY=en_NZ.UTF-8LC_MESSAGES=en_NZ.UTF-8   
 [7] LC_PAPER=en_NZ.UTF-8   LC_NAME=C 
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] utils stats grDevices graphics  methods   base 

other attached packages:
[1] lattice_0.20-35

loaded via a namespace (and not attached):
 [1] compiler_3.4.4   magrittr_1.5   
https://www.antiaging-systems.com/articles/31-bec-5-the-treatment-of-choice-for-non-melanoma-skin-cancers
  assertthat_0.2.0 R6_2.2.1
 [5] tools_3.4.4  pillar_1.2.1 bindrcpp_0.2.2   glue_1.2.0  
 [9] dplyr_0.7.4  tibble_1.4.2 Rcpp_0.12.16 grid_3.4.4  
[13] pkgconfig_2.0.1  rlang_0.2.0  bindr_0.1.1 
> 


best
Patrick


-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [ESS] ess-dump-object-into-edit-buffer

2018-04-24 Thread Patrick Connolly
On Mon, 16-Apr-2018 at 09:02AM -0400, Ista Zahn wrote:

[...]

|> This suggests to me that you did _not_ start with emacs -q, so indeed
|> you should start looking at your configuration to see where the
|> problem is. Did you try commenting out the 'ess-source-directory'
|> setting to see if that is the problem?

I tried that, half-expecting it to make the difference.  But it didn't
-- which was only half-unexpected.  However, I *still* get the problem
even starting with emacs -q.  That was completely unexpected since it
would indicate that the problem is not with my .emacs file.

Where else is there to investigate?  It's getting curiouser and
curiouser.

Thanks for looking into it.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [ESS] ess-dump-object-into-edit-buffer

2018-04-16 Thread Patrick Connolly
This is about the shortest I can get that shows what happens: Just
what the example function does is not material to my question.



## from the bash prompt

mkdir ~/Temp/First
cd ~/Temp/First
emacs &
# start R using M-x R

## within the *R* buffer make a short function

bringLibrary <-
function(lastR = "3.0.2", latestR = "3.1.0", Rloc = "~/local/"){
### Purpose:- Bring library from older R version to newer one.
###   (Idea is to then update the packages that need to be)
### --
### Modified from:- 
### --
### Arguments:- lastR: version of R that has the packages desired
### latestR: latest version of R of interest
### Rloc: where R versions are located (probably not the default)
###Make sure there's a trailing "/"
### ----------
### Author:-   Patrick Connolly, Date:- 29 May 2014, 11:08
### --
### Revisions:- 22/08/14 fixed mistaken swap of lastR & latestR
### 15/10/15 location of R installions made adjustable
### 7//2017 Rloc changed back to ~/local
  now <- system(paste0("ls ", Rloc, "R-", latestR, "/library"), TRUE)
  was <- system(paste0("ls ", Rloc, "R-", lastR, "/library"), TRUE)
  need <- was[!is.element(was, now)]
### Check if it's already been done
  if(length(need) < 1)
stop("Nothing in R-", lastR, " that isn't already in R-", latestR, ".\n")
  for(i in need) # reason for running this function
system(paste0("cp -prv ", Rloc, "R-", lastR, "/library/", i, " ", Rloc,
  "R-", latestR, "/library/"))
### Notify it's finished and give pastable text to update copied packages 
  cat(length(need), " packages copied into R-", latestR,
  " directory.\nProbably a good idea to start R-", latestR,
  " and run\n  update.packages(checkBuilt = TRUE, ask = FALSE)\n", sep = "")
}



## now save and exit then start in another directory:

>   q()
Save workspace image? [y/n/c]: y

## from the bash prompt
mkdir ~/Temp/Second
cd ~/Temp/Second
emacs &
# start R using M-x R

## Within the *R* buffer
> attach("../First/.RData")
> ls(pos = 2)
[1] "bringLibrary" "repos"

## Then
'M-x
ess-dump-object-into-edit-buffer  bringLibrary ' 

bringLibrary <-
function(lastR = "3.0.2", latestR = "3.1.0", Rloc = "~/local/")
{
### Purpose:- Bring library from older R version to newer one.
###   (Idea is to then update the packages that need to be)
  ...


## but in the *R* buffer all code and comment are there.

> bringLibrary
function(lastR = "3.0.2", latestR = "3.1.0", Rloc = "~/local/")
{
### Purpose:- Bring library from older R version to newer one.
###   (Idea is to then update the packages that need to be)
### --
### Modified from:- 
### ------
### Arguments:- lastR: version of R that has the packages desired
### latestR: latest version of R of interest
### Rloc: where R versions are located (probably not the default)
###Make sure there's a trailing "/"
### --
### Author:-   Patrick Connolly, Date:- 29 May 2014, 11:08
### --
### Revisions:- 22/08/14 fixed mistaken swap of lastR & latestR
### 15/10/15 location of R installions made adjustable
### 7//2017 Rloc cchanged back to ~/local
  now <- system(paste0("ls ", Rloc, "R-", latestR, "/library"), TRUE)
  was <- system(paste0("ls ", Rloc, "R-", lastR, "/library"), TRUE)
  need <- was[!is.element(was, now)]
### Check if it's already been done
  if(length(need) < 1)
stop("Nothing in R-", lastR, " that isn't already in R-", latestR, ".\n")
  for(i in need) # reason for running this function
system(paste0("cp -prv ", Rloc, "R-", lastR, "/library/", i, " ", Rloc,
  "R-", latestR, "/library/"))
### Notify it's finished and give pastable text to update copied packages 
  cat(length(need), " packages copied into R-", latestR,
  " directory.\nProbably a good idea to start R-", latestR,
  " and run\n

Re: [ESS] ess-dump-object-into-edit-buffer

2018-04-14 Thread Patrick Connolly
G'day Ista,

I'm having trouble getting an example small enough to show.  Some work
properly and others (usually longer ones) don't.  Can't imagine what
makes the difference.

I'll be at the machine where I normally work and there I'll find a
small example.

Thanks for looking at my problem.

best
Patrick


On Thu, 12-Apr-2018 at 11:08PM -0400, Ista Zahn wrote:

|> Hi Patrick,
|> 
|> I don't use ess-dump-object-into-edit-buffer, so I'm not sure what
|> exactly you expect it to do. A specific example would help, i.e., a
|> description of exactly what you did, exactly what happened, and how
|> what happened differed from you expectation.
|> 
|> For example, if I start R with 'M-x R ' and do 'M-x
|> ess-dump-object-into-edit-buffer  getwd ' I see a new buffer
|> is created containing
|> 
|> getwd <-
|> function ()
|> .Internal(getwd())
|> 
|> Is that what you see? If so, how does it differ from what you expect?
|> If you see something different, how does your setup differ from mine?
|> I'm running Emacs 25.3 and ESS 17.11 [elpa: 20180412.315]
|> 
|> Best,
|> Ista
|> 
|> On Thu, Apr 12, 2018 at 7:19 PM, Patrick Connolly
|> <p_conno...@slingshot.co.nz> wrote:
|> > Thanks Ista.
|> >
|> > The result is not the same, but it's equally useless.  It produces almost
|> > the same as typing the name of the function and pressing . That is 
to
|> > say, unless the function has been edited in the working directory, it lists
|> > all the code without any of the comments almost in the form of a list
|> > element labelled "structure" and a second element labelled "source" which
|> > contains all the source in the form of a character vector.   Quite a lot of
|> > text wrangling is required to get that text into the form of an editable
|> > function.
|> >
|> > There is a slight difference from what results from typing the function 
name
|> > and pressing   in that the word "structure" is not in the latter and
|> > the source is an attr.
|> >
|> > (I say "almost" because neither form is exactly the same as how a list is
|> > displayed.)
|> >
|> > Is that intended behaviour?
|> >
|> > TIA
|> > Patrick
|> >
|> > On 04/13/2018 01:48 AM, Ista Zahn wrote:
|> >
|> > On Thu, Apr 12, 2018 at 3:56 AM, Patrick Connolly
|> > <p_conno...@slingshot.co.nz> wrote:
|> >
|> > Thanks for the response, however, if I start Emacs with a '-q' none of
|> > my ~/.emacs file is read, so Emacs doesn't know how to start R.  More
|> > to the point, I'm unable to run R within Emacs any other way.
|> >
|> > The usual recipe is to start with emacs -q and then evaluate
|> >
|> > (package-initialize)
|> > (require 'ess-site)
|> >
|> > in the scratch buffer, then check to see if you can reproduce the bug.
|> > If you have ESS installed in a way that it is not in your load-path by
|> > default you may have to do something along the lines of
|> >
|> > (add-to-list 'load-path "/path/to/ESS/lisp/")
|> > (load "ess-site")
|> >
|> > Best,
|> > Ista
|> >
|> >
|> >
|> > I gather there is a way of applying individual lines of the .emacs
|> > files but a bear with a small brain doesn't know how to do that (or
|> > where to look in the manual how to do it),
|> >
|> > It would appear, if it doesn't reproduce, that the problem is
|> > somewhere in my .emacs file.  That's a hodge-podge of various things
|> > I've picked up over the decades so it wouldn't be surprising to find
|> > some incompatibilities.
|> >
|> > Ideas appreciated.
|> >
|> >
|> > On Wed, 11-Apr-2018 at 07:44AM -0400, Ista Zahn wrote:
|> >
|> > |> I can't reproduce it with the latest ESS from melpa. Can you give
|> > |> reproduction steps starting with
|> > |>
|> > |> emacs -q
|> > |>
|> > |> ?
|> > |>
|> > |> --Ista
|> > |>
|> > |> On Wed, Apr 11, 2018 at 4:58 AM, Patrick Connolly
|> > |> <p_conno...@slingshot.co.nz> wrote:
|> > |> > For a long time I used to be able to use
|> > |> >
|> > |> > ess-dump-object-into-edit-buffer
|> > |> >
|> > |> > to create a buffer that could be used to edit the designated function
|> > |> > from anywhere on the search path to make a local version.
|> > |> >
|> > |> > Starting at about ess-15.x, only the first 5 or so lines of code is
|> > |> > made available which I took to be a bug that would be fixed.  However,
|> > |&

Re: [ESS] ess-dump-object-into-edit-buffer

2018-04-12 Thread Patrick Connolly
Thanks for the response, however, if I start Emacs with a '-q' none of
my ~/.emacs file is read, so Emacs doesn't know how to start R.  More
to the point, I'm unable to run R within Emacs any other way.

I gather there is a way of applying individual lines of the .emacs
files but a bear with a small brain doesn't know how to do that (or
where to look in the manual how to do it),

It would appear, if it doesn't reproduce, that the problem is
somewhere in my .emacs file.  That's a hodge-podge of various things
I've picked up over the decades so it wouldn't be surprising to find
some incompatibilities.

Ideas appreciated.


On Wed, 11-Apr-2018 at 07:44AM -0400, Ista Zahn wrote:

|> I can't reproduce it with the latest ESS from melpa. Can you give
|> reproduction steps starting with
|> 
|> emacs -q
|> 
|> ?
|> 
|> --Ista
|> 
|> On Wed, Apr 11, 2018 at 4:58 AM, Patrick Connolly
|> <p_conno...@slingshot.co.nz> wrote:
|> > For a long time I used to be able to use
|> >
|> > ess-dump-object-into-edit-buffer
|> >
|> > to create a buffer that could be used to edit the designated function
|> > from anywhere on the search path to make a local version.
|> >
|> > Starting at about ess-15.x, only the first 5 or so lines of code is
|> > made available which I took to be a bug that would be fixed.  However,
|> > I was mistaken.  I installed ess-17.11 and it's still the same.  Being
|> > a bear with only a small brain, I can't imagine what use that would be
|> > if it's what is intended.
|> >
|> > Could it be that there is an additional setting that allows all of the
|> > function (including comments) to be dumped into that buffer?  Perhaps,
|> > more difficult to track down, I have something else in my ~/.emacs
|> > file that is incompatible.
|> >
|> > TIA for suggestions.
|> >
|> > --
|> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
|> >___Patrick Connolly
|> >  {~._.~}   Great minds discuss ideas
|> >  _( Y )_ Average minds discuss events
|> > (:_~*~_:)  Small minds discuss people
|> >  (_)-(_)  . Eleanor Roosevelt
|> >
|> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
|> >
|> > ______
|> > ESS-help@r-project.org mailing list
|> > https://stat.ethz.ch/mailman/listinfo/ess-help

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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