From xemacs-m  Mon Jun  9 00:53:43 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id AAA13322
	for <xemacs-beta@xemacs.org>; Mon, 9 Jun 1997 00:53:42 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id HAA16505; Mon, 9 Jun 1997 07:53:43 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: [PATCH] savehist update
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 09 Jun 1997 07:53:42 +0200
Message-ID: <kigraecs4nt.fsf@jagor.srce.hr>
Lines: 104
X-Mailer: Gnus v5.4.52/XEmacs 20.3(beta4)

I've added chmod-ing the file to 600 by default, and added a few more
variables.  Is anyone actually trying this out?  I find the feature
quite useful.

--- ../work/xemacs/xemacs-beta/lisp/utils/savehist.el	Fri May 30 01:50:26 1997
+++ savehist.el	Mon Jun  9 07:52:37 1997
@@ -4,7 +4,7 @@
 
 ;; Author: Hrvoje Niksic <hniksic@srce.hr>
 ;; Keywords: minibuffer
-;; Version: 0.2
+;; Version: 0.3
 
 ;; This file is part of XEmacs.
 
@@ -75,6 +75,12 @@
     read-expression-history
     ;; shell-command (`M-!')
     shell-command-history
+    ;; compile
+    compile-history
+    ;; find-tag (`M-.')
+    find-tag-history
+    ;; grep
+    grep-history
     ;; Viper stuff
     vip-ex-history vip-search-history
     vip-replace1-history vip-replace2-history
@@ -90,20 +96,17 @@
 
     ;; GNU Emacs-specific:
     ;; Extended commands
-    extended-command-history
-
-    ;; This is not a list, but it's cool to have it anyway, since it's
-    ;; minibuffer history too.
-    compile-command)
+    extended-command-history)
   "*List of symbols to be saved.
-Every symbol should refer to a variable.  The variable will be saved only
-if it is bound is bound, and has a non-nil value.  Thus it is safe to
-specify a superset of the variables a user is expected to want to save.
+Every symbol should refer to a variable.  The variable will be saved
+only if it is bound and has a non-nil value.  Thus it is safe to
+specify a superset of the variables a user is expected to want to
+save.
 
 Default value contains minibuffer history variables used by XEmacs, GNU
-Emacs and Viper (uh-oh).  `compile-command' was added for good measure."
+Emacs and Viper (uh-oh)."
   :type '(repeat (symbol :tag "Variable"))
-  :group 'minibuffer)
+  :group 'savehist)
 
 (defcustom savehist-file "~/.emacs-history"
   "*File name to save minibuffer history to.
@@ -120,6 +123,11 @@
 		 (const :tag "Unlimited" nil))
   :group 'savehist)
 
+(defcustom savehist-modes 384
+  "*Default permissions of the history file."
+  :type 'integer
+  :group 'savehist)
+
 
 ;; Functions
 
@@ -135,8 +143,7 @@
   (interactive "P")
   (unless prefix
     (add-hook 'kill-emacs-hook 'savehist-save))
-  (when (file-exists-p savehist-file)
-    (load savehist-file)))
+  (load savehist-file t))
 
 ;;;###autoload
 (defun savehist-save ()
@@ -167,13 +174,14 @@
 						       savehist-length)))
 		 (current-buffer))
 		(insert ?\n)))
-	    (save-buffer))
+	    (save-buffer)
+	    (set-file-modes savehist-file savehist-modes))
 	(or buffer-exists-p
 	    (kill-buffer (current-buffer)))))))
 
-;; If ARG is a arg with less than N elements, return it, else return
-;; its subsequence of N elements.  If N is nil, always return ARG.  If
-;; ARG is not a list, just return it.
+;; If ARG is a list with less than N elements, return it, else return
+;; its subsequence of N elements.  If N is nil or ARG is not a list,
+;; always return ARG.
 (defun savehist-delimit (arg n)
   (if (and n
 	   (listp arg)


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Contrary to popular belief, Unix is user friendly.  
It just happens to be selective about who it makes friends with.

