Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
6d912ee1
Commit
6d912ee1
authored
Apr 19, 2002
by
Miles Bader
Browse files
(customize-mark-to-save, customize-mark-as-set)
(custom-quote): Moved here from `cus-edit.el'.
parent
60acd41c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
1 deletion
+75
-1
lisp/ChangeLog
lisp/ChangeLog
+8
-1
lisp/custom.el
lisp/custom.el
+67
-0
No files found.
lisp/ChangeLog
View file @
6d912ee1
2002-04-19 Miles Bader <miles@gnu.org>
* custom.el (customize-mark-to-save, customize-mark-as-set)
(custom-quote): Moved here from `cus-edit.el'.
* cus-edit.el (customize-mark-to-save, customize-mark-as-set)
(custom-quote): Moved to `custom.el'.
2002-04-18 Richard M. Stallman <rms@gnu.org>
* facemenu.el (list-text-properties-at): Command deleted.
...
...
@@ -61,7 +68,7 @@
* term.el (term-emulate-terminal): Fix last change.
2002-04-16 Pavel Jan,
B
m(Bk <Pavel@Janik.cz>
2002-04-16 Pavel Jan,
A
m(Bk <Pavel@Janik.cz>
* bindings.el (mode-line-mode-menu): Update names to reflect
latest changes.
...
...
lisp/custom.el
View file @
6d912ee1
...
...
@@ -549,6 +549,73 @@ this sets the local binding in that buffer instead."
(
set
variable
value
))
(
set-default
variable
value
)))
(
defun
custom-quote
(
sexp
)
"Quote SEXP iff it is not self quoting."
(
if
(
or
(
memq
sexp
'
(
t
nil
))
(
keywordp
sexp
)
(
and
(
listp
sexp
)
(
memq
(
car
sexp
)
'
(
lambda
)))
(
stringp
sexp
)
(
numberp
sexp
)
(
vectorp
sexp
)
;;; (and (fboundp 'characterp)
;;; (characterp sexp))
)
sexp
(
list
'quote
sexp
)))
(
defun
customize-mark-to-save
(
symbol
)
"Mark SYMBOL for later saving.
If the default value of SYMBOL is different from the standard value,
set the `saved-value' property to a list whose car evaluates to the
default value. Otherwise, set it til nil.
To actually save the value, call `custom-save-all'.
Return non-nil iff the `saved-value' property actually changed."
(
let*
((
get
(
or
(
get
symbol
'custom-get
)
'default-value
))
(
value
(
funcall
get
symbol
))
(
saved
(
get
symbol
'saved-value
))
(
standard
(
get
symbol
'standard-value
))
(
comment
(
get
symbol
'customized-variable-comment
)))
;; Save default value iff different from standard value.
(
if
(
or
(
null
standard
)
(
not
(
equal
value
(
condition-case
nil
(
eval
(
car
standard
))
(
error
nil
)))))
(
put
symbol
'saved-value
(
list
(
custom-quote
value
)))
(
put
symbol
'saved-value
nil
))
;; Clear customized information (set, but not saved).
(
put
symbol
'customized-value
nil
)
;; Save any comment that might have been set.
(
when
comment
(
put
symbol
'saved-variable-comment
comment
))
(
not
(
equal
saved
(
get
symbol
'saved-value
)))))
(
defun
customize-mark-as-set
(
symbol
)
"Mark current value of SYMBOL as being set from customize.
If the default value of SYMBOL is different from the saved value if any,
or else if it is different from the standard value, set the
`customized-value' property to a list whose car evaluates to the
default value. Otherwise, set it til nil.
Return non-nil iff the `customized-value' property actually changed."
(
let*
((
get
(
or
(
get
symbol
'custom-get
)
'default-value
))
(
value
(
funcall
get
symbol
))
(
customized
(
get
symbol
'customized-value
))
(
old
(
or
(
get
symbol
'saved-value
)
(
get
symbol
'standard-value
))))
;; Mark default value as set iff different from old value.
(
if
(
or
(
null
old
)
(
not
(
equal
value
(
condition-case
nil
(
eval
(
car
old
))
(
error
nil
)))))
(
put
symbol
'customized-value
(
list
(
custom-quote
value
)))
(
put
symbol
'customized-value
nil
))
;; Changed?
(
not
(
equal
customized
(
get
symbol
'customized-value
)))))
;;; The End.
;; Process the defcustoms for variables loaded before this file.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment