Mercurial > hg > xemacs-beta
comparison lisp/cmdloop.el @ 5473:ac37a5f7e5be
Merge with trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Thu, 17 Mar 2011 23:42:59 +0100 |
parents | b9167d522a9a ed74d2ca7082 |
children | 4dee0387b9de |
comparison
equal
deleted
inserted
replaced
5472:e79980ee5efe | 5473:ac37a5f7e5be |
---|---|
144 (setq last-error error-object) | 144 (setq last-error error-object) |
145 | 145 |
146 (message nil) | 146 (message nil) |
147 (ding nil (cond ((eq etype 'undefined-keystroke-sequence) | 147 (ding nil (cond ((eq etype 'undefined-keystroke-sequence) |
148 (if (and (vectorp (nth 1 error-object)) | 148 (if (and (vectorp (nth 1 error-object)) |
149 (/= 0 (length (nth 1 error-object))) | 149 (not (eql 0 (length (nth 1 error-object)))) |
150 (button-event-p (aref (nth 1 error-object) 0))) | 150 (button-event-p (aref (nth 1 error-object) 0))) |
151 'undefined-click | 151 'undefined-click |
152 'undefined-key)) | 152 'undefined-key)) |
153 ((eq etype 'quit) | 153 ((eq etype 'quit) |
154 'quit) | 154 'quit) |
466 (t | 466 (t |
467 (message "%s%s%s%s" pre prompt yn | 467 (message "%s%s%s%s" pre prompt yn |
468 (single-key-description event)) | 468 (single-key-description event)) |
469 (ding nil 'y-or-n-p) | 469 (ding nil 'y-or-n-p) |
470 (discard-input) | 470 (discard-input) |
471 (if (= (length pre) 0) | 471 (if (eql (length pre) 0) |
472 (setq pre (gettext "Please answer y or n. "))))))) | 472 (setq pre (gettext "Please answer y or n. "))))))) |
473 yn))) | 473 yn))) |
474 | 474 |
475 (defun yes-or-no-p-minibuf (prompt) | 475 (defun yes-or-no-p-minibuf (prompt) |
476 "Ask user a yes-or-no question. Return t if answer is yes. | 476 "Ask user a yes-or-no question. Return t if answer is yes. |
503 and can edit it until it as been confirmed." | 503 and can edit it until it as been confirmed." |
504 (if (should-use-dialog-box-p) | 504 (if (should-use-dialog-box-p) |
505 ;; and-fboundp is redundant, since yes-or-no-p-dialog-box is only | 505 ;; and-fboundp is redundant, since yes-or-no-p-dialog-box is only |
506 ;; bound if (featurep 'dialog). But it eliminates a compile-time | 506 ;; bound if (featurep 'dialog). But it eliminates a compile-time |
507 ;; warning. | 507 ;; warning. |
508 (and-fboundp #'yes-or-no-p-dialog-box (yes-or-no-p-dialog-box prompt)) | 508 (and-fboundp 'yes-or-no-p-dialog-box (yes-or-no-p-dialog-box prompt)) |
509 (yes-or-no-p-minibuf prompt))) | 509 (yes-or-no-p-minibuf prompt))) |
510 | 510 |
511 (defun y-or-n-p (prompt) | 511 (defun y-or-n-p (prompt) |
512 "Ask user a \"y or n\" question. Return t if answer is \"y\". | 512 "Ask user a \"y or n\" question. Return t if answer is \"y\". |
513 Takes one argument, which is the string to display to ask the question. | 513 Takes one argument, which is the string to display to ask the question. |