Hi,

I have not been able to understand why pyclewn.vim resides in vimfiles
root. I suggest to put it into plugin/ so users don't need to source
the file in their vimrc.

Let me know if I overlooked anything or if there are no strong reasons
to change layout.
Thanks.
diff -r d2ceeb2c60e1 MANIFEST.in
--- a/MANIFEST.in       Sat Aug 21 18:42:46 2010 +0200
+++ b/MANIFEST.in       Mon Aug 23 20:45:19 2010 +0100
@@ -3,7 +3,7 @@
 include COPYING
 include INSTALL
 include MANIFEST.in
-include runtime/pyclewn.vim
+include runtime/plugin/pyclewn.vim
 include runtime/.pyclewn_keys.*
 include runtime/doc/pyclewn.txt
 include runtime/syntax/dbgvar.vim
diff -r d2ceeb2c60e1 clewn/vim.py
--- a/clewn/vim.py      Sat Aug 21 18:42:46 2010 +0200
+++ b/clewn/vim.py      Mon Aug 23 20:45:19 2010 +0100
@@ -195,7 +195,7 @@
                 'echo v:version > 702 || v:version == 702 && has("patch253")',
                 'echo v:version > 702 || v:version == 702 && has("patch334")',
                 'echo v:version',
-                'runtime pyclewn.vim',
+                'runtime plugin/pyclewn.vim',
                 'if exists("g:pyclewn_version")'
                     ' | echo g:pyclewn_version'
                     ' | endif',
@@ -237,8 +237,6 @@
         info('sourcing the Vim script file: %s', self.f_script.name)
         args[:0] = [self.f_script.name]
         args[:0] = ['-S']
-        args[:0] = ['runtime pyclewn.vim']
-        args[:0] = ['-c']
         if not self.options.vim_args \
                 or not                  \
                 [a for a in self.options.vim_args if a.startswith('-nb')]:
diff -r d2ceeb2c60e1 pyclewn_install.py
--- a/pyclewn_install.py        Sat Aug 21 18:42:46 2010 +0200
+++ b/pyclewn_install.py        Mon Aug 23 20:45:19 2010 +0100
@@ -139,7 +139,7 @@
     # remove vim files and rebuild vim help
     unlink(pathjoin(pathjoin(vimdir(), 'doc'), 'pyclewn.txt'))
     unlink(pathjoin(pathjoin(vimdir(), 'syntax'), 'dbgvar.vim'))
-    unlink(pathjoin(vimdir(), 'pyclewn.vim'))
+    unlink(pathjoin(pathjoin(vimdir(), 'plugin'), 'pyclewn.vim'))
     build_vimhelp()
 
 if __name__ == '__main__':
