help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ElDoc Tooltips


From: Kevin Rodgers
Subject: Re: ElDoc Tooltips
Date: Tue, 09 Feb 2010 23:55:27 -0700
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Nordlöw wrote:
Has anybody provided a tweak to ElDoc to make it display its prototype
hint using a tooltip near (usually under) the cursor instead of a
minibuffer-message?

Here's a start.  Its main deficiency is that it only works in unmodified
buffers, so it would be helpful if someone could show how to adapt it so
that the help-echo property were set via font lock.

(defun eldoc-tooltips ()
"Put the `help-echo' text property on symbols with `eldoc-get-fnsym-args-string'."
  (let ((buffer-modified-p (buffer-modified-p)))
    (save-excursion
      (goto-char (point-min))
      (let (symbol help-echo)
        (while (re-search-forward "[(']" nil t)
          (when (and (setq symbol (eldoc-current-symbol))
                     (setq help-echo (eldoc-get-fnsym-args-string symbol)))
            (put-text-property (1- (point))
                               (save-excursion (forward-sexp 1) (point))
                               'help-echo
                               help-echo)))))
    (restore-buffer-modified-p buffer-modified-p)))

(add-hook 'emacs-lisp-mode-hook 'eldoc-tooltips)

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]