From 7bae77f3371368f90b10c04b7d336414829d27b4 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 6 Nov 2001 23:23:32 +0000 Subject: [PATCH] * nnheader.el (customize-save-variable): Defun-maybe. --- ChangeLog | 4 ++++ lisp/nnheader.el | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index a17a4d9..632fe99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-11-06 Katsumi Yamaoka + + * lisp/nnheader.el (customize-save-variable): Defun-maybe. + 2001-11-01 07:00:00 ShengHuo ZHU * etc/smilies/blink.xpm: New set of xpm. From Oliver Scholz diff --git a/lisp/nnheader.el b/lisp/nnheader.el index b13bf19..5d4229f 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -1202,6 +1202,27 @@ find-file-hooks, etc. (read-coding-system prompt)) 'read-coding-system)) +(defun-maybe customize-save-variable (var val) + "Set the default for VARIABLE to VALUE, and save it for future sessions. +If VARIABLE has a `custom-set' property, that is used for setting +VARIABLE, otherwise `set-default' is used. + +The `customized-value' property of the VARIABLE will be set to a list +with a quoted VALUE as its sole list member. + +If VARIABLE has a `variable-interactive' property, that is used as if +it were the arg to `interactive' (which see) to interactively read the value. + +If VARIABLE has a `custom-type' property, it must be a widget and the +`:prompt-value' property of that widget will be used for reading the value. + +NOTE: This function is imported from Emacs 20.7 for old Emacsen." + (interactive (custom-prompt-variable "Set and ave variable: " + "Set and save value for %s as: ")) + (funcall (or (get var 'custom-set) 'set-default) var val) + (put var 'saved-value (list (custom-quote val))) + (custom-save-all)) + (when (featurep 'xemacs) (require 'nnheaderxm)) -- 1.7.10.4