aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-02-03 10:30:54 +0000
committerRichard M. Stallman2002-02-03 10:30:54 +0000
commit606e6135a8921ae2e4ab2175e43a358e5613a2cd (patch)
tree86420d98d720c66808d6002d10167103fb9359bc
parent3f5075727e735bc6cee9434ef9fb1a7b37b8ea66 (diff)
downloademacs-606e6135a8921ae2e4ab2175e43a358e5613a2cd.tar.gz
emacs-606e6135a8921ae2e4ab2175e43a358e5613a2cd.zip
(disabled-command-hook): Clarify output text.
Indent the paragraph from the command's doc string.
-rw-r--r--lisp/novice.el49
1 files changed, 25 insertions, 24 deletions
diff --git a/lisp/novice.el b/lisp/novice.el
index 2d1481fb56a..c76637fcd06 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -53,33 +53,34 @@ If nil, the feature is disabled, i.e., all commands work normally.")
53 (and (>= (length keys) 2) 53 (and (>= (length keys) 2)
54 (eq (aref keys 0) meta-prefix-char) 54 (eq (aref keys 0) meta-prefix-char)
55 (eq (aref keys 1) ?x))) 55 (eq (aref keys 1) ?x)))
56 (princ "You have invoked the disabled command ") 56 (princ (format "You have invoked the disabled command %s.\n"
57 (princ "You have typed ") 57 (symbol-name this-command)))
58 (princ (key-description keys)) 58 (princ (format "You have typed %s, invoking disabled command %s.\n"
59 (princ ", invoking disabled command "))) 59 (key-description keys) (symbol-name this-command)))))
60 (princ this-command)
61 (princ ":\n")
62 ;; Print any special message saying why the command is disabled. 60 ;; Print any special message saying why the command is disabled.
63 (if (stringp (get this-command 'disabled)) 61 (if (stringp (get this-command 'disabled))
64 (princ (get this-command 'disabled))) 62 (princ (get this-command 'disabled))
65 ;; Keep only the first paragraph of the documentation. 63 (princ "It is disabled because new users often find it confusing.\n")
66 (save-excursion 64 (princ "Here's the first part of its description:\n\n")
67 (set-buffer "*Help*") 65 ;; Keep only the first paragraph of the documentation.
68 (goto-char (point-max)) 66 (with-current-buffer "*Help*"
69 (save-excursion 67 (goto-char (point-max))
70 (princ (or (condition-case () 68 (let ((start (point)))
71 (documentation this-command) 69 (save-excursion
72 (error nil)) 70 (princ (or (condition-case ()
73 "<< not documented >>"))) 71 (documentation this-command)
74 (if (search-forward "\n\n" nil t) 72 (error nil))
75 (delete-region (1- (point)) (point-max)) 73 "<< not documented >>")))
76 (goto-char (point-max)))) 74 (if (search-forward "\n\n" nil t)
77 (princ "\n\n") 75 (delete-region (match-beginning 0) (point-max)))
76 (goto-char (point-max))
77 (indent-rigidly start (point) 3))))
78 (princ "\n\nDo you want to use this command anyway?\n\n")
78 (princ "You can now type 79 (princ "You can now type
79Space to try the command just this once, but leave it disabled, 80Y to try it and enable it (no questions if you use it again).
80Y to try it and enable it (no questions if you use it again), 81N to cancel--don't try the command, and it remains disabled.
81! to try it and enable all commands in this session, or 82SPC to try the command just this once, but leave it disabled.
82N to do nothing (command remains disabled).") 83! to try it, and enable all disabled commands for this session only.")
83 (save-excursion 84 (save-excursion
84 (set-buffer standard-output) 85 (set-buffer standard-output)
85 (help-mode))) 86 (help-mode)))