unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Suggestion: small improvment for compilation
@ 2005-08-06 12:32 Ehud Karni
  0 siblings, 0 replies; 5+ messages in thread
From: Ehud Karni @ 2005-08-06 12:32 UTC (permalink / raw)


Below is small patch to compile.el. This patch add the line:
    Compilation started at Mon Aug 01 17:09:03
and highlight it in the same way as "Compilation finished".

I add this because I have some very long complitions (e.g. build
Emacs on Cygwin) and this helps me keep track of it.

Note. I don't have CVS write permission, so if some of the developers
find this worth adding, please install it.

Ehud.


2005-08-06  Ehud Karni  <ehud@unix.mvs.co.il>

	* progmodes/compile.el (compilation-start): add the line
	"Compilation started" with the time.
        (compilation-mode-font-lock-keywords): add `stared' to keywords.


diff -c /appl/src/emacs/lisp/progmodes/compile-ek.el /appl/src/emacs/lisp/progmodes/compile.el.\~1.368.\~
*** /appl/src/emacs/lisp/progmodes/compile-new.el	Fri Aug  5 13:28:34 2005
--- /appl/src/emacs/lisp/progmodes/compile.el.~1.368.~	Thu Aug  4 04:36:10 2005
***************
*** 382,388 ****
       ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
        (1 font-lock-function-name-face) (3 compilation-line-face nil t))
       (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
!      ("^Compilation \\(finish\\|start\\)ed" . font-lock-keyword-face)
       ("^Compilation exited abnormally" . font-lock-keyword-face))
     "Additional things to highlight in Compilation mode.
  This gets tacked on the end of the generated expressions.")
--- 382,388 ----
       ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
        (1 font-lock-function-name-face) (3 compilation-line-face nil t))
       (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
!      ("^Compilation finished" . font-lock-keyword-face)
       ("^Compilation exited abnormally" . font-lock-keyword-face))
     "Additional things to highlight in Compilation mode.
  This gets tacked on the end of the generated expressions.")
***************
*** 987,997 ****
  	;; Output a mode setter, for saving and later reloading this buffer.
  	(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
--- 987,993 ----
  	;; Output a mode setter, for saving and later reloading this buffer.
  	(insert "-*- mode: " name-of-mode
  		"; default-directory: " (prin1-to-string default-directory)
! 		" -*-\n" command "\n")
  	(setq thisdir default-directory))
        (set-buffer-modified-p nil))
      ;; If we're already in the compilation buffer, go to the end

Diff finished.  Sat Aug  6 15:08:04 2005



--
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Suggestion: small improvment for compilation
@ 2005-08-06 14:03 Ehud Karni
  2005-08-06 18:12 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Ehud Karni @ 2005-08-06 14:03 UTC (permalink / raw)


[this is resend because the attached patch had the files reversed]

Below is small patch to compile.el. This patch add the line:
    Compilation started at Mon Aug 01 17:09:03
and highlight it in the same way as "Compilation finished".

I add this because I have some very long compilations (e.g. build
Emacs on Cygwin) and this helps me keep track of it.

Note. I don't have CVS write permission, so if some of the developers
find this worth adding, please install it.

Ehud.


2005-08-06  Ehud Karni  <ehud@unix.mvs.co.il>

	* progmodes/compile.el (compilation-start): add the line
	"Compilation started" with the time.
        (compilation-mode-font-lock-keywords): add `stared' to keywords.


diff -c progmodes/compile.el.~1.368.~ progmodes/compile-ek.el
*** progmodes/compile.el.~1.368.~	Thu Aug  4 04:36:10 2005
--- progmodes/compile-new.el		Fri Aug  5 13:28:34 2005
***************
*** 382,388 ****
       ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
        (1 font-lock-function-name-face) (3 compilation-line-face nil t))
       (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
!      ("^Compilation finished" . font-lock-keyword-face)
       ("^Compilation exited abnormally" . font-lock-keyword-face))
     "Additional things to highlight in Compilation mode.
  This gets tacked on the end of the generated expressions.")
--- 382,388 ----
       ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
        (1 font-lock-function-name-face) (3 compilation-line-face nil t))
       (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
!      ("^Compilation \\(finish\\|start\\)ed" . font-lock-keyword-face)
       ("^Compilation exited abnormally" . font-lock-keyword-face))
     "Additional things to highlight in Compilation mode.
  This gets tacked on the end of the generated expressions.")
***************
*** 987,993 ****
  	;; Output a mode setter, for saving and later reloading this buffer.
  	(insert "-*- mode: " name-of-mode
  		"; default-directory: " (prin1-to-string default-directory)
! 		" -*-\n" command "\n")
  	(setq thisdir default-directory))
        (set-buffer-modified-p nil))
      ;; If we're already in the compilation buffer, go to the end
--- 987,997 ----
  	;; Output a mode setter, for saving and later reloading this buffer.
  	(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




--
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion: small improvment for compilation
  2005-08-06 14:03 Suggestion: small improvment for compilation Ehud Karni
@ 2005-08-06 18:12 ` Juri Linkov
  2005-08-13 19:10   ` Ehud Karni
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2005-08-06 18:12 UTC (permalink / raw)
  Cc: emacs-devel

> Below is small patch to compile.el. This patch add the line:
>     Compilation started at Mon Aug 01 17:09:03
> and highlight it in the same way as "Compilation finished".
>
> I add this because I have some very long compilations (e.g. build
> Emacs on Cygwin) and this helps me keep track of it.

Good idea.

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'.

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?

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion: small improvment for compilation
  2005-08-06 18:12 ` Juri Linkov
@ 2005-08-13 19:10   ` Ehud Karni
  2005-08-14  8:17     ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Ehud Karni @ 2005-08-13 19:10 UTC (permalink / raw)
  Cc: emacs-devel

On Sat, 06 Aug 2005 21:12:16 +0300, Juri Linkov <juri@jurta.org> 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  <ehud@unix.mvs.co.il>

	* 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Suggestion: small improvment for compilation
  2005-08-13 19:10   ` Ehud Karni
@ 2005-08-14  8:17     ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2005-08-14  8:17 UTC (permalink / raw)
  Cc: emacs-devel

>> 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.

Thanks.  Please see the recent discussion on emacs-pretest-bug.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-14  8:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-06 14:03 Suggestion: small improvment for compilation Ehud Karni
2005-08-06 18:12 ` Juri Linkov
2005-08-13 19:10   ` Ehud Karni
2005-08-14  8:17     ` Juri Linkov
  -- strict thread matches above, loose matches on Subject: below --
2005-08-06 12:32 Ehud Karni

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).