X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnnheaderxm.el;h=d9021e7b34e4d5adeb10a2d0d2fa9b3306dc9c12;hb=e2696774a2e225ea60d46cc665d4232c80412731;hp=869ed69be5ca537cb313dace7ce9a6cd7aa88d33;hpb=7523ac5e3a0e4196d6043822dcb826c060fc1b58;p=elisp%2Fgnus.git- diff --git a/lisp/nnheaderxm.el b/lisp/nnheaderxm.el index 869ed69..d9021e7 100644 --- a/lisp/nnheaderxm.el +++ b/lisp/nnheaderxm.el @@ -1,7 +1,10 @@ ;;; nnheaderxm.el --- making Gnus backends work under XEmacs -;; Copyright (C) 1996,97,98 Free Software Foundation, Inc. -;; Author: Lars Magne Ingebrigtsen +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 +;; Free Software Foundation, Inc. + +;; Author: Lars Magne Ingebrigtsen +;; Katsumi Yamaoka ;; Keywords: news ;; This file is part of GNU Emacs. @@ -25,17 +28,34 @@ ;;; Code: -(defun nnheader-xmas-run-at-time (time repeat function &rest args) - (start-itimer - "nnheader-run-at-time" - `(lambda () - (,function ,@args)) - time repeat)) - -(fset 'nnheader-run-at-time 'nnheader-xmas-run-at-time) -(fset 'nnheader-cancel-timer 'delete-itimer) -(fset 'nnheader-cancel-function-timers 'ignore) +(require 'run-at-time) + +(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) + "Ask user a \"Y/n\" question. Return t if answer is neither \"n\", \"N\" nor \"C-g\"." + (if (should-use-dialog-box-p) + (yes-or-no-p-dialog-box prompt) + (let ((cursor-in-echo-area t) + (echo-keystrokes 0) + (inhibit-quit t) + event) + (message "%s(Y/n) " prompt) + (while (or (not (key-press-event-p (setq event (next-command-event)))) + (not (or (eq (event-key event) 'escape) + (memq (event-to-character event) + '(?\ ?N ?Y ?\C-g ?\e ?\n ?\r ?n ?y)))))) + (if (memq (event-key event) '(?\C-g ?N ?n)) + (progn + (message "%s(Y/n) No" prompt) + nil) + (message "%s(Y/n) Yes" prompt) + t)))) + +(defalias 'nnheader-Y-or-n-p 'nnheader-xmas-Y-or-n-p) (provide 'nnheaderxm) -;;; nnheaderxm.el ends here. +;;; nnheaderxm.el ends here