[ESS] ESS language defaults to S

Vitalie S. spinuvit.list at gmail.com
Thu Dec 9 16:02:40 CET 2010




Aleksandar Blagotić <aca.blagotic at gmail.com> writes:
> Hi lads,
>
> I've been using ESS about a year now, and I always found annoying this
> li'l bug in ESS. Whenever I end up with multiple interactive R
> sessions, and I want to switch between them, I type C-c C-k and "S"
> appears by default. So I have to change that each time I stroke the
> keybinding. I tried customising "ess-language" variable, but with no
> luck. @Vitoshka came up with this fix after my rant on SO:
>
> (defun ess-set-language ()
>   (setq-default ess-language "R")
>   (setq ess-language "R")
>   )
>
> (add-hook 'ess-post-run-hook 'ess-set-language t)
>
> But if I apply that, I cannot access M-_ keybinding. Any ideas?

The problem is that "ess-request-a-process" uses ess-language variable
and not "ess-dialect" for initial-input. Here is the patch:

Index: lisp/ess-inf.el
===================================================================
--- lisp/ess-inf.el	(revision 4436)
+++ lisp/ess-inf.el	(working copy)
@@ -642,7 +642,7 @@
 			      'require-match
 			      ;; If in S buffer, don't offer current process
 			      (if (eq major-mode 'inferior-ess-mode)
-				  ess-language
+				  ess-dialect
 				ess-current-process-name
 				;; maybe ess-local-process-name IF exists?
 				)))))



Taking this opportunity, `ess-electric-brace` when skeleton-pair is used does
not indent the braces. Here is a simple patch:

Index: lisp/ess-mode.el
===================================================================
--- lisp/ess-mode.el	(revision 4436)
+++ lisp/ess-mode.el	(working copy)
@@ -748,7 +748,10 @@
   (interactive "P")
 ;; skeleton-pair takes precedence
 (if (and (boundp 'skeleton-pair) skeleton-pair (featurep 'skeleton))
-  (skeleton-pair-insert-maybe "{")
+  (progn
+    (skeleton-pair-insert-maybe "{")
+    (ess-indent-line)
+    )
 ;; else
   (let (insertpos)
     (if (and (not arg)

Best,     
Vitalie.
>
> Best,
> aL3xa
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list