Gnus development mailing list
 help / color / mirror / Atom feed
From: Jan Vroonhof <vroonhof@math.ethz.ch>
Subject: Re: major problem with recent cvs
Date: 14 Mar 2000 18:17:39 +0100	[thread overview]
Message-ID: <byr9ddtqrw.fsf@math.ethz.ch> (raw)
In-Reply-To: Simon Josefsson's message of "Tue, 14 Mar 2000 00:03:12 GMT"

Simon Josefsson <jas@pdc.kth.se> 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  <jas@pdc.kth.se>
> 
> 	* 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  <vroonhof@math.ethz.ch>

	* 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



  parent reply	other threads:[~2000-03-14 17:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-13 16:54 Laura Conrad
2000-03-13 23:58 ` Simon Josefsson
2000-03-14 10:48   ` Kai Großjohann
2000-03-14 11:42     ` Simon Josefsson
2000-03-14 14:56       ` lconrad
2000-03-14 15:07         ` Karl Kleinpaste
2000-03-14 15:37           ` Laura Conrad
2000-03-14 15:59         ` Kai Großjohann
2000-03-14 16:18           ` Laura Conrad
2000-03-14 16:55           ` Gunnar Evermann
2000-03-14 16:57             ` Kai Großjohann
2000-03-14 16:47         ` Kai Großjohann
2000-03-14 20:18           ` lconrad
2000-03-17 17:12         ` Resolution (was: Re: major problem with recent cvs) lconrad
2000-03-15 10:43       ` major problem with recent cvs Per Abrahamsen
2000-03-15 18:07         ` Jan Vroonhof
2000-03-16 10:34           ` Per Abrahamsen
2000-03-16 11:40             ` Jan Vroonhof
2000-03-17 13:20               ` Per Abrahamsen
2000-03-14 16:43   ` Jan Vroonhof
2000-03-14 17:17   ` Jan Vroonhof [this message]
     [not found] <8aj6qv$qvc$1@quimby.gnus.org>
2000-03-13 20:48 ` Emerick Rogul
2000-03-14 17:35   ` Matt Swift

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=byr9ddtqrw.fsf@math.ethz.ch \
    --to=vroonhof@math.ethz.ch \
    /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).