[ESS] completion in R files

Vitalie Spinu spinuvit at gmail.com
Fri Mar 22 11:27:06 CET 2013


Hi, 

It is not clear what you mean by "not working". Many times everything is
working but not in the "standard" way that users expect. Can you
elaborate on all 3 points below and tell us what you do, and what you
expect.

My bet is that the issue is the TAB key. TAB key does *not* complete by
default. It is emacs' convention that M-TAB (aka C-M-i) completes at
point. TAB is for indentation.

ESS has a flexible support for TAB completion in script buffers. See
ess-tab-complete-in-script and ess-first-tab-never-complete for how to
activate the completion and configure TAB behavior to your needs.

We actually had it activated for a short while, but quickly reverted to
current behavior because it turned to be somewhat aggressive for many
people's taste.

Se also auto-complete integration: http://www.emacswiki.org/emacs/ESSAuto-complete

    HTH, 
    Vitalie

PS: Andreas feel free to follow this to OP on R mailing list.

  >> Rainer M Krug <r.m.krug at gmail.com>
  >> on Fri, 22 Mar 2013 10:41:53 +0100 wrote:

  > On 22/03/13 10:16, Andreas Leha wrote:
  >> Hi all,
  >> 
  >> the possibility to get completion in R files seems not be unknown to many people in the R
  >> community.
  >> 
  >> Maybe someone more knowledgeable than me should respond to this thread 
  >> (http://permalink.gmane.org/gmane.comp.lang.r.devel/33103) on the R-devel mailing list and
  >> explain since when completion in R buffers is available and how to activate it.

  > I would like to piggyback on this question:

  > 1) Is there a way of getting completion with function names and

  > 2) path completion is not working for me in my setup - might it be an interaction with org / ido
  > completion?

  > 3) actually, object completion is also not working...

  > The inferior R process is running, and I get tooltips in the minibuffer.

  > Below please find the ESS section of my emacs.org file

  > Any suggestions welcome,

  > Rainer

  > * ESS
  > ** Load ess
  > #+begin_src emacs-lisp
  >   (add-to-list 'load-path "~/.emacs.d/ess/lisp")
  >   ;; (load "~/.emacs.d/ess/lisp/ess-site")
  >   (require 'ess-site)
  > #+end_src

  > ** ESS help
  > *** kill "bogus" help buffers
  > #+begin_src emacs-lisp
  >   (setq ess-help-kill-bogus-buffers t)
  > #+end_src

  > *** all help in one window and in own frame
  > #+begin_src emacs-lisp
  >   (setq ess-help-own-frame 'one)
  > #+end_src

  > ** activate tracebug
  > #+BEGIN_SRC emacs-lisp
  >   (setq ess-tracebug-prefix "\M-t")
  >   (setq ess-use-tracebug t)
  > #+END_SRC

  > ** Further customisations
  > #+begin_src emacs-lisp
  >   (setq inferior-R-args "--vanilla")
  >   (setq ess-eval-visibly-p nil)
  >   (setq inferior-ess-same-window t)
  >   (setq inferior-ess-client-command "Initial")
  >   (setq inferior-ess-own-frame nil)
  >   (setq ess-ask-for-ess-directory "TRUE")
  > #+end_src
  > ** hideshow
  > hideshow-org (http://github.com/secelis/hideshow-org/tree/master)#+begin_src emacs-lisp
  >   ;;(require 'hideshow)
  >   (require 'hideshow-org)
  >   (add-to-list 'hs-special-modes-alist
  >                '(ess-mode "{" "}" "/[*/]" nil
  >                           hs-c-like-adjust-block-beginning))
  >   (global-set-key "\C-ch" 'hs-org/minor-mode) ;; toggles hideshow-org
  >   (add-hook 'ess-mode-hook 'hs-org/minor-mode) ;; starts for ESS files
  >   ;; (add-hook 'ess-mode-hook '(lambda () (hs-org/minor-mode 1)))
  > #+end_src

  > ** Additional syntax highlighting
  > #+begin_src emacs-lisp
  >   (add-hook 'ess-mode-hook
  >             '(lambda()
  >                (font-lock-add-keywords nil
  >                                        '(

  > ("\\<\\(FIXME\\|TODO\\|COMMENT\\|DONE\\|CHANGES\\|FIXED\\)\\>" 1 font-lock-warning-face prepend) ;
  > highlight certain keywords

  > ("\\<\\(if\\|for\\|function\\|return\\)\\>[\n[:blank:]]*(" 1 font-lock-keyword-face) ; must go
  > first to override highlighting below
  >                                          ("\\<\\([.A-Za-z][._A-Za-z0-9]*\\)[\n[:blank:]]*(" 1
  > font-lock-function-name-face) ; highlight function names

  > ("\\([(,]\\|[\n[:blank:]]*\\)\\([.A-Za-z][._A-Za-z0-9]*\\)[\n[:blank:]]*=[^=]" 2
  > font-lock-reference-face) ; highlight argument names
  >                                          ))
  >                ))
  > #+end_src

  >> 
  >> Regards, Andreas
  >> 
  >> ______________________________________________ ESS-help at r-project.org mailing list 
  >> https://stat.ethz.ch/mailman/listinfo/ess-help>



More information about the ESS-help mailing list