From 086193bc36ccfd6dc9378522ea361b7a1b65144e Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 26 Jan 2005 09:28:23 +0000 Subject: [PATCH] Synch to No Gnus 200501260854. --- contrib/ChangeLog | 4 +++ contrib/gpg.el | 35 ++++++++++++++----- lisp/ChangeLog | 35 +++++++++++++++++++ lisp/dgnushack.el | 7 ++-- lisp/gnus-demon.el | 2 +- lisp/gnus-xmas.el | 2 +- lisp/mail-source.el | 2 +- lisp/mm-url.el | 4 ++- lisp/nnheaderxm.el | 3 +- lisp/password.el | 2 +- lisp/run-at-time.el | 96 --------------------------------------------------- 11 files changed, 76 insertions(+), 116 deletions(-) delete mode 100644 lisp/run-at-time.el diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 4432f30..82ce97d 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +2005-01-26 Steve Youngs + + * gpg.el: Add timer/itimer compatibility. + 2004-10-25 Katsumi Yamaoka * README (compface.el): Describe. diff --git a/contrib/gpg.el b/contrib/gpg.el index 9362788..182f79b 100644 --- a/contrib/gpg.el +++ b/contrib/gpg.el @@ -106,7 +106,9 @@ ;;; Code: -(require 'timer) +(if (featurep 'xemacs) + (require 'timer-funcs) + (require 'timer)) (eval-when-compile (require 'cl)) (eval-and-compile @@ -115,6 +117,21 @@ '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: @@ -779,7 +796,7 @@ evaluates BODY, like `progn'. If BODY evaluates to `nil' (or ;;; Passphrase handling: (defvar gpg-passphrase-timer - (timer-create) + (gpg-timer-create) "This timer will clear the passphrase cache periodically.") (defvar gpg-passphrase @@ -799,7 +816,7 @@ evaluates BODY, like `progn'. If BODY evaluates to `nil' (or "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))) @@ -809,14 +826,14 @@ evaluates BODY, like `progn'. If BODY evaluates to `nil' (or 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) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f1b212f..9b1a2d6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,38 @@ +2005-01-26 Steve Youngs + + * 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 * mml.el (mml-generate-mime-1): Convert string into unibyte when diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 6d82064..bcf11f3 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -328,7 +328,8 @@ Try to re-configure with --with-addpath=FLIM_PATH and run make again. (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) @@ -350,7 +351,6 @@ Try to re-configure with --with-addpath=FLIM_PATH and run make again. (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. @@ -424,8 +424,7 @@ Try to re-configure with --with-addpath=FLIM_PATH and run make again. "")) '("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")) diff --git a/lisp/gnus-demon.el b/lisp/gnus-demon.el index a8515b8..cd43bbf 100644 --- a/lisp/gnus-demon.el +++ b/lisp/gnus-demon.el @@ -37,7 +37,7 @@ (require 'gnus-util) (eval-and-compile (if (featurep 'xemacs) - (require 'itimer) + (require 'timer-funcs) (require 'timer))) (defgroup gnus-demon nil diff --git a/lisp/gnus-xmas.el b/lisp/gnus-xmas.el index f13a1e4..f1e000e 100644 --- a/lisp/gnus-xmas.el +++ b/lisp/gnus-xmas.el @@ -40,7 +40,7 @@ (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" diff --git a/lisp/mail-source.el b/lisp/mail-source.el index a4d754b..987696a 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -874,7 +874,7 @@ See the Gnus manual for details." (eval-when-compile (if (featurep 'xemacs) - (require 'itimer) + (require 'timer-funcs) (require 'timer))) (defun mail-source-start-idle-timer () diff --git a/lisp/mm-url.el b/lisp/mm-url.el index b261077..4a09d70 100644 --- a/lisp/mm-url.el +++ b/lisp/mm-url.el @@ -38,7 +38,9 @@ (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." diff --git a/lisp/nnheaderxm.el b/lisp/nnheaderxm.el index d9021e7..246a19f 100644 --- a/lisp/nnheaderxm.el +++ b/lisp/nnheaderxm.el @@ -28,10 +28,9 @@ ;;; 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) diff --git a/lisp/password.el b/lisp/password.el index e4fb910..5e64808 100644 --- a/lisp/password.el +++ b/lisp/password.el @@ -60,7 +60,7 @@ ;;; Code: (when (featurep 'xemacs) - (require 'run-at-time)) + (require 'timer-funcs)) (eval-when-compile (require 'cl)) diff --git a/lisp/run-at-time.el b/lisp/run-at-time.el deleted file mode 100644 index 47298e9..0000000 --- a/lisp/run-at-time.el +++ /dev/null @@ -1,96 +0,0 @@ -;;; 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 - -;; 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 -- 1.7.10.4