49 |
(defun disabled-command-function (&rest ignore) |
(defun disabled-command-function (&rest ignore) |
50 |
(let (char) |
(let (char) |
51 |
(save-window-excursion |
(save-window-excursion |
52 |
(with-output-to-temp-buffer "*Help*" |
(with-output-to-temp-buffer "*Disabled Command*" |
53 |
(let ((keys (this-command-keys))) |
(let ((keys (this-command-keys))) |
54 |
(if (or (eq (aref keys 0) |
(if (or (eq (aref keys 0) |
55 |
(if (stringp keys) |
(if (stringp keys) |
68 |
(princ "It is disabled because new users often find it confusing.\n") |
(princ "It is disabled because new users often find it confusing.\n") |
69 |
(princ "Here's the first part of its description:\n\n") |
(princ "Here's the first part of its description:\n\n") |
70 |
;; Keep only the first paragraph of the documentation. |
;; Keep only the first paragraph of the documentation. |
71 |
(with-current-buffer "*Help*" |
(with-current-buffer "*Disabled Command*" |
72 |
(goto-char (point-max)) |
(goto-char (point-max)) |
73 |
(let ((start (point))) |
(let ((start (point))) |
74 |
(save-excursion |
(save-excursion |
91 |
(help-mode))) |
(help-mode))) |
92 |
(message "Type y, n, ! or SPC (the space bar): ") |
(message "Type y, n, ! or SPC (the space bar): ") |
93 |
(let ((cursor-in-echo-area t)) |
(let ((cursor-in-echo-area t)) |
94 |
(while (not (memq (setq char (downcase (read-char))) |
(while (progn (setq char (read-event)) |
95 |
'(?! ?y ?n ?\ ))) |
(or (not (numberp char)) |
96 |
|
(not (memq (downcase char) |
97 |
|
'(?! ?y ?n ?\ ?\C-g))))) |
98 |
(ding) |
(ding) |
99 |
(message "Please type y, n, ! or SPC (the space bar): ")))) |
(message "Please type y, n, ! or SPC (the space bar): ")))) |
100 |
|
(setq char (downcase char)) |
101 |
|
(if (= char ?\C-g) |
102 |
|
(setq quit-flag t)) |
103 |
(if (= char ?!) |
(if (= char ?!) |
104 |
(setq disabled-command-function nil)) |
(setq disabled-command-function nil)) |
105 |
(if (= char ?y) |
(if (= char ?y) |