changeset 30219:87d8ca1f4b52

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Fri, 14 Jul 2000 14:01:16 +0000
parents 70f3583c5da1
children e4628d420030
files etc/NEWS src/ChangeLog
diffstat 2 files changed, 53 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Fri Jul 14 13:57:22 2000 +0000
+++ b/etc/NEWS	Fri Jul 14 14:01:16 2000 +0000
@@ -1259,8 +1259,8 @@
 * Lisp changes made after edition 2.6 of the Emacs Lisp Manual,
 (Display-related features are described in a page of their own below.)
 
-** The value of the `help-echo' text property is evaluated, if it
-is not a string already, to obtain a help string.
+** The value of the `help-echo' text property is called as a function
+or evaluated, if it is not a string already, to obtain a help string.
 
 ** Function `make-obsolete' now has an optional arg to say when the
 function was declared obsolete.
@@ -2826,13 +2826,20 @@
 `help-echo'.  This feature also applies to strings in the mode line
 that have a `help-echo' property.
 
-If the value of the `help-echo' property is not a string. it is
-evaluated to obtain a help string.
-
-For tool-bar items, their key definition is used to determine the help
-to display.  If their definition contains a property `:help FORM',
-FORM is evaluated to determine the help string.  Otherwise, the
-caption of the tool-bar item is used.
+If the value of the `help-echo' property is a function, that function
+is called with two arguments OBJECT and POSITION.  OBJECT is the 
+buffer or string which had the `help-echo' property.  POSITION is
+the position within OBJECT under the mouse pointer.  The function
+should return a help string or nil for none.
+
+If the value of the `help-echo' property is neither a function nor a
+string, it is evaluated to obtain a help string.
+
+For tool-bar and menu-bar items, their key definition is used to
+determine the help to display.  If their definition contains a
+property `:help FORM', FORM is evaluated to determine the help string.
+For tool-bar items without a help form, the caption of the item is
+used as help string.
 
 The hook `show-help-function' can be set to a function that displays
 help differently.  For example, enabling a tooltip window causes the
--- a/src/ChangeLog	Fri Jul 14 13:57:22 2000 +0000
+++ b/src/ChangeLog	Fri Jul 14 14:01:16 2000 +0000
@@ -10,6 +10,43 @@
 
 2000-07-14  Gerd Moellmann  <gerd@gnu.org>
 
+	* keyboard.c (show_help_echo): Add parameters OBJECT and POS.
+	if HELP is a function, call it with OBJECT and POS as parameters
+	to get the help to display.
+	(gen_help_event, kbd_buffer_store_help_event): New functions.
+	(kbd_buffer_get_event): Construct the Lisp help-event differently.
+	(read_char): Call show_help_echo with new parameters.
+
+	* keyboard.h (gen_help_event, kbd_buffer_store_help_event): 
+	Add prototypes.
+
+	* xterm.c (help_echo_object, help_echo_pos): New variables.
+	(note_mode_line_highlight): Store additional information about the
+	help-echo in help_echo_object and help_echo_pos.  Check both
+	`local-map' and `keymap' properties for changing the cursor
+	(note_mouse_highlight): Store additional information about the
+	help-echo in help_echo_object and help_echo_pos.
+	(note_tool_bar_highlight): Set help_echo_object to nil and
+	help_echo_pos to -1.
+	(XTread_socket): Use gen_help_event instead of filling
+	input_events manually.
+	(syms_of_xterm): Staticpro help_echo_object.
+
+	* xmenu.c (menu_highlight_callback): Use
+	kbd_buffer_store_help_event instead of setting up and input_event
+	structure manually.
+
+	* xdisp.c (eval_form): GCPRO argument sexpr.
+	(call_function): New function.
+	(handle_single_display_prop): Use call_function and FUNCTIONP
+	instead of checking whether if font_height is a symbol and
+	using eval_form.
+
+	* eval.c (internal_condition_case_2): New function.
+
+	* lisp.h (FUNCTIONP): New macro.
+	(internal_condition_case_2, call_function): Add prototypes.
+
 	* xterm.c (construct_mouse_click, x_scroll_bar_to_input_event)
 	(x_scroll_bar_handle_click, SET_SAVED_MENU_EVENT, XTread_socket):
 	Always set `arg' member of input_events.