[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: using use-package
From: |
Drew Adams |
Subject: |
RE: using use-package |
Date: |
Fri, 14 Aug 2015 07:49:44 -0700 (PDT) |
> > I'd love to be able to do something like
> > (custom-setq my-variable 10)
> > which sets the variable, but does not result in the "the value of
> > this variable has been changed outside of customize" message in Custom.
>
> You can try customize-set-variable.
Yes. (Or `customize-set-value', depending on what you want.)
Or use this, which is the part of `customize-set-(variable|value)'
that does what you are asking for:
(defun tell-customize-option-has-changed (option &optional msgp)
"Tell Customize that OPTION, changed outside Customize, is now set."
(interactive "vOption: \np")
(put option 'customized-value (list (custom-quote (symbol-value option))))
(when msgp (message "Option `%s' is now set (but NOT saved)" option)))
And for a face:
(defun tell-customize-face-has-changed (face &optional msgp)
"Tell Customize that FACE, changed outside Customize, is now set.
The definition of symbol FACE for the current frame is used."
(interactive (list (read-face-name "Face") t))
(put face 'customized-face (list (list 't (face-attr-construct face))))
(put face 'customized-face-comment (get face 'face-comment))
(put face 'face-modified nil)
(when msgp (message "Face `%s' is now set (but NOT saved)" face))))
In short:
- option: (put OPTION 'customized-value
(list (custom-quote (symbol-value OPTION))))
- face: (put FACE 'customized-face SPEC)
(face-spec-set FACE SPEC) ; See `face-spec-set' doc.
See also:
http://www.emacswiki.org/emacs/CustomizingAndSaving#GetCustomizeToRecognizeChangedPreference
- Re: using use-package, (continued)
- Message not available
- Re: using use-package, Stefan Monnier, 2015/08/13
- Re: using use-package, John Yates, 2015/08/13
- Re: using use-package, John Wiegley, 2015/08/14
- Re: using use-package, Phillip Lord, 2015/08/14
- Message not available
- Re: using use-package, Stefan Monnier, 2015/08/14
- Re: using use-package, John Yates, 2015/08/14
- Message not available
- Re: using use-package, Stefan Monnier, 2015/08/14
- RE: using use-package,
Drew Adams <=
- Re: using use-package, Phillip Lord, 2015/08/14
- RE: using use-package, Drew Adams, 2015/08/14
- Message not available
- Re: using use-package, Rusi, 2015/08/12
- Message not available
- Re: using use-package, Rusi, 2015/08/08
- Re: using use-package, Stefan Monnier, 2015/08/09
- Re: using use-package, Rusi, 2015/08/09
- Re: using use-package, Emanuel Berg, 2015/08/09
- Re: using use-package, Stefan Monnier, 2015/08/09
- Re: using use-package, Rusi, 2015/08/09
- Re: using use-package, Stefan Monnier, 2015/08/09