/[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.32 by miles, Mon Sep 1 15:45:13 2003 UTC revision 1.32.2.1 by miles, Sat Sep 4 12:01:08 2004 UTC
# Line 1  Line 1 
1  ;;; novice.el --- handling of disabled commands ("novice mode") for Emacs  ;;; novice.el --- handling of disabled commands ("novice mode") for Emacs
2    
3  ;; Copyright (C) 1985, 1986, 1987, 1994, 2002 Free Software Foundation, Inc.  ;; Copyright (C) 1985, 1986, 1987, 1994, 2002, 2004
4    ;;   Free Software Foundation, Inc.
5    
6  ;; Maintainer: FSF  ;; Maintainer: FSF
7  ;; Keywords: internal, help  ;; Keywords: internal, help
# Line 36  Line 37 
37  ;; and the keys are returned by (this-command-keys).  ;; and the keys are returned by (this-command-keys).
38    
39  ;;;###autoload  ;;;###autoload
40  (defvar disabled-command-hook 'disabled-command-hook  (defvar disabled-command-function 'disabled-command-function
41    "Function to call to handle disabled commands.    "Function to call to handle disabled commands.
42  If nil, the feature is disabled, i.e., all commands work normally.")  If nil, the feature is disabled, i.e., all commands work normally.")
43    
44    (defvaralias 'disabled-command-hook 'disabled-command-function)
45    (make-obsolete-variable
46     'disabled-command-hook
47     "use the variable `disabled-command-function' instead." "21.4")
48    
49  ;;;###autoload  ;;;###autoload
50  (defun disabled-command-hook (&rest ignore)  (defun disabled-command-function (&rest ignore)
51    (let (char)    (let (char)
52      (save-window-excursion      (save-window-excursion
53       (with-output-to-temp-buffer "*Help*"       (with-output-to-temp-buffer "*Help*"
# Line 91  SPC to try the command just this once, b Line 97  SPC to try the command just this once, b
97           (ding)           (ding)
98           (message "Please type y, n, ! or SPC (the space bar): "))))           (message "Please type y, n, ! or SPC (the space bar): "))))
99      (if (= char ?!)      (if (= char ?!)
100          (setq disabled-command-hook nil))          (setq disabled-command-function nil))
101      (if (= char ?y)      (if (= char ?y)
102          (if (and user-init-file          (if (and user-init-file
103                   (not (string= "" user-init-file))                   (not (string= "" user-init-file))
# Line 104  SPC to try the command just this once, b Line 110  SPC to try the command just this once, b
110  ;;;###autoload  ;;;###autoload
111  (defun enable-command (command)  (defun enable-command (command)
112    "Allow COMMAND to be executed without special confirmation from now on.    "Allow COMMAND to be executed without special confirmation from now on.
113  The user's .emacs file is altered so that this will apply  COMMAND must be a symbol.
114    This command alters the user's .emacs file so that this will apply
115  to future sessions."  to future sessions."
116    (interactive "CEnable command: ")    (interactive "CEnable command: ")
117    (put command 'disabled nil)    (put command 'disabled nil)
# Line 141  to future sessions." Line 148  to future sessions."
148  ;;;###autoload  ;;;###autoload
149  (defun disable-command (command)  (defun disable-command (command)
150    "Require special confirmation to execute COMMAND from now on.    "Require special confirmation to execute COMMAND from now on.
151  The user's .emacs file is altered so that this will apply  COMMAND must be a symbol.
152    This command alters the user's .emacs file so that this will apply
153  to future sessions."  to future sessions."
154    (interactive "CDisable command: ")    (interactive "CDisable command: ")
155    (if (not (commandp command))    (if (not (commandp command))

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.32.2.1

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