Gnus development mailing list
 help / color / mirror / Atom feed
* newsgroup variables
@ 2000-04-24 14:30 Shenghuo ZHU
  2000-04-24 16:24 ` Kai Großjohann
  0 siblings, 1 reply; 11+ messages in thread
From: Shenghuo ZHU @ 2000-04-24 14:30 UTC (permalink / raw)



I am going to add a feature that enable users to customize variables
as newsgroup variables, i.e. variables that have separate values in
newsgroups.

Thoughts?

-- 
Shenghuo



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

* Re: newsgroup variables
  2000-04-24 14:30 newsgroup variables Shenghuo ZHU
@ 2000-04-24 16:24 ` Kai Großjohann
  2000-04-24 17:04   ` Shenghuo ZHU
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Großjohann @ 2000-04-24 16:24 UTC (permalink / raw)
  Cc: ding

Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> I am going to add a feature that enable users to customize variables
> as newsgroup variables, i.e. variables that have separate values in
> newsgroups.

Hm.  In what way is this different than the variables you can already
configure in the group parameters?

One thing which would be nice is this: some variables are used in the
summary buffer, others are used in the article buffer, and still
others are used in the message buffers that are created from the
summary buffer.  Could you do stuff that copies the variables over to
all these buffers so that the right thing happens?

kai
-- 
Beware of flying birch trees.



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

* Re: newsgroup variables
  2000-04-24 16:24 ` Kai Großjohann
@ 2000-04-24 17:04   ` Shenghuo ZHU
  2000-04-24 18:44     ` Kai Großjohann
  2000-04-25 13:22     ` Per Abrahamsen
  0 siblings, 2 replies; 11+ messages in thread
From: Shenghuo ZHU @ 2000-04-24 17:04 UTC (permalink / raw)


>>>>> "KG" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

KG> Shenghuo ZHU <zsh@cs.rochester.edu> writes:
>> I am going to add a feature that enable users to customize variables
>> as newsgroup variables, i.e. variables that have separate values in
>> newsgroups.

KG> Hm.  In what way is this different than the variables you can
KG> already configure in the group parameters?

Newsgroup variables are like local variables. They are associated to
the current "active" group. For example, you want to use
gnus-use-cache with different values for different groups. But when
you have two summary buffers at the same time, the second group
setting may override the first one. It may simply solved by making
those variables as local variables of the summary buffer, but the
article buffer may use the variables also. The implementation is just
like gnus-newsgroup-name does, i.e. replacing the global values with
the local values after switching to a summary buffer.

Group parameters are not variables. To access variables, you have to
call get-parameter functions. And you can not use gnus-use-cache as a
group parameter.

KG> One thing which would be nice is this: some variables are used in
KG> the summary buffer, others are used in the article buffer, and
KG> still others are used in the message buffers that are created from
KG> the summary buffer.  Could you do stuff that copies the variables
KG> over to all these buffers so that the right thing happens?

The variables are not copied to all these buffers, just copied
globally. Actually, the article buffer has few local variables besides
gnus-summary-buffer. I can not find that the message buffer has such a
local variable. Maybe we should make one.

-- 
Shenghuo



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

* Re: newsgroup variables
  2000-04-24 17:04   ` Shenghuo ZHU
@ 2000-04-24 18:44     ` Kai Großjohann
  2000-04-25 13:22     ` Per Abrahamsen
  1 sibling, 0 replies; 11+ messages in thread
From: Kai Großjohann @ 2000-04-24 18:44 UTC (permalink / raw)
  Cc: ding

Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> Newsgroup variables are like local variables. They are associated to
> the current "active" group. For example, you want to use
> gnus-use-cache with different values for different groups. But when
> you have two summary buffers at the same time, the second group
> setting may override the first one. It may simply solved by making
> those variables as local variables of the summary buffer,

Yes, that's the way I did it.

> but the article buffer may use the variables also.

Like I said, I think many local variables should be copied all over
the place by Gnus.

> The implementation is just like gnus-newsgroup-name does,
> i.e. replacing the global values with the local values after
> switching to a summary buffer.

Err, hm.  I don't know anything about the implementation of
gnus-newsgroup-name, but I'll go look.

> Group parameters are not variables. To access variables, you have to
> call get-parameter functions. And you can not use gnus-use-cache as a
> group parameter.

