diff options
| author | Alan Mackenzie | 2008-01-16 21:26:59 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2008-01-16 21:26:59 +0000 |
| commit | 1d6c7cd7ee40709f25c6e24a2daffbfbc226efc3 (patch) | |
| tree | 94cced9ddc77cc796ba4beb104bd57769fdcf6ed | |
| parent | 9302e128c967ebb06e05bfac3fbd3525784b5631 (diff) | |
| download | emacs-1d6c7cd7ee40709f25c6e24a2daffbfbc226efc3.tar.gz emacs-1d6c7cd7ee40709f25c6e24a2daffbfbc226efc3.zip | |
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
permit byte-compiling (e.g. in bootstrap).
| -rw-r--r-- | lisp/progmodes/cc-vars.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 6ba2281f344..7596dc60b5f 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -74,22 +74,23 @@ Useful as last item in a `choice' widget." | |||
| 74 | :value 'other)) | 74 | :value 'other)) |
| 75 | 75 | ||
| 76 | ;; The next defun will supersede c-const-symbol. | 76 | ;; The next defun will supersede c-const-symbol. |
| 77 | (defun c-constant-symbol (sym len) | 77 | (eval-and-compile |
| 78 | "Create an uneditable symbol for customization buffers. | 78 | (defun c-constant-symbol (sym len) |
| 79 | "Create an uneditable symbol for customization buffers. | ||
| 79 | SYM is the name of the symbol, LEN the length of the field (in | 80 | SYM is the name of the symbol, LEN the length of the field (in |
| 80 | characters) the symbol will be displayed in. LEN must be big | 81 | characters) the symbol will be displayed in. LEN must be big |
| 81 | enough. | 82 | enough. |
| 82 | 83 | ||
| 83 | This returns a (const ....) structure, suitable for embedding | 84 | This returns a (const ....) structure, suitable for embedding |
| 84 | within a customization type." | 85 | within a customization type." |
| 85 | (or (symbolp sym) (error "c-constant-symbol: %s is not a symbol" sym)) | 86 | (or (symbolp sym) (error "c-constant-symbol: %s is not a symbol" sym)) |
| 86 | (let* ((name (symbol-name sym)) | 87 | (let* ((name (symbol-name sym)) |
| 87 | (l (length name)) | 88 | (l (length name)) |
| 88 | (disp (concat name ":" (make-string (- len l 1) ?\ )))) | 89 | (disp (concat name ":" (make-string (- len l 1) ?\ )))) |
| 89 | `(const | 90 | `(const |
| 90 | :size ,len | 91 | :size ,len |
| 91 | :format ,disp | 92 | :format ,disp |
| 92 | :value ,sym))) | 93 | :value ,sym)))) |
| 93 | 94 | ||
| 94 | (define-widget 'c-const-symbol 'item | 95 | (define-widget 'c-const-symbol 'item |
| 95 | "An uneditable lisp symbol. This is obsolete - | 96 | "An uneditable lisp symbol. This is obsolete - |