diff -r d2ceeb2c60e1 runtime/autoload/pyclewn.vim
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/autoload/pyclewn.vim      Mon Aug 23 20:45:19 2010 +0100
@@ -0,0 +1,127 @@
+" pyclewn run time file
+" Maintainer:   <xdegaye at users dot sourceforge dot net>
+"
+" Configure VIM to be used with pyclewn and netbeans
+"
+if exists("s:did_pyclewn")
+    finish
+endif
+let s:did_pyclewn = 1
+
+" The following variables define how pyclewn is started when
+" the ':Pyclewn' vim command is run.
+" They may be changed to match your preferences.
+
+let s:pgm = "pyclewn"
+
+if exists("pyclewn_args")
+  let s:args = pyclewn_args
+else
+  let s:args = "--gdb= --pgm=gdb --args= --window=top --maxlines=10000"
+endif
+
+if exists("pyclewn_connection")
+  let s:connection = pyclewn_connection
+else
+  let s:connection = "localhost:3219:changeme"
+endif
+
+" Uncomment the following line to print full traces in a file named 'logfile'
+" for debugging purpose.
+" let s:args .= " --level=nbdebug --file=logfile"
+
+" enable balloon_eval
+if has("balloon_eval")
+    set ballooneval
+    set balloondelay=100
+endif
+
+" The 'Pyclewn' command starts pyclewn and vim netbeans interface.
+let s:fixed = "--daemon --editor= --netbeans=" . s:connection . " --cargs="
+
+" Start pyclewn and vim netbeans interface.
+function s:start()
+    if !exists(":nbstart")
+        throw "Error: the ':nbstart' vim command does not exist."
+    endif
+    if has("netbeans_enabled")
+        throw "Error: netbeans is already enabled and connected."
+    endif
+    if !executable(s:pgm)
+        throw "Error: '" . s:pgm . "' cannot be found or is not an executable."
+    endif
+
+    " the pyclewn generated vim script is sourced only once
+    if exists("s:tmpfile")
+        let s:tmpfile = ""
+    else
+        let s:tmpfile = tempname()
+    endif
+
+    " remove console and dbgvar buffers from previous session
+    if bufexists("(clewn)_console")
+        bwipeout (clewn)_console
+    endif
+    if bufexists("(clewn)_dbgvar")
+        bwipeout (clewn)_dbgvar
+    endif
+
+    " start pyclewn and netbeans
+    call s:info("Starting pyclewn, please wait...\n")
+    exe "silent !" . s:pgm . " " . s:args . " " . s:fixed . s:tmpfile . " &"
+    call s:info("'pyclewn' has been started.\n")
+    call s:info("Running nbstart, <C-C> to interrupt.\n")
+    " allow pyclewn to start its dispatch loop, otherwise we will have to
+    " wait 5 seconds for the second connection attempt by vim
+    sleep 500m
+    exe "nbstart :" . s:connection
+
+    " source vim script
+    if has("netbeans_enabled")
+        if s:tmpfile != ""
+            if !filereadable(s:tmpfile)
+                unlet s:tmpfile
+                throw "Error: pyclewn failed to start."
+            endif
+            exe "source " . s:tmpfile
+        endif
+        call s:info("The netbeans socket is connected.\n")
+    else
+        throw "Error: the netbeans socket could not be connected."
+    endif
+endfunction
+
+echoerr "SOURCING"
+
+function pyclewn#StartClewn()
+    try
+        call s:start()
+    catch /.*/
+        if exists("s:tmpfile") && s:tmpfile != ""
+            unlet s:tmpfile
+        endif
+        call s:info("The 'Pyclewn' command has been aborted.\n")
+        call s:error(v:exception)
+        " vim console screen is garbled, redraw the screen
+        if !has("gui_running")
+            redraw!
+        endif
+        " clear the command line
+        echo "\n"
+    endtry
+endfunction
+
+function s:info(msg)
+    echohl WarningMsg
+    echo a:msg
+    echohl None
+endfunction
+
+function s:error(msg)
+    echohl ErrorMsg
+    echo a:msg
+    call inputsave()
+    call input("Press the <Enter> key to continue.")
+    call inputrestore()
+    echohl None
+endfunction
diff -r d2ceeb2c60e1 runtime/doc/pyclewn.txt
--- a/runtime/doc/pyclewn.txt   Sat Aug 21 18:42:46 2010 +0200
+++ b/runtime/doc/pyclewn.txt   Mon Aug 23 20:45:19 2010 +0100
@@ -294,20 +294,12 @@
 
 Configuration:
 --------------
-First, source the pyclewn script to enable the|:Pyclewn|command: >
 
-    :runtime pyclewn.vim
+|:Pyclewn| command is provided by plugin/pyclewn.vim.
 
-To avoid entering this command each time vim is started, add it to
-your|.vimrc|.
-
-To customize the way pyclewn is started by vim, you may change the variables
-at the beginning of pyclewn.vim. For example assuming that pyclewn has been
-downloaded to /tmp, modify /tmp/pyclewn-n.n/runtime/pyclewn.vim and source
-the modified script with the command: >
-
-    :source /tmp/pyclewn-n.n/runtime/pyclewn.vim
-
+Command-line arguments and connection details might be set with pyclewn_args
+and pyclewn_connection variables. For further customization you can edit
+autoload/pyclewn.vim file.
 
 Running pyclewn:
 ----------------
