From xemacs-m  Thu Sep 18 16:29:12 1997
Received: from wfdutilgw.ml.com (wfdutilf01.ml.com [206.3.74.31])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id QAA11499
	for <xemacs-beta@xemacs.org>; Thu, 18 Sep 1997 16:29:09 -0500 (CDT)
Received: from ml1.ml.com ([199.201.57.130])
	by wfdutilgw.ml.com (8.8.5/8.8.5/MLgw-3.03) with ESMTP id RAA05103
	for <xemacs-beta@xemacs.org>; Thu, 18 Sep 1997 17:29:57 -0400 (EDT)
Received: from commpost.ml.com (commpost.ml.com [146.125.4.24])
	by ml1.ml.com (8.8.5/8.8.5/MLml4-2.07) with SMTP id RAA25607
	for <xemacs-beta@xemacs.org>; Thu, 18 Sep 1997 17:28:40 -0400 (EDT)
Received: from spssunp.spspme.ml.com (spssunp.spspme.ml.com [192.168.111.13]) by commpost.ml.com (8.6.12/8.6.12) with ESMTP id RAA24063 for <xemacs-beta@xemacs.org>; Thu, 18 Sep 1997 17:28:41 -0400
Received: by spssunp.spspme.ml.com (SMI-8.6/SMI-4.1)
	id RAA02592; Thu, 18 Sep 1997 17:28:40 -0400
To: XEmacs Beta List <xemacs-beta@xemacs.org>
Subject: [patch] novice.el buglets
X-Face: D>:hrrB{l6#\wU;)0R:OHSTA@ayd.Oq?s@Rrc;[+z0m+<-U"$G-J6L)F2QY`qK~uPu!s1(6{\#uy!Ag/D)?'L[}xErXvxoPn8T_hKi{M]/(`BF{e}X7;hby`p\.E$rJ}Aff#BT,rdDIw\y
X-Y-Zippy: HUMAN REPLICAS are inserted into VATS of NUTRITIONAL YEAST...
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
 boundary="Multipart_Thu_Sep_18_17:28:38_1997-1"
Content-Transfer-Encoding: 7bit
From: Colin Rafferty <craffert@ml.com>
Date: 18 Sep 1997 17:28:38 -0400
Message-ID: <ocr202m9urd.fsf@ml.com>
Lines: 109
X-Mailer: Gnus v5.5/XEmacs 20.3(beta22) - "Minsk"

--Multipart_Thu_Sep_18_17:28:38_1997-1
Content-Type: text/plain; charset=US-ASCII

Two things:

1. `enable-command' modifies `custom-file', `disable-command' modifies
   `user-init-file'.  I corrected `disable-command'.

2. A call to `enable-command' or `disable-command' will add an
   unnecessary blank line to a `custom-file' that has a trailing
   newline.  This causes toggling enable/disable of one command to grow
   the file without bounds.  I fixed this.


--Multipart_Thu_Sep_18_17:28:38_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="novice.patch"
Content-Transfer-Encoding: 8bit

*** lisp/ChangeLog	Thu Sep 18 17:18:33 1997
--- lisp/ChangeLog~	Thu Sep 18 09:35:11 1997
***************
*** 1,11 ****
- 1997-09-18  Colin Rafferty  <craffert@ml.com>
- 
- 	* prim/novice.el (disable-command): Made it modify `custom-file'
- 		  instead of `user-init-file'.
- 
- 		  Stop multiple disable/enable-command calls from adding
- 			  extra newlines.
- 	
  1997-09-17  SL Baur  <steve@altair.xemacs.org>
  
  	* prim/packages.el (locate-library): Simplify regexp for
--- 1,3 ----
*** lisp/prim/novice.el~	Sat Jun 21 16:03:03 1997
--- lisp/prim/novice.el	Thu Sep 18 17:07:11 1997
***************
*** 138,150 ****
     ;; 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
  (defun disable-command (command)
    "Require special confirmation to execute COMMAND from now on.
! The user's .emacs file is altered so that this will apply
  to future sessions."
    (interactive "CDisable command: ")
    (if (not (commandp command))
--- 138,151 ----
     ;; 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))
!    (or (bolp) (insert "\n"))
!    (insert "(put '" (symbol-name command) " 'disabled nil)\n")
     (save-buffer)))
  
  ;;;###autoload
  (defun disable-command (command)
    "Require special confirmation to execute COMMAND from now on.
! The user's `custom-file' is altered so that this will apply
  to future sessions."
    (interactive "CDisable command: ")
    (if (not (commandp command))
***************
*** 152,165 ****
    (put command 'disabled t)
    (save-excursion
     (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)
         (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")
     (save-buffer)))
  
  ;;; novice.el ends here
--- 153,167 ----
    (put command 'disabled t)
    (save-excursion
     (set-buffer (find-file-noselect
! 		(substitute-in-file-name custom-file)))
     (goto-char (point-min))
     (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))
!    (or (bolp) (insert "\n"))
!    (insert "(put '" (symbol-name command) " 'disabled t)\n")
     (save-buffer)))
  
  ;;; novice.el ends here

--Multipart_Thu_Sep_18_17:28:38_1997-1
Content-Type: text/plain; charset=US-ASCII

-- 
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)

--Multipart_Thu_Sep_18_17:28:38_1997-1--

