Mercurial > emacs
comparison lisp/cus-face.el @ 83353:532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied:
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0
tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1
Add CVS metadata files.
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2
Update from CVS.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sun, 04 Sep 2005 03:48:17 +0000 |
parents | 6c13700d1c13 41bb365f41c4 |
children | 732c5740ca8f |
comparison
equal
deleted
inserted
replaced
83352:b258b3492423 | 83353:532e0a9335a9 |
---|---|
1 ;;; cus-face.el --- customization support for faces | 1 ;;; cus-face.el --- customization support for faces |
2 ;; | 2 ;; |
3 ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, |
4 ;; 2005 Free Software Foundation, Inc. | |
4 ;; | 5 ;; |
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | 6 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> |
6 ;; Keywords: help, faces | 7 ;; Keywords: help, faces |
7 | 8 |
8 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
346 (put face 'saved-face spec) | 347 (put face 'saved-face spec) |
347 (custom-push-theme 'theme-face face theme 'set spec)) | 348 (custom-push-theme 'theme-face face theme 'set spec)) |
348 (setq args (cdr (cdr args)))))))) | 349 (setq args (cdr (cdr args)))))))) |
349 | 350 |
350 ;;;###autoload | 351 ;;;###autoload |
351 (defun custom-theme-face-value (face theme) | |
352 "Return spec of FACE in THEME if THEME modifies FACE. | |
353 Value is nil otherwise. The association between theme and spec for FACE | |
354 is stored in FACE's property `theme-face'. The appropriate face | |
355 is retrieved using `custom-theme-value'." | |
356 ;; Returns car because the value is stored inside a one element list | |
357 (car-safe (custom-theme-value theme (get face 'theme-face)))) | |
358 | |
359 (defun custom-theme-reset-internal-face (face to-theme) | |
360 "Reset FACE to the value defined by TO-THEME. | |
361 If FACE is not defined in TO-THEME, reset FACE to the standard | |
362 value. See `custom-theme-face-value'. The standard value is | |
363 stored in SYMBOL's property `face-defface-spec' by `defface'." | |
364 (let ((spec (custom-theme-face-value face to-theme)) | |
365 was-in-theme) | |
366 (setq was-in-theme spec) | |
367 (setq spec (or spec (get face 'face-defface-spec))) | |
368 (when spec | |
369 (put face 'save-face was-in-theme) | |
370 (when (or (get face 'force-face) (facep face)) | |
371 (unless (facep face) | |
372 (make-empty-face face)) | |
373 (face-spec-set face spec))) | |
374 spec)) | |
375 | |
376 ;;;###autoload | |
377 (defun custom-theme-reset-faces (theme &rest args) | 352 (defun custom-theme-reset-faces (theme &rest args) |
378 "Reset the value of the face to values previously defined. | 353 "Reset the specs in THEME of some faces to their specs in other themes. |
379 Associate this setting with THEME. | 354 Each of the arguments ARGS has this form: |
380 | 355 |
381 ARGS is a list of lists of the form | 356 (FACE FROM-THEME) |
382 | 357 |
383 (FACE TO-THEME) | 358 This means reset FACE to its value in FROM-THEME." |
384 | |
385 This means reset FACE to its value in TO-THEME." | |
386 (custom-check-theme theme) | 359 (custom-check-theme theme) |
387 (mapcar '(lambda (arg) | 360 (dolist (arg args) |
388 (apply 'custom-theme-reset-internal-face arg) | 361 (custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg)))) |
389 (custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg))) | |
390 args)) | |
391 | 362 |
392 ;;;###autoload | 363 ;;;###autoload |
393 (defun custom-reset-faces (&rest args) | 364 (defun custom-reset-faces (&rest args) |
394 "Reset the value of the face to values previously saved. | 365 "Reset the specs of some faces to their specs in specified themes. |
395 This is the setting assosiated the `user' theme. | 366 This creates settings in the `user' theme. |
396 | 367 |
397 ARGS is defined as for `custom-theme-reset-faces'" | 368 Each of the arguments ARGS has this form: |
369 | |
370 (FACE FROM-THEME) | |
371 | |
372 This means reset FACE to its value in FROM-THEME." | |
398 (apply 'custom-theme-reset-faces 'user args)) | 373 (apply 'custom-theme-reset-faces 'user args)) |
399 | 374 |
400 ;;; The End. | 375 ;;; The End. |
401 | 376 |
402 (provide 'cus-face) | 377 (provide 'cus-face) |