Mercurial > emacs
changeset 7173:b6a358a4bdfb
(disabled-command-hook): Try to enable command in user
init file only if there is a user init file.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 28 Apr 1994 18:51:35 +0000 |
parents | f9eeb75c2b76 |
children | 0313f520a4d9 |
files | lisp/novice.el |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/novice.el Thu Apr 28 18:13:22 1994 +0000 +++ b/lisp/novice.el Thu Apr 28 18:51:35 1994 +0000 @@ -79,7 +79,9 @@ (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 @@ (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 @@ (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)