diff options
| -rw-r--r-- | lisp/progmodes/compile.el | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index fa9eac2e021..b7b14c238b3 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -377,13 +377,13 @@ you may also want to change `compilation-page-delimiter'.") | |||
| 377 | '(;; configure output lines. | 377 | '(;; configure output lines. |
| 378 | ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" | 378 | ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" |
| 379 | (1 font-lock-variable-name-face) | 379 | (1 font-lock-variable-name-face) |
| 380 | (2 font-lock-keyword-face)) | 380 | (2 (compilation-text-face '(4 . 3)))) |
| 381 | ;; Command output lines. Recognize `make[n]:' lines too. | 381 | ;; Command output lines. Recognize `make[n]:' lines too. |
| 382 | ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" | 382 | ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" |
| 383 | (1 font-lock-function-name-face) (3 compilation-line-face nil t)) | 383 | (1 font-lock-function-name-face) (3 compilation-line-face nil t)) |
| 384 | (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) | 384 | (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) |
| 385 | ("^Compilation finished" . font-lock-keyword-face) | 385 | ("^Compilation finished" . compilation-info-text-face) |
| 386 | ("^Compilation exited abnormally" . font-lock-keyword-face)) | 386 | ("^Compilation exited abnormally" . compilation-error-text-face)) |
| 387 | "Additional things to highlight in Compilation mode. | 387 | "Additional things to highlight in Compilation mode. |
| 388 | This gets tacked on the end of the generated expressions.") | 388 | This gets tacked on the end of the generated expressions.") |
| 389 | 389 | ||
| @@ -468,6 +468,12 @@ starting the compilation process.") | |||
| 468 | ;; History of compile commands. | 468 | ;; History of compile commands. |
| 469 | (defvar compile-history nil) | 469 | (defvar compile-history nil) |
| 470 | 470 | ||
| 471 | (defface compilation-error | ||
| 472 | '((t :inherit font-lock-warning-face)) | ||
| 473 | "Face used to highlight compiler errors." | ||
| 474 | :group 'font-lock-highlighting-faces | ||
| 475 | :version "22.1") | ||
| 476 | |||
| 471 | (defface compilation-warning | 477 | (defface compilation-warning |
| 472 | '((((class color) (min-colors 16)) (:foreground "Orange" :weight bold)) | 478 | '((((class color) (min-colors 16)) (:foreground "Orange" :weight bold)) |
| 473 | (((class color)) (:foreground "cyan" :weight bold)) | 479 | (((class color)) (:foreground "cyan" :weight bold)) |
| @@ -487,44 +493,44 @@ starting the compilation process.") | |||
| 487 | (:foreground "Green" :weight bold)) | 493 | (:foreground "Green" :weight bold)) |
| 488 | (((class color)) (:foreground "green" :weight bold)) | 494 | (((class color)) (:foreground "green" :weight bold)) |
| 489 | (t (:weight bold))) | 495 | (t (:weight bold))) |
| 490 | "Face used to highlight compiler warnings." | 496 | "Face used to highlight compiler information." |
| 491 | :group 'font-lock-highlighting-faces | 497 | :group 'font-lock-highlighting-faces |
| 492 | :version "22.1") | 498 | :version "22.1") |
| 493 | ;; backward-compatibility alias | 499 | ;; backward-compatibility alias |
| 494 | (put 'compilation-info-face 'face-alias 'compilation-info) | 500 | (put 'compilation-info-face 'face-alias 'compilation-info) |
| 495 | 501 | ||
| 496 | (defface compilation-error-file-name | 502 | (defface compilation-error-file-name |
| 497 | '((default :inherit font-lock-warning-face) | 503 | '((default :inherit compilation-error) |
| 498 | (((supports :underline t)) :underline t)) | 504 | (((supports :underline t)) :underline t)) |
| 499 | "Face for displaying file names in compilation errors." | 505 | "Face for displaying file names in error messages." |
| 500 | :group 'font-lock-highlighting-faces | 506 | :group 'font-lock-highlighting-faces |
| 501 | :version "22.1") | 507 | :version "22.1") |
| 502 | 508 | ||
| 503 | (defface compilation-warning-file-name | 509 | (defface compilation-warning-file-name |
| 504 | '((default :inherit font-lock-warning-face) | 510 | '((default :inherit compilation-warning) |
| 505 | (((supports :underline t)) :underline t)) | 511 | (((supports :underline t)) :underline t)) |
| 506 | "Face for displaying file names in compilation errors." | 512 | "Face for displaying file names in warning messages." |
| 507 | :group 'font-lock-highlighting-faces | 513 | :group 'font-lock-highlighting-faces |
| 508 | :version "22.1") | 514 | :version "22.1") |
| 509 | 515 | ||
| 510 | (defface compilation-info-file-name | 516 | (defface compilation-info-file-name |
| 511 | '((default :inherit compilation-info) | 517 | '((default :inherit compilation-info) |
| 512 | (((supports :underline t)) :underline t)) | 518 | (((supports :underline t)) :underline t)) |
| 513 | "Face for displaying file names in compilation errors." | 519 | "Face for displaying file names in informational messages." |
| 514 | :group 'font-lock-highlighting-faces | 520 | :group 'font-lock-highlighting-faces |
| 515 | :version "22.1") | 521 | :version "22.1") |
| 516 | 522 | ||
| 517 | (defface compilation-line-number | 523 | (defface compilation-line-number |
| 518 | '((default :inherit font-lock-variable-name-face) | 524 | '((default :inherit font-lock-variable-name-face) |
| 519 | (((supports :underline t)) :underline t)) | 525 | (((supports :underline t)) :underline t)) |
| 520 | "Face for displaying file names in compilation errors." | 526 | "Face for displaying line numbers in compiler messages." |
| 521 | :group 'font-lock-highlighting-faces | 527 | :group 'font-lock-highlighting-faces |
| 522 | :version "22.1") | 528 | :version "22.1") |
| 523 | 529 | ||
| 524 | (defface compilation-column-number | 530 | (defface compilation-column-number |
| 525 | '((default :inherit font-lock-type-face) | 531 | '((default :inherit font-lock-type-face) |
| 526 | (((supports :underline t)) :underline t)) | 532 | (((supports :underline t)) :underline t)) |
| 527 | "Face for displaying file names in compilation errors." | 533 | "Face for displaying column numbers in compiler messages." |
| 528 | :group 'font-lock-highlighting-faces | 534 | :group 'font-lock-highlighting-faces |
| 529 | :version "22.1") | 535 | :version "22.1") |
| 530 | 536 | ||
| @@ -537,24 +543,33 @@ Faces `compilation-error-face', `compilation-warning-face', | |||
| 537 | (defvar compilation-error-face 'compilation-error-file-name | 543 | (defvar compilation-error-face 'compilation-error-file-name |
| 538 | "Face name to use for file name in error messages.") | 544 | "Face name to use for file name in error messages.") |
| 539 | 545 | ||
| 546 | (defvar compilation-error-text-face 'compilation-error | ||
| 547 | "Face name to use for text of error messages.") | ||
| 548 | |||
| 540 | (defvar compilation-warning-face 'compilation-warning-file-name | 549 | (defvar compilation-warning-face 'compilation-warning-file-name |
| 541 | "Face name to use for file name in warning messages.") | 550 | "Face name to use for file name in warning messages.") |
| 542 | 551 | ||
| 552 | (defvar compilation-warning-text-face 'compilation-warning | ||
| 553 | "Face name to use for text of warning messages.") | ||
| 554 | |||
| 543 | (defvar compilation-info-face 'compilation-info-file-name | 555 | (defvar compilation-info-face 'compilation-info-file-name |
| 544 | "Face name to use for file name in informational messages.") | 556 | "Face name to use for file name in informational messages.") |
| 545 | 557 | ||
| 558 | (defvar compilation-info-text-face 'compilation-info | ||
| 559 | "Face name to use for text of informational messages.") | ||
| 560 | |||
| 546 | (defvar compilation-line-face 'compilation-line-number | 561 | (defvar compilation-line-face 'compilation-line-number |
| 547 | "Face name to use for line number in message.") | 562 | "Face name to use for line numbers in compiler message.") |
| 548 | 563 | ||
| 549 | (defvar compilation-column-face 'compilation-column-number | 564 | (defvar compilation-column-face 'compilation-column-number |
| 550 | "Face name to use for column number in message.") | 565 | "Face name to use for column numbers in compiler messages.") |
| 551 | 566 | ||
| 552 | ;; same faces as dired uses | 567 | ;; same faces as dired uses |
| 553 | (defvar compilation-enter-directory-face 'font-lock-function-name-face | 568 | (defvar compilation-enter-directory-face 'font-lock-function-name-face |
| 554 | "Face name to use for column number in message.") | 569 | "Face name to use for entering directory messages.") |
| 555 | 570 | ||
| 556 | (defvar compilation-leave-directory-face 'font-lock-type-face | 571 | (defvar compilation-leave-directory-face 'font-lock-type-face |
| 557 | "Face name to use for column number in message.") | 572 | "Face name to use for leaving directory messages.") |
| 558 | 573 | ||
| 559 | 574 | ||
| 560 | 575 | ||
| @@ -570,6 +585,11 @@ Faces `compilation-error-face', `compilation-warning-face', | |||
| 570 | (and (cdr type) (match-end (cdr type)) compilation-info-face) | 585 | (and (cdr type) (match-end (cdr type)) compilation-info-face) |
| 571 | compilation-error-face)) | 586 | compilation-error-face)) |
| 572 | 587 | ||
| 588 | (defun compilation-text-face (type) | ||
| 589 | (or (and (car type) (match-end (car type)) compilation-warning-text-face) | ||
| 590 | (and (cdr type) (match-end (cdr type)) compilation-info-text-face) | ||
| 591 | compilation-error-text-face)) | ||
| 592 | |||
| 573 | ;; Internal function for calculating the text properties of a directory | 593 | ;; Internal function for calculating the text properties of a directory |
| 574 | ;; change message. The directory property is important, because it is | 594 | ;; change message. The directory property is important, because it is |
| 575 | ;; the stack of nested enter-messages. Relative filenames on the following | 595 | ;; the stack of nested enter-messages. Relative filenames on the following |