changeset 69780:a86cacdbe08f

(savehist): Add :version. (savehist-ignored-variables): New variable. (savehist-minibuffer-hook): Don't save variables listed in `savehist-ignored-variables'.
author Reiner Steib <Reiner.Steib@gmx.de>
date Mon, 03 Apr 2006 17:32:28 +0000
parents 865de55024d5
children 9a5e8a784858
files lisp/ChangeLog lisp/savehist.el
diffstat 2 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Apr 03 17:27:06 2006 +0000
+++ b/lisp/ChangeLog	Mon Apr 03 17:32:28 2006 +0000
@@ -1,5 +1,10 @@
 2006-04-03  Reiner Steib  <Reiner.Steib@gmx.de>
 
+	* savehist.el (savehist): Add :version.
+	(savehist-ignored-variables): New variable.
+	(savehist-minibuffer-hook): Don't save variables listed in
+	`savehist-ignored-variables'.
+
 	* dired.el (dired-dnd-protocol-alist): Mention that change does
 	only apply to new buffers in doc string.
 
--- a/lisp/savehist.el	Mon Apr 03 17:27:06 2006 +0000
+++ b/lisp/savehist.el	Mon Apr 03 17:32:28 2006 +0000
@@ -56,6 +56,7 @@
 
 (defgroup savehist nil
   "Save minibuffer history."
+  :version "22.1"
   :group 'minibuffer)
 
 ;;;###autoload
@@ -91,6 +92,11 @@
   :type '(repeat variable)
   :group 'savehist)
 
+(defcustom savehist-ignored-variables nil ;; '(command-history)
+  "*List of additional variables not to save."
+  :type '(repeat variable)
+  :group 'savehist)
+
 (defcustom savehist-file
   (cond
    ;; Backward compatibility with previous versions of savehist.
@@ -371,9 +377,12 @@
 	(error nil))))))
 
 (defun savehist-minibuffer-hook ()
-  ;; XEmacs sets minibuffer-history-variable to t to mean "no history
-  ;; is being recorded".
-  (unless (eq minibuffer-history-variable t)
+  (when (memq minibuffer-history-variable savehist-ignored-variables)
+    (debug nil minibuffer-history-variable))
+  (unless (or (eq minibuffer-history-variable t)
+	      ;; XEmacs sets minibuffer-history-variable to t to mean "no
+	      ;; history is being recorded".
+	      (memq minibuffer-history-variable savehist-ignored-variables))
     (add-to-list 'savehist-minibuffer-history-variables
 		 minibuffer-history-variable)))