unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* help needed with gnus mode-line
@ 2011-06-30 11:52 Thierry Volpiatto
  0 siblings, 0 replies; 13+ messages in thread
From: Thierry Volpiatto @ 2011-06-30 11:52 UTC (permalink / raw)
  To: emacs-devel

Hi all,
i would like to display temporarily information in mode-line while i am
in gnus.
In all emacs, something like this work fine:

--8<---------------cut here---------------start------------->8---
(let ((mode-line-format (concat " " str)))
  (force-mode-line-update)
  (sit-for 12))
(force-mode-line-update))
--8<---------------cut here---------------end--------------->8---

But in gnus the mode-line isn't modified.

I saw gnus have it's own mode-line-format for each mode, but i am unable
to use it.

Help is welcome.

Thanks.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* help needed with gnus mode-line
@ 2011-06-30 11:52 Thierry Volpiatto
  2011-06-30 12:20 ` Andreas Schwab
  2011-06-30 20:57 ` Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: Thierry Volpiatto @ 2011-06-30 11:52 UTC (permalink / raw)
  To: emacs-devel

Hi all,
i would like to display temporarily information in mode-line while i am
in gnus.
In all emacs, something like this work fine:

--8<---------------cut here---------------start------------->8---
(let ((mode-line-format (concat " " str)))
  (force-mode-line-update)
  (sit-for 12))
(force-mode-line-update))
--8<---------------cut here---------------end--------------->8---

But in gnus the mode-line isn't modified.

I saw gnus have it's own mode-line-format for each mode, but i am unable
to use it.

Help is welcome.

Thanks.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: help needed with gnus mode-line
  2011-06-30 11:52 help needed with gnus mode-line Thierry Volpiatto
@ 2011-06-30 12:20 ` Andreas Schwab
  2011-06-30 12:35   ` Thierry Volpiatto
  2011-06-30 20:57 ` Stefan Monnier
  1 sibling, 1 reply; 13+ messages in thread
From: Andreas Schwab @ 2011-06-30 12:20 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> i would like to display temporarily information in mode-line while i am
> in gnus.

The mode-line is not designed for temporary display.  That's what the
echo area is for.

> In all emacs, something like this work fine:
>
> (let ((mode-line-format (concat " " str)))
>   (force-mode-line-update)
>   (sit-for 12))
> (force-mode-line-update))
>
> But in gnus the mode-line isn't modified.

Worksforme.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: help needed with gnus mode-line
  2011-06-30 12:20 ` Andreas Schwab
@ 2011-06-30 12:35   ` Thierry Volpiatto
  2011-06-30 13:15     ` Antoine Levitt
  0 siblings, 1 reply; 13+ messages in thread
From: Thierry Volpiatto @ 2011-06-30 12:35 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> i would like to display temporarily information in mode-line while i am
>> in gnus.
>
> The mode-line is not designed for temporary display.
But it can be used for that in many places ;-)

> That's what the echo area is for.
That's not helpful, of course i know echo area.

>> In all emacs, something like this work fine:
>>
>> (let ((mode-line-format (concat " " str)))
>>   (force-mode-line-update)
>>   (sit-for 12))
>> (force-mode-line-update))
>>
>> But in gnus the mode-line isn't modified.
>
> Worksforme.
Don't know what that's mean...

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: help needed with gnus mode-line
  2011-06-30 12:35   ` Thierry Volpiatto
@ 2011-06-30 13:15     ` Antoine Levitt
  2011-06-30 15:01       ` Thierry Volpiatto
  0 siblings, 1 reply; 13+ messages in thread
From: Antoine Levitt @ 2011-06-30 13:15 UTC (permalink / raw)
  To: emacs-devel

30/06/11 14:35, Thierry Volpiatto
> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>>
>>> i would like to display temporarily information in mode-line while i am
>>> in gnus.
>>
>> The mode-line is not designed for temporary display.
> But it can be used for that in many places ;-)
>
>> That's what the echo area is for.
> That's not helpful, of course i know echo area.
>
>>> In all emacs, something like this work fine:
>>>
>>> (let ((mode-line-format (concat " " str)))
>>>   (force-mode-line-update)
>>>   (sit-for 12))
>>> (force-mode-line-update))
>>>
>>> But in gnus the mode-line isn't modified.
>>
>> Worksforme.
> Don't know what that's mean...

It means that it works for him ;)

I manually set gnus-group-mode-line-format, it works fine.




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

* Re: help needed with gnus mode-line
  2011-06-30 13:15     ` Antoine Levitt
