r1243 - in /trunk/packages/vim-scripts: ./ debian/ doc/ ftplugin/ html/ plugin/

jamessan at users.alioth.debian.org jamessan at users.alioth.debian.org
Tue Apr 8 20:43:24 UTC 2008


Author: jamessan
Date: Tue Apr  8 20:43:24 2008
New Revision: 1243

URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=1243
Log:
Update Enhanced Commentify

Added:
    trunk/packages/vim-scripts/LICENSE.EnhancedCommentify
    trunk/packages/vim-scripts/ftplugin/ocaml_enhcomm.vim
    trunk/packages/vim-scripts/ftplugin/php_enhcomm.vim
Modified:
    trunk/packages/vim-scripts/debian/changelog
    trunk/packages/vim-scripts/debian/vim-scripts.status
    trunk/packages/vim-scripts/doc/EnhancedCommentify.txt
    trunk/packages/vim-scripts/html/index.html
    trunk/packages/vim-scripts/html/plugin_EnhancedCommentify.vim.html
    trunk/packages/vim-scripts/plugin/EnhancedCommentify.vim

Added: trunk/packages/vim-scripts/LICENSE.EnhancedCommentify
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/LICENSE.EnhancedCommentify?rev=1243&op=file
==============================================================================
--- trunk/packages/vim-scripts/LICENSE.EnhancedCommentify (added)
+++ trunk/packages/vim-scripts/LICENSE.EnhancedCommentify Tue Apr  8 20:43:24 2008
@@ -1,0 +1,24 @@
+Copyright (c) 2008 Meikel Brandmeyer, Frankfurt am Main
+All rights reserved.
+
+Redistribution and use in source and binary form are permitted provided
+that the following conditions are met:
+
+1. Redistribition of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.

Modified: trunk/packages/vim-scripts/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/changelog?rev=1243&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/changelog (original)
+++ trunk/packages/vim-scripts/debian/changelog Tue Apr  8 20:43:24 2008
@@ -7,10 +7,10 @@
       being run in other buffers.  Thanks to Marvin Renich for the patch fix.
       (Closes: #465330)
   * Updated addons:
-    - xmledit, surround, debPlugin, Markdown syntax, NERD Commenter
+    - xmledit, surround, debPlugin, Markdown syntax, NERD Commenter, Enhanced
+      Commentify.
   * New addons:
     - DetectIndent: Automatically detect indent settings (Closes: #471890)
-  * 
 
  -- James Vega <jamessan at debian.org>  Tue, 05 Feb 2008 17:06:54 -0500
 

Modified: trunk/packages/vim-scripts/debian/vim-scripts.status
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/vim-scripts.status?rev=1243&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/vim-scripts.status (original)
+++ trunk/packages/vim-scripts/debian/vim-scripts.status Tue Apr  8 20:43:24 2008
@@ -171,10 +171,10 @@
 author:      Meikel Brandmeyer
 author_url:  http://www.vim.org/account/profile.php?user_id=62
 email:       Brandels_Mikesh at web.de
-license:     BSD, see /usr/share/common-licenses/BSD
-extras:	     doc/EnhancedCommentify.txt
+license:     license [5], see below
+extras:      doc/EnhancedCommentify.txt, ftplugin/php_enhcomm.vim, ftplugin/ocaml_enhcomm.vim, LICENSE.EnhancedCommentify
 disabledby:  let DidEnhancedCommentify = 1
-version:     2.2
+version:     2.3
 
 script_name: ftplugin/xml.vim
 addon:       xmledit
@@ -505,3 +505,26 @@
        sources, parts of it or from a modified version.  You may use this
        license for previous Vim releases instead of the license that they came
        with, at your option.
+
+license [5]
+  Redistribution and use in source and binary form are permitted provided
+  that the following conditions are met:
+
+  1. Redistribition of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+  ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  SUCH DAMAGE.

Modified: trunk/packages/vim-scripts/doc/EnhancedCommentify.txt
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/doc/EnhancedCommentify.txt?rev=1243&op=diff
==============================================================================
--- trunk/packages/vim-scripts/doc/EnhancedCommentify.txt (original)
+++ trunk/packages/vim-scripts/doc/EnhancedCommentify.txt Tue Apr  8 20:43:24 2008
@@ -304,27 +304,38 @@
 
 3. Adding new languages			    *EnhComm-NewLanguages*
 
-Adding new languages is really easy. Just follow this step-by-step
-process. Assume we want to add the language Foobar. It uses multipart
-comments like C ("/*" <=> "bar", "*/" <=> "baz") and has the filetype
-"foo".
+Since 2.3 there is the possibility to use some callback function to
+handle unrecognised filetypes. This is a substitute to steps a)-d)
+below. Just add a function called "EnhCommentifyCallback" and set
+"g:EnhCommentifyCallbackExists" to some value. >
+    function EnhCommentifyCallback(ft)
+	if a:ft == 'foo'
+		let b:ECcommentOpen = 'bar'
+		let b:ECcommentClose = 'baz'
+	endif
+    endfunction
+    let g:EnhCommentifyCallbackExists = 'Yes'
+<
+Optionally the steps e) and f) still apply.
+
+Of course the old way still works:
 
  a) Open the script.
  b) Go to the GetFileTypeSettings() function.
  c) Now you should see the large "if"-tree. >
     if fileType =~ '^\(c\|css\|...'
