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>
7 ;; Katsumi Yamaoka <yamaoka@jpl.org>
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
31 (require 'run-at-time)
33 (defalias 'nnheader-cancel-timer 'delete-itimer)
34 (defalias 'nnheader-cancel-function-timers 'ignore)
35 (defalias 'nnheader-string-as-multibyte 'identity)
37 (defun nnheader-xmas-Y-or-n-p (prompt)
38 "Ask user a \"Y/n\" question. Return t if answer is neither \"n\", \"N\" nor \"C-g\"."
39 (if (should-use-dialog-box-p)
40 (yes-or-no-p-dialog-box prompt)
41 (let ((cursor-in-echo-area t)
45 (message "%s(Y/n) " prompt)
46 (while (or (not (key-press-event-p (setq event (next-command-event))))
47 (not (or (eq (event-key event) 'escape)
48 (memq (event-to-character event)
49 '(?\ ?N ?Y ?\C-g ?\e ?\n ?\r ?n ?y))))))
50 (if (memq (event-key event) '(?\C-g ?N ?n))
52 (message "%s(Y/n) No" prompt)
54 (message "%s(Y/n) Yes" prompt)
57 (defalias 'nnheader-Y-or-n-p 'nnheader-xmas-Y-or-n-p)
61 ;;; nnheaderxm.el ends here