[ESS] launch help.start() in EWW browser

Tyler Smith ty|er @end|ng |rom p|@nt@rum@c@
Tue Sep 9 04:04:30 CEST 2025


On Fri, Sep 5, 2025, at 6:17 AM, Naresh Gurbuxani via ESS-help wrote:
> When running R in terminal emacs, what options are needed so that
> help.start() opens EWW browser?

The following elisp code opens the R html docs in EWW, when called via `M-x ess-eww`.

It seems to work fine for me on Ubuntu Linux. If it works generally, I'd be happy to clean it up for inclusion in ESS.

Alternatively, if we accept running Emacs in daemon mode as a pre-requisite (i.e., meaning emacsclient is available), it's probably not too hard to find the proper syntax for the `browser` argument of `help.start()`. I looked at that too, but then this approach presented itself. It has the advantage of not needing the emacsclient server.

Let me know if this looks useful!

- tyler


```
(defun ess-eww ()
  (interactive)
  (let ((BUF (generate-new-buffer "URL"))
        (PORT)) 
    (ess-command "print(tools::startDynamicHelp(NA))" BUF)
    (with-current-buffer BUF
      (setq PORT (buffer-substring 5 (point-max))))
    (kill-buffer BUF)
    (eww (concat "http://127.0.0.1:" PORT "/doc/html/index.html"))))
```



More information about the ESS-help mailing list