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., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
31 (require 'timer-funcs)
33 (defalias 'nnheader-cancel-timer 'delete-itimer)
34 (defalias 'nnheader-string-as-multibyte 'identity)
36 (defun nnheader-xmas-Y-or-n-p (prompt)
37 "Ask user a \"Y/n\" question. Return t if answer is neither \"n\", \"N\" nor \"C-g\"."
38 (if (should-use-dialog-box-p)
39 (yes-or-no-p-dialog-box prompt)
40 (let ((cursor-in-echo-area t)
44 (message "%s(Y/n) " prompt)
45 (while (or (not (key-press-event-p (setq event (next-command-event))))
46 (not (or (eq (event-key event) 'escape)
47 (memq (event-to-character event)
48 '(?\ ?N ?Y ?\C-g ?\e ?\n ?\r ?n ?y))))))
49 (if (memq (event-key event) '(?\C-g ?N ?n))
51 (message "%s(Y/n) No" prompt)
53 (message "%s(Y/n) Yes" prompt)
56 (defalias 'nnheader-Y-or-n-p 'nnheader-xmas-Y-or-n-p)
60 ;;; nnheaderxm.el ends here