Subject: 23.1; nntp-marks-file-name is reset to nil and causes "IO error reading [...]: Is a directory"

From: Teemu Likonen <[email-masked]>
Date: Sun, 28 Feb 2010 11:46:48 +0200

Using Gnus agent is not exactly a pleasant experience. I have pretty
much the default settings and all my nntp servers are agentized. Now, in
the Group buffer I go plugged (Jj), check new news (g), download them
(Js) and go unplugged (Jj) again. Good, so far.

Then I enter some group and read news. When exiting from the Summary
buffer Gnus gives me ugly error messages (see below). I answered "yes"
to the both questions and got back to Group buffer.

--8<---------------cut here---------------start------------->8---
Error reading nntp marks file
/home/dtw/News/marks/news.inet.fi/comp/os/linux/misc/ ((error IO error
reading /home/dtw/News/marks/news.inet.fi/comp/os/linux/misc/: Is a
directory)). Continuing will use marks from .newsrc.eld.
Continue? (yes or no)

Could not write to /home/dtw/News/marks/news.inet.fi/comp/os/linux/misc/
((file-error Opening output file is a directory
/home/dtw/News/marks/news.inet.fi/comp/os/linux/misc/)).
Continue? (yes or no)
--8<---------------cut here---------------end--------------->8---

The error happens in file lisp/gnus/nntp.el, function nntp-open-marks
and form (condition-case ...).

The reason for this error is that variable nntp-marks-file-name is nil.
It _should_ be ".marks" but something sets it to nil when I go unplugged
with Jj (gnus-agent-toggle-plugged) command. Since the variable is nil
function nntp-group-pathname doesn't return complete path with filename
but only the directory name, hence the error in trying to read the file:
"error IO error reading [...]: Is a directory".

So there's a bug somewhere. Who is setting nntp-marks-file-name to nil
and why?

Below is my work-around which automatically sets the file name back to
".marks":

--8<---------------cut here---------------start------------->8---
(add-hook 'gnus-agent-unplugged-hook
          #'(lambda ()
              (setq nntp-marks-file-name ".marks")))
--8<---------------cut here---------------end--------------->8---