unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* show_help_echo truncates unconditionally
@ 2005-03-29  6:25 Stephan Stahl
  2005-03-29 13:40 ` Stefan Monnier
  2005-03-30  0:03 ` Richard Stallman
  0 siblings, 2 replies; 8+ messages in thread
From: Stephan Stahl @ 2005-03-29  6:25 UTC (permalink / raw)


Hi.

When tooltip-mode is disabled or more general when show-help-funtion
is nil the help messages are shown in the echo area.  During display
message-truncate-display is bound to t.  I suspect this was done to
avoid a "jumping echo area".  This is nice but i would accept this
tradeoff to see the whole help message.

This patch adds a variable show-help-echo-truncate that can be used to
control this behavior.  It is bound to t to be compatible with the
current code.

If needed i could write News or ChangeLog entries too..

Thanks,
Stephan

diff -c "keyboard.c.~1.816.~" "keyboard.c"
*** keyboard.c.~1.816~ Tue Mar 29 07:46:51 2005
--- keyboard.c Tue Mar 29 07:58:00 2005
***************
*** 194,199 ****
--- 194,203 ----

  Lisp_Object Vshow_help_function;

+ /* If non-nil, truncate messages shown with show_help_echo.  */
+
+ Lisp_Object Vshow_help_echo_truncate;
+
  /* If a string, the message displayed before displaying a help-echo
     in the echo area.  */

***************
*** 2323,2329 ****
  	      if (!help_echo_showing_p)
  		Vpre_help_message = current_message ();

! 	      specbind (Qmessage_truncate_lines, Qt);
  	      message3_nolog (help, SBYTES (help),
  			      STRING_MULTIBYTE (help));
  	      unbind_to (count, Qnil);
--- 2327,2333 ----
  	      if (!help_echo_showing_p)
  		Vpre_help_message = current_message ();

! 	      specbind (Qmessage_truncate_lines, Vshow_help_echo_truncate);
  	      message3_nolog (help, SBYTES (help),
  			      STRING_MULTIBYTE (help));
  	      unbind_to (count, Qnil);
***************
*** 11376,11381 ****
--- 11380,11389 ----
  	       doc: /* If non-nil, the function that implements the display of help.
  It's called with one argument, the help string to display.  */);
    Vshow_help_function = Qnil;
