[ESS-bugs] ess-mode 12.09 [rev. 5167 (2012-09-24)]; R-object-tooltip not working (again)

Vitalie Spinu spinuvit at gmail.com
Sat Sep 29 13:20:02 CEST 2012


Hi, 

The idea is great. I was actually planning to migrate it into ESS12.09,
but have never done that, because we didn't get time for our ESSR
support package. The package is needed to replace the pseudo dispatch
which Eric is now using in ess-R-object-tooltip-alist, with R's generic
mechanism.

The function should also be further extended to allow rotation of
meaningfully information, str, summary, methods arguments, may be even
plots. Also it should work in terminal, and that means to pop an
electric buffer.


---- 
In recent ESS there have been some internal changes and
tooltip-show-at-point was renamed into ess-tooltip-show-at-point. Here
is a modified version which works with 12.09:


(defun ess-R-object-tooltip ()
  "Get info for object at point, and display it in a tooltip."
  (interactive)
  (let ((proc (get-ess-process))
        (objname (current-word))
        (curbuf (current-buffer))
        (tmpbuf (get-buffer-create " *ess-R-object-tooltip*"))
        bs)
    (when objname
      (ess-command (concat "class(" objname ")\n")  tmpbuf nil nil nil proc)
      (with-current-buffer tmpbuf
        (goto-char (point-min))
        (unless (re-search-forward "\(object .* not found\)\|unexpected" nil t)
          (re-search-forward "\"\\(.*\\)\"" nil t)
          (let* ((objcls (match-string 1))
                 (myfun (or (cdr (assoc-string objcls  ess-R-object-tooltip-alist))
                            (cdr (assoc 'other ess-R-object-tooltip-alist)))))
            (ess-command (concat myfun "(" objname ")\n") tmpbuf nil nil nil proc))
          (setq bs (buffer-string)))))
      (when bs
        (ess-tooltip-show-at-point bs 0 30))))

Best, 
Vitalie


  >> Martin Maechler <maechler at stat.math.ethz.ch>
  >> on Sat, 29 Sep 2012 11:52:31 +0200 wrote:

  >>>>>> Stefano Conti <s.conti at gmx.co.uk>
  >>>>>> on Fri, 28 Sep 2012 18:44:07 +0100 writes:

  >> Dear ESS developers team, Since upgrading to the latest
  >> Emacs (latest version 24.2.1) ESS package (version 12.09)
  >> I have been unable to get R (latest version 2.15.1) object
  >> tooltips (u. http://www.emacswiki.org/emacs/ESSToolTips)
  >> working in ESS.

  >> Specifically, upon invoking the ess-R-object-tooltip
  >> command from within Emacs on any R script, I obtain the
  >> "No ESS process is associated with this buffer now"
  >> message from the mini-buffer.  Note that downgrading ESS
  >> to its previous version (12.04-4) restored the
  >> functionality of R object tooltips.

  >> Hope the information above and below is helpful enough; I
  >> am also copying Martin Maechler, whom I have previously
  >> received help on a related issue from, in this
  >> correspondence.

  >> Thank you in advance for any assistance you may provide,
  >> and sincere apologies for any cross-posting.  Kind
  >> regards,

  MM> Caro Stefano,

  MM> as this extra functionality was never adopted in to ESS proper,
  MM> we of course could not pay attention to its continued functioning.

  MM> I think this is quite a nice idea that some, maybe even many people may want,
  MM> and so I consider to add it to ESS proper, and then find out what goes
  MM> wrong (in your case).
  MM> To adopt it into ESS, I'd also want a confirmation by Erik (the
  MM> author, hence in CC) that he'd donate it to ESS as well.  Erik?

  MM> Martin

  MM> _______________________________________________
  MM> ESS-bugs ESS-bugs at r-project.org
  MM> https://stat.ethz.ch/mailman/listinfo/ess-bugs

  MM> _______________________________________________
  MM> ESS-core list: https://stat.ethz.ch/mailman/listinfo/ess-core



More information about the ESS-bugs mailing list