-	let b:EnhCommentifyCommentOpen = '/*'
-	let b:EnhCommentifyCommentClose = '*/'
+	let b:ECcommentOpen = '/*'
+	let b:ECcommentClose = '*/'
     elseif ...
 <
  d) There are two buffer-local variables, which hold the different comment
-    strings. With this in mind we add Foobar: >
+    strings. >
     if fileType =~ '^\(c\|css\|...'
-	let b:EnhCommentifyCommentOpen = '/*'
-	let b:EnhCommentifyCommentClose = '*/'
+	let b:ECcommentOpen = '/*'
+	let b:ECcommentClose = '*/'
     elseif fileType == 'foo'
-	let b:EnhCommentifyCommentOpen = 'bar'
-	let b:EnhCommentifyCommentClose = 'baz'
+	let b:ECcommentOpen = 'bar'
+	let b:ECcommentClose = 'baz'
     elseif ...
 <
      If the new language has only one comment string (like '#' in Perl), we
@@ -447,6 +458,13 @@
  - John Orr
  - Luc Hermite
  - Brett Calcott
+ - Ben Kibbey
+ - Brian Neu
+ - Steve Hall
+ - Zhang Le
+ - Pieter Naaijkens
+ - Thomas Link
+ - Stefano Zacchiroli
 
 Thanks to John Orr and Xiangjiang Ma for their rich feedback and to Luc
 Hermite for some good improvement suggestions.

Added: trunk/packages/vim-scripts/ftplugin/ocaml_enhcomm.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/ftplugin/ocaml_enhcomm.vim?rev=1243&op=file
==============================================================================
--- trunk/packages/vim-scripts/ftplugin/ocaml_enhcomm.vim (added)
+++ trunk/packages/vim-scripts/ftplugin/ocaml_enhcomm.vim Tue Apr  8 20:43:24 2008
@@ -1,0 +1,1 @@
+set commentstring=(*%s*)

Added: trunk/packages/vim-scripts/ftplugin/php_enhcomm.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/ftplugin/php_enhcomm.vim?rev=1243&op=file
==============================================================================
--- trunk/packages/vim-scripts/ftplugin/php_enhcomm.vim (added)
+++ trunk/packages/vim-scripts/ftplugin/php_enhcomm.vim Tue Apr  8 20:43:24 2008
@@ -1,0 +1,6 @@
+"
+" Normal HTML text has no synID-name. So we have to specify this problem
+" case here. Note that you should not try to comment lines starting
+" with '<?'.
+"
+call EnhCommentifyFallback4Embedded('&ft == "php" && synFiletype == ""', "html")

Modified: trunk/packages/vim-scripts/html/index.html
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/html/index.html?rev=1243&op=diff
==============================================================================
--- trunk/packages/vim-scripts/html/index.html (original)
+++ trunk/packages/vim-scripts/html/index.html Tue Apr  8 20:43:24 2008
@@ -49,7 +49,7 @@
    <li><a href="syntax_mkd.vim.html">syntax/mkd.vim.html</a></li>
   </ul>
   <p>
-  Page generated on Tue, 08 Apr 2008 16:25:59 -0400
+  Page generated on Tue, 08 Apr 2008 16:41:46 -0400
 .
   </p>
  </body>

