debugging errorformat strings.

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

debugging errorformat strings.

Hugh Sasse
I have been trying to improve the quickfix facilities
obtainable from gcc.   The file I have in vim7 is:
<quote>
" Vim compiler file
" Compiler:         GNU C Compiler
" Maintainer:       Nikolai Weibull <[hidden email]>
" Latest Revision:  2006-04-19

if exists("current_compiler")
  finish
endif
let current_compiler = "gcc"

let s:cpo_save = &cpo
set cpo-=C

setlocal errorformat=
      \%*[^\"]\"%f\"%*\\D%l:\ %m,
      \\"%f\"%*\\D%l:\ %m,
      \%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,
      \%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
      \%f:%l:\ %m,
      \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
      \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
      \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
      \%DMaking\ %*\\a\ in\ %f

let &cpo = s:cpo_save
unlet s:cpo_save
</quote>

and I have modified it thusly:

--- /usr/local/share/vim/vim70/compiler/gcc.vim 2006-07-19 18:11:22.117752000 +0100
+++ /home/hgs/.vim/compiler/gcc.vim 2006-11-22 18:33:39.269332000 +0000
@@ -16,6 +16,8 @@
       \\"%f\"%*\\D%l:\ %m,
       \%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,
       \%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
+      \%E%f:%l:\ multiple\ definitions\ of\ %m,
+      \%Z%*\\s:%f:%l:\ first\ defined\ here,
       \%f:%l:\ %m,
       \\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
       \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',

This is being picked up correctly (I know because of introducing bugs
in it).  But when I get results like:
/home/hgs/fsv/rawimage.c:97: multiple definition of `image_check_is_png'
image.o:/home/hgs/fsv/image.c:97: first defined here

vim tries to pickup a file called image.o:/home/hgs/fsv/image.c which
clearly doesn't exist.

I have tried the following forms of this line
      \%Z%*\\s:%f:%l:\ first\ defined\ here,
      \%Z%.%#:%f:%l:\ first\ defined\ here,
      \%Z%*[^:]:%f:%l:\ first\ defined\ here,
      \%Z%m:%f:%l:\ first\ defined\ here,
      \%Z%*f:%f:%l:\ first\ defined\ here,

The latter of which complains about 2 %f symbols in the line, despite the
first having a * in it.

        %*{conv} any scanf non-assignable conversion

would seem to suggest I could do that.
Also I can find no examples in the supplied help or supplied compiler files,
or on the web, how to use
<quote>
        %s search text (finds a string)
  [...]
The "%s" conversion specifies the text to search for to locate the error line.
The text is used as a literal string.  The anchors "^" and "$" are added to
the text to locate the error line exactly matching the search text and the
text is prefixed with the "\V" atom to make it "very nomagic".  The "%s"
conversion can be used to locate lines without a line number in the error
output.  Like the output of the "grep" shell command.
When the pattern is present the line number will not be used.
</quote>

Does the string come after the %s?  Does Vim, or the author of the
errorformat add the "^" and "$", and if the latter, are they compulsory
delimiters of the string?

Is there any way to get vim to log what happens when errrorformats are
matched, so one can debug this stuff more easily?

How should I be tacking accessing just the source file I want?

        Thank you
        Hugh
Reply | Threaded
Open this post in threaded view
|

ViM7 spellchecking

Krzysztof Maj
Hello everybody,
I've found that VIM7 has a feature called spellchecking. Great, because it
could be very usefull. But my question is how does it works on Mac OSX, how
to configure it on this platform and choose the language which I wanna
prefer? Additionally, is it any chance to ommit special characters during
the spellcheck in LaTeX files for instance?

Thanks in advance for help,
Krzysztof Maj


--
  "Software is like sex, it's better when it's free"
Linux Debian User. www.GUST.org.pl Member. LRU: 138598

Reply | Threaded
Open this post in threaded view
|

Re: ViM7 spellchecking

Hugh Sasse
On Fri, 24 Nov 2006, Krzysztof Maj wrote:

> Hello everybody,
> I've found that VIM7 has a feature called spellchecking. Great, because it
> could be very usefull. But my question is how does it works on Mac OSX, how

Do you have reason to believe it works differently on Mac OSX compared
to other platforms?  Or are you just telling us your platform?

> to configure it on this platform and choose the language which I wanna

:he spell
:he spelllang

should be sufficient to answer this.
> prefer? Additionally, is it any chance to ommit special characters during
> the spellcheck in LaTeX files for instance?
:he spell-syntax
essentially, yes.

>
> Thanks in advance for help,
> Krzysztof Maj
>
        Hugh
Reply | Threaded
Open this post in threaded view
|

Re: ViM7 spellchecking

Krzysztof Maj
Hugh Sasse <[hidden email]> napisał(a):

> On Fri, 24 Nov 2006, Krzysztof Maj wrote:
>
>> Hello everybody,
>> I've found that VIM7 has a feature called spellchecking. Great,
>> because it
>> could be very usefull. But my question is how does it works on Mac OSX,
>>  how
>
> Do you have reason to believe it works differently on Mac OSX compared
> to other platforms?  Or are you just telling us your platform?

Well, my platform at home is currently Mac OSX and I've found that some
things work diffrent, that's why I asked. I didn't know before, that
spellcheking engine has been built in VIM. So I started to worry about it
since Mac OSX doesn't have ispell or aspell by default.

>
>> to configure it on this platform and choose the language which I wanna
>>
>
> :he spell
> :he spelllang

OK, we'll see if VIM has iso-8859-2 or cp1250 or Mac syntax which I wanna
use...

>
> should be sufficient to answer this.
>> prefer? Additionally, is it any chance to ommit special characters
>> during
>> the spellcheck in LaTeX files for instance?
> :he spell-syntax
> essentially, yes.

Thanks for pointer, I'll read it for sure.

>> Krzysztof Maj



--
  "Software is like sex, it's better when it's free"
Linux Debian User. www.GUST.org.pl Member. LRU: 138598

Reply | Threaded
Open this post in threaded view
|

Re: ViM7 spellchecking

Krzysztof Maj

On 2006-11-24, at 13:18, Krzysztof Maj wrote:

> Hugh Sasse <[hidden email]> napisał(a):
>> On Fri, 24 Nov 2006, Krzysztof Maj wrote:
>>
>>> Hello everybody,
>>> I've found that VIM7 has a feature called spellchecking. Great,
>>> because it
>>> could be very usefull. But my question is how does it works on  
>>> Mac OSX,
>>>  how
>>
>> Do you have reason to believe it works differently on Mac OSX  
>> compared
>> to other platforms?  Or are you just telling us your platform?
>
> Well, my platform at home is currently Mac OSX and I've found that  
> some
> things work diffrent, that's why I asked. I didn't know before, that
> spellcheking engine has been built in VIM. So I started to worry  
> about it
> since Mac OSX doesn't have ispell or aspell by default.
>
>>
>>> to configure it on this platform and choose the language which I  
>>> wanna
>>>
>>
>> :he spell
>> :he spelllang
>
> OK, we'll see if VIM has iso-8859-2 or cp1250 or Mac syntax which I  
> wanna
> use...
I've checked above and seems that VIM7 does not have iso-8859-2 and
cp1250 files included in MacOSX dmg file and also in Windows distro.
I had to download it from the internet and put it manually to spell
directory at both Mac and Windows platforms.
When I did :set spelllang=pl and then :set spell VIM said no file.

So maybe I missed something or Polish support for spelling is not
included in the VIM7 package.

>>
>> should be sufficient to answer this.
>>> prefer? Additionally, is it any chance to ommit special characters
>>> during
>>> the spellcheck in LaTeX files for instance?
>> :he spell-syntax
>> essentially, yes.
>
> Thanks for pointer, I'll read it for sure.
>
>>> Krzysztof Maj

--
Pozdrawiam - Krzysztof Maj
 I'm a Mac now, are you PC?
Oh, dear... ;-)



Reply | Threaded
Open this post in threaded view
|

Re: ViM7 spellchecking

A.J.Mechelynck
Krzysztof MaJ wrote:

>
> On 2006-11-24, at 13:18, Krzysztof Maj wrote:
>
>> Hugh Sasse <[hidden email]> napisał(a):
>>> On Fri, 24 Nov 2006, Krzysztof Maj wrote:
>>>
>>>> Hello everybody,
>>>> I've found that VIM7 has a feature called spellchecking. Great,
>>>> because it
>>>> could be very usefull. But my question is how does it works on Mac OSX,
>>>>  how
>>>
>>> Do you have reason to believe it works differently on Mac OSX compared
>>> to other platforms?  Or are you just telling us your platform?
>>
>> Well, my platform at home is currently Mac OSX and I've found that some
>> things work diffrent, that's why I asked. I didn't know before, that
>> spellcheking engine has been built in VIM. So I started to worry about it
>> since Mac OSX doesn't have ispell or aspell by default.
>>
>>>
>>>> to configure it on this platform and choose the language which I wanna
>>>>
>>>
>>> :he spell
>>> :he spelllang
>>
>> OK, we'll see if VIM has iso-8859-2 or cp1250 or Mac syntax which I wanna
>> use...
> I've checked above and seems that VIM7 does not have iso-8859-2 and
> cp1250 files included in MacOSX dmg file and also in Windows distro.
> I had to download it from the internet and put it manually to spell
> directory at both Mac and Windows platforms.
> When I did :set spelllang=pl and then :set spell VIM said no file.
>
> So maybe I missed something or Polish support for spelling is not
> included in the VIM7 package.
>
>>>
>>> should be sufficient to answer this.
>>>> prefer? Additionally, is it any chance to ommit special characters
>>>> during
>>>> the spellcheck in LaTeX files for instance?
>>> :he spell-syntax
>>> essentially, yes.
>>
>> Thanks for pointer, I'll read it for sure.
>>
>>>> Krzysztof Maj
>
> --Pozdrawiam - Krzysztof Maj
>  I'm a Mac now, are you PC?
> Oh, dear... ;-)
>
>
>
>
>

I see

pl.cp1250.spl
pl.iso-8859-2.spl
pl.utf-8.spl

in the directory $VIMRUNTIME/spell

These files are (IIUC) cross-platform. Maybe you don't have spelling (or at
least spelling dictionaries) installed? Did you get Vim from official sources
or from a third party? If official, did you include the "lang" (language) sources?


Best regards,
Tony.
Reply | Threaded
Open this post in threaded view
|

Re: ViM7 spellchecking

Krzysztof Maj

On 2006-11-24, at 20:22, A.J.Mechelynck wrote:

> Krzysztof MaJ wrote:
>> On 2006-11-24, at 13:18, Krzysztof Maj wrote:
>>> Hugh Sasse <[hidden email]> napisał(a):
>>>> On Fri, 24 Nov 2006, Krzysztof Maj wrote:
>>>>
>>>>> Hello everybody,
>>>>> I've found that VIM7 has a feature called spellchecking. Great,
>>>>> because it
>>>>> could be very usefull. But my question is how does it works on  
>>>>> Mac OSX,
>>>>>  how
>>>>
>>>> Do you have reason to believe it works differently on Mac OSX  
>>>> compared
>>>> to other platforms?  Or are you just telling us your platform?
>>>
>>> Well, my platform at home is currently Mac OSX and I've found  
>>> that some
>>> things work diffrent, that's why I asked. I didn't know before, that
>>> spellcheking engine has been built in VIM. So I started to worry  
>>> about it
>>> since Mac OSX doesn't have ispell or aspell by default.
>>>
>>>>
>>>>> to configure it on this platform and choose the language which  
>>>>> I wanna
>>>>>
>>>>
>>>> :he spell
>>>> :he spelllang
>>>
>>> OK, we'll see if VIM has iso-8859-2 or cp1250 or Mac syntax which  
>>> I wanna
>>> use...
>> I've checked above and seems that VIM7 does not have iso-8859-2 and
>> cp1250 files included in MacOSX dmg file and also in Windows distro.
>> I had to download it from the internet and put it manually to spell
>> directory at both Mac and Windows platforms.
>> When I did :set spelllang=pl and then :set spell VIM said no file.
>> So maybe I missed something or Polish support for spelling is not
>> included in the VIM7 package.
>>>>
>>>> should be sufficient to answer this.
>>>>> prefer? Additionally, is it any chance to ommit special characters
>>>>> during
>>>>> the spellcheck in LaTeX files for instance?
>>>> :he spell-syntax
>>>> essentially, yes.
>>>
>>> Thanks for pointer, I'll read it for sure.
>>>
>>>>> Krzysztof Maj
>> --Pozdrawiam - Krzysztof Maj
>>  I'm a Mac now, are you PC?
>> Oh, dear... ;-)
>
> I see
>
> pl.cp1250.spl
> pl.iso-8859-2.spl
> pl.utf-8.spl
>
> in the directory $VIMRUNTIME/spell
>
> These files are (IIUC) cross-platform. Maybe you don't have  
> spelling (or at least spelling dictionaries) installed? Did you get  
> Vim from official sources or from a third party? If official, did  
> you include the "lang" (language) sources?
>
>
> Best regards,
> Tony.

Well I've get VIM from the vim.org site for windows and from  
macvim.org for Mac platform. But I downloaded only a VIM package  
without any additional sources - lang sources as you said. On Mac  
this is a DMG package, so when I open a content of the package I  
didn't find this file. In the spell directory I have a subdirectory  
pl, but it contained only two files: main.aap and pl_PL.diff :-(

--
Pozdrawiam - Krzysztof Maj
 I'm a Mac now, are you PC?
Oh, dear... ;-)



Reply | Threaded
Open this post in threaded view
|

Re: ViM7 spellchecking

A.J.Mechelynck
Krzysztof MaJ wrote:
[...]

> Well I've get VIM from the vim.org site for windows and from macvim.org
> for Mac platform. But I downloaded only a VIM package without any
> additional sources - lang sources as you said. On Mac this is a DMG
> package, so when I open a content of the package I didn't find this
> file. In the spell directory I have a subdirectory pl, but it contained
> only two files: main.aap and pl_PL.diff :-(
>
> --Pozdrawiam - Krzysztof Maj
>  I'm a Mac now, are you PC?
> Oh, dear... ;-)

IIUC that would be the unpatched 7.0.000 (at least for Windows; not sure about
the Mac).

For Windows, an updated version with executable and all runtime files
(currently 7.0.161 dated Nov.7) can be obtained from
https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721

For the Mac, I don't know where to get an updated executable (unless you want
to compile it yourself); but you can get updated runtime files by downloading
ftp://ftp.vim.org/pub/vim/runtime/ including all sub- and sub-sub-directories
except the dos/ subdirectory.

The spell files are in $VIMRUNTIME/spell itself, not in a further subdirectory.


Best regards,
Tony.
Reply | Threaded
Open this post in threaded view
|

Re: ViM7 spellchecking

Krzysztof Maj

On 2006-11-24, at 21:05, A.J.Mechelynck wrote:

> Krzysztof MaJ wrote:
> [...]
>> Well I've get VIM from the vim.org site for windows and from  
>> macvim.org for Mac platform. But I downloaded only a VIM package  
>> without any additional sources - lang sources as you said. On Mac  
>> this is a DMG package, so when I open a content of the package I  
>> didn't find this file. In the spell directory I have a  
>> subdirectory pl, but it contained only two files: main.aap and  
>> pl_PL.diff :-(
>> --Pozdrawiam - Krzysztof Maj
>>  I'm a Mac now, are you PC?
>> Oh, dear... ;-)
>
> IIUC that would be the unpatched 7.0.000 (at least for Windows; not  
> sure about the Mac).
>
> For Windows, an updated version with executable and all runtime  
> files (currently 7.0.161 dated Nov.7) can be obtained from https://
> sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721
>
> For the Mac, I don't know where to get an updated executable  
> (unless you want to compile it yourself); but you can get updated  
> runtime files by downloading ftp://ftp.vim.org/pub/vim/runtime/  
> including all sub- and sub-sub-directories except the dos/  
> subdirectory.
>
> The spell files are in $VIMRUNTIME/spell itself, not in a further  
> subdirectory.
>
>
> Best regards,
> Tony.

Thanks a lot Tony, it's good to know that not only for me, but maybe  
for the rest people experienced with the same problem.
My solution was to manually download the missing files and copy them  
to the contents of VIM package, works great so far.
Generally, VIM RULEZ!!!

--
Pozdrawiam - Krzysztof Maj
 I'm a Mac now, are you PC?
Oh, dear... ;-)