@ 2011-06-30 15:01       ` Thierry Volpiatto
  0 siblings, 0 replies; 13+ messages in thread
From: Thierry Volpiatto @ 2011-06-30 15:01 UTC (permalink / raw)
  To: emacs-devel

Antoine Levitt <antoine.levitt@gmail.com> writes:

> 30/06/11 14:35, Thierry Volpiatto
>>> Worksforme.
>> Don't know what that's mean...
>
> It means that it works for him ;)
Ah! ok. :-)

> I manually set gnus-group-mode-line-format, it works fine.
You set it how, from where and with which value?

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: help needed with gnus mode-line
  2011-06-30 11:52 help needed with gnus mode-line Thierry Volpiatto
  2011-06-30 12:20 ` Andreas Schwab
@ 2011-06-30 20:57 ` Stefan Monnier
  2011-07-01  7:25   ` Thierry Volpiatto
  1 sibling, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2011-06-30 20:57 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

> i would like to display temporarily information in mode-line while i am
> in gnus.
> In all emacs, something like this work fine:

> --8<---------------cut here---------------start------------->8---
> (let ((mode-line-format (concat " " str)))
>   (force-mode-line-update)
>   (sit-for 12))
> (force-mode-line-update))
> --8<---------------cut here---------------end--------------->8---

Where do you run the above code?  It should work but only if you run it
from within the buffer whose mode-line you want to modify.
Otherwise you may simply be changing the mode-line-format variable of
some other buffer(s).


        Stefan



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

* Re: help needed with gnus mode-line
  2011-06-30 20:57 ` Stefan Monnier
@ 2011-07-01  7:25   ` Thierry Volpiatto
  2011-07-01 16:23     ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Thierry Volpiatto @ 2011-07-01  7:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> i would like to display temporarily information in mode-line while i am
>> in gnus.
>> In all emacs, something like this work fine:
>
>> --8<---------------cut here---------------start------------->8---
>> (let ((mode-line-format (concat " " str)))
>>   (force-mode-line-update)
>>   (sit-for 12))
>> (force-mode-line-update))
>> --8<---------------cut here---------------end--------------->8---
>
> Where do you run the above code?  It should work but only if you run it
> from within the buffer whose mode-line you want to modify.
> Otherwise you may simply be changing the mode-line-format variable of
> some other buffer(s).
Indeed, i have to specify:

--8<---------------cut here---------------start------------->8---
  (with-current-buffer (with-selected-window
                           (minibuffer-selected-window)
                         (current-buffer))
--8<---------------cut here---------------end--------------->8---

instead of

--8<---------------cut here---------------start------------->8---
  (with-current-buffer (current-buffer)
--8<---------------cut here---------------end--------------->8---

Which use the minibuffer only with gnus buffers.
In other place in emacs it use the current-buffer of the selected window
before entering the minibuffer.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: help needed with gnus mode-line
  2011-07-01  7:25   ` Thierry Volpiatto
@ 2011-07-01 16:23     ` Stefan Monnier
  2011-07-01 19:23       ` Thierry Volpiatto
  2011-07-01 19:23       ` Thierry Volpiatto
  0 siblings, 2 replies; 13+ messages in thread
From: Stefan Monnier @ 2011-07-01 16:23 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

>   (with-current-buffer (with-selected-window
>                            (minibuffer-selected-window)
>                          (current-buffer))

Try (window-buffer (minibuffer-selected-window)) ;-)

Of course, minibuffer-selected-window is not quite right either: you
don't want to modify the mode-line of the buffer from where the M-: was
typed, but the mode-line that's right above the minibuffer (which
doesn't even exist in minibuffer-only frames).

> Which use the minibuffer only with gnus buffers.
> In other place in emacs it use the current-buffer of the selected window
> before entering the minibuffer.

No, the problem is that if you don't switch to the other buffer, your
let binding will change the mode-line-format value in the minibuffer and
since the minibuffer basically never sets this value buffer-locally it
means it changes (temporarily) the default value of mode-line-format,
i.e. it changes the value of mode-line-format for all buffers that
haven't set it buffer-locally (i.e. all buffers except Gnus buffers and
a few other ones).

If you have several windows, you should see that your mode-line message
appears in pretty much all mode lines rather than only the one next to
the minibuffer (tho calling force-mode-line-update with a nil may be
sufficient to restrict the change to the window(s) that show this buffer
in many cases).


        Stefan



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

* Re: help needed with gnus mode-line
  2011-07-01 16:23     ` Stefan Monnier
@ 2011-07-01 19:23       ` Thierry Volpiatto
  2011-07-04 15:58         ` Stefan Monnier
  2011-07-01 19:23       ` Thierry Volpiatto
  1 sibling, 1 reply; 13+ messages in thread
From: Thierry Volpiatto @ 2011-07-01 19:23 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Try (window-buffer (minibuffer-selected-window)) ;-)
Yes, of course, thanks ;-)

