1 ;;; nnheaderxm.el --- making Gnus backends work under XEmacs
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
4 ;; Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
30 (defun nnheader-xmas-run-at-time (time repeat function &rest args)
31 "Emulating function run as `run-at-time' in the right way.
32 TIME should be nil meaning now or a number of seconds from now.
33 Return an itimer object which can be used in either `delete-itimer'
35 (let ((itimers (list nil)))
38 (apply #'start-itimer "nnheader-run-at-time"
39 (lambda (itimers repeat function &rest args)
40 (let ((itimer (car itimers)))
45 (lambda (itimer repeat function &rest args)
46 (set-itimer-restart itimer repeat)
47 (set-itimer-function itimer function)
48 (set-itimer-function-arguments itimer args)
49 (apply function args)))
50 (set-itimer-function-arguments
52 (append (list itimer repeat function) args)))
55 (lambda (itimer function &rest args)
56 (delete-itimer itimer)
57 (apply function args)))
58 (set-itimer-function-arguments
60 (append (list itimer function) args)))))
61 1e-9 (if time (max time 1e-9) 1e-9)
62 nil t itimers repeat function args))))
64 (defalias 'nnheader-run-at-time 'nnheader-xmas-run-at-time)
65 (defalias 'nnheader-cancel-timer 'delete-itimer)
66 (defalias 'nnheader-cancel-function-timers 'ignore)
67 (defalias 'nnheader-string-as-multibyte 'identity)
71 ;;; nnheaderxm.el ends here