I have two sessions open in Emacs-ESS: one on my desktop and one on a server using tramp. How can I tell ESS which session to use?
Well I use
M-x ess-switch-process
all the time to switch between my (local) R sessions inside Emacs. Sections 3.2 has details.
Edit As a follow-up to aL3xa's comment, I also have these in a my dot.emacs:
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)
; Slightly more debatable
(global-set-key (kbd "C-x C-b") 'ibuffer)
which makes the process switch much nicer. Kudos to CGWalters, another Emacs user from whom I copied this.
Related
I'm very new with Common Lisp and LispWorks so please describe all the steps.
I want to set 80 columns, how can I do?
I'm using LispWorks Personal.
I have found this command, but I don't know how to use it... where have I to write those two commands?
Turn on auto-fill-mode:
(setf fill-column 80)
(add-hook 'latex-mode-hook #'auto-fill-mode)
Thank you.
The best way for you to set the lini width to the canonical 80 columns in Lispworks Personal is the run the command "Auto Fill Mode".
You hit M-x in any buffer and, at the "Extended Command:" prompt you just type "Auto Fill Mode" (autocompletion via Tab works).
In Lispworks Personal edition you cannot use an init file, so it is pointless to try to put any commands in the ~/.lispworks file.
The commands you show in you post, appear to be Emacs ones, in ELisp. They will not function in Lispworks, which uses an Emacs, but different from the GNU based one. As Rainer said, LW does not have a LaTeX mode.
Cheers
MA
I am trying ESS (Emacs Speaks Statistics).
The problem is: Ctrl-P and the up-arrow are disabled on any buffer because of the following error:
Variable binding depth exceeds max-specpdl-size
The trigger is the following line in .emacs.el
(require 'ess-site)
This line is needed to load ESS. If I delete this line, then the problems does not happen, but, obviously, I can't use ESS.
Notes:
"(setq max-lisp-eval-depth 10000)" does not solve the problem.
"(setq max-specpdl-size 32000)" produces a different error:
Lisp nesting exceeds `max-lisp-eval-depth'
When the above two settings are valid, then I get the error for max-lisp-eval-depth.
This problem happens before M-x R RET. For example, it happens on the scratch buffer just after emacs starts.
I have not found any other key with this problem. (So Ctrl-F and down-arrow are working, for example.)
Deleting the ESS buffer does not solve the problem.
The initial message on the ESS buffer is following. (I don't know, whether it is useful.)
[ess-site.el]: ess-customize-alist=nil
[ess-site.el 2]: ess-customize-alist=nil
(S): ess-s-versions-create making M-x defuns for
(R): ess-r-versions-create making M-x defuns for
Environment:
emacs-ess-15.03.1-1.3.noarch
emacs-24.3-17.2.10.x86_64
R-base-3.1.1-2.1.9.x86_64
openSUSE 13.2 (Harlequin) (x86_64)
You could try
(setq max-specpdl-size 32000)
M-x describe-variable max-specpdl-size for some info
I've had this problem with python-mode and rope, never with ESS though.
Solution: change the order of certain settings.
My .emacs.el has settings for smooth-scrolling (A)
(require 'smooth-scrolling)
(setq smooth-scroll-margin 5)
and for the initial file (B)
(find-file "~/init.org")
(A) should be loaded before (B). (B) was loaded before (A) in my previous .emacs.el and this causes the problem. (I do not know the precise reason for the error which I described in my question.)
I understand from the following resources:
http://www.emacswiki.org/emacs/ESSAuto-complete
http://www.emacswiki.org/emacs/AutoComplete
Emacs autocomplete-mode extension for ESS and R
Is it possible to get code completion for R in Emacs ESS similar to what is available in Rstudio?
...that I should have access to tooltips for auto-complete help in emacs when using ESS for R development. The last link additionally specifies that it should work out of the box with the latest ESS, and:
From version 12.03 ESS integrates out of the box with auto-complete
package.
Three sources ‘ac-source-R-args’, ‘ac-source-R-objects’ and
‘ac-source-R’ are included in ESS distribution. The latest combines
previous two and makes them play nicely together.
I know that in general, my emacs tooltips are possible because they appear correctly with my python jedi setup in emacs.
However, my emacs auto-complete does not work. Instead, there is a buffer at the bottom:
instead of this, with the help superimposed on the working buffer:
And I have the following in my init.el:
(require 'auto-complete)
(setq ess-use-auto-complete t)
(ess-toggle-underscore nil)
I have the following versions of:
ess 20131207.1141 installed No description available.
ess-R-data-view 20130509.458 installed Data viewer for GNU R
ess-R-object-popup 20130302.336 installed popup description of R object
auto-complete 20140208.653 installed Auto Completion for GNU Emacs
What am I missing?
UPDATE 1
Here's my init for ESS stuff. This produces completions in a buffer, but not in a tooltip, where some configuration options from the manual have been added. (I have now tried all permutations of commenting and not commenting all of these):
(require 'auto-complete)
(global-auto-complete-mode)
(require 'auto-complete-config)
(ac-config-default)
(require 'ess-site)
(setq ess-use-auto-complete t)
(setq ac-auto-start 2)
(setq ac-auto-show-menu 0.2)
(ess-toggle-underscore nil)
UPDATE 2
Similar question here, but the same solution is suggested which did not actually result in tooltips on my setup. But it suggests to me this might be a platform issue? The poster there was also on Ubuntu 12.04 as I am---is it possible the solutions that worked for VitoshKa, Alex Vorobiev, and Iqbal Ansari were on a different platform? Are you guys using OS X?
UPDATE 3
Maybe other diagnostics:
ac-source-R is a variable defined in `ess-r-d.el'.
Its value is ((prefix . ess-ac-start)
(candidates . ess-ac-candidates)
(document . ess-ac-help))
Documentation:
Combined ad-completion source for R function arguments and R objects
ac-source-R-objects is a variable defined in `ess-r-d.el'.
Its value is ((prefix . ess-symbol-start)
(candidates . ess-ac-objects)
(document . ess-ac-help-object))
Documentation:
Auto-completion source for R objects
ac-source-R-args is a variable defined in `ess-r-d.el'.
Its value is ((prefix . ess-ac-start-args)
(candidates . ess-ac-args)
(document . ess-ac-help-arg))
Documentation:
Auto-completion source for R function arguments
[back]
where the variables for ess-ac[TAB] are only...
Click <mouse-2> on a completion to select it.
In this buffer, type RET to select the completion near point.
Possible completions are:
ess-ac-R-argument-suffix
ess-ac-sources
So maybe the problem is my ESS install is lacking all ess-ac-* things defined above, like ess-ac-args, etc?
My auto-complete configuration also has
(require 'auto-complete-config)
(ac-config-default)
and after that setting ess-use-auto-complete makes ESS show the popup menus.
So as per your comments it turned out that auto-complete was not enabled in your emacs config. So just enable auto-complete by adding something like this in you init file
(load "auto-complete")
(global-auto-complete-mode)
Also for ESS you will need to set ess-use-auto-complete to t something like following would do
(setq ess-use-auto-complete t)
EDIT: ess-use-auto-complete is by default set to t so this step is not really needed.
Also since you found this option confusing I would recommend you to open an issue on the github repo so that the maintainers can improve the documentation (or code) whichever can reduce the confusion.
Auto-complete has a lot of configuration options do read the manual when you get time.
Glad I could help
Don't confuse eldoc with auto-completion. Eldoc is what you have in your screenshot, it shows all arguments of a function without being intrusive. Auto-completion pops up when you start typing stuff and activates after ac-auto-start characters.
I recently upgraded from R 2.15 and an older version of ESS using Vincent Goulet's Windows 7 installer at http://vgoulet.act.ulaval.ca/en/emacs/. This includes ESS version 13.09. I also just installed R version 3.0.2.
My old workflow was to use C-c C-t (the default key binding) to run commands via ess-execute and send results to a temporary buffer. I found this incredibly useful for my workflow and style of R programming.
However with the new version this key binding has been removed. I searched around and could not find any other threads regarding this topic. I looked into ess-mode.el and found this line:
;; (define-key map "\C-c\C-t" 'ess-execute-in-tb)
Which is commented out. I see they have added the nice feature ess-describe-object-at-point but that doesn't allow for executing commands.
I'm not an emacs power-user so I tend to copy pieces of lisp into my .emacs and do minor edits to them. I tried (1) uncommenting the line above and (2) defining a new keybinding in my .emacs file the same place as the new keybindings in ESSShift Enter (http://www.emacswiki.org/emacs/ESSShiftEnter).
(add-hook 'ess-mode-hook
(lambda()
(local-set-key [(shift return)] 'my-ess-eval)
;; added Ctrl-Enter to stay on same line
(local-set-key [C-return] 'ess-eval-line)
;; Newest version of ESS got rid of C-c C-t for ess-execute add back
(local-set-key "\C-c\C-t" 'ess-execute-in-tb))
However, neither one of these methods worked.
My questions are: Is there a reason this keybinding was disabled in the new version? I.e. should I be using some other feature that has replaced it? If not, what is the best way to enable this keybinding again?
ESS keys were remodeled an year or so ago. C-c C-t is now bound to
dev-map which provides a bunch of useful functionality that you might want to
use in the future. So better not disable it. Your code should work. You probably
tried C-c C-t from the*R* buffer, but that one is inferior-ess-mode, not
ess-mode.
You better define your keys in ess-exta-map, this way it will work both in
ess-mode and inferior-ess-mode. Something like this:
(eval-after-load "ess-mode"
'(progn
(define-key ess-extra-map "\C-e" 'ess-execute-in-tb)))
The pain with eval-after-load is necessary because Vincent's distribution loads ess after the user init file has been loaded. If you load your ESS with (load "ess-site") then you can just leave (define-key ...) part in your .emacs.el .
Now C-c C-e C-e should execute your command.
I am adding this exact key to ESS development version. So, in the next version
you can remove the above code. Thanks for popping this up.
By the way C-RET is bound to
ess-eval-region-or-line-and-step. You might consider keeping it like that.
I would like to change the behavior of the home key within an R session run from emacs. When I press the home key, it takes me all the way to the > prompt. I'd like the home key to take me to the start of the command entry (i.e., two points in from the start of the line). I assume that I can make this adjustments via my .emacs file; any guidance for the commands that I would need to add to that file would be appreciated. Thanks!
The behaviour you want is already available as C-a. You can rebind the home key with the following line:
(local-set-key (kbd "<home>") 'comint-bol)
There are a number of ways to get this to happen automatically when you are using the R session. I use something like the following:
;; Define the keybinding you want
(defun my-inferior-ess-mode-hook ()
(local-set-key (kbd "<home>") 'comint-bol))
;; add the key-binding to the hook that gets called whenever you start an R session:
(add-hook 'inferior-ess-mode-hook 'my-inferior-ess-mode-hook)
That's a bit much for a single key-binding, but you can extend the definition of my-inferior-ess-mode-hook to include a number of customizations you'd like to use.