From: ueno Date: Thu, 7 Jul 2005 08:49:55 +0000 (+0000) Subject: * riece-display.el (riece-channel-buffer): Return nil when X-Git-Tag: channel-coding-branchpoint~227 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fce5d4289e36583b8fde098f5b285a83cd950a40;p=elisp%2Friece.git * riece-display.el (riece-channel-buffer): Return nil when channel-buffer is killed. * riece-debug.el (riece-debug-1): New function. (riece-debug): Always return nil. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d03a783..9340f6d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2005-07-07 Daiki Ueno + + * riece-display.el (riece-channel-buffer): Return nil when + channel-buffer is killed. + + * riece-debug.el (riece-debug-1): New function. + (riece-debug): Always return nil. + 2005-06-03 Daiki Ueno * riece-ruby.el: New file. diff --git a/lisp/riece-debug.el b/lisp/riece-debug.el index def5997..f5e8bf9 100644 --- a/lisp/riece-debug.el +++ b/lisp/riece-debug.el @@ -27,10 +27,7 @@ (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'." +(defun riece-debug-1 (message detail) (message "riece-debug: %s" message) (save-excursion (set-buffer riece-debug-buffer) @@ -40,6 +37,12 @@ If the optional 2nd argument DETAIL is specified, it is stored into (insert message "\n" detail "\n") (insert message "\n"))))) +(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'." + (ignore (riece-debug-1 message detail))) + (defun riece-debug-reset-standard-output () "Reset `riece-temp-buffer' to be used as `standard-output'." (save-excursion diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 037f437..a3d59e2 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -429,7 +429,14 @@ Local to the buffer in `riece-buffer-list'.") (current-buffer))) (defun riece-channel-buffer (identity) - (cdr (riece-identity-assoc identity riece-channel-buffer-alist))) + (let ((entry (riece-identity-assoc identity riece-channel-buffer-alist))) + (if entry + (if (buffer-live-p (cdr entry)) + (cdr entry) + (if riece-debug + (riece-debug + (format "riece-channel-buffer: nonexistent buffer: %s" + (riece-format-identity identity)))))))) (defun riece-switch-to-channel (identity) (let ((last riece-current-channel)