Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 253653 - app-vim/gentoo-syntax should set commentstring
Summary: app-vim/gentoo-syntax should set commentstring
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2009-01-04 02:03 UTC by Mike Richman
Modified: 2010-12-12 03:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Richman 2009-01-04 02:03:34 UTC
app-vim/gentoo-syntax and other *-syntax packages should include code
to set commentstring.  For example, many of the recognized file types
are configuration files, so we should have

	setlocal commentstring =# %s

Internally, vim only uses commentstring for code folding, but plugins
can use it for more other reasons such as commenting and uncommenting
code.  Also, it's possible that there will be more built-in uses of
commentstring in the future.

It should be fairly trivial to set commentstring correctly for most
kinds of files; I'd be more than happy to make the changes and submit
a patch myself, though I might need some direction as to how to
generate the actual patch.

Steps to Reproduce:
1. $ vim /etc/make.conf
2. :set commentstring?
   [prints] commentstring=/*%s*/

Expected:
   [prints] commentstring=# %s
Comment 1 Kevin Pyle 2009-01-17 17:03:14 UTC
Generating patch files is relatively straightforward.  One way, though by no means the only way, is to do as follows:

mkdir ~/patches ~/patches/a ~/patches/b
cp --preserve file1[ file2[ file3]] ~/patches/a/
# Modify the file(s) until you are happy with how they behave
cp --preserve file1[ file2[ file3]] ~/patches/b/
cd ~/patches
diff -r -u a/ b/ > my-changes.patch
# Examine my-changes.patch to confirm that it modifies the files you want to change, and that no extraneous changes have crept in.  If results are not as you wish, go back to "# Modify..." and try again.  You may also find the vimdiff feature useful to let you observe differences and push changes between the two files in an interactive interface.

If the files you are modifying are not at the root of the directory structure from their archive, try to recreate the corresponding directory structure in a/ and b/.  For example, if you patch a file in ./after/syntax/ and another in ./after/filetype/, the ideal layout is to store the unchanged files in a/after/syntax/<file1> and a/after/filetype/<file2> and place the changed files in b/after/syntax/<file1> and b/after/filetype/<file2>.

Be sure to clean out or move aside the 'a' and 'b' subdirectories when you are done, so that your second patch does not include changes from your first patch.

The name you choose for your patch file will be visible when you attach the file here, so it would help if you name the patch files according to what they modify, such as gentoo-syntax-commentstring.patch, dhcpd-syntax-commentstring.patch, etc.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-02-12 21:57:36 UTC
We approach the year mark and no one else has cared yet, interesting.
Comment 3 Mike Richman 2010-02-12 22:37:37 UTC
(In reply to comment #2)
> We approach the year mark and no one else has cared yet, interesting.
> 

I've since switched back to Ubuntu for unrelated reasons... and almost no one uses 'commentstring' anyway.