748 |
(list var val)))) |
(list var val)))) |
749 |
|
|
750 |
;;;###autoload |
;;;###autoload |
751 |
(defun customize-set-value (var val &optional comment) |
(defun customize-set-value (variable value &optional comment) |
752 |
"Set VARIABLE to VALUE, and return VALUE. VALUE is a Lisp object. |
"Set VARIABLE to VALUE, and return VALUE. VALUE is a Lisp object. |
753 |
|
|
754 |
If VARIABLE has a `variable-interactive' property, that is used as if |
If VARIABLE has a `variable-interactive' property, that is used as if |
763 |
current-prefix-arg)) |
current-prefix-arg)) |
764 |
|
|
765 |
(cond ((string= comment "") |
(cond ((string= comment "") |
766 |
(put var 'variable-comment nil)) |
(put variable 'variable-comment nil)) |
767 |
(comment |
(comment |
768 |
(put var 'variable-comment comment))) |
(put variable 'variable-comment comment))) |
769 |
(set var val)) |
(set variable value)) |
770 |
|
|
771 |
;;;###autoload |
;;;###autoload |
772 |
(defun customize-set-variable (variable value &optional comment) |
(defun customize-set-variable (variable value &optional comment) |
801 |
value) |
value) |
802 |
|
|
803 |
;;;###autoload |
;;;###autoload |
804 |
(defun customize-save-variable (var value &optional comment) |
(defun customize-save-variable (variable value &optional comment) |
805 |
"Set the default for VARIABLE to VALUE, and save it for future sessions. |
"Set the default for VARIABLE to VALUE, and save it for future sessions. |
806 |
Return VALUE. |
Return VALUE. |
807 |
|
|
821 |
(interactive (custom-prompt-variable "Set and save variable: " |
(interactive (custom-prompt-variable "Set and save variable: " |
822 |
"Set and save value for %s as: " |
"Set and save value for %s as: " |
823 |
current-prefix-arg)) |
current-prefix-arg)) |
824 |
(funcall (or (get var 'custom-set) 'set-default) var value) |
(funcall (or (get variable 'custom-set) 'set-default) variable value) |
825 |
(put var 'saved-value (list (custom-quote value))) |
(put variable 'saved-value (list (custom-quote value))) |
826 |
(cond ((string= comment "") |
(cond ((string= comment "") |
827 |
(put var 'variable-comment nil) |
(put variable 'variable-comment nil) |
828 |
(put var 'saved-variable-comment nil)) |
(put variable 'saved-variable-comment nil)) |
829 |
(comment |
(comment |
830 |
(put var 'variable-comment comment) |
(put variable 'variable-comment comment) |
831 |
(put var 'saved-variable-comment comment))) |
(put variable 'saved-variable-comment comment))) |
832 |
(custom-save-all) |
(custom-save-all) |
833 |
value) |
value) |
834 |
|
|