* 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.
2005-03-12 Daiki Ueno <ueno@unixuser.org>
+ * 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 <ueno@unixuser.org>
(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."
(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
(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)
(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
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)))
"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)
(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.")