changeset 61885:305cf10830d5

(disable-command): Don't add spurious newlines to the init file. Reported by Dan Jacobson <jidanni@jidanni.org>.
author Lute Kamstra <lute@gnu.org>
date Wed, 27 Apr 2005 07:42:20 +0000
parents 45242a1c6ec2
children 8e632d027b70
files lisp/novice.el
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/novice.el	Wed Apr 27 04:53:04 2005 +0000
+++ b/lisp/novice.el	Wed Apr 27 07:42:20 2005 +0000
@@ -1,6 +1,6 @@
 ;;; novice.el --- handling of disabled commands ("novice mode") for Emacs
 
-;; Copyright (C) 1985, 1986, 1987, 1994, 2002, 2004
+;; Copyright (C) 1985, 1986, 1987, 1994, 2002, 2004, 2005
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -182,9 +182,10 @@
       (if (search-forward (concat "(put '" (symbol-name command) " ") nil t)
 	  (delete-region
 	   (progn (beginning-of-line) (point))
-	   (progn (forward-line 1) (point))))
-      (goto-char (point-max))
-      (insert "\n(put '" (symbol-name command) " 'disabled t)\n")
+	   (progn (forward-line 1) (point)))
+	(goto-char (point-max))
+	(insert ?\n))
+      (insert "(put '" (symbol-name command) " 'disabled t)\n")
       (save-buffer))))
 
 (provide 'novice)