]> git.eshelyaron.com Git - emacs.git/commitdiff
(enable-command): Always insert code to enable.
authorRichard M. Stallman <rms@gnu.org>
Thu, 22 Dec 1994 22:53:34 +0000 (22:53 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 22 Dec 1994 22:53:34 +0000 (22:53 +0000)
(disable-command): Insert newline before as well as after.

lisp/novice.el

index ad9fc94655c95c5feab8e46875c92d610b18d136..0d23f26b3a1e24eeec565ed848fa13cbc197218d 100644 (file)
@@ -104,10 +104,11 @@ to future sessions."
    (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 @@ to future sessions."
        (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