32 |
;;; Todo: |
;;; Todo: |
33 |
|
|
34 |
;; Should parse "#if" and "#elif" expressions and merge the faces |
;; Should parse "#if" and "#elif" expressions and merge the faces |
35 |
;; somehow. |
;; somehow. |
36 |
|
|
37 |
;; Somehow it is sometimes possible to make changes near a read only |
;; Somehow it is sometimes possible to make changes near a read only |
38 |
;; area which you can't undo. Their are other strange effects in that |
;; area which you can't undo. Their are other strange effects in that |
67 |
:type 'face |
:type 'face |
68 |
:group 'cpp) |
:group 'cpp) |
69 |
|
|
70 |
(defcustom cpp-face-type 'light |
(defcustom cpp-face-type 'light |
71 |
"*Indicate what background face type you prefer. |
"*Indicate what background face type you prefer. |
72 |
Can be either light or dark for color screens, mono for monochrome |
Can be either light or dark for color screens, mono for monochrome |
73 |
screens, and none if you don't use a window system and don't have |
screens, and none if you don't use a window system and don't have |
368 |
(cond ((eq cpp-unknown-face 'invisible) |
(cond ((eq cpp-unknown-face 'invisible) |
369 |
(cpp-make-overlay-hidden overlay)) |
(cpp-make-overlay-hidden overlay)) |
370 |
((eq cpp-unknown-face 'default)) |
((eq cpp-unknown-face 'default)) |
371 |
(t |
(t |
372 |
(overlay-put overlay 'face cpp-unknown-face))) |
(overlay-put overlay 'face cpp-unknown-face))) |
373 |
(if cpp-unknown-writable |
(if cpp-unknown-writable |
374 |
() |
() |
461 |
|
|
462 |
(defun cpp-edit-mode () |
(defun cpp-edit-mode () |
463 |
"Major mode for editing the criteria for highlighting cpp conditionals. |
"Major mode for editing the criteria for highlighting cpp conditionals. |
464 |
Click on objects to change them. |
Click on objects to change them. |
465 |
You can also use the keyboard accelerators indicated like this: [K]ey." |
You can also use the keyboard accelerators indicated like this: [K]ey." |
466 |
(kill-all-local-variables) |
(kill-all-local-variables) |
467 |
(buffer-disable-undo) |
(buffer-disable-undo) |
535 |
(eq write 'both)) |
(eq write 'both)) |
536 |
(setq cpp-edit-list (delq entry cpp-edit-list) |
(setq cpp-edit-list (delq entry cpp-edit-list) |
537 |
entry nil)) |
entry nil)) |
538 |
|
|
539 |
(if (> (length symbol) 39) |
(if (> (length symbol) 39) |
540 |
(insert (substring symbol 0 39) ": ") |
(insert (substring symbol 0 39) ": ") |
541 |
(insert (format "%39s: " symbol))) |
(insert (format "%39s: " symbol))) |
649 |
(interactive |
(interactive |
650 |
(let ((symbol (cpp-choose-symbol))) |
(let ((symbol (cpp-choose-symbol))) |
651 |
(list symbol |
(list symbol |
652 |
(cpp-choose-face "False face" |
(cpp-choose-face "False face" |
653 |
(nth 2 (assoc symbol cpp-edit-list)))))) |
(nth 2 (assoc symbol cpp-edit-list)))))) |
654 |
(setcar (nthcdr 2 (cpp-edit-list-entry-get-or-create symbol)) face) |
(setcar (nthcdr 2 (cpp-edit-list-entry-get-or-create symbol)) face) |
655 |
(cpp-edit-reset)) |
(cpp-edit-reset)) |