From: Adrian A. <Adr...@t-...> - 2004-05-29 22:00:58
|
I'd like to commit this patch soonish after review from wencem, disumu, or any other kind soul. I'll comply with the commit log rules of the erc project. ChangeLog is for review purposes and will be massaged into shape for commit. This gotta be automated. I hate manual "processes"! Thanks in advance, Adrian ChangeLog addition: 2004-05-29 Adrian Aichner <ad...@xe...> * erc-autojoin.el: Typo fix. * erc-dcc.el (erc-dcc-do-GET-command): Use expand-file-name. * erc-dcc.el (erc-dcc-get-file): Ditto. * erc-log.el (erc-generate-log-file-name-with-date): XEmacs set-buffer-multibyte compatibility. * erc-log.el (erc-generate-log-file-name-short): Use expand-file-name. * erc-log.el (erc-save-buffer-in-logs): Wrap `with-current-buffer' in `save-excursion' as suggested by Sebastian Freundt. * erc-members.el: XEmacs set-buffer-multibyte compatibility. * erc-sound.el: Use expand-file-name. * erc.el (erc-debug-log-file): Ditto. * erc.el (erc-find-file): Ditto. erc source patch: Diff command: cvs -f -z3 -q diff -u -N Files affected: erc.el erc-sound.el erc-members.el erc-log.el erc-dcc.el erc-autojoin.el Index: erc-autojoin.el =================================================================== RCS file: /cvsroot/erc/erc/erc-autojoin.el,v retrieving revision 1.9 diff -u -r1.9 erc-autojoin.el --- erc-autojoin.el 17 May 2004 17:44:04 -0000 1.9 +++ erc-autojoin.el 29 May 2004 21:37:54 -0000 @@ -28,7 +28,7 @@ ;; we /JOIN and /PART channels, this alist is updated to reflect our ;; current setup, so that when we reconnect, we rejoin the same ;; channels. The alist can be customized, so that the customized -;; value will be used when we reconnect in out next Emacs session. +;; value will be used when we reconnect in our next Emacs session. ;;; Code: Index: erc-dcc.el =================================================================== RCS file: /cvsroot/erc/erc/erc-dcc.el,v retrieving revision 1.84 diff -u -r1.84 erc-dcc.el --- erc-dcc.el 13 May 2004 17:53:48 -0000 1.84 +++ erc-dcc.el 29 May 2004 21:37:54 -0000 @@ -456,9 +456,9 @@ (file-name-nondirectory filename)) (or erc-dcc-get-default-directory default-directory) - (concat (or erc-dcc-get-default-directory - default-directory) - (file-name-nondirectory filename))))) + (expand-file-name (file-name-nondirectory filename) + (or erc-dcc-get-default-directory + default-directory))))) (cond ((file-exists-p file) (if (yes-or-no-p (format "File %s exists. Overwrite? " file)) @@ -808,8 +808,12 @@ proc) (with-current-buffer buffer (fundamental-mode) - ;; This is necessary to have the buffer saved as-is. - (set-buffer-multibyte nil) + ;; This is necessary to have the buffer saved as-is in GNU + ;; Emacs. + ;; XEmacs change: We don't have `set-buffer-multibyte', setting + ;; coding system to 'binary below takes care of us. + (when (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte nil)) (setq mode-line-process '(":%s") buffer-file-type t Index: erc-log.el =================================================================== RCS file: /cvsroot/erc/erc/erc-log.el,v retrieving revision 1.16 diff -u -r1.16 erc-log.el --- erc-log.el 17 May 2004 16:29:28 -0000 1.16 +++ erc-log.el 29 May 2004 21:37:55 -0000 @@ -275,10 +275,9 @@ "This function computes a short log file name. The name of the log file is composed of BUFFER and the current date. This function is a possible value for `erc-generate-log-file-name-function'." - (concat erc-log-channels-directory - "/" (buffer-name buffer) - "-" (format-time-string "%Y-%m-%d") - ".txt")) + (expand-file-name + (concat (buffer-name buffer) "-" (format-time-string "%Y-%m-%d") ".txt") + erc-log-channels-directory)) (defun erc-generate-log-file-name-short (buffer &rest ignore) "This function computes a short log file name. @@ -286,7 +285,8 @@ you can affect that using `rename-buffer' and the-like. This function is a possible value for `erc-generate-log-file-name-function'." - (concat erc-log-channels-directory "/" (buffer-name buffer) ".txt")) + (expand-file-name (concat (buffer-name buffer) ".txt") + erc-log-channels-directory)) (defun erc-generate-log-file-name-long (buffer target nick server port) "Generates a log-file name in the way ERC always did it. @@ -318,19 +318,20 @@ (when (erc-logging-enabled buffer) (let ((file (erc-current-logfile buffer)) (coding-system-for-write erc-log-file-coding-system)) - (with-current-buffer buffer - (save-restriction - (widen) - ;; early on in the initalisation, don't try and write the log out - (when (> erc-insert-marker (1+ erc-last-saved-position)) - (write-region (1+ (marker-position erc-last-saved-position)) - (marker-position erc-insert-marker) + (save-excursion + (with-current-buffer buffer + (save-restriction + (widen) + ;; early on in the initalisation, don't try and write the log out + (when (> erc-insert-marker (1+ erc-last-saved-position)) + (write-region (1+ (marker-position erc-last-saved-position)) + (marker-position erc-insert-marker) file t 'nomessage) - (if (and erc-truncate-buffer-on-save (interactive-p)) - (progn - (let ((inhibit-read-only t)) (erase-buffer)) - (move-marker erc-last-saved-position (point-max)) - (erc-display-prompt)) + (if (and erc-truncate-buffer-on-save (interactive-p)) + (progn + (let ((inhibit-read-only t)) (erase-buffer)) + (move-marker erc-last-saved-position (point-max)) + (erc-display-prompt)) (move-marker erc-last-saved-position ;; If we place erc-last-saved-position ;; at erc-insert-marker, because text @@ -340,7 +341,7 @@ ;; will always be equal to ;; erc-insert-marker). (1- (marker-position erc-insert-marker))))) - (set-buffer-modified-p nil))))) + (set-buffer-modified-p nil)))))) t) (provide 'erc-log) Index: erc-members.el =================================================================== RCS file: /cvsroot/erc/erc/erc-members.el,v retrieving revision 1.6 diff -u -r1.6 erc-members.el --- erc-members.el 18 Mar 2004 20:49:39 -0000 1.6 +++ erc-members.el 29 May 2004 21:37:55 -0000 @@ -35,6 +35,13 @@ ;;; Code: +;; Avoid miscompiling macro `erc-log' and `with-erc-channel-buffer' in +;; absence of loaded definition from 'erc. +;; See 2004-03-15_23-01_macro_err_1.txt in +;; http://labb.contactor.se/~matsl/smoketest/logs/ +;; or newer results for miscompiled macros. +(eval-when-compile (require 'erc)) + (require 'cl); for defstruct (defvar erc-members (makehash 'eq) Index: erc-sound.el =================================================================== RCS file: /cvsroot/erc/erc/erc-sound.el,v retrieving revision 1.4 diff -u -r1.4 erc-sound.el --- erc-sound.el 1 Nov 2003 21:04:36 -0000 1.4 +++ erc-sound.el 29 May 2004 21:37:55 -0000 @@ -116,7 +116,7 @@ ; (let ((filepath nil) ; (paths erc-sound-path)) ; (while (and paths -; (progn (setq filepath (concat (car paths) "/" file)) +; (progn (setq filepath (expand-file-name file (car paths))) ; (not (file-exists-p filepath)))) ; (setq paths (cdr paths))) ; (if (and (not (and filepath (file-exists-p filepath))) Index: erc.el =================================================================== RCS file: /cvsroot/erc/erc/erc.el,v retrieving revision 1.669 diff -u -r1.669 erc.el --- erc.el 26 May 2004 23:00:39 -0000 1.669 +++ erc.el 29 May 2004 21:37:58 -0000 @@ -1341,7 +1341,7 @@ (defvar erc-log-p nil "When set to t, generate debug messages in a separate debug buffer.") -(defvar erc-debug-log-file (concat (expand-file-name ".") "/ERC.debug") +(defvar erc-debug-log-file (expand-file-name "ERC.debug") "Debug log file name.") (defvar erc-dbuf nil) @@ -6239,7 +6239,7 @@ (if (file-readable-p filepath) filepath (progn (while (and path - (progn (setq filepath (concat (car path) "/" file)) + (progn (setq filepath (expand-file-name file (car path))) (not (file-readable-p filepath)))) (setq path (cdr path))) (if path filepath nil))))) -- Adrian Aichner mailto:ad...@xe... http://www.xemacs.org/ |