Loading ...
Sorry, an error occurred while loading the content.

Re: svn syntax with localization?

Expand Messages
  • Dmitry Vasiliev
    ... Why exactly do you want to change the regexp? If I recall correctly it was simplified precisely because the delimiter text was changed. Probably it can be
    Message 1 of 16 , Jul 19, 2013
    • 0 Attachment
      On 07/18/2013 08:15 PM, studog wrote:
      > I checked the source code for svn 1.8.0 and the delimiter is exactly
      > --This line, and those below, will be ignored-- or its localized
      > form.
      >
      > I'd like to update the regex so it's accurate, but I'd need to handle
      > all the languages. Is it possible to support localization within a
      > syntax file? A quick look at :he :syn didn't reveal anything.

      Why exactly do you want to change the regexp? If I recall correctly it
      was simplified precisely because the delimiter text was changed.
      Probably it can be changed to something like ^--[^-]\+--$ but I really
      don't think that all the possible delimiter texts that SVN have ever had
      should be added.

      --
      Dmitry Vasiliev <dima at hlabs.org>
      http://hlabs.org
      http://twitter.com/hdima

      --
      --
      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • studog
      ... It s not accurate. ... I think that s exactly what should happen. I saw in passing just now that the diff syntax file is doing the same thing. ...Stu -- --
      Message 2 of 16 , Jul 22, 2013
      • 0 Attachment
        On Friday, July 19, 2013 6:14:18 PM UTC-4, Dmitry Vasiliev wrote:
        > On 07/18/2013 08:15 PM, studog wrote:
        > > I'd like to update the regex so it's accurate,

        > Why exactly do you want to change the regexp?

        It's not accurate.

        > If I recall correctly it
        > was simplified precisely because the delimiter text was changed.
        > Probably it can be changed to something like ^--[^-]\+--$ but I really
        > don't think that all the possible delimiter texts that SVN have ever had
        > should be added.

        I think that's exactly what should happen. I saw in passing just now that the diff syntax file is doing the same thing.

        ...Stu

        --
        --
        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 vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Dmitry Vasiliev
        ... I think accuracy is not the right reason for changing the code which have no complaints for 7 years. Especially when this change will make maintenance
        Message 3 of 16 , Jul 25, 2013
        • 0 Attachment
          On Tuesday, July 23, 2013 8:16:39 AM UTC+2, studog wrote:
          > On Friday, July 19, 2013 6:14:18 PM UTC-4, Dmitry Vasiliev wrote:
          > > On 07/18/2013 08:15 PM, studog wrote:
          > > > I'd like to update the regex so it's accurate,
          >
          > > Why exactly do you want to change the regexp?
          >
          > It's not accurate.

          I think accuracy is not the right reason for changing the code which have no complaints for 7 years. Especially when this change will make maintenance harder. So if accuracy is the only reason it's better to not touch this code.

          > > If I recall correctly it
          > > was simplified precisely because the delimiter text was changed.
          > > Probably it can be changed to something like ^--[^-]\+--$ but I really
          > > don't think that all the possible delimiter texts that SVN have ever had
          > > should be added.
          >
          > I think that's exactly what should happen. I saw in passing just now that the diff syntax file is doing the same thing.

          I don't think diff.vim is the correct comparison. In the diff output there are no any special formats for information messages so all the needed messages should be added as patterns. But in version control systems there are almost always some special formats for commit descriptions. For example for Svn there's "--A Message--" delimiter and Git uses # to comment out all unrelated to the commit message text.

          --
          Dmitry Vasiliev

          --
          --
          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 vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • studog
          ... I often quote the original log message when merging, usually by doing ... which is incorrectly highlighted by the existing svn.vim. So... it s wrong. I d
          Message 4 of 16 , Jul 25, 2013
          • 0 Attachment
            On Thursday, July 25, 2013 5:15:05 PM UTC-4, Dmitry Vasiliev wrote:
            > I think accuracy is not the right reason for changing the code which have no complaints for 7 years. Especially when this change will make maintenance harder. So if accuracy is the only reason it's better to not touch this code.

            I often quote the original log message when merging, usually by doing
            --- Start here ---
            --- End ---
            which is incorrectly highlighted by the existing svn.vim.

            So... it's wrong. I'd like it to be right.

            > I don't think diff.vim is the correct comparison. In the diff output there are no any special formats for information messages so all the needed messages should be added as patterns.

            Which is exactly the same situation as svn. There are no special formats for the delimiter message, so all the needed messages should be added as patterns.

            I cloned your repository, updated the svn.vim syntax file, and have been running it for a few days. It works great. Patch attached.

            I added all the translations svn-1.8.0 is currently using; there's one language they haven't gotten the delimiter translated for yet. Maintenance will consist of trawling the older svn sources for other delimiter messages, and then adding an update now and again when svn adds an update. I don't think it's going to be very often at all.

            ...Stu

            --
            --
            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 vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • studog
            ... Of course it does, because the pattern is wrong. See my other reply just now. ... It s not that much effort, and I ll do it. Because the wrong line
            Message 5 of 16 , Jul 25, 2013
            • 0 Attachment
              On Friday, July 19, 2013 9:59:38 AM UTC-4, Bram Moolenaar wrote:
              > Does the pattern actually match in the wrong place?

              Of course it does, because the pattern is wrong. See my other reply just now.

              > Translations will change over time, so the syntax file gets outdated.
              > It's only worth the effort if we actually need to match the text to
              > avoid highlighting the wrong line.

              It's not that much effort, and I'll do it. Because the wrong line highlights for me every time I do a merge.

              Look at it from another angle: the top part of the svn-commit.tmp file is user input. The highlighting must be accurate to be useful; to show the user when they've accidentally typed in the delimiter causing svn to truncate their log message. I had to take a chance to see if I was right or wrong about whether my log message would truncate.

              ...Stu

              --
              --
              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 vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Dmitry Vasiliev
              ... BTW, can you send it as a pull request? ... There are some encoding errors in your patch - some of the characters just replaced with ? . And actually I
              Message 6 of 16 , Jul 29, 2013
              • 0 Attachment
                On Friday, July 26, 2013 5:11:56 AM UTC+2, studog wrote:
                > I cloned your repository, updated the svn.vim syntax file, and have been running it for a few days. It works great. Patch attached.

                BTW, can you send it as a pull request?

                > I added all the translations svn-1.8.0 is currently using; there's one language they haven't gotten the delimiter translated for yet. Maintenance will consist of trawling the older svn sources for other delimiter messages, and then adding an update now and again when svn adds an update. I don't think it's going to be very often at all.

                There are some encoding errors in your patch - some of the characters just replaced with '?'.

                And actually I still think that it can be done in a simpler way. For example by searching for the last '^--.*--$' line in the file.

                --
                Dmitry Vasiliev

                --
                --
                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 vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • studog
                ... Not at the moment; the git respository is in a VM on my laptop which isn t usually publically available. I ll look at setting up on github. Also, I am
                Message 7 of 16 , Jul 29, 2013
                • 0 Attachment
                  On Monday, July 29, 2013 7:55:47 AM UTC-4, Dmitry Vasiliev wrote:
                  > BTW, can you send it as a pull request?

                  Not at the moment; the git respository is in a VM on my laptop which isn't usually publically available. I'll look at setting up on github.

                  Also, I am waiting until I've pulled all the translations from the svn source. I'm though the 0.x.x releases so far.

                  But yes, I'll send a PR when the time comes. I did a patch just now so I could get a result out quickly, people could see exactly what I was talking about, and Bram likes patches.

                  > There are some encoding errors in your patch - some of the characters just replaced with '?'.

                  That's... odd. I attached the patch file instead of cutting and pasting to avoid encoding issues.

                  > And actually I still think that it can be done in a simpler way. For example by searching for the last '^--.*--$' line in the file.

                  That is an interesting idea. It does make the file somewhat easier to maintain again, but, it's still wrong. I'll have to double check the svn source, but I think they are matching the first instance of the exact string they expect. So the double-dash regex would have to match the first instance of double-dashes, which would still highlight my log messages incorrectly.

                  I really don't think doing the correct matching is much work. All the 0.x.x releases have had only the one english string, which is still the same string in the current release. I expect I'll find that the translations were added once, and have used the same strings all the way though. (Which means my patch would be the finished result.)

                  The only work thereafter would be pulling in the new translations as they occur, which I can do.

                  ...Stu

                  --
                  --
                  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 vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                Your message has been successfully submitted and would be delivered to recipients shortly.