Undo the last change.
authorueno <ueno>
Tue, 7 Dec 2004 06:16:34 +0000 (06:16 +0000)
committerueno <ueno>
Tue, 7 Dec 2004 06:16:34 +0000 (06:16 +0000)
lisp/riece-log.el

index f511d70..f8d6b47 100644 (file)
@@ -119,27 +119,45 @@ If integer, flash back only this line numbers. t means all lines."
        (expand-file-name name (expand-file-name server riece-log-directory))
       (expand-file-name name riece-log-directory))))
 
+(defun riece-log-get-directory-1 (identity)
+  (let ((prefix (riece-identity-canonicalize-prefix
+                (riece-identity-prefix identity)))
+       (server (riece-identity-server identity))
+       (map (assoc (riece-format-identity identity) riece-log-directory-map))
+       name)
+    (if map
+       (setq name (cdr map))
+      (expand-file-name (riece-log-encode-file-name prefix)
+                       (expand-file-name
+                        (riece-log-encode-file-name (concat "." server))
+                        riece-log-directory)))))
+
 (defun riece-log-encode-file-name (file-name)
   (if riece-log-file-name-coding-system
       (setq file-name
            (encode-coding-string file-name
                                  riece-log-file-name-coding-system)))
-  (let ((index 0))
-    (while (string-match "[^-0-9A-Za-z=_.\x80-\xFF]" file-name index)
-      (setq file-name (replace-match
-                      (format "=%02X"
-                              (aref file-name (match-beginning 0)))
+  (let ((index 0)
+       c)
+    (while (string-match "[^-0-9A-Za-z=_\x80-\xFF]" file-name index)
+      (setq c (aref file-name (match-beginning 0))
+           file-name (replace-match
+                      (if (eq c ?=)
+                          "=="
+                        (format "=%02X" c))
                       nil t file-name)
            index (+ 3 index)))
     file-name))
 
 (defun riece-log-decode-file-name (file-name)
   (let ((index 0))
-    (while (string-match "=\\([0-7][0-9A-F]\\)" file-name index)
+    (while (string-match "==\\|=\\([0-7][0-9A-F]\\)" file-name index)
       (setq file-name (replace-match
-                      (char-to-string
-                       (car (read-from-string
-                             (concat "?\\x" (match-string 1 file-name)))))
+                      (if (eq (aref file-name (match-end 0)) ?=)
+                          "="
+                        (char-to-string
+                         (car (read-from-string
+                               (concat "?\\x" (match-string 1 file-name))))))
                       nil t file-name)
            index (1+ index)))
     file-name)