After typing `G c' in the Group buffer, it is possible to set local
variables in addition to group parameters.  I'm not sure what happens
when one does that, though.

> KG> One thing which would be nice is this: some variables are used in
> KG> the summary buffer, others are used in the article buffer, and
> KG> still others are used in the message buffers that are created from
> KG> the summary buffer.  Could you do stuff that copies the variables
> KG> over to all these buffers so that the right thing happens?
> 
> The variables are not copied to all these buffers, just copied
> globally. Actually, the article buffer has few local variables besides
> gnus-summary-buffer. I can not find that the message buffer has such a
> local variable. Maybe we should make one.

???  I think I'll go read the sources, first.  I can't make heads nor
tails of what you're saying :-)  Not your fault, of course.

kai
-- 
Beware of flying birch trees.



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

* Re: newsgroup variables
  2000-04-24 17:04   ` Shenghuo ZHU
  2000-04-24 18:44     ` Kai Großjohann
@ 2000-04-25 13:22     ` Per Abrahamsen
  2000-04-26 12:31       ` Janne Rinta-Manty
  1 sibling, 1 reply; 11+ messages in thread
From: Per Abrahamsen @ 2000-04-25 13:22 UTC (permalink / raw)


Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> Group parameters are not variables. To access variables, you have to
> call get-parameter functions. And you can not use gnus-use-cache as a
> group parameter.

Yes, but you are also supposed to be able to set ordinary variables
with the group parameters mechanism:

Gnus> `(VARIABLE FORM)'
Gnus>      You can use the group parameters to set variables local to the
Gnus>      group you are entering.  If you want to turn threading off in
Gnus>      `news.answers', you could put `(gnus-show-threads nil)' in the
Gnus>      group parameters of that group.  `gnus-show-threads' will be made
Gnus>      into a local variable in the summary buffer you enter, and the form
Gnus>      `nil' will be `eval'ed there.
Gnus> 
Gnus>      This can also be used as a group-specific hook function, if you'd
Gnus>      like.  If you want to hear a beep when you enter a group, you could
Gnus>      put something like `(dummy-variable (ding))' in the parameters of
Gnus>      that group.  `dummy-variable' will be set to the result of the
Gnus>      `(ding)' form, but who cares?



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

* Re: newsgroup variables
  2000-04-25 13:22     ` Per Abrahamsen
@ 2000-04-26 12:31       ` Janne Rinta-Manty
  2000-04-26 12:42         ` Kai Großjohann
  0 siblings, 1 reply; 11+ messages in thread
From: Janne Rinta-Manty @ 2000-04-26 12:31 UTC (permalink / raw)


Per Abrahamsen 2000-04-25T13:24:17Z:
PA> Shenghuo ZHU <zsh@cs.rochester.edu> writes:
>> Group parameters are not variables. To access variables, you have to
>> call get-parameter functions. And you can not use gnus-use-cache as a
>> group parameter.

PA> Yes, but you are also supposed to be able to set ordinary variables
PA> with the group parameters mechanism:

Gnus> `(VARIABLE FORM)'

Gnus> You can use the group parameters to set variables local to the
Gnus> group you are entering.  If you want to turn threading off in
Gnus> `news.answers', you could put `(gnus-show-threads nil)' in the
Gnus> group parameters of that group.  `gnus-show-threads' will be
Gnus> made into a local variable in the summary buffer you enter, and
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Gnus> the form `nil' will be `eval'ed there.

Yes, I've been using this feature. It works fine with variables that
have something to do with the summary. Recently I tried to set
gnus-part-display-hook for a couple of groups using group parameters
and got hit by the underlined part above. Of course it was obvious
when I realized why it wasn't working, but it took me some time...

I wonder if it would be The Right Thing to "inherit" (some) variables
group -> summary -> article/message? Or would it make things too
complex / break something?

-- 
Janne Rinta-Mänty



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

* Re: newsgroup variables
  2000-04-26 12:31       ` Janne Rinta-Manty
@ 2000-04-26 12:42         ` Kai Großjohann
  2000-04-26 13:39           ` Shenghuo ZHU
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Großjohann @ 2000-04-26 12:42 UTC (permalink / raw)
  Cc: ding

Janne Rinta-Manty <jrm@iki.fi> writes:

> I wonder if it would be The Right Thing to "inherit" (some) variables
> group -> summary -> article/message? Or would it make things too
> complex / break something?

I think there is already code that clones some variables from the
article or summary buffer to the message buffer, and I think the same
mechanism should be used for cloning from the summary buffer to the
article buffer.

kai
-- 
Beware of flying birch trees.



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

* Re: newsgroup variables
  2000-04-26 12:42         ` Kai Großjohann
@ 2000-04-26 13:39           ` Shenghuo ZHU
  2000-04-26 15:58             ` Kai Großjohann
  0 siblings, 1 reply; 11+ messages in thread
From: Shenghuo ZHU @ 2000-04-26 13:39 UTC (permalink / raw)


