From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/59431 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: can't delete nnml groups Date: Thu, 16 Dec 2004 20:39:56 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1103197462 3686 80.91.229.6 (16 Dec 2004 11:44:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Dec 2004 11:44:22 +0000 (UTC) Original-X-From: ding-owner+M7971@lists.math.uh.edu Thu Dec 16 12:44:13 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ceu3J-0001GL-00 for ; Thu, 16 Dec 2004 12:44:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1CetzW-0002Ez-00; Thu, 16 Dec 2004 05:40:18 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1CetzN-0002Et-00 for ding@lists.math.uh.edu; Thu, 16 Dec 2004 05:40:09 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1CetzH-0007Nc-HY for ding@lists.math.uh.edu; Thu, 16 Dec 2004 05:40:03 -0600 Original-Received: from washington.hostforweb.net ([69.61.11.2]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1CetzG-0005Lm-00 for ; Thu, 16 Dec 2004 12:40:02 +0100 Original-Received: from localhost ([127.0.0.1]) by washington.hostforweb.net with esmtpa (Exim 4.43) id 1CetzE-00047A-Vx for ding@gnus.org; Thu, 16 Dec 2004 06:40:01 -0500 Original-To: ding@gnus.org X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:spHDlH45m2ZxEFnFerprAJIl8Kc= X-Hashcash: 1:20:041216:ding@gnus.org::glnSiPkRvxAh6LZQ:00001hoQ X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: main.gmane.org gmane.emacs.gnus.general:59431 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:59431 --=-=-= >>>>> In Katsumi Yamaoka wrote: > I noticed I cannot delete nnml groups if there are persistent > articles. > Debugger entered--Lisp error: (file-error "Removing old name: > is a directory" "/home/yamaoka/News/cache/nnml:foo.bar.baz") > delete-file("/home/yamaoka/News/cache/nnml:foo.bar.baz") > gnus-delete-file("/home/yamaoka/News/cache/nnml:foo.bar.baz") > gnus-cache-delete-group("nnml:foo.bar.baz") > gnus-request-delete-group("nnml:foo.bar.baz" (4)) > gnus-group-delete-group("nnml:foo.bar.baz" (4)) > call-interactively(gnus-group-delete-group) > There seems to be the same problem in `gnus-agent-delete-group'. > Although making articles persistent in nnml groups might be > nonsense, it will be useful for back ends which don't make local > article files. > Emacs 21 provides the `dired-delete-file' function which deletes > a file and also a directory recursively. Can't we use the copy > of it as `gnus-delete-file'? Here it is: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defun gnus-delete-file-1 (file) (if (eq t (car (file-attributes file))) ;; FILE is a directory. (let ((files (directory-files file t "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) (while files (gnus-delete-file-1 (car files)) (setq files (cdr files))) (delete-directory file)) ;; FILE is a file or a symlink. (delete-file file))) (defun gnus-delete-file (file) "Delete FILE or directory if it exists. If FILE is a directory, all files and subdirectories are also deleted." (when (file-exists-p file) (gnus-delete-file-1 file))) --=-=-=--