all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: ElDoc Tooltips
Date: Tue, 09 Feb 2010 23:55:27 -0700	[thread overview]
Message-ID: <hktl8o$bf9$1@ger.gmane.org> (raw)
In-Reply-To: <ffcf6be8-97d7-47e5-98dd-1ef35ad05cd5@l19g2000yqb.googlegroups.com>

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





      parent reply	other threads:[~2010-02-10  6:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09 11:53 ElDoc Tooltips Nordlöw
2010-02-09 14:02 ` Richard Riley
2010-02-10  6:55 ` Kevin Rodgers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hktl8o$bf9$1@ger.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.