diff options
| author | Richard M. Stallman | 1997-05-31 00:54:10 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-31 00:54:10 +0000 |
| commit | 4883633e7b4416a0da1a63bc7fd0c4081bdc7837 (patch) | |
| tree | 51e53429f2e23d0d3e1a2b5d78ae04db0be77d98 /lisp | |
| parent | 87631ef75db38259541da5f9f47fde3c8021e759 (diff) | |
| download | emacs-4883633e7b4416a0da1a63bc7fd0c4081bdc7837.tar.gz emacs-4883633e7b4416a0da1a63bc7fd0c4081bdc7837.zip | |
Arrange to load it once during dumping,
and again if needed by cus-edit.el.
(custom-start-quote): Don't define as separate function.
(load-path): Improve the :type.
(delete-exited-processes): Fix group to processes-basics.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/cus-start.el | 75 |
1 files changed, 45 insertions, 30 deletions
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index ac339793029..c94e1550520 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -24,26 +24,16 @@ | |||
| 24 | 24 | ||
| 25 | ;;; Commentary: | 25 | ;;; Commentary: |
| 26 | ;; | 26 | ;; |
| 27 | ;; Must be run before the user has changed the value of any options! | 27 | ;; This file adds customize support for built-in variables. |
| 28 | 28 | ||
| 29 | ;;; Code: | 29 | ;; While dumping Emacs, this file is loaded, but it only records |
| 30 | ;; the standard values; it does not do the rest of the job. | ||
| 31 | ;; Later on, if the user makes a customization buffer, | ||
| 32 | ;; this file is loaded again with (require 'cus-start); | ||
| 33 | ;; then it does the whole job. | ||
| 30 | 34 | ||
| 31 | (defun custom-start-quote (sexp) | 35 | ;;; Code: |
| 32 | ;; This is copied from `cus-edit.el'. | ||
| 33 | "Quote SEXP iff it is not self quoting." | ||
| 34 | (if (or (memq sexp '(t nil)) | ||
| 35 | (and (symbolp sexp) | ||
| 36 | (eq (aref (symbol-name sexp) 0) ?:)) | ||
| 37 | (and (listp sexp) | ||
| 38 | (memq (car sexp) '(lambda))) | ||
| 39 | (stringp sexp) | ||
| 40 | (numberp sexp) | ||
| 41 | (and (fboundp 'characterp) | ||
| 42 | (characterp sexp))) | ||
| 43 | sexp | ||
| 44 | (list 'quote sexp))) | ||
| 45 | 36 | ||
| 46 | ;; Add support for build in variables. | ||
| 47 | (let ((all '(;; abbrev.c | 37 | (let ((all '(;; abbrev.c |
| 48 | (abbrev-all-caps abbrev-mode boolean) | 38 | (abbrev-all-caps abbrev-mode boolean) |
| 49 | (pre-abbrev-expand-hook abbrev-mode hook) | 39 | (pre-abbrev-expand-hook abbrev-mode hook) |
| @@ -131,15 +121,15 @@ | |||
| 131 | :format "%t"))) | 121 | :format "%t"))) |
| 132 | ;; lread.c | 122 | ;; lread.c |
| 133 | (load-path environment | 123 | (load-path environment |
| 134 | (repeat (choice :tag "Current or Specific Dir" | 124 | (repeat (choice :tag "[Current dir?]" |
| 135 | (const :tag "use current" nil) | 125 | (const :tag " current dir" nil) |
| 136 | (directory :tag "Specific")))) | 126 | (directory :format "%v")))) |
| 137 | ;; minibuf.c | 127 | ;; minibuf.c |
| 138 | (completion-auto-help minibuffer boolean) | 128 | (completion-auto-help minibuffer boolean) |
| 139 | (enable-recursive-minibuffers minibuffer boolean) | 129 | (enable-recursive-minibuffers minibuffer boolean) |
| 140 | (minibuffer-auto-raise minibuffer boolean) | 130 | (minibuffer-auto-raise minibuffer boolean) |
| 141 | ;; process.c | 131 | ;; process.c |
| 142 | (delete-exited-processes proces-basics boolean) | 132 | (delete-exited-processes processes-basics boolean) |
| 143 | ;; syntax.c | 133 | ;; syntax.c |
| 144 | (parse-sexp-ignore-comments editing-basics boolean) | 134 | (parse-sexp-ignore-comments editing-basics boolean) |
| 145 | (words-include-escapes editing-basics boolean) | 135 | (words-include-escapes editing-basics boolean) |
| @@ -195,7 +185,21 @@ | |||
| 195 | ;; xfns.c | 185 | ;; xfns.c |
| 196 | (x-bitmap-file-path installation | 186 | (x-bitmap-file-path installation |
| 197 | (repeat (directory :format "%v"))))) | 187 | (repeat (directory :format "%v"))))) |
| 198 | this symbol group type) | 188 | this symbol group type |
| 189 | ;; This function turns a value | ||
| 190 | ;; into an expression which produces that value. | ||
| 191 | (quoter (lambda (sexp) | ||
| 192 | (if (or (memq sexp '(t nil)) | ||
| 193 | (and (symbolp sexp) | ||
| 194 | (eq (aref (symbol-name sexp) 0) ?:)) | ||
| 195 | (and (listp sexp) | ||
| 196 | (memq (car sexp) '(lambda))) | ||
| 197 | (stringp sexp) | ||
| 198 | (numberp sexp) | ||
| 199 | (and (fboundp 'characterp) | ||
| 200 | (characterp sexp))) | ||
| 201 | sexp | ||
| 202 | (list 'quote sexp))))) | ||
| 199 | (while all | 203 | (while all |
| 200 | (setq this (car all) | 204 | (setq this (car all) |
| 201 | all (cdr all) | 205 | all (cdr all) |
| @@ -204,13 +208,24 @@ | |||
| 204 | type (nth 2 this)) | 208 | type (nth 2 this)) |
| 205 | (if (not (boundp symbol)) | 209 | (if (not (boundp symbol)) |
| 206 | ;; If variables are removed from C code, give an error here! | 210 | ;; If variables are removed from C code, give an error here! |
| 207 | (message "Intrinsic `%S' not bound" symbol) | 211 | (message "Built-in variable `%S' not bound" symbol) |
| 208 | ;; This is called before any user can have changed the value. | 212 | ;; Save the standard value, unless we already did. |
| 209 | (put symbol 'factory-value | 213 | (or (get symbol 'standard-value) |
| 210 | (list (custom-start-quote (default-value symbol)))) | 214 | (put symbol 'standard-value |
| 211 | ;; Add it to the right group. | 215 | (list (funcall quoter (default-value symbol))))) |
| 212 | (custom-add-to-group group symbol 'custom-variable) | 216 | ;; If this is NOT while dumping Emacs, |
| 213 | ;; Set the type. | 217 | ;; set up the rest of the customization info. |
| 214 | (put symbol 'custom-type type)))) | 218 | (unless purify-flag |
| 219 | ;; Add it to the right group. | ||
| 220 | (custom-add-to-group group symbol 'custom-variable) | ||
| 221 | ;; Set the type. | ||
| 222 | (put symbol 'custom-type type))))) | ||
| 223 | |||
| 224 | ;; Record cus-start as loaded | ||
| 225 | ;; if we have set up all the info that we can set up. | ||
| 226 | ;; Don't record cus-start as loaded | ||
| 227 | ;; if we have set up only the standard values. | ||
| 228 | (unless purify-flag | ||
| 229 | (provide 'cus-start)) | ||
| 215 | 230 | ||
| 216 | ;;; cus-start.el ends here. | 231 | ;;; cus-start.el ends here. |