On Sat, 06 Aug 2005 21:12:16 +0300, Juri Linkov <[EMAIL PROTECTED]> wrote:
>
> I think it's better to use exactly the same format as used in the
> function `compilation-handle-exit', i.e. `mode-name' instead of
> `(capitalize name-of-mode)', and `(substring (current-time-string) 0 19)'
> instead of `format-time-string'.

I agree, see my corrected patch below.
>
> Also I see there is a difference in highlighting grep and compilation
> exit messages.  In the grep output the mode name `Grep' is
> not highlighted, but the exit code is highlighted (highlighting
> is underlined below).
>
> Grep exited abnormally with code 2 at Tue Jul 19 15:42:32
>      =================           =
>
> In the compilation output the mode name is highlighted,
> but the exit code is not:
>
> Compilation exited abnormally with code 1 at Wed Jul 20 12:21:12
> =============================
>
> Shouldn't they be more uniform?

I agree that the `with code nnn' should be highlighted too, but it
does not have to be exactly like grep, since grep uses different
highlighting all the way (including the matches found).

Bellow is my suggested patch.

Ehud.

2005-08-13  Ehud Karni  <[EMAIL PROTECTED]>

        * progmodes/compile.el (compilation-mode-font-lock-keywords):
        improve the highlighting of abnormal exit/kill.
        (compilation-start): change the format of "Compilation started"
        line.


diff -c lisp/progmodes/compile.el.\~1.371.\~ lisp/progmodes/compile.el
*** lisp/progmodes/compile.el.~1.371.~  Fri Aug 12 13:17:17 2005
--- lisp/progmodes/compile.el           Sat Aug 13 21:36:19 2005
***************
*** 383,389 ****
        (1 font-lock-function-name-face) (3 compilation-line-face nil t))
       (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
       ("^Compilation \\(finish\\|start\\)ed" . compilation-info-face)
!      ("^Compilation exited abnormally" . compilation-error-face))
     "Additional things to highlight in Compilation mode.
  This gets tacked on the end of the generated expressions.")

--- 383,391 ----
        (1 font-lock-function-name-face) (3 compilation-line-face nil t))
       (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
       ("^Compilation \\(finish\\|start\\)ed" . compilation-info-face)
!      ("\\(^Compilation\\( exited abnormally\\)?\\) \\(killed\\|with code 
[1-9][0-9]*\\).*"
!       (1 compilation-info-face)
!       (3 compilation-error-face)))
     "Additional things to highlight in Compilation mode.
  This gets tacked on the end of the generated expressions.")

***************
*** 971,980 ****
        (insert "-*- mode: " name-of-mode
                "; default-directory: " (prin1-to-string default-directory)
                " -*-\n"
!               (format "%s started at %s\n"
!                       (capitalize name-of-mode)
!                       (format-time-string "%a %b %d %H:%M:%S"))
!               command "\n")
        (setq thisdir default-directory))
        (set-buffer-modified-p nil))
      ;; If we're already in the compilation buffer, go to the end
--- 973,981 ----
        (insert "-*- mode: " name-of-mode
                "; default-directory: " (prin1-to-string default-directory)
                " -*-\n"
!               (format "%s started at %s\n" mode-name
!                         (substring (current-time-string) 0 19))
!                 command "\n")
        (setq thisdir default-directory))
        (set-buffer-modified-p nil))
      ;; If we're already in the compilation buffer, go to the end



--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to