Update to 7.0.3.
[riece] / lisp / riece-button.el
index b7f5126..a04d576 100644 (file)
@@ -61,7 +61,7 @@
     ;; wid-edit (XEmacs only).
     (if (boundp 'help-echo-owns-message)
        (setq help-echo-owns-message t))
-    (format "%S: switch to %s; down-mouse-3: more options"
+    (format (riece-mcat "%S: switch to %s; down-mouse-3: more options")
            (aref riece-mouse-2 0)
            ;; XEmacs will get a single widget arg; Emacs 21 will get
            ;; window, overlay, position.
@@ -78,7 +78,8 @@ This function is used as a callback for a channel button."
     (if (riece-identity-member channel riece-current-channels)
        (riece-command-switch-to-channel channel)
       (message "%s" (substitute-command-keys
-                    "Type \\[riece-command-join] to join the channel")))))
+                    (riece-mcat
+                     "Type \\[riece-command-join] to join the channel"))))))
 
 (defun riece-identity-button-click (event)
   "Call widget-button-click and select the last selected window."
@@ -88,8 +89,7 @@ This function is used as a callback for a channel button."
        (point (point))
        window)
     (unwind-protect
-       (save-excursion
-         (set-buffer (riece-event-buffer event))
+       (with-current-buffer (riece-event-buffer event)
          (goto-char (riece-event-point event))
          (widget-button-click event))
       ;; riece-button-switch-to-identity changes window-configuration
@@ -105,8 +105,7 @@ This function is used as a callback for a channel button."
 (defun riece-identity-button-popup-menu (event)
   "Popup the menu for identity buttons."
   (interactive "e")
-  (save-excursion
-    (set-buffer (riece-event-buffer event))
+  (with-current-buffer (riece-event-buffer event)
     (goto-char (riece-event-point event))
     (riece-popup-menu-popup
      (if (riece-channel-p (riece-identity-prefix
@@ -255,8 +254,7 @@ This function is used as a callback for a channel button."
     (let ((buffers riece-buffer-list))
       (while buffers
        (set-buffer (car buffers))
-       (if (eq (derived-mode-class major-mode)
-               'riece-dialogue-mode)
+       (if (riece-derived-mode-p 'riece-dialogue-mode)
            (riece-button-dialogue-mode-hook))
        (setq buffers (cdr buffers)))))
   (add-hook 'riece-channel-list-mode-hook
@@ -291,8 +289,7 @@ This function is used as a callback for a channel button."
   (let ((pointer riece-buffer-list))
     (while pointer
       (with-current-buffer (car pointer)
-       (if (eq (derived-mode-class major-mode)
-               'riece-dialogue-mode)
+       (if (riece-derived-mode-p 'riece-dialogue-mode)
            (riece-button-update-buffer)))
       (setq pointer (cdr pointer)))
     (if riece-current-channel