[ESS] file completion R script buffer not auto completing
Vitalie Spinu
@p|nuv|t @end|ng |rom gm@||@com
Sat Dec 17 12:13:26 CET 2016
Indeed, you should install company mode through emacs package manager
http://company-mode.github.io/
Company provides files completion everywhere. ESS automatically inserts its
backends for function arguments and R objects within ESS modes. Should work out
of the box.
Vitalie
>> On Fri, Dec 16 2016 11:56, Ista Zahn wrote:
> On Fri, Dec 16, 2016 at 9:02 AM, Stephen Sefick <ssefick using auburn.edu> wrote:
>> Thank you both for the useful comments. I will try setting C-c TAB
>> in .emacs, and it is useful to know about a file needing a ., /, etc.
> Just to clarify, I was describing the behavior of company completions
> in a R script buffer. The comint-dynamic-complete stuff is totally
> different and probably doesn't work the same way.
> --Ista
> I
>> use ESS instead of R Studio now, and I like it very much. I appreciate
>> all of the work that went into this software. Thank you!
>> kindest regards,
>>
>> Stephen
>>
>> On Thu, 2016-12-15 at 13:51 -0500, Ista Zahn wrote:
>>> On Thu, Dec 15, 2016 at 12:32 PM, Martin Maechler
>>> <maechler using stat.math.ethz.ch> wrote:
>>> >>>>>> 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
>>>
>>> I don't know modern emacs well, but I'd like to think I know how to
>>> use it pretty well.
>>>
>>> ESS uses company to complete if available. On my system it works
>>> pretty well for completing file names, though the string must start
>>> with '.', '~', or '/'. That is, if I have a directory named 'data' in
>>> my working directory, 'dat will not complete but './da' will.
>>>
>>> So, as far as I know you just need to install (and load? or does ESS
>>> do that for you?) the company package.
>>>
>>> Best,
>>> Ista
>>>
>>> >
>>> > 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
>>> >
>>> > ______________________________________________
>>> > ESS-help using r-project.org mailing list
>>> > https://stat.ethz.ch/mailman/listinfo/ess-help>
>> ______________________________________________
>> ESS-help using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
> ______________________________________________
> ESS-help using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
More information about the ESS-help
mailing list