From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40967 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.emacs.gnus.general Subject: patch: create nonexistent groups in nnmaildir-save-mail Date: Tue, 25 Dec 2001 18:59:24 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035176440 3734 80.91.224.250 (21 Oct 2002 05:00:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:00:40 +0000 (UTC) Return-Path: Original-Received: (qmail 3354 invoked from network); 26 Dec 2001 00:00:18 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 26 Dec 2001 00:00:18 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16J1Tx-0004V4-00; Tue, 25 Dec 2001 17:59:41 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 25 Dec 2001 17:59:33 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id RAA10946 for ; Tue, 25 Dec 2001 17:59:22 -0600 (CST) Original-Received: (qmail 3338 invoked by alias); 25 Dec 2001 23:59:25 -0000 Original-Received: (qmail 3333 invoked from network); 25 Dec 2001 23:59:25 -0000 Original-Received: from multivac.student.cwru.edu (HELO multivac.cwru.edu) (qmail-remote@129.22.96.25) by gnus.org with SMTP; 25 Dec 2001 23:59:25 -0000 Original-Received: (qmail 11135 invoked by uid 500); 25 Dec 2001 23:59:46 -0000 Original-To: ding@gnus.org Mail-Copies-To: nobody Mail-Followup-To: ding@gnus.org Original-Lines: 8 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 (i386-redhat-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:40967 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:40967 --=-=-= Oops. I had thought nnmail took care of this. * nnmaildir.el (nnmaildir-save-mail): create the destination groups if they do not exist. paul --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnmaildir.patch Index: lisp/nnmaildir.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnmaildir.el,v retrieving revision 6.3 diff -u -r6.3 nnmaildir.el --- lisp/nnmaildir.el 2001/12/21 23:13:00 6.3 +++ lisp/nnmaildir.el 2001/12/26 00:11:36 @@ -37,7 +37,7 @@ ;; * We make it easy to manipulate marks, etc., from outside Gnus. ;; * All information about a group is stored in the maildir, for easy ;; backup and restoring. -;; * Use the filesystem as a database. +;; * We use the filesystem as a database. ;; ;; Todo: ;; * Ignore old NOV data when gnus-extra-headers has changed. @@ -1383,18 +1383,23 @@ (catch 'return (if group-art nil (throw 'return nil)) - (let ((group-art group-art) - x nnmaildir--file deactivate-mark) + (let ((ret group-art) + ga gname x groups nnmaildir--file deactivate-mark) (save-excursion (goto-char (point-min)) (save-match-data (while (looking-at "From ") (replace-match "X-From-Line: ") (forward-line 1)))) - (setq x (caar group-art) group-art (cdr group-art)) - (if (nnmaildir-request-accept-article x) nil - (throw 'return nil)) ; not that nnmail bothers to check - (setq x (nnmaildir--prepare nil x) + (setq groups (nnmaildir--srv-get-groups nnmaildir--cur-server) + ga (car group-art) group-art (cdr group-art) + gname (car ga)) + (or (intern-soft gname groups) + (nnmaildir-request-create-group gname) + (throw 'return nil)) ;; not that nnmail bothers to check :( + (if (nnmaildir-request-accept-article gname) nil + (throw 'return nil)) + (setq x (nnmaildir--prepare nil gname) nnmaildir--file (nnmaildir--srv-get-dir nnmaildir--cur-server) nnmaildir--file (concat nnmaildir--file (nnmaildir--grp-get-name x)) @@ -1406,10 +1411,13 @@ (nnmaildir--art-get-prefix x) (nnmaildir--art-get-suffix x))) (while group-art - (setq x (caar group-art) group-art (cdr group-art)) - (if (nnmaildir-request-accept-article x) nil - (throw 'return nil)))) - group-art)) + (setq ga (car group-art) group-art (cdr group-art) + gname (car ga)) + (if (and (or (intern-soft gname groups) + (nnmaildir-request-create-group gname)) + (nnmaildir-request-accept-article gname)) nil + (setq ret (delq ga ret)))) ;; We'll still try the other groups + ret))) (defun nnmaildir-active-number (group) (let ((x (nnmaildir--prepare nil group))) --=-=-=--