[ESS] Easy argument list: r-autoyas

ottorino ottorino-luca.pantani at unifi.it
Thu Mar 10 18:34:59 CET 2011


Il giorno gio, 10/03/2011 alle 06.37 +0100, Sven Hartenstein ha scritto:
> I'd love to receive your honest feedback!

It looks like what I've been dreaming for years !!!
But unfortunately seems not to work on my system.

I followed the directions you kindly give on your site, and installed
the whole stuff where requested (not for the "bundle" but for the
complete YASnippets)

On opening emacs I can get the YASnippets menu, but I cannot when an .R
file is displayed on the buffer.
The combination ctrl-esc-tab seems inactive.


As far as I can understand the problems is in my .emacs
which is derived from the one of Vincent Goulet
(http://vgoulet.act.ulaval.ca/emacs/mac/) 

At time of writing the file site.start.el seems not to be downloadable


I've added the following lines to my .emacs 

(add-hook 'ess-mode-hook
          '(lambda ()
             (load "/home/ottorino/.emacs.d/plugins/r-autoyas.el")
             (local-set-key (kbd "C-M-<tab>") 'r-autoyas-expand)
             (local-set-key (kbd "C-M-g")
'r-autoyas-exit-snippet-delete-remaining)))

but the rest of the modified ESS keybinding in my .emacs looks like


(defun my-ess-tilde-hook ()
    (local-set-key "~" (lambda () (interactive) (insert " ~ "))))
(add-hook 'ess-mode-hook 'my-ess-tilde-hook)
(add-hook 'inferior-ess-mode-hook 'my-ess-tilde-hook)


Should I put something different in my .emacs ?

###################### a part of my .emacs 
(require 'ess-site)
(setq ess-ask-for-ess-directory nil) ; do not prompt for directory (nil)
(setq ess-help-own-frame 'one) ; open another emacs frame for help

;; from http://www.svenhartenstein.de/Software/R-autoyas#toc3
(add-hook 'ess-mode-hook
          '(lambda ()
             (load "/home/ottorino/.emacs.d/plugins/r-autoyas.el")
             (local-set-key (kbd "C-M-<tab>") 'r-autoyas-expand)
             (local-set-key (kbd "C-M-g")
'r-autoyas-exit-snippet-delete-remaining)))

(defun my-ess-tilde-hook ()
    (local-set-key "~" (lambda () (interactive) (insert " ~ "))))
(add-hook 'ess-mode-hook 'my-ess-tilde-hook)
(add-hook 'inferior-ess-mode-hook 'my-ess-tilde-hook)

 (defun Rnw-mode ()
  (require 'ess-noweb)
  (noweb-mode)
  (if (fboundp 'R-mode)
      (setq noweb-default-code-mode 'R-mode)))

  (add-hook 'ess-mode-hook 'my-ess-options)
  (add-hook 'inferior-ess-mode-hook 'my-iess-keybindings)

 (defun my-ess-options ()
   (ess-set-style 'C++)
   (column-number-mode t)
   (add-hook 'local-write-file-hooks
	     (lambda ()
	       (nuke-trailing-whitespace)))
   (define-key ess-mode-map [(meta backspace)] 'backward-kill-word)
   (define-key ess-mode-map [(control ?c) (?;)] 'comment-region)
   (define-key ess-mode-map [(control ?c) (?:)] 'uncomment-region)
 )

 (defun my-iess-keybindings ()
   (define-key inferior-ess-mode-map [(control ?a)] 'comint-bol)
   (define-key inferior-ess-mode-map [home] 'comint-bol))


-- 
Ottorino-Luca Pantani, Università di Firenze
Dip.to di Scienze delle Produzioni Vegetali,
del Suolo e dell'Ambiente Forestale (DiPSA)
P.zle Cascine 28 50144 Firenze Italia
Ubuntu 10.04 -- GNOME 2.30.2
GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version
2.18.0)
ESS version 5.13 -- R 2.12.2



More information about the ESS-help mailing list