emacs-devel
[Top][All Lists]
Advanced

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

Re: Global bar to display global information


From: Jérémy Compostella
Subject: Re: Global bar to display global information
Date: Thu, 26 Apr 2012 20:12:08 +0200

All,

I would be very thankful too is someone could look at it. It's a very
simple patch that I use for more than 6 months now and provide me a way
to use the echo area as a global information area.

Thanks a lot,

Jérémy


2012/4/24 Stefan Monnier <address@hidden>:
> OK, I found the patch.  To my eyes, it looks fine, but could someone
> more familiar with the redisplay double check that it is doing the
> right thing?
>
>
>        Stefan
>
>
>>>>>> "Jérémy" == Jérémy Compostella <address@hidden> writes:
>
>> 2011/8/22 Stefan Monnier <address@hidden>
>>> > Yet, the displayed information is not completely stable. What I mean is
>>> > that if I move the cursor in another buffer, the echo area is sometimes
>>> > cleared. It's a little bit annoying. How could I fix this without
>>> > advising several cursor displacement function ?
>>>
>>> I don't know enough about this code to be able to answer.  You're going
>>> to have to investigate which code does this "clearing" and what calls
>>> it, to then be able to figure out what's the best way to address the
>>> problem (we can change the C code for that in 24.2 if needed).
>>>
>>>
>> Hi,
>
>> I finally get time to work again on this global information area. I
>> think the use of " *Minibuf-0*" proposal is really interesting since the
>> echo area is most of the time useless and the global information are not
>> really useful when I'm using the minibuffer. So I tried to figure out
>> why it didn't work the way you said.
>
>> The problem is, considering I had put data in the " *Minibuf-0*", these
>> data are not displayed in the echo area. However, the " *Minibuf-0*" is
>> displayed each time I do a switch-to-buffer call. But once I type, the
>> echo area is cleared.
>
>> First, each time I type, the clear_message(1, 0) is called even when the
>> echo area is already cleared. This call looks useless and is part of the
>> cause of the behavior described above.
>
>> Second, when the echo area is clearing it does not redisplay the
>> miniwindow. So the " *Minibuf-0*" is not displayed as expected.
>
>> I tested this patch with emacs -Q, emacs -Q -nw and with my whole
>> configuration. Everything works perfectly fine and as
>> expected. Moreover, I verified that this patch does not generate extras
>> miniwindow redisplay.
>
>> Please merge it or review it,
>
>> Best regards,
>
>> Jérémy
>
>> --
>> One Emacs to rule them all
>> From 7fb88fc4dbca5cfc1f93494f5fb24efeea796842 Mon Sep 17 00:00:00 2001
>> From: Jeremy Compostella <address@hidden>
>> Date: Fri, 30 Dec 2011 14:01:13 +0100
>> Subject: [PATCH] echo-area: Remove unnecessary clearing and get default 
>> minibuffer displayed
>
>> Each time we push a keyboard key the clear_message(1, 0) is called
>> even if the echo-area is already cleared.
>
>> When the echo area is cleared, the default minibuffer should be
>> displayed instead of an empty message.
>
>> With this patch, it is possible to display information in the echo
>> area using the default minibuffer when the echo area is cleared and
>> the minibuffer is inactive.
>
>> Signed-off-by: Jeremy Compostella <address@hidden>
>> ---
>>  src/keyboard.c |    5 +++--
>>  src/xdisp.c    |   13 ++++++++++++-
>>  2 files changed, 15 insertions(+), 3 deletions(-)
>
>> diff --git a/src/keyboard.c b/src/keyboard.c
>> index 2df1ba7..771ee98 100644
>> --- a/src/keyboard.c
>> +++ b/src/keyboard.c
>> @@ -2982,9 +2982,10 @@ read_char (int commandflag, ptrdiff_t nmaps, 
>> Lisp_Object *maps,
>>        || (!(EQ (Qhelp_echo, XCAR (c)))
>>         && !(EQ (Qswitch_frame, XCAR (c)))))
>>      {
>> -      if (!NILP (echo_area_buffer[0]))
>> +      if (!NILP (echo_area_buffer[0])) {
>>       safe_run_hooks (Qecho_area_clear_hook);
>> -      clear_message (1, 0);
>> +     clear_message (1, 0);
>> +      }
>>      }
>
>>   reread_for_input_method:
>> diff --git a/src/xdisp.c b/src/xdisp.c
>> index 90375ba..77cd80c 100644
>> --- a/src/xdisp.c
>> +++ b/src/xdisp.c
>> @@ -12666,6 +12666,9 @@ redisplay_internal (void)
>>       frames.  Zero means, only selected_window is considered.  */
>>    int consider_all_windows_p;
>
>> +  /* Non-zero means redisplay has to redisplay the miniwindow */
>> +  int update_miniwindow_p = 0;
>> +
>>    TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p));
>
>>    /* No redisplay if running in batch mode or frame is not yet fully
>> @@ -12852,6 +12855,10 @@ redisplay_internal (void)
>>         && !MINI_WINDOW_P (XWINDOW (selected_window))))
>>      {
>>        int window_height_changed_p = echo_area_display (0);
>> +
>> +      if (message_cleared_p)
>> +     update_miniwindow_p = 1;
>> +
>>        must_finish = 1;
>
>>        /* If we don't display the current message, don't clear the
>> @@ -13227,7 +13234,7 @@ redisplay_internal (void)
>>      }
>>    else if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf))
>>      {
>> -      Lisp_Object mini_window;
>> +      Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
>>        struct frame *mini_frame;
>
>>        displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer);
>> @@ -13236,6 +13243,10 @@ redisplay_internal (void)
>>        internal_condition_case_1 (redisplay_window_1, selected_window,
>>                                list_of_error,
>>                                redisplay_window_error);
>> +      if (update_miniwindow_p)
>> +     internal_condition_case_1 (redisplay_window_1, mini_window,
>> +                                list_of_error,
>> +                                redisplay_window_error);
>
>>        /* Compare desired and current matrices, perform output.  */
>
>> --
>> 1.7.2.5
>
>



-- 
« Si debugger, c'est supprimer des bugs, alors programmer ne peut être
que les ajouter » - Edsger Dijkstra



reply via email to

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