www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DLint and D-Mode

reply John Demme <me teqdruid.com> writes:
So I just started using Ben Hinkle's dlint program along with his d-mode
for emacs- the lastest one that ties into dlint.

First, let me say that it's great!  I don't miss Eclipse with Java
anymore (well, almost)!

I have two problems with it, however:
1) The green color it uses to highlight lines makes it really hard for
me to read the text underneath.  How do I change this?

2) Sometimes, especially when programming in templates, errors don't
show until you instantiate the template in another file.  In this case,
d-mode shows the error on the import line.  I'd like it to (in addition
to this) highlight the line in the offending file if that file is open.
Is this possible?

-John
Jun 28 2005
parent reply John Demme <me teqdruid.com> writes:
Ah yes- forgot one:
3) Does anyone know how to invoke the dlint runner without saving the
file?  I want do this whenever I change and save another file which
affects the buffer I want to do this one.

John

On Tue, 2005-06-28 at 23:24 -0400, John Demme wrote:
 So I just started using Ben Hinkle's dlint program along with his d-mode
 for emacs- the lastest one that ties into dlint.
 
 First, let me say that it's great!  I don't miss Eclipse with Java
 anymore (well, almost)!
 
 I have two problems with it, however:
 1) The green color it uses to highlight lines makes it really hard for
 me to read the text underneath.  How do I change this?
 
 2) Sometimes, especially when programming in templates, errors don't
 show until you instantiate the template in another file.  In this case,
 d-mode shows the error on the import line.  I'd like it to (in addition
 to this) highlight the line in the offending file if that file is open.
 Is this possible?
 
 -John
 
Jun 28 2005
parent reply "Ben Hinkle" <ben.hinkle gmail.com> writes:
"John Demme" <me teqdruid.com> wrote in message 
news:1120019093.31037.28.camel localhost...
 Ah yes- forgot one:
 3) Does anyone know how to invoke the dlint runner without saving the
 file?  I want do this whenever I change and save another file which
 affects the buffer I want to do this one.
That's a good idea but right now the dlint minor mode requires a saved file. In principle it could pipe the current buffer to dlint and not need the file but it doesn't do that yet.
 John

 On Tue, 2005-06-28 at 23:24 -0400, John Demme wrote:
 So I just started using Ben Hinkle's dlint program along with his d-mode
 for emacs- the lastest one that ties into dlint.

 First, let me say that it's great!  I don't miss Eclipse with Java
 anymore (well, almost)!

 I have two problems with it, however:
 1) The green color it uses to highlight lines makes it really hard for
 me to read the text underneath.  How do I change this?
Check out the colors in linemark.el for linemark-go-face. It is hard-coded to use that pretty ugly green. I don't particularly like the colors dlint-mode uses either so suggestions would be appreciated.
 2) Sometimes, especially when programming in templates, errors don't
 show until you instantiate the template in another file.  In this case,
 d-mode shows the error on the import line.  I'd like it to (in addition
 to this) highlight the line in the offending file if that file is open.
 Is this possible?
Currently dlint-mode only highlights lines in the current buffer and if the error is in an imported file the import statement is highlighted. You're right it would be better to highlight the template instantiation line instead. It will require some hopefully small modifications to the dmd front end. In any case if you hover over the import line or view the error at that line it should say exactly what file and what line caused the problem. My emacs coding skills are terrible so don't hold your breath for when something like that could get supported. The current dlint-mode is a minor modifications of the matlab mlint-mode written by a friend Eric Ludlam.
Jun 29 2005
parent John Demme <me teqdruid.com> writes:
On Wed, 2005-06-29 at 18:11 -0400, Ben Hinkle wrote:
 "John Demme" <me teqdruid.com> wrote in message 
 news:1120019093.31037.28.camel localhost...
 Ah yes- forgot one:
 3) Does anyone know how to invoke the dlint runner without saving the
 file?  I want do this whenever I change and save another file which
 affects the buffer I want to do this one.
That's a good idea but right now the dlint minor mode requires a saved file. In principle it could pipe the current buffer to dlint and not need the file but it doesn't do that yet.
Actually it IS a saved file. The errors that get highlighted, however, aren't in the file, they're in other files, so once I fix and save the error in the file, I want to run dlint on the file where they're being highlighted. Assuming that dlint can run (and already has been run) on a buffer, I just want to run it again.
 
 2) Sometimes, especially when programming in templates, errors don't
 show until you instantiate the template in another file.  In this case,
 d-mode shows the error on the import line.  I'd like it to (in addition
 to this) highlight the line in the offending file if that file is open.
 Is this possible?
Currently dlint-mode only highlights lines in the current buffer and if the error is in an imported file the import statement is highlighted. You're right it would be better to highlight the template instantiation line instead. It will require some hopefully small modifications to the dmd front end. In any case if you hover over the import line or view the error at that line it should say exactly what file and what line caused the problem. My emacs coding skills are terrible so don't hold your breath for when something like that could get supported. The current dlint-mode is a minor modifications of the matlab mlint-mode written by a friend Eric Ludlam.
I think you misunderstand. I want dlint-mode to highlight the error line in a different buffer. Say I'm working on a.d, and an error on a line in b.d shows up when running dlint on a.d. If I currently have b.d open in a buffer, I want the line to be highlighted in that buffer. John
Jun 29 2005