From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/29516 Path: main.gmane.org!not-for-mail From: Jan Vroonhof Newsgroups: gmane.emacs.gnus.general Subject: Re: major problem with recent cvs Date: 14 Mar 2000 18:17:39 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035166172 3165 80.91.224.250 (21 Oct 2002 02:09:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:09:32 +0000 (UTC) Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by mailhost.sclp.com (Postfix) with ESMTP id 2C479D051E for ; Tue, 14 Mar 2000 12:18:53 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by lisa.math.uh.edu (8.9.1/8.9.1) with ESMTP id LAB17259; Tue, 14 Mar 2000 11:18:39 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 14 Mar 2000 11:17:49 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id LAA29410 for ; Tue, 14 Mar 2000 11:17:35 -0600 (CST) Original-Received: from frege.math.ethz.ch (frege-d-math-north-g-west.math.ethz.ch [129.132.145.3]) by mailhost.sclp.com (Postfix) with ESMTP id A2A19D051E for ; Tue, 14 Mar 2000 12:17:47 -0500 (EST) Original-Received: (from daemon@localhost) by frege.math.ethz.ch (8.9.1/8.9.1) id SAA24993 for ; Tue, 14 Mar 2000 18:17:46 +0100 (MET) Original-Received: from urysohn(129.132.146.167), claiming to be "urysohn.math.ethz.ch" via SMTP by frege, id smtpdAAAa0066V; Tue Mar 14 18:17:40 2000 Original-Received: (vroonhof@localhost) by urysohn.math.ethz.ch (8.9.3/D-MATH-client) id SAA24924; Tue, 14 Mar 2000 18:17:39 +0100 X-Authentication-Warning: urysohn.math.ethz.ch: vroonhof set sender to vroonhof@math.ethz.ch using -f Original-To: ding@gnus.org In-Reply-To: Simon Josefsson's message of "Tue, 14 Mar 2000 00:03:12 GMT" Original-Lines: 232 User-Agent: Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.2 (Iris) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:29516 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:29516 Simon Josefsson writes: > Glancing recent modifications made me came up with this patch. Please > test if it work and I'll commit it. > > 2000-03-14 Simon Josefsson > > * nnheader.el (nnheader-group-pathname): Add "/". > > * nnmail.el (nnmail-group-pathname): Ditto. Here is an untested (but IMO better) patch, with the help of igrep and a keyboard macro. In a new development cycle, somebody should do this for the whole of gnus. 2000-03-14 Jan Vroonhof * nnmh.el (nnmh-retrieve-headers): Use expand-file-name instead of concat. (nnmh-request-article): ditto. (nnmh-request-expire-articles): ditto. (nnmh-request-move-article): ditto. (nnmh-request-replace-article): ditto. (nnmh-request-rename-group): ditto. (nnmh-save-mail): ditto. (nnmh-active-number): ditto. (nnmh-update-gnus-unreads): ditto. (nnmh-deletable-article-p): ditto. * nnml.el (nnml-request-article): Use expand-file-name instead of concat. (nnml-request-rename-group): ditto. (nnml-save-mail): ditto. (nnml-generate-nov-file): ditto. Index: nnmh.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnmh.el,v retrieving revision 5.10 diff -u -u -r5.10 nnmh.el --- nnmh.el 1999/12/04 06:38:52 5.10 +++ nnmh.el 2000/03/14 17:15:05 @@ -91,10 +91,10 @@ 'headers (while articles (when (and (file-exists-p - (setq file (concat (file-name-as-directory - nnmh-current-directory) + (setq file (expand-file-name (int-to-string - (setq article (pop articles)))))) + (setq article (pop articles))) + nnmh-current-directory))) (not (file-directory-p file))) (insert (format "221 %d Article retrieved.\n" article)) (setq beg (point)) @@ -141,7 +141,7 @@ (nnmh-possibly-change-directory newsgroup server) (let ((file (if (stringp id) nil - (concat nnmh-current-directory (int-to-string id)))) + (expand-file-name (int-to-string id) nnmh-current-directory))) (pathname-coding-system 'binary) (nntp-server-buffer (or buffer nntp-server-buffer))) (and (stringp file) @@ -256,8 +256,8 @@ (nnheader-init-server-buffer) (while (and articles is-old) - (setq article (concat nnmh-current-directory - (int-to-string (car articles)))) + (setq article (expand-file-name + (int-to-string (car articles)) nnmh-current-directory)) (when (setq mod-time (nth 5 (file-attributes article))) (if (and (nnmh-deletable-article-p newsgroup (car articles)) (setq is-old @@ -297,7 +297,7 @@ (nnmh-possibly-change-directory group server) (condition-case () (funcall nnmail-delete-file-function - (concat nnmh-current-directory (int-to-string article))) + (expand-file-name (int-to-string article) nnmh-current-directory)) (file-error nil)))) result)) @@ -330,7 +330,7 @@ (ignore-errors (nnmail-write-region (point-min) (point-max) - (concat nnmh-current-directory (int-to-string article)) + (expand-file-name (int-to-string article) nnmh-current-directory) nil (if (nnheader-be-verbose 5) nil 'nomesg)) t))) @@ -386,8 +386,8 @@ (let ((files (nnheader-article-to-file-alist old-dir))) (while files (rename-file - (concat old-dir (cdar files)) - (concat new-dir (cdar files))) + (expand-file-name (cdar files) old-dir) + (expand-file-name (cdar files) new-dir)) (pop files))) (when (<= (length (directory-files old-dir)) 2) (ignore-errors @@ -443,9 +443,10 @@ first) (while ga (nnmh-possibly-create-directory (caar ga)) - (let ((file (concat (nnmail-group-pathname - (caar ga) nnmh-directory) - (int-to-string (cdar ga))))) + (let ((file (expand-file-name + (int-to-string (cdar ga)) + (nnmail-group-pathname + (caar ga) nnmh-directory)))) (if first ;; It was already saved, so we just make a hard link. (funcall nnmail-crosspost-link-function first file t) @@ -481,8 +482,9 @@ (while (or ;; See whether the file exists... (file-exists-p - (setq file (concat (nnmail-group-pathname group nnmh-directory) - (int-to-string (cdr active))))) + (setq file (expand-file-name + (int-to-string (cdr active)) + (nnmail-group-pathname group nnmh-directory)))) ;; ... or there is a buffer that will make that file exist ;; in the future. (get-file-buffer file)) @@ -499,7 +501,7 @@ (directory-files nnmh-current-directory nil "^[0-9]+$" t)) '<)) - (nnmh-file (concat dir ".nnmh-articles")) + (nnmh-file (expand-file-name ".nnmh-articles" dir)) new articles) ;; Load the .nnmh-articles file. (when (file-exists-p nnmh-file) @@ -526,7 +528,7 @@ (while (setq art (pop arts)) (when (not (equal (nth 5 (file-attributes - (concat dir (int-to-string (car art))))) + (expand-file-name (int-to-string (car art)) dir))) (cdr art))) (setq articles (delq art articles)) (push (car art) new)))) @@ -538,7 +540,7 @@ (lambda (art) (cons art (nth 5 (file-attributes - (concat dir (int-to-string art)))))) + (expand-file-name (int-to-string art) dir))))) new))) ;; Make Gnus mark all new articles as unread. (when new @@ -557,7 +559,7 @@ (defun nnmh-deletable-article-p (group article) "Say whether ARTICLE in GROUP can be deleted." - (let ((path (concat nnmh-current-directory (int-to-string article)))) + (let ((path (expand-file-name (int-to-string article) nnmh-current-directory))) ;; Writable. (and (file-writable-p path) (or Index: nnml.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnml.el,v retrieving revision 5.21 diff -u -u -r5.21 nnml.el --- nnml.el 2000/03/13 19:43:14 5.21 +++ nnml.el 2000/03/14 17:15:05 @@ -174,7 +174,7 @@ (nnmail-group-pathname (car group-num) nnml-directory)))))) - (setq path (concat gpath (int-to-string (cdr group-num))))) + (setq path (expand-file-name (int-to-string (cdr group-num)) gpath))) (setq path (nnml-article-to-file id))) (cond ((not path) @@ -439,13 +439,13 @@ (let ((files (nnheader-article-to-file-alist old-dir))) (while files (rename-file - (concat old-dir (cdar files)) - (concat new-dir (cdar files))) + (expand-file-name (cdar files) old-dir) + (expand-file-name (cdar files) new-dir)) (pop files))) ;; Move .overview file. - (let ((overview (concat old-dir nnml-nov-file-name))) + (let ((overview (expand-file-name nnml-nov-file-name old-dir))) (when (file-exists-p overview) - (rename-file overview (concat new-dir nnml-nov-file-name)))) + (rename-file overview (expand-file-name nnml-nov-file-name new-dir)))) (when (<= (length (directory-files old-dir)) 2) (ignore-errors (delete-directory old-dir))) ;; That went ok, so we change the internal structures. @@ -590,9 +590,10 @@ first) (while ga (nnml-possibly-create-directory (caar ga)) - (let ((file (concat (nnmail-group-pathname - (caar ga) nnml-directory) - (int-to-string (cdar ga))))) + (let ((file (expand-file-name + (int-to-string (cdar ga)) + (nnmail-group-pathname + (caar ga) nnml-directory)))) (if first ;; It was already saved, so we just make a hard link. (funcall nnmail-crosspost-link-function first file t) @@ -756,7 +757,7 @@ (defun nnml-generate-nov-file (dir files) (let* ((dir (file-name-as-directory dir)) - (nov (concat dir nnml-nov-file-name)) + (nov (expand-file-name nnml-nov-file-name dir)) (nov-buffer (get-buffer-create " *nov*")) chars file headers) (save-excursion @@ -769,7 +770,8 @@ (when (file-exists-p nov) (funcall nnmail-delete-file-function nov)) (while files - (unless (file-directory-p (setq file (concat dir (cdar files)))) + (unless (file-directory-p (setq file (expand-file-name + (cdar files) dir))) (erase-buffer) (nnheader-insert-file-contents file) (narrow-to-region