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

Sparapani, Rodney r@p@r@p@ @end|ng |rom mcw@edu
Fri Sep 19 20:32:45 CEST 2025


Hi Tyler:

Almost!  That code has a stray comment in the last line.  But I�ve tested
this and it works on both macOS and Linux�.


(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 (search-forward-regexp "\\[1\\] ")
(point-max)))
      (message (buffer-substring (point-min) (point-max))))
    (kill-buffer BUF)
    (eww (concat "http://127.0.0.1:" PORT "/doc/html/index.html"))))

N.B. the second to last string might be transformed into a URL rather than text.
So, here I am escaping it by substituting all-CAPS for those who need that...
"HTTP://127.0.0.1:"


--

Rodney Sparapani, Associate Professor of Biostatistics

Director, Wisconsin Chapter of the American Statistical Association

Division of Biostatistics, Data Science Institute

Medical College of Wisconsin, Milwaukee Campus



	[[alternative HTML version deleted]]



More information about the ESS-help mailing list