From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: help-echo in Custom Date: Thu, 14 Aug 2003 11:46:56 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200308141646.h7EGku827416@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1060880325 1133 80.91.224.253 (14 Aug 2003 16:58:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2003 16:58:45 +0000 (UTC) Cc: Per Abrahamsen Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Aug 14 18:58:44 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19nLQy-0000a6-00 for ; Thu, 14 Aug 2003 18:58:44 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19nLRb-00084J-00 for ; Thu, 14 Aug 2003 18:59:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19nLPW-0001xb-FU for emacs-devel@quimby.gnus.org; Thu, 14 Aug 2003 12:57:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19nLND-0000R3-Bu for emacs-devel@gnu.org; Thu, 14 Aug 2003 12:54:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19nLLV-0006LI-SO for emacs-devel@gnu.org; Thu, 14 Aug 2003 12:53:37 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.20) id 19nLHW-00047V-Je for emacs-devel@gnu.org; Thu, 14 Aug 2003 12:48:58 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.9/8.12.9) with ESMTP id h7EGmmeQ016688; Thu, 14 Aug 2003 11:48:48 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id h7EGku827416; Thu, 14 Aug 2003 11:46:56 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15948 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15948 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.