+
+   DEFVAR_LISP ("show-help-echo-truncate", &Vshow_help_echo_truncate,
+ 	       doc: /* If non-nil, truncate messages shown with show_help_echo. */);
+   Vshow_help_echo_truncate = Qt;

    DEFVAR_LISP ("disable-point-adjustment", &Vdisable_point_adjustment,
  	       doc: /* If non-nil, suppress point adjustment after executing a command.

Diff finished.  Tue Mar 29 07:58:31 2005
-- 
Stephan Stahl

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

* Re: show_help_echo truncates unconditionally
  2005-03-29  6:25 show_help_echo truncates unconditionally Stephan Stahl
@ 2005-03-29 13:40 ` Stefan Monnier
  2005-03-29 15:44   ` Stephan Stahl
  2005-03-30  0:03 ` Richard Stallman
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2005-03-29 13:40 UTC (permalink / raw)
  Cc: emacs-devel

> When tooltip-mode is disabled or more general when show-help-funtion
> is nil the help messages are shown in the echo area.  During display
> message-truncate-display is bound to t.  I suspect this was done to
> avoid a "jumping echo area".  This is nice but i would accept this
> tradeoff to see the whole help message.

> This patch adds a variable show-help-echo-truncate that can be used to
> control this behavior.  It is bound to t to be compatible with the
> current code.

I'd rather find a way to get the best of both worlds without
a config variable.
E.g. using scrolling in the single-line minibuffer, or by only truncating
for the first few seconds and then expanding the echo area if you stay on
the same help-echo spot long enough.


        Stefan

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

* Re: show_help_echo truncates unconditionally
  2005-03-29 13:40 ` Stefan Monnier
@ 2005-03-29 15:44   ` Stephan Stahl
  0 siblings, 0 replies; 8+ messages in thread
From: Stephan Stahl @ 2005-03-29 15:44 UTC (permalink / raw)
  Cc: emacs-devel

Hi Stefan.

Stefan Monnier said:
> I'd rather find a way to get the best of both worlds without
> a config variable.
> E.g. using scrolling in the single-line minibuffer, or by only truncating
> for the first few seconds and then expanding the echo area if you stay on
> the same help-echo spot long enough.

I like (setq show-help-function nil) because it shows the info
instantaneously.  So waiting a few seconds would reduce this feature just
like tooltips.

Besides is it always possible to know for how long one requests the help
echo?  E.G. Does C-h . use show-help-message?

Stephan
-- 
Stephan Stahl

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

* Re: show_help_echo truncates unconditionally
  2005-03-29  6:25 show_help_echo truncates unconditionally Stephan Stahl
  2005-03-29 13:40 ` Stefan Monnier
@ 2005-03-30  0:03 ` Richard Stallman
  2005-03-30  9:24   ` Stephan Stahl
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2005-03-30  0:03 UTC (permalink / raw)
  Cc: emacs-devel

What job does show_help_echo do?  The comment says

    /* Display help echo in the echo area.

       HELP a string means display that string, HELP nil means clear the
       help echo.  If HELP is a function, call it with OBJECT and POS as
       arguments; the function should return a help string or nil for
       none.  For all other types of HELP evaluate it to obtain a string.

but that is cryptic and incomprehensible.  For instance, it says
"Display help echo"; what is this "help echo" that it is supposed
to display?

Under what sort of circumstances does this function get called?

I can't begin to think about whether this function should be changed
unless I know what job it does.  Anyway, on general purposes it is
essential for the comments to explain that clearly.

    +   DEFVAR_LISP ("show-help-echo-truncate", &Vshow_help_echo_truncate,
    + 	       doc: /* If non-nil, truncate messages shown with show_help_echo. */);
    +   Vshow_help_echo_truncate = Qt;

The doc string is supposed to tell users what this variable does.
This text is not clear, because users don't know what show_help_echo
is.  (And if they tried to read the source to find out, they would be
as puzzled as I am.)

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

* Re: show_help_echo truncates unconditionally
  2005-03-30  0:03 ` Richard Stallman
@ 2005-03-30  9:24   ` Stephan Stahl
  2005-03-31 18:21     ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Stephan Stahl @ 2005-03-30  9:24 UTC (permalink / raw)
  Cc: Stephan Stahl, emacs-devel

Hi Richard.

Richard Stallman said:
> What job does show_help_echo do?  The comment says
[..]
> but that is cryptic and incomprehensible.  For instance, it says
> "Display help echo"; what is this "help echo" that it is supposed
> to display?
>
> Under what sort of circumstances does this function get called?

It is called to display information stored in the help-echo property
of strings.  For example moving the mouse pointer over the mode-line,
menu entries or some buttons, buffer lines in grep-mode.  Normaly
show_help_echo delegates all work to show-help-function.  This
mechanism is used to popup tooltips.  When show-help-function is nil
(like on text only displays or when tooltip-mode is disabled)
show_help_echo does the job itself by displaying those strings in the
echo-area.

Maybe Stefan can add something to my explaination.

Stephan
-- 
Stephan Stahl

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

* Re: show_help_echo truncates unconditionally
  2005-03-30  9:24   ` Stephan Stahl
@ 2005-03-31 18:21     ` Richard Stallman
  2005-04-01  7:39       ` Stephan Stahl
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2005-03-31 18:21 UTC (permalink / raw)
  Cc: stahl, emacs-devel

    It is called to display information stored in the help-echo property
    of strings.  For example moving the mouse pointer over the mode-line,
    menu entries or some buttons, buffer lines in grep-mode.  Normaly
    show_help_echo delegates all work to show-help-function.  This
    mechanism is used to popup tooltips.  When show-help-function is nil
    (like on text only displays or when tooltip-mode is disabled)
    show_help_echo does the job itself by displaying those strings in the
    echo-area.

Could someone please clarify the comment based on this?
The existing comment was not written with a view to making
it clear to people who don't already know.

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

* Re: show_help_echo truncates unconditionally
  2005-03-31 18:21     ` Richard Stallman
