1 ;;; nnheaderxm.el --- making Gnus backends work under XEmacs
2 ;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
28 (defun nnheader-xmas-run-at-time (time repeat function &rest args)
30 "nnheader-run-at-time"
35 (defun nnheader-xmas-Y-or-n-p (prompt)
36 "Ask user a \"Y/n\" question. Return t if answer is neither \"n\", \"N\" nor \"C-g\"."
37 (if (should-use-dialog-box-p)
38 (yes-or-no-p-dialog-box prompt)
39 (let ((cursor-in-echo-area t)
43 (message "%s(Y/n) " prompt)
44 (while (or (not (key-press-event-p (setq event (next-command-event))))
45 (not (or (eq (event-key event) 'escape)
46 (memq (event-to-character event)
47 '(?\ ?N ?Y ?\C-g ?\e ?\n ?\r ?n ?y))))))
48 (if (memq (event-key event) '(?\C-g ?N ?n))
50 (message "%s(Y/n) No" prompt)
52 (message "%s(Y/n) Yes" prompt)
55 (fset 'nnheader-run-at-time 'nnheader-xmas-run-at-time)
56 (fset 'nnheader-cancel-timer 'delete-itimer)
57 (fset 'nnheader-cancel-function-timers 'ignore)
58 (fset 'nnheader-Y-or-n-p 'nnheader-xmas-Y-or-n-p)
62 ;;; nnheaderxm.el ends here.