Mercurial > emacs
comparison lisp/custom.el @ 49588:37645a051842
Trailing whitespace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 11:26:42 +0000 |
parents | 4dd5da1ea3dc |
children | 7c924263658d d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49587:e82b3fe06d4c | 49588:37645a051842 |
---|---|
189 Add SYMBOL to that group. | 189 Add SYMBOL to that group. |
190 :link LINK-DATA | 190 :link LINK-DATA |
191 Include an external link after the documentation string for this | 191 Include an external link after the documentation string for this |
192 item. This is a sentence containing an active field which | 192 item. This is a sentence containing an active field which |
193 references some other documentation. | 193 references some other documentation. |
194 | 194 |
195 There are three alternatives you can use for LINK-DATA: | 195 There are three alternatives you can use for LINK-DATA: |
196 | 196 |
197 (custom-manual INFO-NODE) | 197 (custom-manual INFO-NODE) |
198 Link to an Info node; INFO-NODE is a string which specifies | 198 Link to an Info node; INFO-NODE is a string which specifies |
199 the node name, as in \"(emacs)Top\". The link appears as | 199 the node name, as in \"(emacs)Top\". The link appears as |
200 `[manual]' in the customization buffer. | 200 `[manual]' in the customization buffer. |
201 | 201 |
202 (info-link INFO-NODE) | 202 (info-link INFO-NODE) |
203 Like `custom-manual' except that the link appears in the | 203 Like `custom-manual' except that the link appears in the |
204 customization buffer with the Info node name. | 204 customization buffer with the Info node name. |
205 | 205 |
206 (url-link URL) | 206 (url-link URL) |
207 Link to a web page; URL is a string which specifies the URL. | 207 Link to a web page; URL is a string which specifies the URL. |
208 The link appears in the customization buffer as URL. | 208 The link appears in the customization buffer as URL. |
209 | 209 |
210 You can specify the text to use in the customization buffer by | 210 You can specify the text to use in the customization buffer by |
211 adding `:tag NAME' after the first element of the LINK-DATA; for | 211 adding `:tag NAME' after the first element of the LINK-DATA; for |
212 example, (info-link :tag \"foo\" \"(emacs)Top\") makes a link to the | 212 example, (info-link :tag \"foo\" \"(emacs)Top\") makes a link to the |
213 Emacs manual which appears in the buffer as `foo'. | 213 Emacs manual which appears in the buffer as `foo'. |
214 | 214 |
215 An item can have more than one external link; however, most items | 215 An item can have more than one external link; however, most items |
216 have none at all. | 216 have none at all. |
217 :initialize | 217 :initialize |
218 VALUE should be a function used to initialize the | 218 VALUE should be a function used to initialize the |
219 variable. It takes two arguments, the symbol and value | 219 variable. It takes two arguments, the symbol and value |
770 (put symbol 'force-value t) | 770 (put symbol 'force-value t) |
771 (funcall set symbol (eval value))) | 771 (funcall set symbol (eval value))) |
772 ((default-boundp symbol) | 772 ((default-boundp symbol) |
773 ;; Something already set this, overwrite it. | 773 ;; Something already set this, overwrite it. |
774 (funcall set symbol (eval value)))) | 774 (funcall set symbol (eval value)))) |
775 (error | 775 (error |
776 (message "Error setting %s: %s" symbol data))) | 776 (message "Error setting %s: %s" symbol data))) |
777 (setq args (cdr args)) | 777 (setq args (cdr args)) |
778 (and (or now (default-boundp symbol)) | 778 (and (or now (default-boundp symbol)) |
779 (put symbol 'variable-comment comment))) | 779 (put symbol 'variable-comment comment))) |
780 ;; Old format, a plist of SYMBOL VALUE pairs. | 780 ;; Old format, a plist of SYMBOL VALUE pairs. |
813 (list 'quote sexp))) | 813 (list 'quote sexp))) |
814 | 814 |
815 (defun customize-mark-to-save (symbol) | 815 (defun customize-mark-to-save (symbol) |
816 "Mark SYMBOL for later saving. | 816 "Mark SYMBOL for later saving. |
817 | 817 |
818 If the default value of SYMBOL is different from the standard value, | 818 If the default value of SYMBOL is different from the standard value, |
819 set the `saved-value' property to a list whose car evaluates to the | 819 set the `saved-value' property to a list whose car evaluates to the |
820 default value. Otherwise, set it to nil. | 820 default value. Otherwise, set it to nil. |
821 | 821 |
822 To actually save the value, call `custom-save-all'. | 822 To actually save the value, call `custom-save-all'. |
823 | 823 |
842 (not (equal saved (get symbol 'saved-value))))) | 842 (not (equal saved (get symbol 'saved-value))))) |
843 | 843 |
844 (defun customize-mark-as-set (symbol) | 844 (defun customize-mark-as-set (symbol) |
845 "Mark current value of SYMBOL as being set from customize. | 845 "Mark current value of SYMBOL as being set from customize. |
846 | 846 |
847 If the default value of SYMBOL is different from the saved value if any, | 847 If the default value of SYMBOL is different from the saved value if any, |
848 or else if it is different from the standard value, set the | 848 or else if it is different from the standard value, set the |
849 `customized-value' property to a list whose car evaluates to the | 849 `customized-value' property to a list whose car evaluates to the |
850 default value. Otherwise, set it to nil. | 850 default value. Otherwise, set it to nil. |
851 | 851 |
852 Return non-nil iff the `customized-value' property actually changed." | 852 Return non-nil iff the `customized-value' property actually changed." |
853 (let* ((get (or (get symbol 'custom-get) 'default-value)) | 853 (let* ((get (or (get symbol 'custom-get) 'default-value)) |
854 (value (funcall get symbol)) | 854 (value (funcall get symbol)) |
855 (customized (get symbol 'customized-value)) | 855 (customized (get symbol 'customized-value)) |
856 (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) | 856 (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) |
857 ;; Mark default value as set iff different from old value. | 857 ;; Mark default value as set iff different from old value. |
858 (if (or (null old) | 858 (if (or (null old) |
859 (not (equal value (condition-case nil | 859 (not (equal value (condition-case nil |
860 (eval (car old)) | 860 (eval (car old)) |
861 (error nil))))) | 861 (error nil))))) |
862 (put symbol 'customized-value (list (custom-quote value))) | 862 (put symbol 'customized-value (list (custom-quote value))) |
863 (put symbol 'customized-value nil)) | 863 (put symbol 'customized-value nil)) |
864 ;; Changed? | 864 ;; Changed? |