345 |
(setq args (cdr (cdr args)))))))) |
(setq args (cdr (cdr args)))))))) |
346 |
|
|
347 |
;;;###autoload |
;;;###autoload |
|
(defun custom-theme-face-value (face theme) |
|
|
"Return spec of FACE in THEME if THEME modifies FACE. |
|
|
Value is nil otherwise. The association between theme and spec for FACE |
|
|
is stored in FACE's property `theme-face'. The appropriate face |
|
|
is retrieved using `custom-theme-value'." |
|
|
;; Returns car because the value is stored inside a one element list |
|
|
(car-safe (custom-theme-value theme (get face 'theme-face)))) |
|
|
|
|
|
(defun custom-theme-reset-internal-face (face to-theme) |
|
|
"Reset FACE to the value defined by TO-THEME. |
|
|
If FACE is not defined in TO-THEME, reset FACE to the standard |
|
|
value. See `custom-theme-face-value'. The standard value is |
|
|
stored in SYMBOL's property `face-defface-spec' by `defface'." |
|
|
(let ((spec (custom-theme-face-value face to-theme)) |
|
|
was-in-theme) |
|
|
(setq was-in-theme spec) |
|
|
(setq spec (or spec (get face 'face-defface-spec))) |
|
|
(when spec |
|
|
(put face 'save-face was-in-theme) |
|
|
(when (or (get face 'force-face) (facep face)) |
|
|
(unless (facep face) |
|
|
(make-empty-face face)) |
|
|
(face-spec-set face spec))) |
|
|
spec)) |
|
|
|
|
|
;;;###autoload |
|
348 |
(defun custom-theme-reset-faces (theme &rest args) |
(defun custom-theme-reset-faces (theme &rest args) |
349 |
"Reset the value of the face to values previously defined. |
"Reset the specs in THEME of some faces to their specs in other themes. |
350 |
Associate this setting with THEME. |
Each of the arguments ARGS has this form: |
|
|
|
|
ARGS is a list of lists of the form |
|
351 |
|
|
352 |
(FACE TO-THEME) |
(FACE FROM-THEME) |
353 |
|
|
354 |
This means reset FACE to its value in TO-THEME." |
This means reset FACE to its value in FROM-THEME." |
355 |
(custom-check-theme theme) |
(custom-check-theme theme) |
356 |
(mapcar '(lambda (arg) |
(dolist (arg args) |
357 |
(apply 'custom-theme-reset-internal-face arg) |
(custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg)))) |
|
(custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg))) |
|
|
args)) |
|
358 |
|
|
359 |
;;;###autoload |
;;;###autoload |
360 |
(defun custom-reset-faces (&rest args) |
(defun custom-reset-faces (&rest args) |
361 |
"Reset the value of the face to values previously saved. |
"Reset the specs of some faces to their specs in specified themes. |
362 |
This is the setting assosiated the `user' theme. |
This creates settings in the `user' theme. |
363 |
|
|
364 |
|
Each of the arguments ARGS has this form: |
365 |
|
|
366 |
|
(FACE FROM-THEME) |
367 |
|
|
368 |
ARGS is defined as for `custom-theme-reset-faces'" |
This means reset FACE to its value in FROM-THEME." |
369 |
(apply 'custom-theme-reset-faces 'user args)) |
(apply 'custom-theme-reset-faces 'user args)) |
370 |
|
|
371 |
;;; The End. |
;;; The End. |