X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnnheaderxm.el;h=ea5df2f8b05afe89201aa76061490c70e9ef97b8;hb=9b741e050b400987d68ff761c6cc3276c932839c;hp=174d76ceb7c79fc51fc73084cbd87ebd02d0c11d;hpb=a707b63af25b91cb730c12e65156ca364bf49a44;p=elisp%2Fgnus.git- diff --git a/lisp/nnheaderxm.el b/lisp/nnheaderxm.el index 174d76c..ea5df2f 100644 --- a/lisp/nnheaderxm.el +++ b/lisp/nnheaderxm.el @@ -1,9 +1,10 @@ ;;; nnheaderxm.el --- making Gnus backends work under XEmacs -;; Copyright (C) 1996, 1997, 1998, 1999, 2000 +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen +;; Katsumi Yamaoka ;; Keywords: news ;; This file is part of GNU Emacs. @@ -34,11 +35,32 @@ (,function ,@args)) time repeat)) +(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-run-at-time 'nnheader-xmas-run-at-time) (defalias 'nnheader-cancel-timer 'delete-itimer) (defalias 'nnheader-cancel-function-timers 'ignore) (defalias 'nnheader-string-as-multibyte 'identity) +(defalias 'nnheader-Y-or-n-p 'nnheader-xmas-Y-or-n-p) (provide 'nnheaderxm) -;;; nnheaderxm.el ends here. +;;; nnheaderxm.el ends here