Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Knauel <knauel@informatik.uni-tuebingen.de>
Subject: Re: nnimap, gnus-agent and `/' as a subfolder separator
Date: Thu, 10 Apr 2003 16:47:10 +0200	[thread overview]
Message-ID: <vw3znmybea9.fsf@informatik.uni-tuebingen.de> (raw)
In-Reply-To: <u1y0b6w7z.fsf@xpediantsolutions.com>


Hi Kevin,

Kevin Greiner <kgreiner@xpediantsolutions.com> writes:

> I'm assuming that you mentioned nnmail-use-long-file-names because
> you debugged the code enough to localize the error.  Thanks.
>
> Eric Knauel <knauel@informatik.uni-tuebingen.de> writes:
>
> You've obviously read the code.  I could use a second opinion.  I've
> concluded that nnmail-group-pathname doesn't use
> nnmail-use-long-file-names as expected (at least as I would expected).
> The problem is that nnmail-group-pathname first converts periods (.)
> into underscores (_). It then checks nnmail-use-long-file-names and,
> if it is null, converts periods (.) into slashes (/).  But what's the
> point? By this time, no periods should remain in the group name.

Maybe it's this:

(defun nnmail-group-pathname (group dir &optional file)
  "Make file name for GROUP."
  (concat
   (let ((dir (file-name-as-directory (expand-file-name dir))))
     (setq group (nnheader-replace-duplicate-chars-in-string
                                   ^^^^^^^^^

This probably should be `nnheader-replace-chars-in-string'.

		  (nnheader-replace-chars-in-string group ?/ ?_)
		  ?. ?_))
     (setq group (nnheader-translate-file-chars group))
     ;; If this directory exists, we use it directly.
     (file-name-as-directory
      (if (or nnmail-use-long-file-names
	      (file-directory-p (concat dir group)))
	  (expand-file-name group dir)
	;; If not, we translate dots into slashes.
	(expand-file-name
	 (mm-encode-coding-string
	  (nnheader-replace-chars-in-string group ?. ?/)
	  nnmail-pathname-coding-system)
	 dir))))
   (or file "")))

With `nnheader-replace-duplicate-chars-in-string' the periods remain
in the group name:

(nnheader-replace-duplicate-chars-in-string "mail.uni.pu" ?. ?_)
=> "mail.uni.pu"

So the `(nnheader-replace-chars-in-string group ?. ?/)' in the
`nnmail-use-long-file-names' != nil case might be actually be a
hack. 

Using `dabbrev-expand' while coding Lisp is evil. ;-)

>> BTW I'm using (setq nnmail-use-long-file-names t) in my gnus.el.
>
> Yes, nnmail-use-long-file-names appears to be the problem.
>
> Let's see if this function fixes your problem.
>
> (defun gnus-agent-group-path (group)
>   "Translate GROUP into a file name."
>   (nnheader-translate-file-chars
>    (nnheader-replace-duplicate-chars-in-string
>     (nnheader-replace-chars-in-string 
>      (gnus-group-real-name group)
>      ?/ ?_)
>     ?. ?_)))
>
> You can either replace the original in gnus-agent.el or simply eval
> this form after loading gnus-agent.

That seems to solve the problem! I removed all directories and links
prefixed by "macnews/" in
`/Users/knauel/.gnus/News/agent/nnimap/webmail.macnews.de'. The next
`gnus-agent-fetch-session' created directories `macnews_xyz', which
open up properly. Thanks!

-Eric
-- 
"Excuse me --- Di Du Du Duuuuh Di Dii --- Huh Weeeheeee" (Albert King)




      reply	other threads:[~2003-04-10 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-09  9:01 Eric Knauel
2003-04-09 23:06 ` Danny Siu
2003-04-10  0:18 ` Kevin Greiner
2003-04-10 14:47   ` Eric Knauel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vw3znmybea9.fsf@informatik.uni-tuebingen.de \
    --to=knauel@informatik.uni-tuebingen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).