[S] [PATCH] erc: take 2 to make erc-generate-log-file-name-long and erc-log-file-coding-system xemacs-compatible
Adrian Aichner <[email protected]>
| Newsgroups | gmane.emacs.xemacs.design,gmane.emacs.erc.general |
|---|---|
| Message-ID | <[email protected]> |
SUPERSEDES <[email protected]> Hello erc developers, this should be applied instead of what I sent in under message-id <[email protected]> NB: Only the first hunk changed. This is what I will start with in the XEmacs ERC Package. Best regards, Adrian 2003-11-25 Adrian Aichner <[email protected]> * erc-log.el (erc-log-file-coding-system): Use 'binary coding-system under XEmacs (instead of 'emacs-mule). * erc-log.el (erc-w32-invalid-file-characters): Removed as no longer needed. * erc-log.el (erc-generate-log-file-name-long): Use `convert-standard-filename', which exists in XEmacs too. erc source patch: Diff command: cvs -f -z3 -q diff -u -N Files affected: erc-log.el Index: erc-log.el =================================================================== RCS file: /cvsroot/erc/erc/erc-log.el,v retrieving revision 1.8 diff -u -r1.8 erc-log.el --- erc-log.el 18 Oct 2003 14:00:24 -0000 1.8 +++ erc-log.el 25 Nov 2003 22:20:00 -0000 @@ -153,28 +153,15 @@ :group 'erc-log :type 'boolean) -(defcustom erc-log-file-coding-system 'emacs-mule +(defcustom erc-log-file-coding-system (if (featurep 'xemacs) + 'binary + 'emacs-mule) "*The coding system ERC should use for writing log files. This should ideally, be a \"catch-all\" coding system, like `emacs-mule', or `iso-2022-7bit'." :group 'erc-log) -(defconst erc-w32-invalid-file-characters - (if (memq system-type '(windows-nt ms-dos cygwin)) - (let ((regexp file-name-invalid-regexp)) - (when (string-match "^.*\\?\\(:.*\\)" regexp) - (setq regexp (match-string 1 regexp)) - (when (string-match "\\[\\(.*\\)]" regexp) - (setq regexp (concat "[" - (regexp-quote - (concat ":" - (match-string 1 regexp))) - "]")))) - regexp) - nil) - "Regular expression matching invalid file-name characters on w32 systems.") - ;;;###autoload (autoload 'erc-log-mode "erc-log" nil t) (define-erc-module log nil "Automatically logs things you receive on IRC into files. @@ -304,10 +291,8 @@ ((numberp port) (number-to-string port))) ".txt"))) ;; we need a make-safe-file-name function. - (if erc-w32-invalid-file-characters - (while (string-match erc-w32-invalid-file-characters file) - (setq file (replace-match "-" nil t file)))) - (concat erc-log-channels-directory "/" file))) + (expand-file-name (convert-standard-filename file) + erc-log-channels-directory))) ;;;###autoload (defun erc-save-buffer-in-logs (&optional buffer) -- Adrian Aichner mailto:[email protected] http://www.xemacs.org/