Bug 113647 - wrong filetype detection in vim for /boot/grub/menu.lst
Summary: wrong filetype detection in vim for /boot/grub/menu.lst
Status: VERIFIED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: Other All
: P5 - None : Minor (vote)
Target Milestone: ---
Assignee: Matthias Koenig
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-28 16:03 UTC by Christian Boltz
Modified: 2006-11-18 23:18 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.)