Agent and cache are happy with "...".
authorShengHuo ZHU <zsh@cs.rochester.edu>
Mon, 8 Nov 1999 04:11:07 +0000 (04:11 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Mon, 8 Nov 1999 04:11:07 +0000 (04:11 +0000)
Remove backslash before dot.

lisp/ChangeLog
lisp/gnus-agent.el
lisp/gnus-cache.el
lisp/gnus-util.el
lisp/nnheader.el
lisp/nnmail.el

index 6d72a4f..3a4148c 100644 (file)
@@ -1,3 +1,17 @@
+1999-11-07 22:56:46  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-agent.el (gnus-agent-save-group-info): Remove backslash
+       before dot.
+       * gnus-util.el (gnus-write-active-file): Ditto.
+
+1999-11-07 22:31:10  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * nnheader.el (nnheader-replace-duplicate-chars-in-string): New
+       function.
+       * gnus-cache.el (gnus-cache-file-name): Use it.
+       * gnus-agent.el (gnus-agent-group-path): Use it.
+       * nnmail.el (nnmail-group-pathname): Use it.
+
 1999-11-07 21:07:55  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-start.el (gnus-active-to-gnus-format): Don't insert backslash
index 1b16f3d..d35bf36 100644 (file)
@@ -624,15 +624,23 @@ the actual number of articles toggled is returned."
               (concat "^" (regexp-quote group) " ") nil t)
          (gnus-delete-line))
        (insert (format "%S %d %d y\n" (intern group) (cdr active)
-                       (car active)))))))
+                       (car active)))
+       (goto-char (point-max))
+       (while (search-backward "\\." nil t)
+         (delete-char 1))))))
 
 (defun gnus-agent-group-path (group)
   "Translate GROUP into a path."
   (if nnmail-use-long-file-names
       (gnus-group-real-name group)
-    (nnheader-replace-chars-in-string
-     (nnheader-translate-file-chars (gnus-group-real-name group))
-     ?. ?/)))
+    (nnheader-translate-file-chars
+     (nnheader-replace-chars-in-string
+      (nnheader-replace-duplicate-chars-in-string
+       (nnheader-replace-chars-in-string 
+       (gnus-group-real-name group)
+       ?/ ?_)
+       ?. ?_)
+      ?. ?/))))
 
 \f
 
index 30927d7..fcb8bb5 100644 (file)
@@ -412,7 +412,9 @@ Returns the list of articles removed."
           (nnheader-translate-file-chars
            (if (gnus-use-long-file-name 'not-cache)
                group
-             (let ((group (nnheader-replace-chars-in-string group ?/ ?_)))
+             (let ((group (nnheader-replace-duplicate-chars-in-string
+                           (nnheader-replace-chars-in-string group ?/ ?_)
+                           ?. ?_)))
                ;; Translate the first colon into a slash.
                (when (string-match ":" group)
                  (aset group (match-beginning 0) ?/))
index fac744c..761e3b3 100644 (file)
@@ -953,7 +953,10 @@ ARG is passed to the first function."
                         (or (cdr (symbol-value sym))
                             (car (symbol-value sym)))
                         (car (symbol-value sym))))))
-     hashtb)))
+     hashtb)
+    (goto-char (point-max))
+    (while (search-backward "\\." nil t)
+      (delete-char 1))))
 
 (provide 'gnus-util)
 
index 19a655f..c193ca1 100644 (file)
@@ -676,6 +676,21 @@ without formatting."
       (setq idx (1+ idx)))
     string))
 
+(defun nnheader-replace-duplicate-chars-in-string (string from to)
+  "Replace characters in STRING from FROM to TO."
+  (let ((string (substring string 0))  ;Copy string.
+       (len (length string))
+       (idx 0) prev i)
+    ;; Replace all occurrences of FROM with TO.
+    (while (< idx len)
+      (setq i (aref string idx))
+      (when (and (eq prev from) (= i from))
+       (aset string (1- idx) to)
+       (aset string idx to))
+      (setq prev i)
+      (setq idx (1+ idx)))
+    string))
+
 (defun nnheader-file-to-group (file &optional top)
   "Return a group name based on FILE and TOP."
   (nnheader-replace-chars-in-string
index 73057c2..88ccb1e 100644 (file)
@@ -463,6 +463,9 @@ parameter.  It should return nil, `warn' or `delete'."
   "Make pathname for GROUP."
   (concat
    (let ((dir (file-name-as-directory (expand-file-name dir))))
+     (setq group (nnheader-replace-duplicate-chars-in-string
+                 (nnheader-replace-chars-in-string group ?/ ?_)
+                 ?. ?_))
      (setq group (nnheader-translate-file-chars group))
      ;; If this directory exists, we use it directly.
      (if (or nnmail-use-long-file-names