> Well, I have covered all my code with
> 
>      if has('python')
>      endif
> 
> so I hoped that it should be harmless for anybody without Python 
> support. Seriously, what could get wrong?

I see

    except ImportError:
        pass

. This definitely means that if `rpm` python package is not installed *and* 
user has python support then both of the following statements are true:

1. Function s:GetRelVer does not give any error messages.
2. Yet it does nothing.

Not sure whether this behavior is fine.


There is also a possible error:

> +    specfile = vim.current.buffer.name
> +    spec = rpm.spec(specfile)

. How rpm.spec() behaves if specfile is None? This is unlikely because `None` 
means buffer with no file name (which means to get this ftplugin loaded one 
needs to explicitly do `:set filetype=spec` or `:filetype spec`) and not saved 
to disk, but possible.


Also from this patch I see that you are using `ver` and `rel` in a function 
*different* from s:GetRelVer. But I do not see you adding any assignments for 
`ver` and `rel`. In fact you assign them in s:GetRelVer, but this function 
returns nothing. Do you expect vim or python magically propagate these 
variables to a separate scope? They will not. In fact new function is not 
different from

    function s:GetRelVer()
        if has('python')
            " Pretend we are doing some computations here
            sleep 10m
        endif
    endfunction

. From the file I see that these variables are assigned earlier (thus you do 
not get any errors), but obviously as you do not add reassignments in the patch 
their value does not change.


That means in the current state the only actual change is 

diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim
index 9778e1c..e70bc71 100644
--- a/runtime/ftplugin/spec.vim
+++ b/runtime/ftplugin/spec.vim 
@@ -82,7 +109,7 @@ if !exists("*s:SpecChangelog")
                         endif
                 endif
                 if (chgline != -1)
-                        let parsed_format = "* ".strftime(format)
+                        let parsed_format = "* ".strftime(format)." - 
".ver."-".rel
                         let release_info = "+ ".name."-".ver."-".rel
                         let wrong_format = 0
                         let wrong_release = 0 

. I am not an rpm spec writer thus cannot estimate whether this change has any 
value, but one does not need 28 insertions as a substitute for one.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui