Mercurial > hg > xemacs-beta
diff lisp/custom.el @ 4744:17f7e9191c0b
Rationalise duplicated functionality, #'custom-quote, #'quote-maybe.
src/ChangeLog addition:
2009-11-15 Aidan Kehoe <kehoea@parhasard.net>
* eval.c (Fquote_maybe):
Move this function here from callint.c; make it more comprehensive
about which types are self-quoting.
* lisp.h: Declare Fquote_maybe here, since it's now used in
callint.c and defined in eval.c
* callint.c (Fquote_maybe): Remove this function from this file.
lisp/ChangeLog addition:
2009-11-15 Aidan Kehoe <kehoea@parhasard.net>
* custom.el (custom-quote):
Define this as an alias for `quote-maybe', which is in C and more
comprehensive; packages still use this name in places.
(customize-mark-to-save, customize-mark-as-set): Use
`quote-maybe', not `custom-quote'.
* cus-edit.el (customize-set-variable, customize-save-variable)
(custom-variable-value-create, custom-variable-set)
(custom-variable-pre-save):
Remove a version of `custom-quote' specific to this file; use
`quote-maybe' universally instead.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 15 Nov 2009 14:59:53 +0000 |
parents | 061e030e3270 |
children | 7d06a8bf47d2 |
line wrap: on
line diff
--- a/lisp/custom.el Sat Nov 14 13:33:52 2009 +0000 +++ b/lisp/custom.el Sun Nov 15 14:59:53 2009 +0000 @@ -820,20 +820,8 @@ (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))) +;; Now in C, but the old name is still used by some packages: +(defalias 'custom-quote 'quote-maybe) (defun customize-mark-to-save (symbol) "Mark SYMBOL for later saving. @@ -855,7 +843,7 @@ (not (equal value (condition-case nil (eval (car standard)) (error nil))))) - (put symbol 'saved-value (list (custom-quote value))) + (put symbol 'saved-value (list (quote-maybe value))) (put symbol 'saved-value nil)) ;; Clear customized information (set, but not saved). (put symbol 'customized-value nil) @@ -882,7 +870,7 @@ (not (equal value (condition-case nil (eval (car old)) (error nil))))) - (put symbol 'customized-value (list (custom-quote value))) + (put symbol 'customized-value (list (quote-maybe value))) (put symbol 'customized-value nil)) ;; Changed? (not (equal customized (get symbol 'customized-value)))))