> Of course, minibuffer-selected-window is not quite right either: you
> don't want to modify the mode-line of the buffer from where the M-: was
> typed, but the mode-line that's right above the minibuffer (which
> doesn't even exist in minibuffer-only frames).
Right, i didn't find how to get safely the window right above
minibuffer.

> No, the problem is that if you don't switch to the other buffer, your
> let binding will change the mode-line-format value in the minibuffer and
> since the minibuffer basically never sets this value buffer-locally it
> means it changes (temporarily) the default value of mode-line-format,
> i.e. it changes the value of mode-line-format for all buffers that
> haven't set it buffer-locally (i.e. all buffers except Gnus buffers and
> a few other ones).
Right.

> If you have several windows, you should see that your mode-line message
> appears in pretty much all mode lines rather than only the one next to
> the minibuffer (tho calling force-mode-line-update with a nil may be
> sufficient to restrict the change to the window(s) that show this buffer
> in many cases).
Thanks for all these explanations.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: help needed with gnus mode-line
  2011-07-01 16:23     ` Stefan Monnier
  2011-07-01 19:23       ` Thierry Volpiatto
@ 2011-07-01 19:23       ` Thierry Volpiatto
  1 sibling, 0 replies; 13+ messages in thread
From: Thierry Volpiatto @ 2011-07-01 19:23 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Try (window-buffer (minibuffer-selected-window)) ;-)
Yes, of course, thanks ;-)

> Of course, minibuffer-selected-window is not quite right either: you
> don't want to modify the mode-line of the buffer from where the M-: was
> typed, but the mode-line that's right above the minibuffer (which
> doesn't even exist in minibuffer-only frames).
Right, i didn't find how to get safely the window right above
minibuffer.

> No, the problem is that if you don't switch to the other buffer, your
> let binding will change the mode-line-format value in the minibuffer and
> since the minibuffer basically never sets this value buffer-locally it
> means it changes (temporarily) the default value of mode-line-format,
> i.e. it changes the value of mode-line-format for all buffers that
> haven't set it buffer-locally (i.e. all buffers except Gnus buffers and
> a few other ones).
Right.

> If you have several windows, you should see that your mode-line message
> appears in pretty much all mode lines rather than only the one next to
> the minibuffer (tho calling force-mode-line-update with a nil may be
> sufficient to restrict the change to the window(s) that show this buffer
> in many cases).
Thanks for all these explanations.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

* Re: help needed with gnus mode-line
  2011-07-01 19:23       ` Thierry Volpiatto
@ 2011-07-04 15:58         ` Stefan Monnier
  2011-07-04 19:00           ` Thierry Volpiatto
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2011-07-04 15:58 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

>> Of course, minibuffer-selected-window is not quite right either: you
>> don't want to modify the mode-line of the buffer from where the M-: was
>> typed, but the mode-line that's right above the minibuffer (which
>> doesn't even exist in minibuffer-only frames).
> Right, i didn't find how to get safely the window right above
> minibuffer.

If the frame is split, there might be several windows directly above
the minibuffer.  But if "the leftmost" or "the rightmost" is good
enough, then maybe windmove.el will give you some working code.


        Stefan "Yes, using the mode-line is messy"



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

* Re: help needed with gnus mode-line
  2011-07-04 15:58         ` Stefan Monnier
@ 2011-07-04 19:00           ` Thierry Volpiatto
  0 siblings, 0 replies; 13+ messages in thread
From: Thierry Volpiatto @ 2011-07-04 19:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> If the frame is split, there might be several windows directly above
> the minibuffer.  But if "the leftmost" or "the rightmost" is good
> enough, then maybe windmove.el will give you some working code.

No, hopefully, now we have `window-in-direction', thanks to Martin i
think.
See the last version of my patch i posted here that use it.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



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

end of thread, other threads:[~2011-07-04 19:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-30 11:52 help needed with gnus mode-line Thierry Volpiatto
2011-06-30 12:20 ` Andreas Schwab
2011-06-30 12:35   ` Thierry Volpiatto
2011-06-30 13:15     ` Antoine Levitt
2011-06-30 15:01       ` Thierry Volpiatto
2011-06-30 20:57 ` Stefan Monnier
2011-07-01  7:25   ` Thierry Volpiatto
2011-07-01 16:23     ` Stefan Monnier
2011-07-01 19:23       ` Thierry Volpiatto
2011-07-04 15:58         ` Stefan Monnier
2011-07-04 19:00           ` Thierry Volpiatto
2011-07-01 19:23       ` Thierry Volpiatto
  -- strict thread matches above, loose matches on Subject: below --
2011-06-30 11:52 Thierry Volpiatto

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).