[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] widget :help-echo property different between XEmacs & Emacs

From: William M. Perry
Subject: [BUG] widget :help-echo property different between XEmacs & Emacs
Date: Sun, 12 Nov 2000 18:07:53 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.90

If the :help-echo property for widgets was a function in Emacs 20, it would
be called with the widget as the first argument (I cannot remember what the
rest were, I always ignored them).

In emacs 21, the :help-echo property is passed unaltered as the 'help-echo'
property of the overlay used for the widget display properties.  But when
the 'help-echo' property is a function, emacs calls it with the window,
object, and position.

This is incompatible with both the old way of doing things and XEmacs, and
made me put the following patch into Emacs/W3.  Ugh.

*** w3-display.el.~1.23.~       Mon Jul 10 09:43:33 2000
--- w3-display.el       Sun Nov 12 17:47:47 2000
*** 557,562 ****
--- 557,568 ----
        (and extent (extent-buffer extent)))))
  (defun w3-widget-echo (widget &rest ignore)
+   (if (windowp widget)
+       ;; FSF emacs does some weird stuff here...
+       ;; args are window object pos
+       (save-excursion
+       (set-buffer (window-buffer widget))
+       (setq widget (widget-at (cadr ignore)))))
      (set-buffer (or (w3-widget-buffer widget) (current-buffer)))
      (let* ((url (widget-get widget :href))

Any chance we could get a wrapper put in wid-edit.el (widget-specify-field
to be exact) to use a generic help-echo function that uses the old
behaviour in the case the :help-echo property is not a simple string?

I notice a comment in wid-edit.el that this is considered a 'feature',

                 ;; Kluge: help-echo originally could be a function of
                 ;; one arg -- the widget.  It is more useful in Emacs
                 ;; 21 to have it as a function usable also as a
                 ;; help-echo property, when it can sort out its own
                 ;; widget if necessary.  Try both calling sequences
                 ;; (rather than messing around to get the function's
                 ;; arity).

There should at least be mention of this in NEWS or the documentation for
the widget library.

-Bill P.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]