Modified: trunk/packages/vim-scripts/html/plugin_EnhancedCommentify.vim.html
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/html/plugin_EnhancedCommentify.vim.html?rev=1243&op=diff
==============================================================================
--- trunk/packages/vim-scripts/html/plugin_EnhancedCommentify.vim.html (original)
+++ trunk/packages/vim-scripts/html/plugin_EnhancedCommentify.vim.html Tue Apr  8 20:43:24 2008
@@ -153,8 +153,8 @@
 <tr>
   <td class="lightbg"><b>&nbsp;script karma&nbsp;</b></td>
   <td>
-    Rating <b>963/308</b>,
-    Downloaded by 12865  </td>
+    Rating <b>1069/338</b>,
+    Downloaded by 13955  </td>
 </tr>
 </table>
 <p>
@@ -167,7 +167,7 @@
 <tr><td>utility</td></tr>
 <tr><td>&nbsp;</td></tr>
 <tr><td class="prompt">description</td></tr>
-<tr><td>This script is strongly based on ToggleCommentify.vim (<a href="/scripts/script.php?script_id=4">vimscript #4</a>) of Vincent Nijs. I extended it with some nice features, but Vincent wants to keep his
<br>script simple. So, he suggest me to put my modifications to vim online by myself. Well, here we go:
<br>New features:
<br> * MultiPart-comment-strings are now possible (eg. /* */, &lt;!-- --&gt;)
<br> * MultiPart-comments inside comments are now escaped.
<br> * Supported languages: Vim, C, C++, PHP, Perl, ox, Tex, Sh, LISP, Python, HTML, XML, Java, JProperties, CAOS, CSS a. o.
<br> * length of comment-strings is computed dynamically
<br> * comment strings are escaped to prevent problems with regular expressions
<br> * option to turn &quot;commentification&quot; of empty lines on or off
<br> * commentifies multiple lines in visual mode</td></tr>
+<tr><td>The development of the script is done at <a target="_blank" href="http://ec.kotka.de">http://ec.kotka.de</A>. Releases may be downloaded from below.
<br>
<br>There is a major rework for Vim7 underway. In case you are missing any features, this is the time to suggest them. Send me an email or report your bugs or suggestions in the trac at the link above. This is a serious request from me to the users. In the past a lof of people complained on mailing lists, that &quot;this doesn't work&quot; or &quot;that feature is missing&quot;, without contacting me. If you don't tell the upstream author, then this won't change!
<br>
<br>Stay tuned.</td></tr>
 <tr><td>&nbsp;</td></tr>
 <tr><td class="prompt">install details</td></tr>
 <tr><td>Simply drop the script in your .vim/plugin directory. There is a detailed EnhancedCommentify.txt, since there are to much options to explain here. Put it in your .vim/doc directory and issue the ':helptags ~/.vim/doc' command. ':help EnhancedCommentify' should then give you any information you need in order to use the new features of the script.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
@@ -204,28 +204,36 @@
     <th valign="top">release notes</th>
 </tr>
 <tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=3490">EnhancedCommentify-2.2.tar.gz</a></td>
-    <td class="rowodd" valign="top" nowrap><b>2.2</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2004-09-27</i></td>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=8319">EnhancedCommentify-2.3.tar.gz</a></td>
+    <td class="rowodd" valign="top" nowrap><b>2.3</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2008-02-21</i></td>
     <td class="rowodd" valign="top" nowrap>6.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=62">Meikel Brandmeyer</a></i></td>
-    <td class="rowodd" valign="top" width="2000">New features:
<br> * Keybindings may be turned off in the different modes. (eg. no bindings in insert mode)
<br> * Keybindings may be local to the buffer now.
<br> * Keybindings may be turned off in case of an unknown filetype.
<br>
<br>Bugfixes:
<br> * Fixed a problem with UseSyntax. (thanks to Pieter Naaijkens)
<br> * Fixed Ocaml support. (thanks to Zhang Le)</td>
-</tr>
-<tr>
-        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=2677">EnhancedCommentify-2.1.tar.gz</a></td>
-    <td class="roweven" valign="top" nowrap><b>2.1</b></td>
-    <td class="roweven" valign="top" nowrap><i>2004-01-26</i></td>
+    <td class="rowodd" valign="top" width="2000">Still alive! Yeah! :-D
<br>
<br>Finally a new release....
<br>
<br>This is mainly a bugfix release:
<br>* Fixed a typo in the apache detection. (thanks to Brian Neu)
<br>* Fixed handling of nested comment escape strings. (thanks to Samuel Ferencik)
<br>* Fixed broken keyboard mappings when wcm is set to &lt;Tab&gt;. (thanks to xpatriotx)
<br>
<br>* Added support for viki & deplate (thanks to Thomas Link)
<br>* Added support xslt, xsd & mail (thanks to Stefano Zacchiroli)
<br>* Added callback-functionality to enable extension of the script without actually modifying the script.
<br></td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=3490">EnhancedCommentify-2.2.tar.gz</a></td>
+    <td class="roweven" valign="top" nowrap><b>2.2</b></td>
+    <td class="roweven" valign="top" nowrap><i>2004-09-27</i></td>
     <td class="roweven" valign="top" nowrap>6.0</td>
     <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=62">Meikel Brandmeyer</a></i></td>
-    <td class="roweven" valign="top" width="2000">This is version 2.1 of the EnhancedCommentify Script.
<br>New features:
<br> * one-block commenting for multipart comments
<br> * if possible, use commentstring option in order to determine the comment strings.
<br> * moved autocmd to BufWinEnter in order to fix modeline usage
<br> * experimental parsing of comments option to find out middle string for new one-block feature.
<br>
<br>Bugfixes:
<br> * fixed problems with tabs if align-right option is used
<br> * fixed case sensitive check for overrideEL (thanks to Steve Hall)
<br> * fixed problems with javascript filetype (thanks to Brian Neu)
<br> * changed init-autocmd to BufWinEnter to fix usage of modeline
<br></td>
-</tr>
-<tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=1202">EnhancedCommentify-2.0.tar.gz</a></td>
-    <td class="rowodd" valign="top" nowrap><b>2.0</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2002-09-11</i></td>
+    <td class="roweven" valign="top" width="2000">New features:
<br> * Keybindings may be turned off in the different modes. (eg. no bindings in insert mode)
<br> * Keybindings may be local to the buffer now.
<br> * Keybindings may be turned off in case of an unknown filetype.
<br>
<br>Bugfixes:
<br> * Fixed a problem with UseSyntax. (thanks to Pieter Naaijkens)
<br> * Fixed Ocaml support. (thanks to Zhang Le)</td>
+</tr>
+<tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=2677">EnhancedCommentify-2.1.tar.gz</a></td>
+    <td class="rowodd" valign="top" nowrap><b>2.1</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2004-01-26</i></td>
     <td class="rowodd" valign="top" nowrap>6.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=62">Meikel Brandmeyer</a></i></td>
-    <td class="rowodd" valign="top" width="2000">Version 2.0 is finally out. With a whole bunch of changes. Most important:
<br>The script is now released under BSD license. But this should be no restriction I think.
<br>Bugfixes:
<br> * '&#039' is an invalid expression (thanks to Zak Beck)
<br> * AltOpen/Close set to '' could cause problems (thanks to Ben Kibbey)
<br> * bug in keybinding code (thanks to Charles Campbell)
<br> * trouble with 'C' in cpo (thanks to Luc Hermitte)
<br>New features:
<br> * produces now block comments, eg:
<br>&nbsp;&nbsp;&nbsp;&nbsp;/*int a;
<br>&nbsp;&nbsp;&nbsp;&nbsp;char b;*/
<br> * option to add ident string only at opener
<br> * options may now be set on a per buffer basis.
<br>
<br>I can only recommend (again!) to read the help file for new options and explanations for old ones.
<br>This release contains script und helpfile in a tar.gz.
<br></td>
+    <td class="rowodd" valign="top" width="2000">This is version 2.1 of the EnhancedCommentify Script.
<br>New features:
<br> * one-block commenting for multipart comments
<br> * if possible, use commentstring option in order to determine the comment strings.
<br> * moved autocmd to BufWinEnter in order to fix modeline usage
<br> * experimental parsing of comments option to find out middle string for new one-block feature.
<br>
<br>Bugfixes:
<br> * fixed problems with tabs if align-right option is used
<br> * fixed case sensitive check for overrideEL (thanks to Steve Hall)
<br> * fixed problems with javascript filetype (thanks to Brian Neu)
<br> * changed init-autocmd to BufWinEnter to fix usage of modeline
<br></td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=1202">EnhancedCommentify-2.0.tar.gz</a></td>
+    <td class="roweven" valign="top" nowrap><b>2.0</b></td>
+    <td class="roweven" valign="top" nowrap><i>2002-09-11</i></td>
+    <td class="roweven" valign="top" nowrap>6.0</td>
+    <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=62">Meikel Brandmeyer</a></i></td>
+    <td class="roweven" valign="top" width="2000">Version 2.0 is finally out. With a whole bunch of changes. Most important:
<br>The script is now released under BSD license. But this should be no restriction I think.
<br>Bugfixes:
<br> * '&#039' is an invalid expression (thanks to Zak Beck)
<br> * AltOpen/Close set to '' could cause problems (thanks to Ben Kibbey)
<br> * bug in keybinding code (thanks to Charles Campbell)
<br> * trouble with 'C' in cpo (thanks to Luc Hermitte)
<br>New features:
<br> * produces now block comments, eg:
<br>&nbsp;&nbsp;&nbsp;&nbsp;/*int a;
<br>&nbsp;&nbsp;&nbsp;&nbsp;char b;*/
<br> * option to add ident string only at opener
<br> * options may now be set on a per buffer basis.
<br>
<br>I can only recommend (again!) to read the help file for new options and explanations for old ones.
<br>This release contains script und helpfile in a tar.gz.
<br></td>
 </tr>
 </table>
 <!-- finish off the framework -->
@@ -271,8 +279,7 @@
           </td>
 
     <td align="right" valign="top">
-      	<a href="http://www.webconceptgroup.net"><img src="/images/logo_sponsor_wcg.jpg" width="131" height="30" border="0" alt="Sponsored by Web Concept Group Inc."></a>
-	<a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=8&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
+      		<a href="http://sourceforge.net" rel="nofollow"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=8&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
     </td>
 
     <td><img src="/images/spacer.gif" width="5" height="1" alt=""></td>

Modified: trunk/packages/vim-scripts/plugin/EnhancedCommentify.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/EnhancedCommentify.vim?rev=1243&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/EnhancedCommentify.vim (original)
+++ trunk/packages/vim-scripts/plugin/EnhancedCommentify.vim Tue Apr  8 20:43:24 2008
@@ -1,34 +1,33 @@
 " EnhancedCommentify.vim
 " Maintainer:	Meikel Brandmeyer <Brandels_Mikesh at web.de>
-" Version:	2.2
-" Last Change:	Monday, 27th September 2004
+" Version:	2.3
+" Last Change:	Wednesday, February 20th, 2008
 
 " License:
-" Copyright (c) 2002,2003,2004 Meikel Brandmeyer, Kaiserslautern.
+" Copyright (c) 2008 Meikel Brandmeyer, Frankfurt am Main
 " All rights reserved.
-"
-" Redistribution and use in source and binary forms, with or without
-" modification, are permitted provided that the following conditions are met:
-"
-"   * Redistributions of source code must retain the above copyright notice,
-"     this list of conditions and the following disclaimer.
-"   * Redistributions in binary form must reproduce the above copyright notice,
-"     this list of conditions and the following disclaimer in the documentation
-"     and/or other materials provided with the distribution.
-"   * Neither the name of the author nor the names of its contributors may be
-"     used to endorse or promote products derived from this software without
-"     specific prior written permission.
-"
-" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+" 
+" Redistribution and use in source and binary form are permitted provided
+" that the following conditions are met:
+" 
+" 1. Redistribition of source code must retain the above copyright
+"    notice, this list of conditions and the following disclaimer.
+" 
+" 2. Redistributions in binary form must reproduce the above copyright
+"    notice, this list of conditions and the following disclaimer in the
+"    documentation and/or other materials provided with the distribution.
+" 
+" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS "AS IS" AND
+" ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
 " FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+" SUCH DAMAGE.
 
 " Description: 
 " This is a (well... more or less) simple script to comment lines in a program.
@@ -36,6 +35,11 @@
 " language, python, HTML, Perl, LISP, Tex, Shell, CAOS and others.
 
 " Bugfixes:
+"   2.3
+"   Fixed type 'apacha' -> 'apache' (thanks to Brian Neu)
+"   Fixed nested comment escapes strings. (thanks to Samuel Ferencik)
+"   Fixed broken keyboard mappings when wcm was set to <Tab>.
+"					(thanks to xpatriotx)
 "   2.2
 "   Fixed problem with UseSyntax (thanks to Pieter Naaijkens) 
 "   Fixed typo in ParseCommentsOp (commstr -> commStr). 
@@ -63,6 +67,11 @@
 "   made function silent	     (thanks to Mare Ellen Foster)
 
 " Changelog:
+"   2.3
+"   Added support for viki/deplate (thanks to Thomas Link)
+"   Added support for xslt/xsd/mail (thanks to Stefano Zacchiroli)
+"   Added callback-functionality to enable extensions without the
+"   need of modification directly in the script.
 "   2.2
 "   Added possibility to override the modes, in which keybindings are
 "   defined.
@@ -153,7 +162,7 @@
 	let {a:scriptVar} = a:defaultVal
     endif
 endfunction
-    
+
 "
 " InitStringVariable(confVar, scriptVar, defaultVal)
 "	confVar		-- name of the configuration variable
@@ -407,7 +416,7 @@
 function EnhancedCommentifyInitBuffer()
     if !exists("b:ECdidBufferInit")
 	call s:InitScriptVariables("b")
-	
+
 	if !exists("b:EnhCommentifyFallbackTest")
 	    let b:EnhCommentifyFallbackTest = 0
 	endif
@@ -589,7 +598,7 @@
     let i = a:start
     let len = 0
     let amount = 100000	    " this should be enough ...
-    
+
     while i <= a:end
 	if b:ECuseBlockIndent && getline(i) !~ '^\s*$'
 	    let cur = indent(i)
@@ -611,7 +620,7 @@
 		let len = cur
 	    endif
 	endif
-	
+
 	let i = i + 1
     endwhile
 
@@ -660,7 +669,7 @@
 	    let ft = &ft
 	endif
     endif
-    
+
     " Nothing changed!
     if ft == b:ECsyntax
 	return
@@ -679,6 +688,20 @@
 "
 function s:GetFileTypeSettings(ft)
     let fileType = a:ft
+
+    " If we find nothing appropriate this is the default.
+    let b:ECcommentOpen = ''
+    let b:ECcommentClose = ''
+
+    if exists("g:EnhCommentifyCallbackExists")
+	call EnhCommentifyCallback(fileType)
+
+	" Check whether the callback did yield a result.
+	" If so we use it. The user nows, what he's doing.
+	if b:ECcommentOpen != ''
+	    return
+	endif
+    endif
 
     " I learned about the commentstring option. Let's use it.
     " For now we ignore it, if it is "/*%s*/". This is the
@@ -696,7 +719,7 @@
 		\ 'strace\|xpm\|yacc\)$'
 	let b:ECcommentOpen = '/*'
 	let b:ECcommentClose = '*/'
-    elseif fileType =~ '^\(html\|xml\|dtd\|sgmllnx\)$'
+    elseif fileType =~ '^\(html\|xhtml\|xml\|xslt\|xsd\|dtd\|sgmllnx\)$'
 	let b:ECcommentOpen = '<!--'
 	let b:ECcommentClose = '-->'
     elseif fileType =~ '^\(sgml\|smil\)$'
@@ -749,7 +772,7 @@
 	let b:ECcommentOpen = ';'
 	let b:ECcommentClose = ''
     elseif fileType =~ '^\(python\|perl\|[^w]*sh$\|tcl\|jproperties\|make\|'.
-		\ 'robots\|apacha\|apachestyle\|awk\|bc\|cfg\|cl\|conf\|'.
+		\ 'robots\|apache\|apachestyle\|awk\|bc\|cfg\|cl\|conf\|'.
 		\ 'crontab\|diff\|ecd\|elmfilt\|eterm\|expect\|exports\|'.
 		\ 'fgl\|fvwm\|gdb\|gnuplot\|gtkrc\|hb\|hog\|ia64\|icon\|'.
 		\ 'inittab\|lftp\|lilo\|lout\|lss\|lynx\|maple\|mush\|'.
@@ -771,7 +794,7 @@
 	let b:ECcommentClose = ''
     elseif fileType =~ '^\(tex\|abc\|erlang\|ist\|lprolog\|matlab\|mf\|'.
 		\ 'postscr\|ppd\|prolog\|simula\|slang\|slrnrc\|slrnsc\|'.
-		\ 'texmf\|virata\)$'
+		\ 'texmf\|viki\|virata\)$'
 	let b:ECcommentOpen = '%'
 	let b:ECcommentClose = ''
     elseif fileType =~ '^\(caos\|cterm\|form\|foxpro\|sicad\|snobol4\)$'
@@ -834,8 +857,8 @@
     elseif fileType == 'texinfo'
 	let b:ECcommentOpen = '@c '
 	let b:ECcommentClose = ''
-    else 
-	let b:ECcommentOpen = ''
+    elseif fileType == 'mail'
+	let b:ECcommentOpen = '>'
 	let b:ECcommentClose = ''
     endif
 
@@ -1116,13 +1139,18 @@
 function s:UnEscape(lineString, commentStart, commentEnd)
     let line = a:lineString
 
+    " We translate only the first and the last occurrence
+    " of this resp. escape string. Commenting a line several
+    " times and decommenting it again breaks things.
     if b:ECaltOpen != ''
 	let line = substitute(line, s:EscapeString(b:ECaltOpen),
-		    \ a:commentStart, "g")
+		    \ a:commentStart, "")
     endif
     if b:ECaltClose != ''
