unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Richard Riley <rileyrgdev@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: ElDoc Tooltips
Date: Tue, 09 Feb 2010 15:02:52 +0100	[thread overview]
Message-ID: <ei6847-so8.ln1@news.eternal-september.org> (raw)
In-Reply-To: ffcf6be8-97d7-47e5-98dd-1ef35ad05cd5@l19g2000yqb.googlegroups.com

Nordlöw <per.nordlow@gmail.com> writes:

> 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?
>
> /Nordlöw
>

I was hoping for something similar and actually started a little while
ago to look at using company-mode's display for this but got
distracted. One thing I did knock up ages ago when trying to learn elisp
was to make eldoc actually tell me something that helped. This shows the
help for a symbol under the point in a dedicated buffer. If you hide it,
toggle twice to make it reappear. POssibly the "eldoc" advice and the main
context help function could form the basis (when rewritten no doubt ;))
for a "proper" tooltip in an overlay perhaps?

,----
|   (defun rgr/context-buffer()
|     (get-buffer-create "*Help*"))
|   
|   (defun rgr/toggle-context-help()
|     "Turn on or off the context help. Note that if ON and you hide the help buffer then you need to manually reshow it. A double toggle will make it reappear"
|     (interactive)
|     (with-current-buffer (rgr/context-buffer)
|       (unless (local-variable-p 'context-help) (set (make-local-variable 'context-help) t))
|       (if (setq context-help (not context-help))
|           (progn
|             (if (not (get-buffer-window (help-buffer)))
|                 (display-buffer (help-buffer)))))
|       (message "Context help %s" (if context-help "ON" "OFF"))))
|   
|   (global-set-key (kbd "C-c h") 'rgr/toggle-context-help)
| 
|   (defun rgr/context-help()
|     " Display function or variable at point in the *Help* buffer if it is visible. Default behaviour can be turned off by setting the buffer local context-help to false"
|     (interactive)
|     
|     (let((helptext nil)( rgr-symbol (symbol-at-point)))(with-current-buffer (rgr/context-buffer)
|       (unless (local-variable-p 'context-help) (set (make-local-variable 'context-help) t))
|       (if (and context-help (get-buffer-window (help-buffer)) rgr-symbol )
|           (if (fboundp  rgr-symbol) (describe-function rgr-symbol) 
|             (if (boundp  rgr-symbol) (describe-variable rgr-symbol))))))
|         )
|   
|    (defadvice eldoc-print-current-symbol-info
|      (around eldoc-show-c-tag activate)
|      (cond 
|           ((eq major-mode 'emacs-lisp-mode)(rgr/context-help) ad-do-it)
|           ((eq major-mode 'lisp-interaction-mode)(rgr/context-help) ad-do-it)
|           ((eq major-mode 'apropos-mode)(rgr/context-help) ad-do-it)
|           (t ad-do-it)))
|   
|   
`----






  reply	other threads:[~2010-02-09 14:02 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 [this message]
2010-02-10  6:55 ` Kevin Rodgers

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=ei6847-so8.ln1@news.eternal-september.org \
    --to=rileyrgdev@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).