Mercurial > emacs
comparison lisp/emulation/tpu-edt.el @ 14344:1e97bcb05a16
(tpu-y-or-n-p): Delete format call inside message.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 25 Jan 1996 01:03:29 +0000 |
parents | 04dba88947bc |
children | 88df8e3ef688 |
comparison
equal
deleted
inserted
replaced
14343:ab021899d604 | 14344:1e97bcb05a16 |
---|---|
559 | 559 |
560 (defun tpu-y-or-n-p (prompt &optional not-yes) | 560 (defun tpu-y-or-n-p (prompt &optional not-yes) |
561 "Prompt for a y or n answer with positive default. | 561 "Prompt for a y or n answer with positive default. |
562 Optional second argument NOT-YES changes default to negative. | 562 Optional second argument NOT-YES changes default to negative. |
563 Like Emacs `y-or-n-p', but also accepts space as y and DEL as n." | 563 Like Emacs `y-or-n-p', but also accepts space as y and DEL as n." |
564 (message (format "%s[%s]" prompt (if not-yes "n" "y"))) | 564 (message "%s[%s]" prompt (if not-yes "n" "y")) |
565 (let ((doit t)) | 565 (let ((doit t)) |
566 (while doit | 566 (while doit |
567 (setq doit nil) | 567 (setq doit nil) |
568 (let ((ans (read-char))) | 568 (let ((ans (read-char))) |
569 (cond ((or (= ans ?y) (= ans ?Y) (= ans ?\ )) | 569 (cond ((or (= ans ?y) (= ans ?Y) (= ans ?\ )) |
571 ((or (= ans ?n) (= ans ?N) (= ans ?\C-?)) | 571 ((or (= ans ?n) (= ans ?N) (= ans ?\C-?)) |
572 (setq tpu-last-answer nil)) | 572 (setq tpu-last-answer nil)) |
573 ((= ans ?\r) (setq tpu-last-answer (not not-yes))) | 573 ((= ans ?\r) (setq tpu-last-answer (not not-yes))) |
574 (t | 574 (t |
575 (setq doit t) (beep) | 575 (setq doit t) (beep) |
576 (message (format "Please answer y or n. %s[%s]" | 576 (message "Please answer y or n. %s[%s]" |
577 prompt (if not-yes "n" "y")))))))) | 577 prompt (if not-yes "n" "y"))))))) |
578 tpu-last-answer) | 578 tpu-last-answer) |
579 | 579 |
580 (defun tpu-local-set-key (key func) | 580 (defun tpu-local-set-key (key func) |
581 "Replace a key in the TPU-edt local key map. | 581 "Replace a key in the TPU-edt local key map. |
582 Create the key map if necessary." | 582 Create the key map if necessary." |