[ESS] file completion R script buffer not auto completing
Martin Maechler
m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Thu Dec 15 18:32:19 CET 2016
>>>>> Stephen Sefick <ssefick using auburn.edu>
>>>>> on Wed, 14 Dec 2016 11:45:49 -0600 writes:
> Hello:
> Long time R user; new ESS user. Thank you all so much for this wonderful
> IDE. I am having problems with the ESS and the R script buffer.
> I would like to be able to use an autocomplete file name/path like in R
> studio. I am sure that I am missing something in my .emacs file. Please
> let me know what things would be helpful to post in order to diagnose my
> problem.
Completion (not just on file names) is "of course" a very very
old topic in emacs and hence also ESS.
I'm interested to hear what others say... notably those who know
modern (>= 24.x or even >= 25.x) emacs well
The filename vs / and object name (of R objects in this case)
completion becomes relevant here and ideally ESS would know
which kind of completion is desired here.
In the very remote past I had decided to distinguish between
filename completion and object name completion --- which is
nicely built into ESS and typically activated just by [Tab].
For this reason, I've been using (in my ~/.emacs or rather
'default.el' equivalent) for many years
;;=== Define C-c-Tab (Alt-Tab = Meta-Tab is *taken* by "GUI")
;;=== for File Name Completion ===
(autoload 'comint-dynamic-complete "comint" nil t)
(autoload 'comint-dynamic-complete-filename "comint" nil t)
(define-key global-map [?\C-c tab] 'comint-dynamic-complete-filename)
(if xemacs-p
(progn
;; The following WORKS in xemacs, but gives an ERROR when default.el
;; is only LOADED in GNU emacs (20.2):
;; BUG (define-key global-map "\C-\M-\t" 'comint-dynamic-complete)
)
;; else
(define-key global-map [C-M-tab] 'comint-dynamic-complete)
)
BTW: I have no idea what Rstudio is doing (and how they do it).
As "they" learnt so much from ESS initially (which was
acknowledged orally at the time), maybe we could learn from
Rstudio on this issue now...
or see how other interpreted languagues such as emacs lisp or
bash or ?? deal with this.
> I appreciate the help.
Maybe try the above and then use C-c [Tab]
which is stored in my fingers in the mean time..
Martin
> kindest regards,
> Stephen
More information about the ESS-help
mailing list