57 |
:type 'boolean |
:type 'boolean |
58 |
:group 'mpuz) |
:group 'mpuz) |
59 |
|
|
60 |
(defface mpuz-unsolved-face |
(defface mpuz-unsolved |
61 |
'((((class color)) (:foreground "red1" :bold t)) |
'((((class color)) (:foreground "red1" :bold t)) |
62 |
(t (:bold t))) |
(t (:bold t))) |
63 |
"*Face to use for letters to be solved." |
"*Face to use for letters to be solved." |
64 |
:group 'mpuz) |
:group 'mpuz) |
65 |
|
;; backward-compatibility alias |
66 |
|
(put 'mpuz-unsolved-face 'face-alias 'mpuz-unsolved) |
67 |
|
|
68 |
(defface mpuz-solved-face |
(defface mpuz-solved |
69 |
'((((class color)) (:foreground "green1" :bold t)) |
'((((class color)) (:foreground "green1" :bold t)) |
70 |
(t (:bold t))) |
(t (:bold t))) |
71 |
"*Face to use for solved digits." |
"*Face to use for solved digits." |
72 |
:group 'mpuz) |
:group 'mpuz) |
73 |
|
;; backward-compatibility alias |
74 |
|
(put 'mpuz-solved-face 'face-alias 'mpuz-solved) |
75 |
|
|
76 |
(defface mpuz-trivial-face |
(defface mpuz-trivial |
77 |
'((((class color)) (:foreground "blue" :bold t)) |
'((((class color)) (:foreground "blue" :bold t)) |
78 |
(t (:bold t))) |
(t (:bold t))) |
79 |
"*Face to use for trivial digits solved for you." |
"*Face to use for trivial digits solved for you." |
80 |
:group 'mpuz) |
:group 'mpuz) |
81 |
|
;; backward-compatibility alias |
82 |
|
(put 'mpuz-trivial-face 'face-alias 'mpuz-trivial) |
83 |
|
|
84 |
(defface mpuz-text-face |
(defface mpuz-text |
85 |
'((t (:inherit variable-pitch))) |
'((t (:inherit variable-pitch))) |
86 |
"*Face to use for text on right." |
"*Face to use for text on right." |
87 |
:group 'mpuz) |
:group 'mpuz) |
88 |
|
;; backward-compatibility alias |
89 |
|
(put 'mpuz-text-face 'face-alias 'mpuz-text) |
90 |
|
|
91 |
|
|
92 |
;; Mpuz mode and keymaps |
;; Mpuz mode and keymaps |
304 |
(defun mpuz-create-buffer () |
(defun mpuz-create-buffer () |
305 |
"Create (or recreate) the puzzle buffer. Return it." |
"Create (or recreate) the puzzle buffer. Return it." |
306 |
(let ((buf (get-buffer-create "*Mult Puzzle*")) |
(let ((buf (get-buffer-create "*Mult Puzzle*")) |
307 |
(face '(face mpuz-text-face)) |
(face '(face mpuz-text)) |
308 |
buffer-read-only) |
buffer-read-only) |
309 |
(save-excursion |
(save-excursion |
310 |
(set-buffer buf) |
(set-buffer buf) |
355 |
(+ digit ?0) |
(+ digit ?0) |
356 |
(+ (mpuz-to-letter digit) ?A))) |
(+ (mpuz-to-letter digit) ?A))) |
357 |
(face `(face |
(face `(face |
358 |
,(cond ((aref mpuz-trivial-digits digit) 'mpuz-trivial-face) |
,(cond ((aref mpuz-trivial-digits digit) 'mpuz-trivial) |
359 |
((aref mpuz-found-digits digit) 'mpuz-solved-face) |
((aref mpuz-found-digits digit) 'mpuz-solved) |
360 |
('mpuz-unsolved-face)))) |
('mpuz-unsolved)))) |
361 |
buffer-read-only) |
buffer-read-only) |
362 |
(mapc (lambda (square) |
(mapc (lambda (square) |
363 |
(goto-line (car square)) ; line before column! |
(goto-line (car square)) ; line before column! |