all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* help-echo in Custom
@ 2003-08-14 16:46 Luc Teirlinck
  2003-08-14 17:25 ` Luc Teirlinck
  2003-08-15 11:52 ` Per Abrahamsen
  0 siblings, 2 replies; 11+ messages in thread
From: Luc Teirlinck @ 2003-08-14 16:46 UTC (permalink / raw)
  Cc: Per Abrahamsen

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: help-echo in Custom
@ 2003-08-14 16:56 Luc Teirlinck
  0 siblings, 0 replies; 11+ messages in thread
From: Luc Teirlinck @ 2003-08-14 16:56 UTC (permalink / raw)
  Cc: abraham, emacs-devel

>From my previous message:

   Custom apparently goes to quite some length to do this conversion: it
   actually uses `widget-mouse-help' as a place-holder 'echo-help
   property

I meant `help-echo' property, of course.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-08-17  5:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-14 16:46 help-echo in Custom Luc Teirlinck
2003-08-14 17:25 ` 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

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.