file uu-decode.pbm was added on branch t-gnus-6_17 on 2005-05-01 23:25:48 +0000
[elisp/gnus.git-] / lisp / nnheaderxm.el
1 ;;; nnheaderxm.el --- making Gnus backends work under XEmacs
2
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
4 ;;      Free Software Foundation, Inc.
5
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;;      Katsumi Yamaoka  <yamaoka@jpl.org>
8 ;; Keywords: news
9
10 ;; This file is part of GNU Emacs.
11
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)
15 ;; any later version.
16
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.
21
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.
26
27 ;;; Commentary:
28
29 ;;; Code:
30
31 (require 'run-at-time)
32
33 (defalias 'nnheader-cancel-timer 'delete-itimer)
34 (defalias 'nnheader-cancel-function-timers 'ignore)
35 (defalias 'nnheader-string-as-multibyte 'identity)
36
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)
42           (echo-keystrokes 0)
43           (inhibit-quit t)
44           event)
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))
51           (progn
52             (message "%s(Y/n) No" prompt)
53             nil)
54         (message "%s(Y/n) Yes" prompt)
55         t))))
56
57 (defalias 'nnheader-Y-or-n-p 'nnheader-xmas-Y-or-n-p)
58
59 (provide 'nnheaderxm)
60
61 ;;; nnheaderxm.el ends here