>>>>> "KG" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

KG> Janne Rinta-Manty <jrm@iki.fi> writes:
>> I wonder if it would be The Right Thing to "inherit" (some) variables
>> group -> summary -> article/message? Or would it make things too
>> complex / break something?

KG> I think there is already code that clones some variables from the
KG> article or summary buffer to the message buffer, and I think the
KG> same mechanism should be used for cloning from the summary buffer
KG> to the article buffer.

Is it helpful to provide a simple mechanism to do this? I mean, what
you need to do is just (push 'the-variable gnus-newsgroup-variables).
You need not care which buffer it should be copied to.

-- 
Shenghuo



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

* Re: newsgroup variables
  2000-04-26 13:39           ` Shenghuo ZHU
@ 2000-04-26 15:58             ` Kai Großjohann
  2000-04-26 17:24               ` Shenghuo ZHU
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Großjohann @ 2000-04-26 15:58 UTC (permalink / raw)
  Cc: ding

Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> Is it helpful to provide a simple mechanism to do this? I mean, what
> you need to do is just (push 'the-variable gnus-newsgroup-variables).
> You need not care which buffer it should be copied to.

What you're proposing sounds way cool.  I think it could also replace
message-clone-locals, the old mechanism (for copying variables from
the summary buffer to a message buffer, I think).

kai
-- 
Beware of flying birch trees.



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

* Re: newsgroup variables
  2000-04-26 15:58             ` Kai Großjohann
@ 2000-04-26 17:24               ` Shenghuo ZHU
  2000-04-26 20:09                 ` Kai Großjohann
  0 siblings, 1 reply; 11+ messages in thread
From: Shenghuo ZHU @ 2000-04-26 17:24 UTC (permalink / raw)


>>>>> "KG" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

KG> Shenghuo ZHU <zsh@cs.rochester.edu> writes:
>> Is it helpful to provide a simple mechanism to do this? I mean, what
>> you need to do is just (push 'the-variable gnus-newsgroup-variables).
>> You need not care which buffer it should be copied to.

KG> What you're proposing sounds way cool.  I think it could also
KG> replace message-clone-locals, the old mechanism (for copying
KG> variables from the summary buffer to a message buffer, I think).

I think the mechanism of message-clone-locals is too aggressive. At
least I found a bug because of message-clone-locals. I need a list of
variables that are used in message buffer, so that they can be
explicitly listed in the gnus-newsgroup-variables.

I also think whether those variables should be cloned. If only one
copy is kept in summary buffer, you can not get those value after
exiting the summary buffer. Sometimes, messages are sent after user
exits the current summary buffer. If this were a problem, we would
have got a big trouble to send emails from nndraft:drafts, where those
variables are not kept at all.

-- 
Shenghuo



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

* Re: newsgroup variables
  2000-04-26 17:24               ` Shenghuo ZHU
@ 2000-04-26 20:09                 ` Kai Großjohann
  0 siblings, 0 replies; 11+ messages in thread
From: Kai Großjohann @ 2000-04-26 20:09 UTC (permalink / raw)


Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> I think the mechanism of message-clone-locals is too aggressive.

_I_ think it isn't aggressive enough :-)  But OTOH, I can't remember a
case where I was bit by this, so maybe I shouldn't be talking too
loudly.

I think your approach of having a list of variables to copy is a Good
Thing; this way people can control exactly what variables are copied.

But we should think about the interface for naive users.  Suppose
somebody sets a variable local to a group via `G c'.  Then that person
will surely expect this change to `just work', even if the variable is
actually used in the article buffer, say.

(Just to take an example -- what about fill-column?  Presumably, `W w'
and `W Q' in summary mode take into account that variable (I haven't
checked), but the variable is used in the article buffer.  Surely,
people will be surprised when they frob fill-column from the group
parameters and nothing changes.)

What can be done about this?  Would it be enough to document this in
the buffer that appears after `G c'?

kai
-- 
Beware of flying birch trees.



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

end of thread, other threads:[~2000-04-26 20:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-24 14:30 newsgroup variables Shenghuo ZHU
2000-04-24 16:24 ` Kai Großjohann
2000-04-24 17:04   ` Shenghuo ZHU
2000-04-24 18:44     ` Kai Großjohann
2000-04-25 13:22     ` Per Abrahamsen
2000-04-26 12:31       ` Janne Rinta-Manty
2000-04-26 12:42         ` Kai Großjohann
2000-04-26 13:39           ` Shenghuo ZHU
2000-04-26 15:58             ` Kai Großjohann
2000-04-26 17:24               ` Shenghuo ZHU
2000-04-26 20:09                 ` Kai Großjohann

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