@ 2005-04-01  7:39       ` Stephan Stahl
  2005-04-02  4:19         ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Stephan Stahl @ 2005-04-01  7:39 UTC (permalink / raw)
  Cc: emacs-devel

Hi Richard.

Richard Stallman said:
> Could someone please clarify the comment based on this?
> The existing comment was not written with a view to making
> it clear to people who don't already know.

Would this change be clear enough?

diff -c "keyboard.c" "/tmp/buffer-content-86723hP"
*** keyboard.c Fri Apr  1 09:28:54 2005
--- /tmp/buffer-content-86723hP Fri Apr  1 09:29:59 2005
***************
*** 2258,2264 ****
    return c;
  }

! /* Display help echo in the echo area.

     HELP a string means display that string, HELP nil means clear the
     help echo.  If HELP is a function, call it with OBJECT and POS as
--- 2258,2266 ----
    return c;
  }

! /* Display help-echo property under the mouse pointer.  Either show it
!    in the echo area or when non-nil call show-help-function to display
!    it by other means (maybe in tooltips).

     HELP a string means display that string, HELP nil means clear the
     help echo.  If HELP is a function, call it with OBJECT and POS as

Diff finished.  Fri Apr 01 09:30:00 2005

PS: Some lines down this comment it says:
   and POS is the position in the overlay's buffer under the mouse.
Is "under the mouse" correct?  I'm no native english speaker so i'm not
sure..  Just in case it is wrong:

diff -c "keyboard.c" "/tmp/buffer-content-8672eTM"
*** keyboard.c Fri Apr  1 09:28:54 2005
--- /tmp/buffer-content-8672eTM Fri Apr  1 09:36:37 2005
***************
*** 2272,2282 ****
     `help-echo' text property was found.

     If OBJECT is an overlay, that overlay has a `help-echo' property,
!    and POS is the position in the overlay's buffer under the mouse.

     If OBJECT is a string (an overlay string or a string displayed with
     the `display' property).  POS is the position in that string under
!    the mouse.

     OK_TO_OVERWRITE_KEYSTROKE_ECHO non-zero means it's okay if the help
     echo overwrites a keystroke echo currently displayed in the echo
--- 2272,2283 ----
     `help-echo' text property was found.

     If OBJECT is an overlay, that overlay has a `help-echo' property,
!    and POS is the position in the overlay's buffer under the mouse
!    pointer.

     If OBJECT is a string (an overlay string or a string displayed with
     the `display' property).  POS is the position in that string under
!    the mouse pointer.

     OK_TO_OVERWRITE_KEYSTROKE_ECHO non-zero means it's okay if the help
     echo overwrites a keystroke echo currently displayed in the echo

Diff finished.  Fri Apr 01 09:36:37 2005
-- 
Stephan Stahl

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

* Re: show_help_echo truncates unconditionally
  2005-04-01  7:39       ` Stephan Stahl
@ 2005-04-02  4:19         ` Richard Stallman
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2005-04-02  4:19 UTC (permalink / raw)
  Cc: emacs-devel

    ! /* Display help-echo property under the mouse pointer.  Either show it
    !    in the echo area or when non-nil call show-help-function to display
    !    it by other means (maybe in tooltips).

That is clear.  I will install it, assuming that it is correct, and I
hope someone else will fix it if it is wrong.  Thanks.

    PS: Some lines down this comment it says:
       and POS is the position in the overlay's buffer under the mouse.
    Is "under the mouse" correct?

There is no way to misunderstand it, no plausible but wrong other
meaning, so I see no problem.

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

end of thread, other threads:[~2005-04-02  4:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-29  6:25 show_help_echo truncates unconditionally Stephan Stahl
2005-03-29 13:40 ` Stefan Monnier
2005-03-29 15:44   ` Stephan Stahl
2005-03-30  0:03 ` Richard Stallman
2005-03-30  9:24   ` Stephan Stahl
2005-03-31 18:21     ` Richard Stallman
2005-04-01  7:39       ` Stephan Stahl
2005-04-02  4:19         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).