Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Right justifying text in the summary line
@ 2002-04-24 14:37 Paul Moore
  2002-04-24 18:35 ` Kai Großjohann
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Moore @ 2002-04-24 14:37 UTC (permalink / raw)


I'd like to define a summary line with some text right justified, but
I can't work out how to do it. Can anyone help?

Basically, I'm trying to set a gnus-summary-line-format to achieve
something like the following effect:

   ....>>>>Subject                              Author
   ^       ^                                    ^
   Flags   Indented based on thread             In last 10 cols
                                                of window

The first part (up to and including the subject) is fine. I can do the
indentation with %I or %> (what is the difference?) It's the author
column I can't get to work. There are two issues - the first is
putting it in a fixed column - I need to undo the effect of the
threading indent. I suspect %< is involved here, somehow, but I'm not
sure how... The second is how to make the location of the author
column depend on the window width.

What I'm trying to do is to display as much as I can of the subject,
while still showing the author (in a fixed-width field). I don't want
the author field at the start of the line, as it gives it more
prominence than I like.

I could use the facility of making gnus-summary-line-format an
arbitrary elisp form - this would also allow me to use a different
format of line for the root of a thread and for child articles, which
would also be nice. But if I do this, how do I get access to the data
that the format letters (%N, %S, %f etc) offer? I don't really want to
reimplement these for myself...

The more I look at this, the more I suspect I'm trying to do something
advanced. But I really don't like the default format of summary lines,
and my attempts at more basic tweaking haven't come up with anything
that suits me.

Thanks in advance for any suggestions/help.

Paul Moore


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

* Re: Right justifying text in the summary line
  2002-04-24 14:37 Right justifying text in the summary line Paul Moore
@ 2002-04-24 18:35 ` Kai Großjohann
  2002-04-24 21:08   ` Paul Moore
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Großjohann @ 2002-04-24 18:35 UTC (permalink / raw)


Paul Moore <gustav@morpheus.demon.co.uk> writes:

> The second is how to make the location of the author column depend
> on the window width.

That is in principle possible, but you have to tell Emacs to execute
some Lisp code whenever the window (frame) is resized.  The Lisp
needs to frob gnus-summary-line-format.

It's not pretty.

kai
-- 
Silence is foo!


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

* Re: Right justifying text in the summary line
  2002-04-24 18:35 ` Kai Großjohann
@ 2002-04-24 21:08   ` Paul Moore
  2002-04-24 23:18     ` Patric Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Moore @ 2002-04-24 21:08 UTC (permalink / raw)


On Wed, 24 Apr 2002 20:35:38 +0200, Kai.Grossjohann@CS.Uni-Dortmund.DE
(Kai Großjohann) wrote:

>Paul Moore <gustav@morpheus.demon.co.uk> writes:
>
>> The second is how to make the location of the author column depend
>> on the window width.
>
>That is in principle possible, but you have to tell Emacs to execute
>some Lisp code whenever the window (frame) is resized.  The Lisp
>needs to frob gnus-summary-line-format.
>
>It's not pretty.

I thought that might be the case... Is it possible to just put the
author at a fixed column? If it wasn't for the threading indent,
something like %-60,60s would be enough. But with a %I in there, I'm not
sure how to compensate for that. Any pointers?

Thanks,
Paul Moore.


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

* Re: Right justifying text in the summary line
  2002-04-24 21:08   ` Paul Moore
@ 2002-04-24 23:18     ` Patric Mueller
  0 siblings, 0 replies; 4+ messages in thread
From: Patric Mueller @ 2002-04-24 23:18 UTC (permalink / raw)


Paul Moore <gustav@morpheus.demon.co.uk> wrote:
>
> I thought that might be the case... Is it possible to just put the
> author at a fixed column? If it wasn't for the threading indent,
> something like %-60,60s would be enough. But with a %I in there, I'm not
> sure how to compensate for that. Any pointers?
>
> Thanks,
> Paul Moore.

I'm using this piece of code to achieve something similar.

You can see a screenshot at:
http://www.mysunrise.ch/users/bhaak/various/gnus-summary.gif

Bye
Patric


(defun gnus-user-format-function-i (header)
"Returns bhaak-gnus-max-depth*gnus-thread-indent-level - Indentationlevel"
  (let* ((art-nr (aref header 0))
	 (level (or (gnus-summary-thread-level art-nr) 0))
	 (level-str "") 
	 (indent "")
	 (n 0)
	 (string ""))
    (setq n gnus-thread-indent-level)
    (while (> n 0)
      (setq level-str (format "%s " level-str)
	    n (1- n)))

    (setq n (- bhaak-gnus-max-depth level))
    (while (> n 0)
      (setq indent (format "%s%s" level-str indent)
	    n (1- n)))

		(setq string indent)))

(defun gnus-user-format-function-d (header)
	"Convert the DATE to DD Mon HH:MM."
	(format-time-string "%d-%b-%y %R "
											(gnus-date-get-time (mail-header-date header))))

(setq bhaak-gnus-max-depth 13)
(setq gnus-thread-indent-level 3)
(setq gnus-summary-line-format "%(%U%R%z %-67,67s |%I %[%4L: %-25,25n%]%ui| %ud%)\n")


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

end of thread, other threads:[~2002-04-24 23:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-24 14:37 Right justifying text in the summary line Paul Moore
2002-04-24 18:35 ` Kai Großjohann
2002-04-24 21:08   ` Paul Moore
2002-04-24 23:18     ` Patric Mueller

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 NNTP newsgroup(s).