changeset 10216:c1ad03de412e

(enable-command): Always insert code to enable. (disable-command): Insert newline before as well as after.
author Richard M. Stallman <rms@gnu.org>
date Thu, 22 Dec 1994 22:53:34 +0000
parents 7690653b9231
children d112e49af18b
files lisp/novice.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/novice.el	Thu Dec 22 22:05:52 1994 +0000
+++ b/lisp/novice.el	Thu Dec 22 22:53:34 1994 +0000
@@ -104,10 +104,11 @@
    (if (search-forward (concat "(put '" (symbol-name command) " ") nil t)
        (delete-region
 	(progn (beginning-of-line) (point))
-	(progn (forward-line 1) (point)))
-     ;; Must have been disabled by default.
-     (goto-char (point-max))
-     (insert "\n(put '" (symbol-name command) " 'disabled nil)\n"))
+	(progn (forward-line 1) (point))))
+   ;; Explicitly enable, in case this command is disabled by default
+   ;; or in case the code we deleted was actually a comment.
+   (goto-char (point-max))
+   (insert "\n(put '" (symbol-name command) " 'disabled nil)\n")
    (save-buffer)))
 
 ;;;###autoload
@@ -128,7 +129,7 @@
 	(progn (beginning-of-line) (point))
 	(progn (forward-line 1) (point))))
    (goto-char (point-max))
-   (insert "(put '" (symbol-name command) " 'disabled t)\n")
+   (insert "\n(put '" (symbol-name command) " 'disabled t)\n")
    (save-buffer)))
 
 ;;; novice.el ends here