(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
(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)
+(if (fboundp 'put-case-table-pair)
+ (defalias 'riece-set-case-syntax-pair
+ 'put-case-table-pair)
+ ;; In XEmacs 21.1, case-table is a list of strings.
+ (defun riece-set-case-syntax-pair (uc lc case-table)
+ (aset (car case-table) (char-to-int uc) lc)
+ (if (nth 1 case-table)
+ (aset (nth 1 case-table) (char-to-int lc) uc))
+ (if (nth 2 case-table)
+ (aset (nth 2 case-table) (char-to-int uc) lc))))
+
+(if (fboundp 'copy-case-table)
+ (defalias 'riece-copy-case-table 'copy-case-table)
+ ;; In XEmacs 21.1, case-table is a list of strings.
+ (defun riece-copy-case-table (case-table)
+ (mapcar #'copy-sequence case-table)))
;;; stolen (and renamed) from gnus-xmas.el.
;;; In GNU Emacs, user can intercept whole mouse tracking events by
(defalias 'riece-overlay-start 'extent-start-position)
(defalias 'riece-overlay-buffer 'extent-buffer)
+(defun riece-overlays-in (start end)
+ (extent-list (current-buffer) start end))
+
+(defalias 'riece-delete-overlay 'delete-extent)
+
+(defun riece-kill-all-overlays ()
+ "Delete all extents in the current buffer."
+ (map-extents (lambda (extent ignore)
+ (delete-extent extent)
+ nil)))
+
+;;; stolen (and renamed) from nnheaderxm.el.
+(defun riece-xemacs-generate-timer-name (&optional prefix)
+ (let ((counter '(0)))
+ (format "%s-%d"
+ (or prefix
+ "riece-xemacs-timer")
+ (prog1 (car counter)
+ (setcar counter (1+ (car counter)))))))
+
+(defun riece-run-at-time (time repeat function &rest args)
+ (let ((name (riece-xemacs-generate-timer-name "riece-run-at-time")))
+ (start-itimer
+ name
+ `(lambda ()
+ (,function ,@args))
+ time repeat)
+ name))
+
+(defun riece-run-with-idle-timer (time repeat function &rest args)
+ (let ((name (riece-xemacs-generate-timer-name "riece-run-with-idle-timer")))
+ (start-itimer
+ name
+ `(lambda ()
+ (,function ,@args))
+ time (if repeat 1) t)
+ name))
+
+(defalias 'riece-cancel-timer 'delete-itimer)
+
(provide 'riece-xemacs)
;;; riece-xemacs.el ends here