diff options
| author | Miles Bader | 2000-11-28 06:41:19 +0000 |
|---|---|---|
| committer | Miles Bader | 2000-11-28 06:41:19 +0000 |
| commit | 36b80a0dd40879ab14221baeaec8100ffcbba59e (patch) | |
| tree | ede71571b773679b980e82431a1c3847b51abef6 | |
| parent | d970106bfbcee014036ba019a58a9ab8b7c3ddd7 (diff) | |
| download | emacs-36b80a0dd40879ab14221baeaec8100ffcbba59e.tar.gz emacs-36b80a0dd40879ab14221baeaec8100ffcbba59e.zip | |
(custom-face-attributes): Add post-filter function for :box.
Make pre-filter function for :box handle all cases.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/cus-face.el | 36 |
2 files changed, 32 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc633c88ab9..50c1b52c872 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2000-11-28 Miles Bader <miles@gnu.org> | 1 | 2000-11-28 Miles Bader <miles@gnu.org> |
| 2 | 2 | ||
| 3 | * cus-face.el (custom-face-attributes): Add post-filter function | ||
| 4 | for :box. Make pre-filter function for :box handle all cases. | ||
| 5 | |||
| 3 | * wid-edit.el (widget-choose): Make sure pop-up window is large | 6 | * wid-edit.el (widget-choose): Make sure pop-up window is large |
| 4 | enough to display all the choices, as there's no way to scroll it. | 7 | enough to display all the choices, as there's no way to scroll it. |
| 5 | 8 | ||
diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 7c4930ff990..dd6692bc9e8 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el | |||
| @@ -161,8 +161,7 @@ | |||
| 161 | (const :tag "*" nil) | 161 | (const :tag "*" nil) |
| 162 | (const :tag "Off" off) | 162 | (const :tag "Off" off) |
| 163 | (list :tag "Box" | 163 | (list :tag "Box" |
| 164 | :value (:line-width 2 :color "grey75" | 164 | :value (:line-width 2 :color "grey75" :style released-button) |
| 165 | :style released-button) | ||
| 166 | (const :format "" :value :line-width) | 165 | (const :format "" :value :line-width) |
| 167 | (integer :tag "Width") | 166 | (integer :tag "Width") |
| 168 | (const :format "" :value :color) | 167 | (const :format "" :value :color) |
| @@ -174,11 +173,34 @@ | |||
| 174 | (const :tag "None" nil)))) | 173 | (const :tag "None" nil)))) |
| 175 | ;; filter to make value suitable for customize | 174 | ;; filter to make value suitable for customize |
| 176 | (lambda (real-value) | 175 | (lambda (real-value) |
| 177 | (if (consp real-value) | 176 | (let ((lwidth |
| 178 | (list :line-width (or (plist-get real-value :line-width) 1) | 177 | (or (and (consp real-value) (plist-get real-value :line-width)) |
| 179 | :color (plist-get real-value :color) | 178 | (and (integerp real-value) real-value) |
| 180 | :style (plist-get real-value :style)) | 179 | 1)) |
| 181 | real-value))) | 180 | (color |
| 181 | (or (and (consp real-value) (plist-get real-value :color)) | ||
| 182 | (and (stringp real-value) real-value) | ||
| 183 | nil)) | ||
| 184 | (style | ||
| 185 | (and (consp real-value) (plist-get real-value :line-width)))) | ||
| 186 | (list :line-width lwidth :color color :style style))) | ||
| 187 | ;; filter to make customized-value suitable for storing | ||
| 188 | (lambda (cus-value) | ||
| 189 | (if (consp cus-value) | ||
| 190 | (let ((lwidth (plist-get cus-value :line-width)) | ||
| 191 | (color (plist-get cus-value :color)) | ||
| 192 | (style (plist-get cus-value :style))) | ||
| 193 | (cond ((and (null color) (null style)) | ||
| 194 | lwidth) | ||
| 195 | ((and (null lwidth) (null style)) | ||
| 196 | ;; actually can't happen, because LWIDTH is always an int | ||
| 197 | color) | ||
| 198 | (t | ||
| 199 | ;; Keep as a plist, but remove null entries | ||
| 200 | (nconc (and lwidth `(:line-width ,lwidth)) | ||
| 201 | (and color `(:color ,color)) | ||
| 202 | (and style `(:style ,style)))))) | ||
| 203 | cus-value))) | ||
| 182 | 204 | ||
| 183 | (:inverse-video | 205 | (:inverse-video |
| 184 | (choice :tag "Inverse-video" | 206 | (choice :tag "Inverse-video" |