;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Code:
(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
(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)
(defun riece-part-channel (identity)
(let ((pointer (riece-identity-member identity riece-current-channels)))
- (if pointer
- (setcar pointer nil))
+ (unless pointer
+ (error "No such channel!"))
+ (setcar pointer nil)
(if (riece-identity-equal identity riece-current-channel)
- (riece-switch-to-nearest-channel pointer))
+ (riece-switch-to-nearest-channel pointer)
+ (riece-emit-signal 'channel-list-changed))
(funcall riece-buffer-dispose-function (riece-channel-buffer identity))))
(defun riece-redisplay-buffers (&optional force)