1

I am using ESS for using R. When I use help in ESS, I have the screenshot like Picture 1. But, I want to get Picture 2. How do I manage my init.el? The following code is my init related to ESS.

Picture1

Picture2

(use-package ess
  :ensure t
  :init (require 'ess-site)
  :config
  (setq inferior-R-program-name "/usr/local/bin/R")
  (setq ess-ask-for-ess-directory nil)
  (defun forbid-vertical-split ()
  (setq-local split-height-threshold nil)
  (setq-local split-width-threshold 0))
  (add-hook 'ess-mode-hook
          'forbid-vertical-split))
2
  • Just to be sure to understand correctly: what you want is that the help buffer totally hides the R console, and occupies the whole right side of the screen? (I.e., you really don't want the help buffer to be displayed on the bottom-right corner just below the R console, as it is often the case?)
    – Philopolis
    Aug 21 at 5:26
  • I usually do tasks of R codes on the left side screen and console on the right side screen. When I hit help, the help window pops up on the right screen of the right-side screen. (like Picture 2). I want to avoid this because my right-side screen becomes narrow. It is OK to be displayed on the bottom-right corner, but if possible, I want to display it on the whole left-side screen. And when I hit q, I want to move back to the console screen.
    – hrkshr
    Aug 21 at 13:16
1

Your function forbid-vertical-split sets some rather extreme settings for window splitting. If I remove this, I get the behaviour you want: calling help from R puts the help buffer in one of the existing windows, and doesn't create the funny split in your first figure.

You may need to tweak your settings to get this working exactly how you want it. Just removing the (setq-local split-width-threshold 0) appears to fix the problem for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.