* Group based gnus-summary-line-format ?
@ 1998-03-15 12:09 jari.aalto
1998-03-15 19:56 ` Kai Grossjohann
1998-03-19 13:06 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 10+ messages in thread
From: jari.aalto @ 1998-03-15 12:09 UTC (permalink / raw)
I'm trying to figure out where should I redefine the default
gnus-summary-line-format for selected groups: nntp, mailing
listp, private mail and my work mail have different needs
for gnus-summary-line-format.
If I change it inside gnus-summary-generate-hook, that won't
work. What's next place to look for?
(defun my-gnus-summary-generate-hook ()
....
(when (string-match "nntp" group)
(make-local-variable 'gnus-summary-line-format)
(setq gnus-summary-line-format ...)
)
Further, I tried to figure out how to byte compile this custom
spec beforehand, so that instead of saying
(setq gnus-summary-line-format ...)
I would like to replace the definition with pre-byte-compiled one.
The gnus-spec.el::gnus-compile is pretty hairy to read, how
does it actually work? (pictures would be nice)
jari
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
1998-03-15 12:09 Group based gnus-summary-line-format ? jari.aalto
@ 1998-03-15 19:56 ` Kai Grossjohann
1998-03-15 21:05 ` jari.aalto
1998-03-19 13:06 ` Lars Magne Ingebrigtsen
1 sibling, 1 reply; 10+ messages in thread
From: Kai Grossjohann @ 1998-03-15 19:56 UTC (permalink / raw)
Cc: Ding mailing list
>>>>> On 15 Mar 1998, said:
Jari> I would like to replace the definition with
Jari> pre-byte-compiled one. The gnus-spec.el::gnus-compile is
Jari> pretty hairy to read, how does it actually work? (pictures
Jari> would be nice)
Isn't it sufficient to set the variable, then call gnus-compile?
kai
--
Really cancel? [OK] [Cancel]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
1998-03-15 19:56 ` Kai Grossjohann
@ 1998-03-15 21:05 ` jari.aalto
[not found] ` <x7en03qte0.fsf@peorth.gweep.net>
0 siblings, 1 reply; 10+ messages in thread
From: jari.aalto @ 1998-03-15 21:05 UTC (permalink / raw)
| 98-03-15 Kai Grossjohann <grossjohann@charly.cs.uni-dortmund.de> list.ding
| >>>>> On 15 Mar 1998, said:
|
| Jari> I would like to replace the definition with
| Jari> pre-byte-compiled one. The gnus-spec.el::gnus-compile is
| Jari> pretty hairy to read, how does it actually work? (pictures
| Jari> would be nice)
|
| Isn't it sufficient to set the variable, then call gnus-compile?
I mean that if I have 5 different summary line formats for 5
different "type of" Groups: nntp, private mail, mailing list, server
logs ....
For all Gnus uses gnus-summaryline-format and that's
what it byte compiles too. But if I shift in the custom format to the
gnus-summary-line-format, I have to byte compile, and when
I shift in format2, I have to byte compile it again...
So I wanted to pre-byte-compile these 5 different formats, so that
I could do:
(setq gnus-summary-line-format fmt1)
(setq ...byte-compiled-definition fm1-byte-compiled)
Instead of
(setq gnus-summary-line-format fmt1)
(gnus-update-format-specifications 'force)
which would mean constant byte compiling whenever I would
change Groups....
jari
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
[not found] ` <x7en03qte0.fsf@peorth.gweep.net>
@ 1998-03-16 2:18 ` Hrvoje Niksic
[not found] ` <x7u38zpe1b.fsf@peorth.gweep.net>
1998-03-16 13:07 ` jari.aalto
1998-03-16 23:42 ` Raja R Harinath
2 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1998-03-16 2:18 UTC (permalink / raw)
Stainless Steel Rat <ratinox@peorth.gweep.net> writes:
> | Isn't it sufficient to set the variable, then call gnus-compile?
>
> ja> I mean that if I have 5 different summary line formats for 5
> ja> different "type of" Groups: nntp, private mail, mailing list, server
> ja> logs ....
>
> I have nearly as many. I have gnus-select-group-hook set an
> appropriate gnus-summary-line-format based on the newsgroup name,
> then at the end it calls gnus-compile. It does not take that long.
Yet, this sounds wrong for general consumption. One should be able to
use Gnus without having the byte-compiler loaded at all.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
4. Thou shalt not warlorde a sig if it bee the sig of Kibo, nor if
it bee the sig of the Inner Circle.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
[not found] ` <x7u38zpe1b.fsf@peorth.gweep.net>
@ 1998-03-16 2:54 ` Hrvoje Niksic
[not found] ` <x7ra43pbcj.fsf@peorth.gweep.net>
0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1998-03-16 2:54 UTC (permalink / raw)
Stainless Steel Rat <ratinox@peorth.gweep.net> writes:
> >>>>> "Hrvoje" == Hrvoje Niksic <hniksic@srce.hr> writes:
>
> Hrvoje> Yet, this sounds wrong for general consumption. One should be able
> Hrvoje> to use Gnus without having the byte-compiler loaded at all.
>
> Oh, you can use Gnus and variable values for
> gnus-summary-line-format without having the byte-compiler loaded.
> Gnus will be dramatically slower for it, but it certainly can be
> done.
Unless I am missing something obvious, why is the byte-compiler needed
at all? It is not hard to imagine code that would keep an alist of
the byte-compiled formats and look up the appropriate element. The
whole alist could be saved to `.newsrc.eld'.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
* Q: What is an experienced Emacs user?
* A: A person who wishes that the terminal had pedals.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
[not found] ` <x7ra43pbcj.fsf@peorth.gweep.net>
@ 1998-03-16 3:28 ` Hrvoje Niksic
[not found] ` <x7u38z2slw.fsf@peorth.gweep.net>
0 siblings, 1 reply; 10+ messages in thread
From: Hrvoje Niksic @ 1998-03-16 3:28 UTC (permalink / raw)
Stainless Steel Rat <ratinox@peorth.gweep.net> writes:
> >>>>> "Hrvoje" == Hrvoje Niksic <hniksic@srce.hr> writes:
>
> Hrvoje> Unless I am missing something obvious, why is the byte-compiler
> Hrvoje> needed at all? It is not hard to imagine code that would keep an
> Hrvoje> alist of the byte-compiled formats and look up the appropriate
> Hrvoje> element. The whole alist could be saved to `.newsrc.eld'.
>
> Because it is hypothetically possible to have a different value for
> gnus-summary-line-format for every group.
In that hypothetical case you will end up having a large cache. What
is your point?
> And unless I am missing something obvious, why is it "bad" to invoke
> the byte-compiler
I've never said it was bad to invoke the byte-compiler, but I did
imply that the code should be designed so that its invocation is not
mandatory.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Psychos _do not_ explode when sunlight hits them."
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
[not found] ` <x7u38z2slw.fsf@peorth.gweep.net>
@ 1998-03-16 4:15 ` Hrvoje Niksic
0 siblings, 0 replies; 10+ messages in thread
From: Hrvoje Niksic @ 1998-03-16 4:15 UTC (permalink / raw)
Stainless Steel Rat <ratinox@peorth.gweep.net> writes:
> >>>>> "Hrvoje" == Hrvoje Niksic <hniksic@srce.hr> writes:
>
> Hrvoje> In that hypothetical case you will end up having a large cache.
> Hrvoje> What is your point?
>
> That the cache is utterly and completely unnecessary. It wastes
> both disk and memory when a simpler solution already exists.
Using that argument, you could also claim that saving bytecompiled
specs to `.newsrc.eld' at all is "utterly and completely unnecessary",
too.
The whole point of caching the compiled specs is not having to invoke
the byte-compiler each time you have to deal with them. Why this
cache would suddenly become unnecessary when you deal with more than
one specification is beyond me.
> Hrvoje> I've never said it was bad to invoke the byte-compiler, but
> Hrvoje> I did imply that the code should be designed so that its
> Hrvoje> invocation is not mandatory.
>
> The invocation is *NOT* mandatory now. Neither is changing the
> value of gnus-summary-line-format.
Uh, great.
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Which is worse: ignorance or apathy? Who knows? Who cares?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
[not found] ` <x7en03qte0.fsf@peorth.gweep.net>
1998-03-16 2:18 ` Hrvoje Niksic
@ 1998-03-16 13:07 ` jari.aalto
1998-03-16 23:42 ` Raja R Harinath
2 siblings, 0 replies; 10+ messages in thread
From: jari.aalto @ 1998-03-16 13:07 UTC (permalink / raw)
| 98-03-15 Stainless Steel Rat <ratinox@peorth.gweep.net> list.ding
| >>>>> "ja" == <jari.aalto@poboxes.com> writes:
|
| | Isn't it sufficient to set the variable, then call gnus-compile?
|
| ja> I mean that if I have 5 different summary line formats for 5
| ja> different "type of" Groups: nntp, private mail, mailing list, server
| ja> logs ....
|
| I have nearly as many. I have gnus-select-group-hook set an appropriate
| gnus-summary-line-format based on the newsgroup name, then at the end it
| calls gnus-compile. It does not take that long.
Thanks ratinox, I think I got it working. I compile the sspec like this
now:
;; I'm only interested in compiling this spec
(let* ((gnus-format-specs (list (assq 'summary gnus-format-specs))))
(gnus-compile))
But I'm curious, what does gnus-update-format-specifications do?
jari
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
[not found] ` <x7en03qte0.fsf@peorth.gweep.net>
1998-03-16 2:18 ` Hrvoje Niksic
1998-03-16 13:07 ` jari.aalto
@ 1998-03-16 23:42 ` Raja R Harinath
2 siblings, 0 replies; 10+ messages in thread
From: Raja R Harinath @ 1998-03-16 23:42 UTC (permalink / raw)
Stainless Steel Rat <ratinox@peorth.gweep.net> writes:
> >>>>> "ja" == <jari.aalto@poboxes.com> writes:
> | Isn't it sufficient to set the variable, then call gnus-compile?
>
> ja> I mean that if I have 5 different summary line formats for 5
> ja> different "type of" Groups: nntp, private mail, mailing list, server
> ja> logs ....
>
> I have nearly as many. I have gnus-select-group-hook set an appropriate
> gnus-summary-line-format based on the newsgroup name, then at the end it
> calls gnus-compile. It does not take that long.
Here's the recommended way to set `gnus-summary-line-format', taken from
gnus-gl.el. Adapt it to your requirements:
;; Change how summary lines look
(make-local-variable 'gnus-summary-line-format)
(make-local-variable 'gnus-summary-line-format-spec)
(setq gnus-summary-line-format gnus-summary-grouplens-line-format)
(setq gnus-summary-line-format-spec nil)
(gnus-update-format-specifications nil 'summary)
(gnus-update-summary-mark-positions)
replacing `gnus-summary-grouplens-line-format' with your prefered
format.
- Hari
--
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions." -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing." -- Roy L Ash
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Group based gnus-summary-line-format ?
1998-03-15 12:09 Group based gnus-summary-line-format ? jari.aalto
1998-03-15 19:56 ` Kai Grossjohann
@ 1998-03-19 13:06 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-03-19 13:06 UTC (permalink / raw)
<jari.aalto@poboxes.com> writes:
> If I change it inside gnus-summary-generate-hook, that won't
> work. What's next place to look for?
The place to change things for mode X is in `x-mode-hook'.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~1998-03-19 13:06 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-15 12:09 Group based gnus-summary-line-format ? jari.aalto
1998-03-15 19:56 ` Kai Grossjohann
1998-03-15 21:05 ` jari.aalto
[not found] ` <x7en03qte0.fsf@peorth.gweep.net>
1998-03-16 2:18 ` Hrvoje Niksic
[not found] ` <x7u38zpe1b.fsf@peorth.gweep.net>
1998-03-16 2:54 ` Hrvoje Niksic
[not found] ` <x7ra43pbcj.fsf@peorth.gweep.net>
1998-03-16 3:28 ` Hrvoje Niksic
[not found] ` <x7u38z2slw.fsf@peorth.gweep.net>
1998-03-16 4:15 ` Hrvoje Niksic
1998-03-16 13:07 ` jari.aalto
1998-03-16 23:42 ` Raja R Harinath
1998-03-19 13:06 ` Lars Magne Ingebrigtsen
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).