From 524d149c18a3e96cae76b3433f79dd1dbc5433db Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 7 Dec 2004 06:16:34 +0000 Subject: [PATCH] Undo the last change. --- lisp/riece-log.el | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/lisp/riece-log.el b/lisp/riece-log.el index f511d70..f8d6b47 100644 --- a/lisp/riece-log.el +++ b/lisp/riece-log.el @@ -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) -- 1.7.10.4