summaryrefslogtreecommitdiff
path: root/lisp/novice.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-04-28 18:51:35 +0000
committerRichard M. Stallman <rms@gnu.org>1994-04-28 18:51:35 +0000
commit7435bd25826dc4dc9c4ea549c966dc44f743f890 (patch)
tree86555641a06112e34c59548c05244f8b14829283 /lisp/novice.el
parentb8228bebad005ddb1887d41c2fab9700026e1720 (diff)
downloademacs-7435bd25826dc4dc9c4ea549c966dc44f743f890.tar.gz
(disabled-command-hook): Try to enable command in user
init file only if there is a user init file.
Diffstat (limited to 'lisp/novice.el')
-rw-r--r--lisp/novice.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/novice.el b/lisp/novice.el
index 2c61715cefd..4fc9a48bfd5 100644
--- a/lisp/novice.el
+++ b/lisp/novice.el
@@ -79,7 +79,9 @@ N to do nothing (command remains disabled)."))
(ding)
(message "Please type y, n or Space: "))))
(if (= char ?y)
- (if (y-or-n-p "Enable command for future editing sessions also? ")
+ (if (and user-init-file
+ (not (string= "" user-init-file))
+ (y-or-n-p "Enable command for future editing sessions also? "))
(enable-command this-command)
(put this-command 'disabled nil)))
(if (/= char ?n)
@@ -93,7 +95,7 @@ to future sessions."
(interactive "CEnable command: ")
(put command 'disabled nil)
(save-excursion
- (set-buffer (find-file-noselect
+ (set-buffer (find-file-noselect
(substitute-in-file-name user-init-file)))
(goto-char (point-min))
(if (search-forward (concat "(put '" (symbol-name command) " ") nil t)
@@ -115,7 +117,7 @@ to future sessions."
(error "Invalid command name `%s'" command))
(put command 'disabled t)
(save-excursion
- (set-buffer (find-file-noselect
+ (set-buffer (find-file-noselect
(substitute-in-file-name user-init-file)))
(goto-char (point-min))
(if (search-forward (concat "(put '" (symbol-name command) " ") nil t)