-	let line = substitute(line, s:EscapeString(b:ECaltClose),
-		    \ a:commentEnd, "g")
+	let esAltClose = s:EscapeString(b:ECaltClose)
+	let line = substitute(line, esAltClose
+		    \ . "\\(.*" . esAltClose . "\\)\\@!",
+		    \ a:commentEnd, "")
     endif
 
     return line
@@ -1154,7 +1182,7 @@
 	    let line = substitute(line, s:LookFor('commentmiddle'),
 			\ s:SubstituteWith('commentmiddle', a:2), "")
 	endif
-	    
+
 	if !b:ECuseMPBlock || (b:ECuseMPBlock && s:i == s:endBlock)
 	    " Align the closing part to the right.
 	    if b:ECalignRight && s:inBlock
@@ -1170,13 +1198,13 @@
 			\ s:SubstituteWith('commentend', a:1), "")
 	endif
     endif
-    
+
     " insert the comment symbol
     if !b:ECuseMPBlock || a:0 == 0 || (b:ECuseMPBlock && s:i == s:startBlock) 
 	let line = substitute(line, s:LookFor('commentstart'),
 		    \ s:SubstituteWith('commentstart', a:commentSymbol), "")
     endif
-    
+
     return line
 endfunction
 
@@ -1238,7 +1266,7 @@
 function s:GetLineLen(line, offset)
     let len = a:offset
     let i = 0
