+2005-01-26 Steve Youngs <steve@sxemacs.org>
+
+ * gpg.el: Add timer/itimer compatibility.
+
2004-10-25 Katsumi Yamaoka <yamaoka@jpl.org>
* README (compface.el): Describe.
\f
;;; Code:
-(require 'timer)
+(if (featurep 'xemacs)
+ (require 'timer-funcs)
+ (require 'timer))
(eval-when-compile (require 'cl))
(eval-and-compile
'point-at-eol
'line-end-position)))
+;; itimer/timer compatibility
+(eval-and-compile
+ (if (featurep 'xemacs)
+ (progn
+ (defalias 'gpg-cancel-timer 'delete-itimer)
+ (defalias 'gpg-timer-activate 'activate-itimer)
+ (defalias 'gpg-timer-create 'make-itimer)
+ (defalias 'gpg-timer-set-function 'set-itimer-function)
+ (defalias 'gpg-timer-set-time 'set-itimer-value))
+ (defalias 'gpg-cancel-timer 'cancel-timer)
+ (defalias 'gpg-timer-activate 'timer-activate)
+ (defalias 'gpg-timer-create 'timer-create)
+ (defalias 'gpg-timer-set-function 'timer-set-function)
+ (defalias 'gpg-timer-set-time 'timer-set-time)))
+
;;;; Customization:
;;; Customization: Groups:
;;; Passphrase handling:
(defvar gpg-passphrase-timer
- (timer-create)
+ (gpg-timer-create)
"This timer will clear the passphrase cache periodically.")
(defvar gpg-passphrase
"Forget stored passphrase."
(interactive)
(when gpg-passphrase
- (cancel-timer gpg-passphrase-timer)
+ (gpg-cancel-timer gpg-passphrase-timer)
(setq gpg-passphrase-timer nil)
(gpg-passphrase-clear-string gpg-passphrase)
(setq gpg-passphrase nil)))
Updates the timeout for clearing the cache to `gpg-passphrase-timeout'."
(unless (equal gpg-passphrase-timeout 0)
(if (null gpg-passphrase-timer)
- (setq gpg-passphrase-timer (timer-create)))
- (timer-set-time gpg-passphrase-timer
- (timer-relative-time (current-time)
- gpg-passphrase-timeout))
- (timer-set-function gpg-passphrase-timer 'gpg-passphrase-forget)
+ (setq gpg-passphrase-timer (gpg-timer-create)))
+ (gpg-timer-set-time gpg-passphrase-timer
+ (timer-relative-time (current-time)
+ gpg-passphrase-timeout))
+ (gpg-timer-set-function gpg-passphrase-timer 'gpg-passphrase-forget)
(unless (and (fboundp 'itimer-live-p)
(itimer-live-p gpg-passphrase-timer))
- (timer-activate gpg-passphrase-timer))
+ (gpg-timer-activate gpg-passphrase-timer))
(setq gpg-passphrase passphrase))
passphrase)
+2005-01-26 Steve Youngs <steve@sxemacs.org>
+
+ * run-at-time.el: Removed. It is no longer needed as
+ timer-funcs.el in the xemacs-base package has a working version of
+ `run-at-time'.
+
+ * gnus-xmas.el: Require timer-funcs instead of run-at-time.
+
+ * password.el: Require timer-funcs instead of run-at-time in
+ XEmacs.
+ Remove `password-run-at-time' macro.
+ (password-cache-add): Use `run-at-time' instead of
+ `password-run-at-time'.
+
+ * nnheaderxm.el: Require timer-funcs instead of run-at-time.
+ Remove `nnheader-cancel-function-timers' alias,
+ `cancel-function-timers' exists in XEmacs in timer-funcs.
+
+ * mail-source.el: Require timer-funcs instead of itimer in XEmacs
+ for `run-with-idle-timer'.
+
+ * gnus-demon.el: Require timer-funcs instead of itimer in XEmacs
+ for `run-at-time'.
+
+ * mm-url.el: Require timer-funcs at compile time when in XEmacs
+ for `with-timeout'.
+
+ * dgnushack.el: Autoload the correct `setenv' for SXEmacs which is
+ the same as for XEmacs 21.4.
+ No need to ignore `run-with-idle-timer', this function exists in
+ XEmacs now in timer-funcs.el in the xemacs-base package.
+ (dgnushack-compile): No need to delete
+ run-at-time.el from the list of files to compile because it
+ doesn't exist anymore.
+
2005-01-24 Katsumi Yamaoka <yamaoka@jpl.org>
* mml.el (mml-generate-mime-1): Convert string into unibyte when
(autoload 'read-passwd "passwd")
(autoload 'regexp-opt "regexp-opt")
(autoload 'reporter-submit-bug-report "reporter")
- (if (emacs-version>= 21 5)
+ (if (and (emacs-version>= 21 5)
+ (not (featurep 'sxemacs)))
(autoload 'setenv "process" nil t)
(autoload 'setenv "env" nil t))
(autoload 'sgml-mode "psgml" nil t)
(defalias 'overlays-in 'ignore)
(defalias 'replace-dehighlight 'ignore)
(defalias 'replace-highlight 'ignore)
- (defalias 'run-with-idle-timer 'ignore)
(defalias 'w3-coding-system-for-mime-charset 'ignore)))
;; T-gnus stuff.
""))
'("gnus-bbdb.el")))
(unless (featurep 'xemacs)
- '("gnus-xmas.el" "messagexmas.el" "nnheaderxm.el"
- "run-at-time.el"))
+ '("gnus-xmas.el" "messagexmas.el" "nnheaderxm.el"))
(when (and (fboundp 'base64-decode-string)
(subrp (symbol-function 'base64-decode-string)))
'("base64.el"))
(require 'gnus-util)
(eval-and-compile
(if (featurep 'xemacs)
- (require 'itimer)
+ (require 'timer-funcs)
(require 'timer)))
(defgroup gnus-demon nil
(defvar menu-bar-mode (featurep 'menubar))
(require 'messagexmas)
(require 'wid-edit)
-(require 'run-at-time)
+(require 'timer-funcs)
(defgroup gnus-xmas nil
"XEmacsoid support for Gnus"
(eval-when-compile
(if (featurep 'xemacs)
- (require 'itimer)
+ (require 'timer-funcs)
(require 'timer)))
(defun mail-source-start-idle-timer ()
(autoload 'exec-installed-p "path-util"))
(eval-when-compile
- (require 'timer))
+ (if (featurep 'xemacs)
+ (require 'timer-funcs)
+ (require 'timer)))
(defgroup mm-url nil
"A wrapper of url package and external url command for Gnus."
;;; Code:
-(require 'run-at-time)
+(require 'timer-funcs)
(defalias 'nnheader-cancel-timer 'delete-itimer)
-(defalias 'nnheader-cancel-function-timers 'ignore)
(defalias 'nnheader-string-as-multibyte 'identity)
(defun nnheader-xmas-Y-or-n-p (prompt)
;;; Code:
(when (featurep 'xemacs)
- (require 'run-at-time))
+ (require 'timer-funcs))
(eval-when-compile
(require 'cl))
+++ /dev/null
-;;; run-at-time.el --- A non-buggy version of the run-at-time function
-
-;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
-
-;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; 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.
-
-;;; Commentary:
-
-;; XEmacs has a buggy version of run-at-time. This file defines a
-;; non-buggy version of the same.
-
-(defalias
- 'run-at-time
- (if (condition-case nil
- (progn
- (unless (or itimer-process itimer-timer)
- (itimer-driver-start))
- ;; Check whether there is a bug to which the difference of
- ;; the present time and the time when the itimer driver was
- ;; woken up is subtracted from the initial itimer value.
- (let* ((inhibit-quit t)
- (ctime (current-time))
- (itimer-timer-last-wakeup
- (prog1
- ctime
- (setcar ctime (1- (car ctime)))))
- (itimer-list nil)
- (itimer (start-itimer "run-at-time" 'ignore 5)))
- (sleep-for 0.1) ;; Accept the timeout interrupt.
- (prog1
- (> (itimer-value itimer) 0)
- (delete-itimer itimer))))
- (error nil))
- (lambda (time repeat function &rest args)
- "Function emulating the function of the same name of Emacs.
-TIME should be nil meaning now, or a number of seconds from now.
-Return an itimer object which can be used in either `delete-itimer'
-or `cancel-timer'."
- (apply #'start-itimer "run-at-time"
- function (if time (max time 1e-9) 1e-9)
- repeat nil t args))
- (lambda (time repeat function &rest args)
- "Function emulating the function of the same name of Emacs.
-It works correctly for TIME even if there is a bug in the XEmacs core.
-TIME should be nil meaning now, or a number of seconds from now.
-Return an itimer object which can be used in either `delete-itimer'
-or `cancel-timer'."
- (let ((itimers (list nil)))
- (setcar
- itimers
- (apply #'start-itimer "fixed-run-at-time"
- (lambda (itimers repeat function &rest args)
- (let ((itimer (car itimers)))
- (if repeat
- (progn
- (set-itimer-function
- itimer
- (lambda (itimer repeat function &rest args)
- (set-itimer-restart itimer repeat)
- (set-itimer-function itimer function)
- (set-itimer-function-arguments itimer args)
- (apply function args)))
- (set-itimer-function-arguments
- itimer
- (append (list itimer repeat function) args)))
- (set-itimer-function
- itimer
- (lambda (itimer function &rest args)
- (delete-itimer itimer)
- (apply function args)))
- (set-itimer-function-arguments
- itimer
- (append (list itimer function) args)))))
- 1e-9 (if time (max time 1e-9) 1e-9)
- nil t itimers repeat function args))))))
-
-(provide 'run-at-time)
-
-;;; run-at-time.el ends here