From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: ElDoc Tooltips Date: Tue, 09 Feb 2010 23:55:27 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1265785000 11925 80.91.229.12 (10 Feb 2010 06:56:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Feb 2010 06:56:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 10 07:56:32 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nf6Ux-0005wa-MK for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Feb 2010 07:56:31 +0100 Original-Received: from localhost ([127.0.0.1]:59987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nf6Ux-0003wu-9E for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Feb 2010 01:56:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nf6UL-0003vq-9r for help-gnu-emacs@gnu.org; Wed, 10 Feb 2010 01:55:53 -0500 Original-Received: from [199.232.76.173] (port=53479 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nf6UK-0003vF-BG for help-gnu-emacs@gnu.org; Wed, 10 Feb 2010 01:55:52 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nf6UI-0007PC-FM for help-gnu-emacs@gnu.org; Wed, 10 Feb 2010 01:55:52 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:36791) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nf6UI-0007P0-4t for help-gnu-emacs@gnu.org; Wed, 10 Feb 2010 01:55:50 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Nf6UF-0005eF-DU for help-gnu-emacs@gnu.org; Wed, 10 Feb 2010 07:55:47 +0100 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Feb 2010 07:55:47 +0100 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Feb 2010 07:55:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71776 Archived-At: 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