* use faces on the mode-line for compile.el
@ 2008-02-23 23:59 Dan Nicolaescu
2008-02-24 13:42 ` Stefan Monnier
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Dan Nicolaescu @ 2008-02-23 23:59 UTC (permalink / raw)
To: emacs-devel
I posted this 2 years ago, but that was during the pretest, so let's
look at this again.
If the mode-line for the compilation buffer would be a bit more
visible it would be easier to see if a compilation is still running
(which is handy if you have compilations that take a long time and
don't want to spend too much time checking if it's done).
Also if the compilation fails it's nice to be able to see it faster.
It can be seen with just the peripheral vision, or from farther away
from the screen.
A simple patch can accomplish the above. It uses
font-lock-warning-face which is designed to be highly visible.
IMO this is a very nice feature to have, and simple to implement...
Thoughts?
*** compile.el 04 Apr 2006 09:50:37 -0700 1.394
--- compile.el 19 Apr 2006 22:54:58 -0700
***************
*** 1060,1066 ****
(start-process-shell-command (downcase mode-name)
outbuf command))))
;; Make the buffer's mode line show process state.
! (setq mode-line-process '(":%s"))
(set-process-sentinel proc 'compilation-sentinel)
(set-process-filter proc 'compilation-filter)
(set-marker (process-mark proc) (point) outbuf)
--- 1060,1066 ----
(start-process-shell-command (downcase mode-name)
outbuf command))))
;; Make the buffer's mode line show process state.
! (setq mode-line-process (list (propertize ":%s" 'face 'font-lock-warning-face)))
(set-process-sentinel proc 'compilation-sentinel)
(set-process-filter proc 'compilation-filter)
(set-marker (process-mark proc) (point) outbuf)
***************
*** 1074,1080 ****
;; No asynchronous processes available.
(message "Executing `%s'..." command)
;; Fake modeline display as if `start-process' were run.
! (setq mode-line-process ":run")
(force-mode-line-update)
(sit-for 0) ; Force redisplay
(let* ((buffer-read-only nil) ; call-process needs to modify outbuf
--- 1074,1080 ----
;; No asynchronous processes available.
(message "Executing `%s'..." command)
;; Fake modeline display as if `start-process' were run.
! (setq mode-line-process (propertize ":run" 'face 'font-lock-warning-face))
(force-mode-line-update)
(sit-for 0) ; Force redisplay
(let* ((buffer-read-only nil) ; call-process needs to modify outbuf
***************
*** 1403,1409 ****
;; Prevent that message from being recognized as a compilation error.
(add-text-properties omax (point)
(append '(compilation-handle-exit t) nil))
! (setq mode-line-process (format ":%s [%s]" process-status (cdr status)))
;; Force mode line redisplay soon.
(force-mode-line-update)
(if (and opoint (< opoint omax))
--- 1403,1415 ----
;; Prevent that message from being recognized as a compilation error.
(add-text-properties omax (point)
(append '(compilation-handle-exit t) nil))
! (setq mode-line-process
! (concat (format ":%s " process-status)
! (format (if (> exit-status 0)
! (propertize "[%s]" 'face 'font-lock-warning-face)
! "[%s]")
! (cdr status))))
! (message (format "exit status: %s %s" exit-status (> 0 exit-status)))
;; Force mode line redisplay soon.
(force-mode-line-update)
(if (and opoint (< opoint omax))
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: use faces on the mode-line for compile.el
2008-02-23 23:59 use faces on the mode-line for compile.el Dan Nicolaescu
@ 2008-02-24 13:42 ` Stefan Monnier
2008-02-24 20:48 ` Dan Nicolaescu
2008-02-24 17:40 ` Juri Linkov
2008-02-26 2:00 ` Xavier Maillard
2 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2008-02-24 13:42 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
> If the mode-line for the compilation buffer would be a bit more
> visible it would be easier to see if a compilation is still running
> (which is handy if you have compilations that take a long time and
> don't want to spend too much time checking if it's done).
> Also if the compilation fails it's nice to be able to see it faster.
> It can be seen with just the peripheral vision, or from farther away
> from the screen.
Sounds OK,
Stefan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: use faces on the mode-line for compile.el
2008-02-24 13:42 ` Stefan Monnier
@ 2008-02-24 20:48 ` Dan Nicolaescu
0 siblings, 0 replies; 11+ messages in thread
From: Dan Nicolaescu @ 2008-02-24 20:48 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > If the mode-line for the compilation buffer would be a bit more
> > visible it would be easier to see if a compilation is still running
> > (which is handy if you have compilations that take a long time and
> > don't want to spend too much time checking if it's done).
> > Also if the compilation fails it's nice to be able to see it faster.
> > It can be seen with just the peripheral vision, or from farther away
> > from the screen.
>
> Sounds OK,
Checked in.
It's not completely right though. What's the right way to specify the
face in `compilation-start' so that it works?
More, it would be nice if the face would go on the " Compiling" string
too. Is there a generic way to specify a face for a minor-mode ?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: use faces on the mode-line for compile.el
2008-02-23 23:59 use faces on the mode-line for compile.el Dan Nicolaescu
2008-02-24 13:42 ` Stefan Monnier
@ 2008-02-24 17:40 ` Juri Linkov
2008-02-24 20:53 ` Dan Nicolaescu
2008-02-26 2:00 ` Xavier Maillard
2 siblings, 1 reply; 11+ messages in thread
From: Juri Linkov @ 2008-02-24 17:40 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
> If the mode-line for the compilation buffer would be a bit more
> visible it would be easier to see if a compilation is still running
> (which is handy if you have compilations that take a long time and
> don't want to spend too much time checking if it's done).
> Also if the compilation fails it's nice to be able to see it faster.
> It can be seen with just the peripheral vision, or from farther away
> from the screen.
I think it would be more useful if the result message displayed
in the minibuffer was the same as at the end of the compilation
buffer, i.e.
Compilation exited abnormally with code 1 at Sun Feb 24 19:36:34
The date part at the end of this message may be not necessary
when displayed in the minibuffer.
> A simple patch can accomplish the above. It uses
> font-lock-warning-face which is designed to be highly visible.
What do you think about using a special compilation face
`compilation-error' that inherits from `font-lock-warning-face'?
This face is already used to highlight the exit code at the end of the
compilation buffer.
But maybe we should add a new face?
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: use faces on the mode-line for compile.el
2008-02-24 17:40 ` Juri Linkov
@ 2008-02-24 20:53 ` Dan Nicolaescu
2008-02-24 23:23 ` Juri Linkov
0 siblings, 1 reply; 11+ messages in thread
From: Dan Nicolaescu @ 2008-02-24 20:53 UTC (permalink / raw)
To: Juri Linkov; +Cc: emacs-devel
Juri Linkov <juri@jurta.org> writes:
> > If the mode-line for the compilation buffer would be a bit more
> > visible it would be easier to see if a compilation is still running
> > (which is handy if you have compilations that take a long time and
> > don't want to spend too much time checking if it's done).
> > Also if the compilation fails it's nice to be able to see it faster.
> > It can be seen with just the peripheral vision, or from farther away
> > from the screen.
>
> I think it would be more useful if the result message displayed
> in the minibuffer was the same as at the end of the compilation
> buffer, i.e.
>
> Compilation exited abnormally with code 1 at Sun Feb 24 19:36:34
>
> The date part at the end of this message may be not necessary
> when displayed in the minibuffer.
That was just a debug leftover...
> > A simple patch can accomplish the above. It uses
> > font-lock-warning-face which is designed to be highly visible.
>
> What do you think about using a special compilation face
> `compilation-error' that inherits from `font-lock-warning-face'?
No opinion, feel free to change it if it works...
> But maybe we should add a new face?
We have enough faces, there should be a suitable one...
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: use faces on the mode-line for compile.el
2008-02-24 20:53 ` Dan Nicolaescu
@ 2008-02-24 23:23 ` Juri Linkov
0 siblings, 0 replies; 11+ messages in thread
From: Juri Linkov @ 2008-02-24 23:23 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
> > > A simple patch can accomplish the above. It uses
> > > font-lock-warning-face which is designed to be highly visible.
> >
> > What do you think about using a special compilation face
> > `compilation-error' that inherits from `font-lock-warning-face'?
>
> No opinion, feel free to change it if it works...
Done.
I wonder what is the purpose of the following code in
`compilation-handle-exit':
(if (and (numberp compilation-window-height)
(zerop compilation-window-height))
(message "%s" (cdr status)))
Is it now unnecessary since it becomes overwritten by another
message later?
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: use faces on the mode-line for compile.el
2008-02-23 23:59 use faces on the mode-line for compile.el Dan Nicolaescu
2008-02-24 13:42 ` Stefan Monnier
2008-02-24 17:40 ` Juri Linkov
@ 2008-02-26 2:00 ` Xavier Maillard
2 siblings, 0 replies; 11+ messages in thread
From: Xavier Maillard @ 2008-02-26 2:00 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
A simple patch can accomplish the above. It uses
font-lock-warning-face which is designed to be highly visible.
IMO this is a very nice feature to have, and simple to implement...
Thoughts?
Tested and adopted. I find it very useful.
Xavier
--
http://www.gnu.org
http://www.april.org
http://www.lolica.org
^ permalink raw reply [flat|nested] 11+ messages in thread
* use faces on the mode-line for compile.el
@ 2006-04-20 6:20 Dan Nicolaescu
2006-04-20 7:34 ` Nick Roberts
0 siblings, 1 reply; 11+ messages in thread
From: Dan Nicolaescu @ 2006-04-20 6:20 UTC (permalink / raw)
If the mode-line for the compilation buffer would be a bit more
visible it would be easier to see if a compilation is still running
(which is handy if you have compilations that take a long time and
don't want to spend too much time checking if it's done).
Also if the compilation fails it's nice to be able to see it faster.
A simple patch can accomplish the above. It uses
font-lock-warning-face which is designed to be highly visible.
IMO this is a very nice feature to have, and simple to implement...
Thoughts?
*** compile.el 04 Apr 2006 09:50:37 -0700 1.394
--- compile.el 19 Apr 2006 22:54:58 -0700
***************
*** 1060,1066 ****
(start-process-shell-command (downcase mode-name)
outbuf command))))
;; Make the buffer's mode line show process state.
! (setq mode-line-process '(":%s"))
(set-process-sentinel proc 'compilation-sentinel)
(set-process-filter proc 'compilation-filter)
(set-marker (process-mark proc) (point) outbuf)
--- 1060,1066 ----
(start-process-shell-command (downcase mode-name)
outbuf command))))
;; Make the buffer's mode line show process state.
! (setq mode-line-process (list (propertize ":%s" 'face 'font-lock-warning-face)))
(set-process-sentinel proc 'compilation-sentinel)
(set-process-filter proc 'compilation-filter)
(set-marker (process-mark proc) (point) outbuf)
***************
*** 1074,1080 ****
;; No asynchronous processes available.
(message "Executing `%s'..." command)
;; Fake modeline display as if `start-process' were run.
! (setq mode-line-process ":run")
(force-mode-line-update)
(sit-for 0) ; Force redisplay
(let* ((buffer-read-only nil) ; call-process needs to modify outbuf
--- 1074,1080 ----
;; No asynchronous processes available.
(message "Executing `%s'..." command)
;; Fake modeline display as if `start-process' were run.
! (setq mode-line-process (propertize ":run" 'face 'font-lock-warning-face))
(force-mode-line-update)
(sit-for 0) ; Force redisplay
(let* ((buffer-read-only nil) ; call-process needs to modify outbuf
***************
*** 1403,1409 ****
;; Prevent that message from being recognized as a compilation error.
(add-text-properties omax (point)
(append '(compilation-handle-exit t) nil))
! (setq mode-line-process (format ":%s [%s]" process-status (cdr status)))
;; Force mode line redisplay soon.
(force-mode-line-update)
(if (and opoint (< opoint omax))
--- 1403,1415 ----
;; Prevent that message from being recognized as a compilation error.
(add-text-properties omax (point)
(append '(compilation-handle-exit t) nil))
! (setq mode-line-process
! (concat (format ":%s " process-status)
! (format (if (> exit-status 0)
! (propertize "[%s]" 'face 'font-lock-warning-face)
! "[%s]")
! (cdr status))))
! (message (format "exit status: %s %s" exit-status (> 0 exit-status)))
;; Force mode line redisplay soon.
(force-mode-line-update)
(if (and opoint (< opoint omax))
^ permalink raw reply [flat|nested] 11+ messages in thread
* use faces on the mode-line for compile.el
2006-04-20 6:20 Dan Nicolaescu
@ 2006-04-20 7:34 ` Nick Roberts
2006-04-20 18:27 ` Dan Nicolaescu
0 siblings, 1 reply; 11+ messages in thread
From: Nick Roberts @ 2006-04-20 7:34 UTC (permalink / raw)
Cc: emacs-devel
> If the mode-line for the compilation buffer would be a bit more
> visible it would be easier to see if a compilation is still running
> (which is handy if you have compilations that take a long time and
> don't want to spend too much time checking if it's done).
> Also if the compilation fails it's nice to be able to see it faster.
>
> A simple patch can accomplish the above. It uses
> font-lock-warning-face which is designed to be highly visible.
>
> IMO this is a very nice feature to have, and simple to implement...
>
> Thoughts?
Font-lock-warning-face is normally used to report warnings or errors, not
normal progress like "run".
*Every* modeline already displays the keyword "Compiling" during compilation.
It will only be seen if the compilation buffer is visible and this is already
heavily fontified.
If we are ever going to get to a pretest then I think we need to stop
suggesting new features.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: use faces on the mode-line for compile.el
2006-04-20 7:34 ` Nick Roberts
@ 2006-04-20 18:27 ` Dan Nicolaescu
2006-04-21 13:07 ` Richard Stallman
0 siblings, 1 reply; 11+ messages in thread
From: Dan Nicolaescu @ 2006-04-20 18:27 UTC (permalink / raw)
Cc: emacs-devel
Nick Roberts <nickrob@snap.net.nz> writes:
> > If the mode-line for the compilation buffer would be a bit more
> > visible it would be easier to see if a compilation is still running
> > (which is handy if you have compilations that take a long time and
> > don't want to spend too much time checking if it's done).
> > Also if the compilation fails it's nice to be able to see it faster.
> >
> > A simple patch can accomplish the above. It uses
> > font-lock-warning-face which is designed to be highly visible.
> >
> > IMO this is a very nice feature to have, and simple to implement...
> >
> > Thoughts?
> Font-lock-warning-face is normally used to report warnings or
> errors, not normal progress like "run".
I used font-lock-warning-face in 2 contexts, in this one you have a
point, maybe another face can be used.
> *Every* modeline already displays the keyword "Compiling" during
> compilation.
Right, and it would be nice for it to be in a different color so that
it can be seen if you are not exactly in front of the computer. I have
had this patch in my tree for a while and it does make a difference.
> It will only be seen if the compilation buffer is visible and this
> is already heavily fontified.
It is, but if the errors are not in the visible portion of the buffer
all that fontification does not help. Using font-lock-warning-face in
the modeline in case of an error gives a strong signal that you need
to look at the what is going on.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-02-26 2:00 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-23 23:59 use faces on the mode-line for compile.el Dan Nicolaescu
2008-02-24 13:42 ` Stefan Monnier
2008-02-24 20:48 ` Dan Nicolaescu
2008-02-24 17:40 ` Juri Linkov
2008-02-24 20:53 ` Dan Nicolaescu
2008-02-24 23:23 ` Juri Linkov
2008-02-26 2:00 ` Xavier Maillard
-- strict thread matches above, loose matches on Subject: below --
2006-04-20 6:20 Dan Nicolaescu
2006-04-20 7:34 ` Nick Roberts
2006-04-20 18:27 ` Dan Nicolaescu
2006-04-21 13:07 ` Richard Stallman
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).