|
From: | Jay Belanger |
Subject: | Re: [Axiom-developer] Re: axiom-mode |
Date: | Tue, 22 May 2007 20:23:11 -0500 |
User-agent: | Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
Martin Rubey <address@hidden> writes: ... > Below is what I have so far. One thing I'm stuck with: how can I allow the > user to change the face, or at least the color? > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > (defface axiom-output-paint '((t (:background "lightblue"))) > "Face to use for painting." > :group 'axiom) Perhaps you could make axiom-output-paint a variable; something like: (defface axiom-output-blue '((t (:background "blue"))) "Blue face to use for painting." :group 'axiom) (defface axiom-output-lightblue '((t (:background "lightblue"))) "Light blue face to use for painting." :group 'axiom) (defface axiom-output-red '((t (:background "red"))) "Red face to use for painting." :group 'axiom) etc. (which are automatically customizable) (defvar axiom-output-face-alist '(("blue" . axiom-output-blue) ("lightblue" . axiom-output-lightblue) ("red" . axiom-output-red) ...)) (defvar axiom-output-paint 'axiom-output-lightblue) (defun axiom-output-change-paint () (interactive) (let ((newpaint (completing-read "New paint: " axiom-output-face-alist nil t))) (setq axiom-output-paint (cdr (assoc newpaint axiom-output-face-alist))))) and then the end of > (defun make-space-if-necessary-and-paint () could be > (overlay-put over 'face > (get axiom-output-paint 'face-defface-spec)))) Jay
[Prev in Thread] | Current Thread | [Next in Thread] |