/[emacs]/emacs/lisp/novice.el
ViewVC logotype

Diff of /emacs/lisp/novice.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by eliz, Sat Feb 2 12:47:54 2002 UTC revision 1.30 by rms, Sun Feb 3 10:30:54 2002 UTC
# Line 53  If nil, the feature is disabled, i.e., a Line 53  If nil, the feature is disabled, i.e., a
53                   (and (>= (length keys) 2)                   (and (>= (length keys) 2)
54                        (eq (aref keys 0) meta-prefix-char)                        (eq (aref keys 0) meta-prefix-char)
55                        (eq (aref keys 1) ?x)))                        (eq (aref keys 1) ?x)))
56               (princ "You have invoked the disabled command ")               (princ (format "You have invoked the disabled command %s.\n"
57             (princ "You have typed ")                              (symbol-name this-command)))
58             (princ (key-description keys))             (princ (format "You have typed %s, invoking disabled command %s.\n"
59             (princ ", invoking disabled command ")))                            (key-description keys) (symbol-name this-command)))))
        (princ this-command)  
        (princ ":\n")  
60         ;; Print any special message saying why the command is disabled.         ;; Print any special message saying why the command is disabled.
61         (if (stringp (get this-command 'disabled))         (if (stringp (get this-command 'disabled))
62             (princ (get this-command 'disabled)))             (princ (get this-command 'disabled))
63         ;; Keep only the first paragraph of the documentation.           (princ "It is disabled because new users often find it confusing.\n")
64         (save-excursion           (princ "Here's the first part of its description:\n\n")
65           (set-buffer "*Help*")           ;; Keep only the first paragraph of the documentation.
66           (goto-char (point-max))           (with-current-buffer "*Help*"
67           (save-excursion             (goto-char (point-max))
68             (princ (or (condition-case ()             (let ((start (point)))
69                            (documentation this-command)               (save-excursion
70                          (error nil))                 (princ (or (condition-case ()
71                        "<< not documented >>")))                                (documentation this-command)
72           (if (search-forward "\n\n" nil t)                              (error nil))
73               (delete-region (1- (point)) (point-max))                            "<< not documented >>")))
74             (goto-char (point-max))))               (if (search-forward "\n\n" nil t)
75         (princ "\n\n")                   (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")
79         (princ "You can now type         (princ "You can now type
80  Space to try the command just this once, but leave it disabled,  Y   to try it and enable it (no questions if you use it again).
81  Y to try it and enable it (no questions if you use it again),  N   to cancel--don't try the command, and it remains disabled.
82  ! to try it and enable all commands in this session, or  SPC to try the command just this once, but leave it disabled.
83  N to do nothing (command remains disabled).")  !   to try it, and enable all disabled commands for this session only.")
84         (save-excursion         (save-excursion
85          (set-buffer standard-output)          (set-buffer standard-output)
86          (help-mode)))          (help-mode)))

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26