Bug 113647

Summary: wrong filetype detection in vim for /boot/grub/menu.lst
Product: [openSUSE] SUSE Linux 10.1 Reporter: Christian Boltz <suse-beta>
Component: BasesystemAssignee: Matthias Koenig <mkoenig>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Christian Boltz 2005-08-28 16:03:01 UTC
vi /boot/grub/menu.lst 
opens the file with the wrong syntax highlighting. vim uses "asm", but "grub" 
would be correct. 
 
Workaround is ":set ft=grub" - but this is not known to average users.
Comment 1 Mads Martin Joergensen 2005-08-29 14:36:35 UTC
On latest beta, this works just fine for me.

filetype is set to grub as it should.
Comment 2 Christian Boltz 2006-10-30 07:04:16 UTC
Finally found it: it works well for /boot/grub/menu.lst, but not for /testroot/boot/grub/menu.lst (/testroot is a partition I just prepared for betatesting 10.2)

I also now know the reason why the /testroot/boot/grub/menu.lst is not detected as filetype=grub:

# grep grub /usr/share/vim/current/filetype.vim
au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf  setf grub

To reproduce: copy menu.lst to another directory and/or rename it.
Comment 3 Matthias Koenig 2006-10-31 14:15:37 UTC
Fixed in stable.
Comment 4 Christian Boltz 2006-11-18 23:18:31 UTC
# grep grub filetype.vim
au BufNewFile,BufRead 
    */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf  setf grub

OK, this fixes the problem for grub configurations in "foreign" system partitions. Therefore it works in the "main corner case" :-)

The cases "rename the file" or "copy it to another directory" are not covered, but those cases are really rare. (Detection based on file content would be perfect, but I'm not sure if it's worth the work.)