-    
+
     while a:line[i] != ""
 	if a:line[i] == "\t"
 	    let len = (((len / &tabstop) + 1) * &tabstop)
@@ -1250,7 +1278,7 @@
 
     return len
 endfunction
-     
+
 "
 " EscapeString(string)
 "	string	    -- string to process
@@ -1284,7 +1312,7 @@
     else
 	let handleWhitespace = b:ECsaveWhite
     endif
-	
+
     if a:what == 'checkstart'
 	let regex = '^'. b:ECsaveWhite . s:EscapeString(a:1)
 		    \ . s:EscapeString(b:ECidentFront)
@@ -1337,7 +1365,7 @@
 	let handleWhitespace = b:ECrespectWhite . commentSymbol
 		    \ . b:ECignoreWhite
     endif
-	
+
     if a:what == 'commentstart'
 	let regex = handleWhitespace . b:ECidentFront
 		    \ . b:ECprettyComments
@@ -1467,16 +1495,16 @@
 
 noremap <Plug>VisualComment
 	    \ <Esc>:call EnhancedCommentify('', 'comment',
-	    \				    line("'<"), line("'>"))<CR>
+	    \   line("'<"), line("'>"))<CR>
 noremap <Plug>VisualDeComment
 	    \ <Esc>:call EnhancedCommentify('', 'decomment',
-	    \				    line("'<"), line("'>"))<CR>
+	    \   line("'<"), line("'>"))<CR>
 noremap <Plug>VisualTraditional
 	    \ <Esc>:call EnhancedCommentify('', 'guess',
-	    \				    line("'<"), line("'>"))<CR>
+	    \   line("'<"), line("'>"))<CR>
 noremap <Plug>VisualFirstLine
 	    \ <Esc>:call EnhancedCommentify('', 'first',
-	    \				    line("'<"), line("'>"))<CR>
+	    \   line("'<"), line("'>"))<CR>
 "
 " Finally set keybindings.
 "




More information about the pkg-vim-maintainers mailing list