* riece-server.el (riece-quit-server-process): Use riece-run-at-time.
[riece] / lisp / riece-xemacs.el
index f6b1262..dd896dd 100644 (file)
@@ -23,8 +23,6 @@
 
 ;;; Code:
 
-(require 'riece-compat)
-
 (defun riece-xemacs-hide-modeline ()
   "Remove modeline from current window."
   (set-specifier has-modeline-p nil (current-buffer)))
 (add-hook 'riece-user-list-mode-hook 'riece-xemacs-hide-modeline)
 (add-hook 'riece-channel-list-mode-hook 'riece-xemacs-hide-modeline)
 
-(defun riece-xemacs-mode-line-buffer-identification (line)
-  "Decorate 1st        element of `mode-line-buffer-identification' LINE.
-Modify whole identification by side effect."
-  (let ((id (car line)) chop)
-    (if (and (stringp id) (string-match "^Riece:" id))
-       (progn
-         (setq chop (match-end 0))
-         (nconc
-          (list
-           (cons (copy-extent modeline-buffer-id-left-extent)
-                 (substring id 0 chop))
-           (cons (copy-extent modeline-buffer-id-right-extent)
-                 (substring id chop)))
-          (cdr line)))
-      line)))
-
 (defun riece-xemacs-simplify-modeline-format ()
   "Remove unnecessary information from `modeline-format'."
   (setq modeline-format
@@ -64,15 +46,45 @@ Modify whole identification by side effect."
                  (delq 'modeline-multibyte-status
                        (copy-sequence mode-line-format)))))
 
-(defalias 'riece-mode-line-buffer-identification
-  'riece-xemacs-mode-line-buffer-identification)
-
 (defalias 'riece-simplify-mode-line-format
   'riece-xemacs-simplify-modeline-format)
 
 (defalias 'riece-set-case-syntax-pair
   'put-case-table-pair)
 
+;;; stolen (and renamed) from gnus-xmas.el.
+;;; In GNU Emacs, user can intercept whole mouse tracking events by
+;;; assigning [mouse-X].  In XEmacs, however, which causes different
+;;; effect, that is, the command assigned to [mouse-X] only catches
+;;; button-release events.
+(defvar riece-mouse-2 [button2])
+
+;;; popup-menu compatibility stuff, stolen (and renamed) from
+;;; semi-def.el.
+(defun riece-popup-menu-popup (menu event)
+  (let ((response (get-popup-menu-response menu event)))
+    (if response
+       (funcall (event-function response) (event-object response)))))
+
+(defalias 'riece-event-buffer 'event-buffer)
+(defalias 'riece-event-point 'event-point)
+
+;;; stolen (and renamed) from gnus-xmas.el.
+(defalias 'riece-region-active-p 'region-active-p)
+
+(defalias 'riece-make-overlay 'make-extent)
+(defalias 'riece-overlay-put 'set-extent-property)
+(defalias 'riece-overlay-start 'extent-start-position)
+(defalias 'riece-overlay-buffer 'extent-buffer)
+
+;;; stolen (and renamed) from nnheaderxm.el.
+(defun riece-run-at-time (time repeat function &rest args)
+  (start-itimer
+   "riece-run-at-time"
+   `(lambda ()
+      (,function ,@args))
+   time repeat))
+
 (provide 'riece-xemacs)
 
 ;;; riece-xemacs.el ends here