diff -r d2ceeb2c60e1 runtime/plugin/pyclewn.vim
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/plugin/pyclewn.vim        Mon Aug 23 20:45:19 2010 +0100
@@ -0,0 +1,11 @@
+" pyclewn run time file
+" Maintainer:   <xdegaye at users dot sourceforge dot net>
+"
+" Configure VIM to be used with pyclewn and netbeans
+"
+
+" pyclewn version
+let g:pyclewn_version = "pyclewn-1.3"
+
+" The 'Pyclewn' command starts pyclewn and vim netbeans interface.
+command -nargs=0 Pyclewn call pyclewn#StartClewn()
diff -r d2ceeb2c60e1 runtime/pyclewn.vim
--- a/runtime/pyclewn.vim       Sat Aug 21 18:42:46 2010 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-" pyclewn run time file
-" Maintainer:   <xdegaye at users dot sourceforge dot net>
-"
-" Configure VIM to be used with pyclewn and netbeans
-"
-
-" The following variables define how pyclewn is started when
-" the ':Pyclewn' vim command is run.
-" They may be changed to match your preferences.
-let s:pgm = "pyclewn"
-let s:args = "--gdb= --pgm=gdb --args= --window=top --maxlines=10000"
-let s:connection = "localhost:3219:changeme"
-" Uncomment the following line to print full traces in a file named 'logfile'
-" for debugging purpose.
-" let s:args .= " --level=nbdebug --file=logfile"
-
-if exists("s:did_pyclewn")
-    finish
-endif
-let s:did_pyclewn = 1
-
-" pyclewn version
-let g:pyclewn_version = "pyclewn-1.3"
-
-" enable balloon_eval
-if has("balloon_eval")
-    set ballooneval
-    set balloondelay=100
-endif
-
-" The 'Pyclewn' command starts pyclewn and vim netbeans interface.
-command -nargs=0 Pyclewn call s:startclewn()
-let s:fixed = "--daemon --editor= --netbeans=" . s:connection . " --cargs="
-
-" Start pyclewn and vim netbeans interface.
-function s:start()
-    if !exists(":nbstart")
-        throw "Error: the ':nbstart' vim command does not exist."
-    endif
-    if has("netbeans_enabled")
-        throw "Error: netbeans is already enabled and connected."
-    endif
-    if !executable(s:pgm)
-        throw "Error: '" . s:pgm . "' cannot be found or is not an executable."
-    endif
-
-    " the pyclewn generated vim script is sourced only once
-    if exists("s:tmpfile")
-        let s:tmpfile = ""
-    else
-        let s:tmpfile = tempname()
-    endif
-
-    " remove console and dbgvar buffers from previous session
-    if bufexists("(clewn)_console")
-        bwipeout (clewn)_console
-    endif
-    if bufexists("(clewn)_dbgvar")
-        bwipeout (clewn)_dbgvar
-    endif
-
-    " start pyclewn and netbeans
-    call s:info("Starting pyclewn, please wait...\n")
-    exe "silent !" . s:pgm . " " . s:args . " " . s:fixed . s:tmpfile . " &"
-    call s:info("'pyclewn' has been started.\n")
-    call s:info("Running nbstart, <C-C> to interrupt.\n")
-    " allow pyclewn to start its dispatch loop, otherwise we will have to
-    " wait 5 seconds for the second connection attempt by vim
-    sleep 500m
-    exe "nbstart :" . s:connection
-
-    " source vim script
-    if has("netbeans_enabled")
-        if s:tmpfile != ""
-            if !filereadable(s:tmpfile)
-                unlet s:tmpfile
-                throw "Error: pyclewn failed to start."
-            endif
-            exe "source " . s:tmpfile
-        endif
-        call s:info("The netbeans socket is connected.\n")
-    else
-        throw "Error: the netbeans socket could not be connected."
-    endif
-endfunction
-
-function s:startclewn()
-    try
-        call s:start()
-    catch /.*/
-        if exists("s:tmpfile") && s:tmpfile != ""
-            unlet s:tmpfile
-        endif
-        call s:info("The 'Pyclewn' command has been aborted.\n")
-        call s:error(v:exception)
-        " vim console screen is garbled, redraw the screen
-        if !has("gui_running")
-            redraw!
-        endif
-        " clear the command line
-        echo "\n"
-    endtry
-endfunction
-
-function s:info(msg)
-    echohl WarningMsg
-    echo a:msg
-    echohl None
-endfunction
-
-function s:error(msg)
-    echohl ErrorMsg
-    echo a:msg
-    call inputsave()
-    call input("Press the <Enter> key to continue.")
-    call inputrestore()
-    echohl None
-endfunction
diff -r d2ceeb2c60e1 setup.py
--- a/setup.py  Sat Aug 21 18:42:46 2010 +0200
+++ b/setup.py  Mon Aug 23 20:45:19 2010 +0100
@@ -43,7 +43,7 @@
 
 DEBUGGERS = ('simple', 'gdb')
 DATA_FILES = [
-    (vimdir, ['runtime/pyclewn.vim']),
+    (pathjoin(vimdir, 'plugin'), ['runtime/pyclewn.vim']),
     (pathjoin(vimdir, 'doc'), ['runtime/doc/pyclewn.txt']),
     (pathjoin(vimdir, 'macros'),
         [('runtime/.pyclewn_keys.%s' % d) for d in DEBUGGERS]),
@@ -123,7 +123,7 @@
 class sdist(_sdist):
     """Specialized sdister."""
     def run(self):
-        update_version('runtime/pyclewn.vim')
+        update_version('runtime/plugin/pyclewn.vim')
         update_version('INSTALL')
         keymap_files()
         _sdist.run(self)
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Pyclewn-general mailing list
Pyclewn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyclewn-general

Reply via email to