Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
2701 views
1
Stephen Eglen's notes on future changes to ESS -*- org -*-
2
3
* Problem with ESS infrastructure and Martin away? Email [email protected]
4
* ess-history-file
5
6
needs documenting and possibly updating:
7
8
From: Stephen Eglen <[email protected]>
9
To: Erik Iverson <[email protected]>
10
Comments: In-reply-to Erik Iverson <[email protected]>
11
message dated "Wed, 20 Apr 2011 09:36:26 -0500."
12
Date: Tue, 26 Apr 2011 09:01:29 +0100
13
Cc: Feng Li <[email protected]>, [email protected]
14
Subject: Re: [ESS] ESS and .Rhistory
15
Sender: [email protected]
16
17
Dear Erik, Feng,
18
19
Thanks for this -- I was blissfully unaware about this persistence of
20
history across R sessions. Howabout if we change the semantics of
21
ess-history-file to be:
22
23
nil -- do not attempt to read/write a history file
24
t -- use the default naming scheme for loading the history
25
"some.string" -- use this value as the filename.
26
27
28
Stephen
29
> Feng,
30
>
31
> On 04/20/2011 09:00 AM, Feng Li wrote:
32
> > Dear list,
33
> >
34
> > I tried to change the ESS default R history to a permanent file so
35
> > that ESS does not generate .Rhistory everywhere. I tried both
36
> >
37
> > (setq ess-history-directory "~/.R/history")
38
> >
39
> > and
40
> >
41
> > (setq ess-history-file "~/.R/history/.Rhistory")
42
>
43
> If I recall correctly, it's because of the way the ess-history-file
44
> variable is set in the ESS code. The following works for me:
45
>
46
> (defun ei-no-rhistory ()
47
> (setq ess-history-file "/dev/null"))
48
>
49
> (add-hook 'inferior-ess-mode-hook 'ei-no-rhistory)
50
51
* completion of functions within buffers
52
53
From: Stephen Eglen <[email protected]>
54
To: [email protected]
55
Date: Tue, 22 Jun 2010 14:00:25 +0100
56
Cc: Stephen Eglen <[email protected]>
57
Subject: [ESS] request for comments: completion within .R buffers
58
Sender: [email protected]
59
60
Rodney recently kindly polled ess-help, and a summary of the results can
61
be seen in the SVN sources at:
62
63
https://svn.r-project.org/ESS/trunk/rsn.txt
64
65
One thing that came up was (thanks Ista Zhan):
66
67
Function/variable completion in script files (maybe this already is
68
supposed to work, but for me completion only works in interactive
69
sessions).
70
71
Below is some suggested code to implement this, based on a hint from
72
Deepayan. If you press TAB at the start of the line, you still get
73
standard indentation, but if you are already typing something, e.g.
74
write.t
75
76
then hitting TAB will complete to write.table
77
78
Hitting TAB again, will then bring up a *Completions* window showing
79
(for me):
80
81
Possible completions are:
82
write.table
83
write.table0
84
85
I don't like the *Completions* window hanging around, but apart from
86
that, is that the sort of completion people would like? Erik Iverson
87
mentioned something related:
88
89
I think ESS is very feature complete at this point. The only thing
90
I've looked at that seems interesting is some sort of 'intellisense'
91
feature that uses R's built-in completion mechanism to temporarily
92
display available completions using something like company-mode,
93
autocomplete, or completion-ui. I had at one point something that
94
almost worked, but I believe the library it was built in,
95
company-mode, has now changed significantly.
96
97
but I've not explored those options.
98
99
Code/ideas welcome!
100
101
Stephen
102
103
----------------------------------------------------------------------
104
105
(defun ess-indent-or-complete (&optional whole-exp)
106
(interactive "P")
107
"Function bound to TAB key in R mode buffers.
108
If at the start of the line, or numeric prefix provided, call
109
`ess-indent-command', otherwise try to complete object at point."
110
(if (or whole-exp
111
(save-excursion
112
(skip-chars-backward " \t")
113
(bolp)))
114
(ess-indent-command whole-exp)
115
(ess-complete-object-name)))
116
117
(add-hook 'ess-mode-hook
118
'(lambda () (local-set-key "\t" 'ess-indent-or-complete)))
119
120
121
* ess-eldoc.el
122
123
** Switch to use R-mode-hook, rather than ess-mode-hook
124
125
** Document in the info node.
126
127
* Debugger
128
129
Would like to implement a debugger akin to Norm Matloff's work:
130
131
http://cran.r-project.org/web/packages/edtdbg/index.html
132
133
http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/
134
135
Norm posted that he had started work on ESS, but had to abandon it.
136
137
138
* Comint so slow? ess-eval-visibly-p should be t again.
139
140
Why is comint so slow when passing code line by line? Markus Triska
141
recently looked at this:
142
143
To: [email protected]
144
connect(): No such file or directory
145
From: Markus Triska <[email protected]>
146
Date: Sun, 16 May 2010 13:59:57 +0200
147
Subject: Re: [ESS] ESS on Mac slower than R.app?
148
Sender: [email protected]
149
150
Hi Rodney,
151
152
Rodney Sparapani <[email protected]> writes:
153
154
> I think if you update to the latest version of ESS this problem will
155
> go away. See the previous discussion of a very similar GNU Emacs bug
156
> fix at https://stat.ethz.ch/pipermail/ess-bugs/2009q4/000584.html
157
158
I think ess-eval-visibly-p should remain true by default, as it is quite
159
useful. If you change the accept-process-output call in
160
ess-eval-linewise to:
161
162
(accept-process-output sprocess 0 timeout-ms)
163
164
(the difference being that you explicitly state to wait for input from
165
"sprocess"), the test case works instantly also with ess-eval-visibly-p.
166
167
All the best,
168
Markus
169
170
* Funny indentation if semicolon follows brace:
171
172
From: Stephen Eglen <[email protected]>
173
To: Paul Burkander <[email protected]>
174
Comments: In-reply-to Paul Burkander <[email protected]>
175
message dated "Sat, 04 Jun 2011 10:17:03 -0400."
176
Date: Mon, 06 Jun 2011 10:35:27 +0100
177
Cc: [email protected]
178
Subject: Re: [ESS] ess-indent-exp follow OWN style?
179
Sender: [email protected]
180
181
> I think it must be ess-electric-brace, and I think it warrants a bug report.
182
>
183
> The behavior is the same in R and Stata (though I don't know if it
184
> would ever come up in R)
185
>
186
> Typing any line (excluding comments) that ends in { sets the
187
> indentation of the next line to ess-indent-level
188
> Typing any line (excluding comments) that ends in {; sets the
189
> indentation of the next line to so that the first character is below
190
> the preceding semicolon.
191
>
192
> I know basically nothing about Lisp, otherwise I'd like to try to
193
> debug this thing.  It seems like an important replicable issue that
194
> warrants a bug report.
195
196
Thanks; I can see this behaviour in R mode. As I don't think its a
197
common idiom in R to write something like
198
199
for (i in seq) {;
200
...
201
202
I'm afraid its not high enough on my priority list to fix right now
203
(sorry, too many other things already need fixing in ESS), but
204
I will make a note of it. Is this biting other users?
205
206
Stephen
207
208
** is ess-electric-brace working okay? should reindent line?
209
210
* Handing the *ESS* buffer
211
212
Is the *ESS* buffer necessary for end users? If not, have a toggle to
213
switch it off.
214
215
From: Stephen Eglen <[email protected]>
216
Date: Mon, 6 Jun 2011 22:12:08 +0100
217
218
> Re: the *ESS* buffer, how much of a pain is it? I recall also
219
> finding it a bit offputting seeing this many years ago, and in all
220
> my years of developing ESS, I for one have yet to find reason of
221
> inspecting it! I imagine other developers may differ -- but one
222
> thing I could suggest to other core members is having a variable
223
> to inhibit this buffer?
224
225
This could be as simple as having a variable ess-dribble-buffer
226
which if nil, means that the buffer is not created, otherwise, the
227
variable contains (as a string) the name of the buffer to use, which
228
defaults to "*ESS*". It could even be " *ESS*" so that it doesn't
229
appear in buffer lists, but is there and will be included into
230
reports generated by ess-submit-bug-report.
231
232
233
* Add ess-r-versions-list
234
235
Subject: Re: [ESS] Customisation of ess-r-versions or ess-r-versions-list
236
From: John Maindonald <[email protected]>
237
Date: Thu, 18 Aug 2011 10:19:44 +1000
238
Cc: [email protected]
239
To: Stephen Eglen <[email protected]>
240
241
On 18/08/2011, at 5:38 AM, Stephen Eglen wrote:
242
243
>> Yes,
244
>> (setq ess-s-versions-list
245
>> '( ("R64" "/usr/bin/R64")
246
>> ("R32" "/usr/bin/R32")))
247
>> works. The buffer for R64 is however called *S+6*. No doubt there is
248
>> some variable that one can set that will fix this; I have not
249
>> investigated.
250
> I don't recall ever doing this for R, but this was quite a few years
251
> ago. Did it ever work for you in earlier versions of ESS?
252
253
The lines that I had commented out had 'ess-r-versions-list'. If this variable
254
has never been available, this would be something that I tried by analogy
255
with 'ess-s-versions-list' and never did work.
256
257
If 'ess-s-versions-list' is to stay, it would seem to be cleanest to have a
258
matching 'ess-r-versions-list' also, following the precedent of
259
'ess-s-versions' and 'ess-r-versions'. An advantage of this way of doing
260
things (an 'ess-r-versions-list'), for some users at least, is that it is explicit
261
about the command line statement that is invoked.
262
263
> One can have defvar in place of setq. Does it matter which one uses?
264
> Better to use setq -- as it will always update the value. By contrast:
265
>
266
> (defvar apple 1)
267
> (defvar apple 2)
268
>
269
> Evaluate both lines above, in order, and check "apple" -- it has the
270
> value 1.
271
>
272
> Stephen
273
274
275
John Maindonald email: [email protected]
276
phone : +61 2 (6125)3473 fax : +61 2(6125)5549
277
Centre for Mathematics & Its Applications, Room 1194,
278
John Dedman Mathematical Sciences Building (Building 27)
279
Australian National University, Canberra ACT 0200.
280
http://www.maths.anu.edu.au/~johnm
281
282
* Toolbar is missing from file.Rt transcript buffers
283
Add toolbar?
284
285