ESS+Emacs+R: placing R views, and opening help files?

433 Views Asked by At

This is two questions in one:

  • What is the best way of ordering windows in Emacs - and have them enabled as such in .emacs so that the R console and editor are on the right, and R Dired help and R View on the left? Some thing like
    *-----------*---------*
    | R console | R view  |
    *-----------*---------*
    | editor    | R Dired |
    *-----------*---------*

Or the editor on top and console on the bottom ... but I like my working environment on the left, and explorations/help on the right. Currently I have R Dired opening on the right, but viewing a dataframe opens up in the window of the R console.

  • How can I have a help file open up within emacs? I want help to open up in a window on the right, but at the moment help files open up in a browser window. I have set
(setq browse-url-browser-function 'eww-browse-url)

in my .emacs, but it doesn't seem to make any difference.

Note that I'm using Windows 10 here, with GNU Emacs 26.3 (build 1, x86_64-w64-mingw32). However, I would have thought that most emacs command should be system-agnostic.

I have also based my configuration file on the very detailed example given here.

I am not new to Emacs; relatively new to R, and completely new to ESS!

Thanks, Alasdair

1

There are 1 best solutions below

0
Jose On

To configure the window you can set the variable "display-buffer-alist" in your emacs configuration file. Take a look to this example and adapt it to your needs:

;; An example of window configuration:
(setq display-buffer-alist
      '(("*R Dired"
     (display-buffer-reuse-window display-buffer-at-bottom)
     (window-width . 0.5)
     (window-height . 0.25)
     (reusable-frames . nil))
    ("*R"
     (display-buffer-reuse-window display-buffer-in-side-window)
     (side . right)
     (slot . -1)
     (window-width . 0.5)
     (reusable-frames . nil))
    ("*Help"
     (display-buffer-reuse-window display-buffer-in-side-window)
     (side . right)
     (slot . 1)
     (window-width . 0.5)
     (reusable-frames . nil))))

This code is from: https://github.com/ess-intro/presentation-ess-customization/blob/main/tutorial/ess-init.el