all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: Per Abrahamsen <abraham@dina.kvl.dk>
Subject: help-echo in Custom
Date: Thu, 14 Aug 2003 11:46:56 -0500 (CDT)	[thread overview]
Message-ID: <200308141646.h7EGku827416@raven.dms.auburn.edu> (raw)

The CVS Elisp manual seems to suggest that the syntax for help-echo's
used in :help-echo type keywords in Custom is exactly the same as for
`help-echo' text properties used elsewhere. In Info do: 

(elisp)Type Keywords

There we find:

`:help-echo MOTION-DOC'
     When you move to this item with `widget-forward' or
     `widget-backward', it will display the string MOTION-DOC in the
     echo area.  In addition, MOTION-DOC is used as the mouse
     `help-echo' string and may actually be a function or form
     evaluated to yield a help string as for `help-echo' text
     properties.

First of all, :help-echo type keywords in Custom can not be variables
evaluating to strings.  I guess this one is just a bug and can be
fixed by putting two eval's in the last two lines of
`widget-echo-help':

(defun widget-echo-help (pos)
  "Display help-echo text for widget at POS."
  (let* ((widget (widget-at pos))
   (help-echo (and widget (widget-get widget :help-echo))))
    (if (functionp help-echo)
    (setq help-echo (funcall help-echo widget)))
    (if (stringp (eval help-echo))
    (message "%s" (eval help-echo)))))

There also is a fundamental difference in functional help-echo's.
Such help-echo's written for :help-echo type keywords in Custom have
to take one argument WIDGET.  help-echo's written for text properties
take three arguments.

Custom apparently goes to quite some length to do this conversion: it
actually uses `widget-mouse-help' as a place-holder 'echo-help
property with three arguments and then makes that one call the one
argument function:

(defun widget-mouse-help (window overlay point)
  "Help-echo callback for widgets whose :help-echo is a function."
  (with-current-buffer (overlay-buffer overlay)
    (let* ((widget (widget-at (overlay-start overlay)))
       (help-echo (if widget (widget-get widget :help-echo))))
      (if (functionp help-echo)
        (funcall help-echo widget)
	help-echo))))

Is this intentional (to make all the information in WIDGET available
to the function)?  If so, the documentation in the Elisp manual is not
only incomplete, but misleading.

If this is an unintentional bug, then I could send a test case
illustrating the problem, if desired.

Sincerely,

Luc.

             reply	other threads:[~2003-08-14 16:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-14 16:46 Luc Teirlinck [this message]
2003-08-14 17:25 ` help-echo in Custom Luc Teirlinck
2003-08-14 18:14   ` Luc Teirlinck
2003-08-14 19:00     ` Luc Teirlinck
2003-08-14 19:32       ` Luc Teirlinck
2003-08-14 19:56         ` Luc Teirlinck
2003-08-15 11:52 ` Per Abrahamsen
2003-08-15 14:40   ` Luc Teirlinck
2003-08-17  0:36     ` Richard Stallman
2003-08-17  5:00       ` Luc Teirlinck
  -- strict thread matches above, loose matches on Subject: below --
2003-08-14 16:56 Luc Teirlinck

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=200308141646.h7EGku827416@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=abraham@dina.kvl.dk \
    /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.