Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* gnus-no-server and startup level
@ 2012-10-17 14:41 Jarmo Hurri
  2012-10-17 14:56 ` Jarmo Hurri
  2012-10-18  6:26 ` Jarmo Hurri
  0 siblings, 2 replies; 6+ messages in thread
From: Jarmo Hurri @ 2012-10-17 14:41 UTC (permalink / raw)
  To: info-gnus-english


Greetings.

Because I occasionally need to start gnus without any connection to the
network, I have for some time already defined all of my groups by using
secondary select methods. (I hope my terminology is correct enough.)  I
am not sure if this is the wisest way, but it has worked up to this
point. As a consequence, I always start gnus by (gnus-no-server).

However, I recently needed to change the levels of my groups so that my
imaps are level 1, nntps are level 2 and nnfolders are level
3. Everything else worked just fine, except that I could not get my
nnfolders to appear at startup, which caused additional problems when
sending messages (gnus was unable to find the nnfolder where the Gcc was
supposed to go).

So I tried this and that setting, until I tracked the "problem" to this
function:

;; --------------------------------------------------------------------
(defun gnus-no-server-1 (&optional arg slave)
  "Read network news.
If ARG is a positive number, Gnus will use that as the startup
level.  If ARG is nil, Gnus will be started at level 2
\(`gnus-level-default-subscribed' minus one).  If ARG is non-nil
and not a positive number, Gnus will prompt the user for the name
of an NNTP server to use.  As opposed to \\[gnus], this command
will not connect to the local server."
  (interactive "P")
  (let ((val (or arg (1- gnus-level-default-subscribed))))
    (gnus val t slave)
    (make-local-variable 'gnus-group-use-permanent-levels)
    (setq gnus-group-use-permanent-levels val)))
;; --------------------------------------------------------------------

So gnus-no-server starts gnus at level 2, and that is why I do not see
my nnfolders.

The easy way out would be to define a function / key that calls
gnus-no-server with argument 3. This, however, does not work for me,
because I also launch gnus-no-server directly from org (they were kind
enough to accept a patch for doing this); this is done by a direct call
to gnus-no-server, without any arguments.

So I guess my only choice (?) is to play with
gnus-level-default-subscribed. But this has not worked either. I have
tried to set it to value 4 in .gnus, and also in hook gnus-started-hook,
but nothing seems to help. Even if the variable has value 4 in the Group
buffer, I still can not see my nnfolders.

What's the right way to fix the problem?

BTW, finding the problem took quite a bit of work. Future generations
might appreciate it if someone would add a little warning text about
gnus-no-server in the manual in section "Group Levels", where the
display of groups is described otherwise.

--

Jarmo

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

* Re: gnus-no-server and startup level
  2012-10-17 14:41 gnus-no-server and startup level Jarmo Hurri
@ 2012-10-17 14:56 ` Jarmo Hurri
  2012-10-17 15:47   ` Tassilo Horn
  2012-10-18  6:26 ` Jarmo Hurri
  1 sibling, 1 reply; 6+ messages in thread
From: Jarmo Hurri @ 2012-10-17 14:56 UTC (permalink / raw)
  To: info-gnus-english


Jarmo Hurri <jarmo.hurri@syk.fi> writes:

> So I guess my only choice (?) is to play with
> gnus-level-default-subscribed. But this has not worked either. I have
> tried to set it to value 4 in .gnus, and also in hook gnus-started-hook,
> but nothing seems to help. Even if the variable has value 4 in the Group
> buffer, I still can not see my nnfolders.
>
> What's the right way to fix the problem?

Problem solved: I needed to setq the value of the variable in my
.emacs-file, not in any hooks or in .gnus.

But I would still appreciate the addition to the manual. And perhaps
somebody telling me if there is a better way to achieve what I have
done: playing with gnus-level-default-subscribed seems a bit weird to
me.

--

Jarmo

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

* Re: gnus-no-server and startup level
  2012-10-17 14:56 ` Jarmo Hurri
@ 2012-10-17 15:47   ` Tassilo Horn
  2012-10-17 17:43     ` Jarmo Hurri
  0 siblings, 1 reply; 6+ messages in thread
From: Tassilo Horn @ 2012-10-17 15:47 UTC (permalink / raw)
  To: info-gnus-english

Jarmo Hurri <jarmo.hurri@syk.fi> writes:

> Problem solved: I needed to setq the value of the variable in my
> .emacs-file, not in any hooks or in .gnus.

Indeed.  Gnus loads the `gnus-init-file' after `gnus-no-server-1'...

> But I would still appreciate the addition to the manual. And perhaps
> somebody telling me if there is a better way to achieve what I have
> done: playing with gnus-level-default-subscribed seems a bit weird to
> me.

That's what I would have suggested you.

But that `gnus-no-server' is concerned with levels at all doesn't seem
right.  Why should I want to use a different level with `gnus-no-server'
than with `gnus'?

Bye,
Tassilo

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

* Re: gnus-no-server and startup level
  2012-10-17 15:47   ` Tassilo Horn
@ 2012-10-17 17:43     ` Jarmo Hurri
  2012-10-18  6:41       ` Tassilo Horn
  0 siblings, 1 reply; 6+ messages in thread
From: Jarmo Hurri @ 2012-10-17 17:43 UTC (permalink / raw)
  To: info-gnus-english


Tassilo Horn <tsdh@gnu.org> writes:

> But that `gnus-no-server' is concerned with levels at all doesn't seem
> right.  Why should I want to use a different level with
> `gnus-no-server' than with `gnus'?

I think they give the explanation here:

http://comments.gmane.org/gmane.emacs.gnus.general/11479

That is, for historical reasons: it seems that a large number of users
are used to reading their mail this way.

--

Jarmo

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

* Re: gnus-no-server and startup level
  2012-10-17 14:41 gnus-no-server and startup level Jarmo Hurri
  2012-10-17 14:56 ` Jarmo Hurri
@ 2012-10-18  6:26 ` Jarmo Hurri
  1 sibling, 0 replies; 6+ messages in thread
From: Jarmo Hurri @ 2012-10-18  6:26 UTC (permalink / raw)
  To: info-gnus-english


> So gnus-no-server starts gnus at level 2, and that is why I do not see
> my nnfolders.

Thinking about this overnight I came up with an idea. Since
gnus-no-server needs to be started at level 2 for legacy reasons, but
there seems to be more than one person who would want it to start with
the default level setup, could we not have a boolean variable for this?
Something like

gnus-no-server-startup-level-default-subscribed-minus-1

whose default value would be t for legacy reasons. Setting this to nil
would mean that gnus-no-server would not enforce a startup level, nor
would it set gnus-group-use-permanent-levels. This would imply minor
changes in the following function; I can try to send a patch later if
need be:

;; ------------------------------------------------------------------
(defun gnus-no-server-1 (&optional arg slave)
  "Read network news.
If ARG is a positive number, Gnus will use that as the startup
level.  If ARG is nil, Gnus will be started at level 2
\(`gnus-level-default-subscribed' minus one).  If ARG is non-nil
and not a positive number, Gnus will prompt the user for the name
of an NNTP server to use.  As opposed to \\[gnus], this command
will not connect to the local server."
  (interactive "P")
  (let ((val (or arg (1- gnus-level-default-subscribed))))
    (gnus val t slave)
    (make-local-variable 'gnus-group-use-permanent-levels)
    (setq gnus-group-use-permanent-levels val)))
;; ------------------------------------------------------------------

The problem with the current "solution" - setting
gnus-level-default-subscribed - is that, first, it messes the value of
that variable and, second, gnus-group-use-permanent-levels is still set,
which affects the visibility of groups.

--

Jarmo

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

* Re: gnus-no-server and startup level
  2012-10-17 17:43     ` Jarmo Hurri
@ 2012-10-18  6:41       ` Tassilo Horn
  0 siblings, 0 replies; 6+ messages in thread
From: Tassilo Horn @ 2012-10-18  6:41 UTC (permalink / raw)
  To: info-gnus-english

Jarmo Hurri <jarmo.hurri@syk.fi> writes:

>> But that `gnus-no-server' is concerned with levels at all doesn't
>> seem right.  Why should I want to use a different level with
>> `gnus-no-server' than with `gnus'?
>
> I think they give the explanation here:
>
> http://comments.gmane.org/gmane.emacs.gnus.general/11479
>
> That is, for historical reasons: it seems that a large number of users
> are used to reading their mail this way.

Well, ok, now it's 15 years later.  Maybe we should take another stab at
separating "don't contact servers" from "show only this level".  At
least I agree very much with Dan Christensen's suggestions.

(But my vote shouldn't count too much.  I almost never use
gnus-no-server.)

Bye,
Tassilo

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

end of thread, other threads:[~2012-10-18  6:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-17 14:41 gnus-no-server and startup level Jarmo Hurri
2012-10-17 14:56 ` Jarmo Hurri
2012-10-17 15:47   ` Tassilo Horn
2012-10-17 17:43     ` Jarmo Hurri
2012-10-18  6:41       ` Tassilo Horn
2012-10-18  6:26 ` Jarmo Hurri

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