[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/simple.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/simple.el |
Date: |
Fri, 09 Aug 2002 10:14:07 -0400 |
Index: emacs/lisp/simple.el
diff -c emacs/lisp/simple.el:1.560 emacs/lisp/simple.el:1.561
*** emacs/lisp/simple.el:1.560 Tue Jul 23 15:25:27 2002
--- emacs/lisp/simple.el Fri Aug 9 10:14:06 2002
***************
*** 3634,3640 ****
(defvar set-variable-value-history nil
"History of values entered with `set-variable'.")
! (defun set-variable (var val)
"Set VARIABLE to VALUE. VALUE is a Lisp object.
When using this interactively, enter a Lisp object for VALUE.
If you want VALUE to be a string, you must surround it with doublequotes.
--- 3634,3640 ----
(defvar set-variable-value-history nil
"History of values entered with `set-variable'.")
! (defun set-variable (var val &optional make-local)
"Set VARIABLE to VALUE. VALUE is a Lisp object.
When using this interactively, enter a Lisp object for VALUE.
If you want VALUE to be a string, you must surround it with doublequotes.
***************
*** 3644,3650 ****
it were the arg to `interactive' (which see) to interactively read VALUE.
If VARIABLE has been defined with `defcustom', then the type information
! in the definition is used to check that VALUE is valid."
(interactive
(let* ((default-var (variable-at-point))
(var (if (symbolp default-var)
--- 3644,3652 ----
it were the arg to `interactive' (which see) to interactively read VALUE.
If VARIABLE has been defined with `defcustom', then the type information
! in the definition is used to check that VALUE is valid.
!
! With a prefix argument, set VARIABLE to VALUE buffer-locally."
(interactive
(let* ((default-var (variable-at-point))
(var (if (symbolp default-var)
***************
*** 3653,3659 ****
(read-variable "Set variable: ")))
(minibuffer-help-form '(describe-variable var))
(prop (get var 'variable-interactive))
! (prompt (format "Set %s to value: " var))
(val (if prop
;; Use VAR's `variable-interactive' property
;; as an interactive spec for prompting.
--- 3655,3667 ----
(read-variable "Set variable: ")))
(minibuffer-help-form '(describe-variable var))
(prop (get var 'variable-interactive))
! (prompt (format "Set %s%s to value: " var
! (cond ((local-variable-p var)
! " (buffer-local)")
! ((or current-prefix-arg
! (local-variable-if-set-p var))
! " buffer-locally")
! (t " globally"))))
(val (if prop
;; Use VAR's `variable-interactive' property
;; as an interactive spec for prompting.
***************
*** 3663,3669 ****
(read
(read-string prompt nil
'set-variable-value-history)))))
! (list var val)))
(let ((type (get var 'custom-type)))
(when type
--- 3671,3677 ----
(read
(read-string prompt nil
'set-variable-value-history)))))
! (list var val current-prefix-arg)))
(let ((type (get var 'custom-type)))
(when type
***************
*** 3673,3678 ****
--- 3681,3690 ----
(unless (widget-apply type :match val)
(error "Value `%S' does not match type %S of %S"
val (car type) var))))
+
+ (if make-local
+ (make-local-variable var))
+
(set var val)
;; Force a thorough redisplay for the case that the variable
- [Emacs-diffs] Changes to emacs/lisp/simple.el,
Richard M. Stallman <=