From 03a91a4d299d85c536c1997fb7acac759ff16b98 Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 12 Mar 2005 23:39:10 +0000 Subject: [PATCH] * riece.el (riece-buffer-alist): Init riece-debug-buffer. * riece-globals.el (riece-debug-buffer): New variable. * riece-filter.el (riece-sentinel): Use riece-debug. * riece-display.el (riece-channel-buffer-name): Use riece-debug. * riece-button.el (riece-identity-button-click): Use riece-debug. * riece-debug.el (riece-debug): New function. (riece-ignore-errors): Use it. --- lisp/ChangeLog | 8 ++++++++ lisp/riece-button.el | 3 ++- lisp/riece-debug.el | 21 ++++++++++++++++++++- lisp/riece-display.el | 3 ++- lisp/riece-filter.el | 9 +++++---- lisp/riece-globals.el | 2 ++ lisp/riece.el | 3 ++- 7 files changed, 41 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eb9e3d3..8e0b422 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2005-03-12 Daiki Ueno + * riece.el (riece-buffer-alist): Init riece-debug-buffer. + * riece-globals.el (riece-debug-buffer): New variable. + * riece-filter.el (riece-sentinel): Use riece-debug. + * riece-display.el (riece-channel-buffer-name): Use riece-debug. + * riece-button.el (riece-identity-button-click): Use riece-debug. + * riece-debug.el (riece-debug): New function. + (riece-ignore-errors): Use it. + * riece-filter.el (riece-filter): Removed (eobp) check. 2005-03-06 Daiki Ueno diff --git a/lisp/riece-button.el b/lisp/riece-button.el index ff8c0e5..f125dbf 100644 --- a/lisp/riece-button.el +++ b/lisp/riece-button.el @@ -102,7 +102,8 @@ This function is used as a callback for a channel button." (select-window window) (set-window-point window point)) (if riece-debug - (message "buffer %s not visible" (buffer-name buffer))))))) + (riece-debug (format "buffer %s not visible" + (buffer-name buffer)))))))) (defun riece-identity-button-popup-menu (event) "Popup the menu for identity buttons." diff --git a/lisp/riece-debug.el b/lisp/riece-debug.el index abe461c..eaa1b9e 100644 --- a/lisp/riece-debug.el +++ b/lisp/riece-debug.el @@ -27,6 +27,24 @@ (require 'riece-globals) (require 'riece-options) +(defun riece-debug (message &optional detail) + "Print a one-line debug MESSAGE at the bottom of the frame. +If the optional 2nd argument DETAIL is specified, it is stored into +`riece-debug-buffer'." + (message "riece-debug: %s" message) + (save-excursion + (set-buffer riece-debug-buffer) + (goto-char (point-max)) + (let ((point (point))) + (if detail + (insert message "\n" detail "\n") + (insert message "\n")) + (goto-char point) + (beginning-of-line) + (while (not (eobp)) + (insert "riece-debug: ") + (forward-line))))) + (defun riece-debug-reset-standard-output () "Reset `riece-temp-buffer' to be used as `standard-output'." (save-excursion @@ -61,7 +79,8 @@ backtrace to standard-output." (goto-char (point-min)) (if (re-search-forward "^ signal(" nil t) (delete-region (point-min) (match-beginning 0))) - (message "Error in `%s': %S\n%s" ,location error (buffer-string)))) + (riece-debug (format "Error in `%s': %S" ,location error) + (buffer-string)))) nil))) (put 'riece-ignore-errors 'lisp-indent-function 1) diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 5a16cdf..037f437 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -404,7 +404,8 @@ Local to the buffer in `riece-buffer-list'.") (if channels (setq identity (car channels)) (if riece-debug - (message "%S is not a member of riece-current-channels" identity))) + (riece-debug (format "%S is not a member of riece-current-channels" + identity)))) (format riece-channel-buffer-format (riece-format-identity identity)))) (eval-when-compile diff --git a/lisp/riece-filter.el b/lisp/riece-filter.el index ebf1a2c..a07d0c6 100644 --- a/lisp/riece-filter.el +++ b/lisp/riece-filter.el @@ -117,10 +117,11 @@ riece-server-name))) (if riece-debug (if (equal server-name "") - (message "Connection closed: %s" - (substring status 0 (1- (length status)))) - (message "Connection to \"%s\" closed: %s" - server-name (substring status 0 (1- (length status))))) + (riece-debug (format "Connection closed: %s" + (substring status 0 (1- (length status))))) + (riece-debug (format "Connection to \"%s\" closed: %s" + server-name + (substring status 0 (1- (length status)))))) (if (equal server-name "") (message "Connection closed") (message "Connection to \"%s\" closed" server-name))) diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el index 56fb58b..814d41f 100644 --- a/lisp/riece-globals.el +++ b/lisp/riece-globals.el @@ -182,6 +182,8 @@ user's status on the current channel.") "Buffer for messages arrived in the current channel.") (defvar riece-temp-buffer nil "Buffer for temporally use.") +(defvar riece-debug-buffer nil + "Buffer for debug output.") (defvar riece-buffer-list nil) (defvar riece-overriding-server-name nil) diff --git a/lisp/riece.el b/lisp/riece.el index 8b00907..a1d5302 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -59,7 +59,8 @@ (riece-others-buffer "*Others*" riece-others-mode) (riece-channel-list-buffer "*Channels*" riece-channel-list-mode) (riece-user-list-buffer " *Users*" riece-user-list-mode) - (riece-temp-buffer " *Temp*"))) + (riece-temp-buffer " *Temp*") + (riece-debug-buffer " *Debug*"))) (defvar riece-shrink-buffer-idle-timer nil "Timer object to periodically shrink channel buffers.") -- 1.7.10.4