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

Bug with (or without) 'Z' in cpoptions writing to read-only file

Expand Messages
  • Linda W
    This used to work, but stopped about 18 months ago, I think. Now, I ve both with Z and without in cpoptions, but notice when I write a file with w! , the
    Message 1 of 4 , Jun 14, 2013
      This used to work, but stopped about 18 months ago, I think.

      Now, I've both with 'Z' and without in cpoptions, but
      notice when I write a file with "w!", the read-only flag
      is still being reset to it's initial state.

      Has anyone else noticed this? It's very annoying.

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Linda W
      ... I have figured out at least one place that causes this.. It seems that some .vim scripts ignore the options in cpo and install &vim options while the
      Message 2 of 4 , Jun 14, 2013
        Linda W wrote:
        > This used to work, but stopped about 18 months ago, I think.
        >
        > Now, I've both with 'Z' and without in cpoptions, but
        > notice when I write a file with "w!", the read-only flag
        > is still being reset to it's initial state.
        I have figured out at least one place that causes this..

        It seems that some .vim scripts ignore the options in cpo
        and install '&vim' options while the file is being
        saved, then restore cpo after the fact so it looks like
        the cpo options have no effect.

        I don't think it would be affecting my usage, but an example of this
        is in "menu.vim"...
        Several places, the purpose is to make sure the "<" and "C" flags
        are not included in cpoptions...
        But that's not what the code does -- it resets them to some arbitrary state.

        To remove those flags, one would use
        cpo-="<C"
        (as far as I know)....

        Trouble is, with examples like that in the official Vim code, there's no
        telling where else it might be a problem.

        though I noticed signs that I've edited out those problem areas before
        (but had my changes overwritten on a subsequent update.




        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Linda W
        ... Actually, I guess one can tell how many places it is broken: ./autoload/getscript.vim:30:set cpo&vim ./autoload/getscript.vim:183: set ei=all hls&vim
        Message 3 of 4 , Jun 14, 2013
          Linda W wrote:
          > Trouble is, with examples like that in the official Vim code, there's no
          > telling where else it might be a problem.
          ---
          Actually, I guess one can tell how many places it is broken:

          ./autoload/getscript.vim:30:set cpo&vim
          ./autoload/getscript.vim:183: set ei=all hls&vim noacd
          ./autoload/netrw.vim:45:setlocal cpo&vim
          ./autoload/netrwFileHandlers.vim:31:set cpo&vim
          ./autoload/tar.vim:33:set cpo&vim
          ./autoload/vimball.vim:25:set cpo&vim
          ./autoload/zip.vim:30:set cpo&vim
          ./compiler/ant.vim:16:set cpo&vim
          ./compiler/perl.vim:16:set cpo&vim
          ./compiler/xmlwf.vim:12:set cpo&vim
          ./doc/tags:2688::set-&vim options.txt /*:set-&vim*
          ./doc/usr_41.txt:1695: 12 set cpo&vim
          ./doc/usr_41.txt:1913: 12 set cpo&vim
          ./doc/options.txt:47: *:set-default* *:set-&*
          *:set-&vi* *:set-&vim*
          ./doc/options.txt:51::se[t] {option}&vim Reset option to its Vim
          default value. {not in Vi}
          ./doc/version6.txt:1831:- ":set opt&vi" sets an option to its Vi
          default, ":set opt&vim" to its Vim
          ./filetype.vim:14:set cpo&vim
          ./ftplugin/a2ps.vim:12:set cpo&vim
          ./ftplugin/abaqus.vim:14:set cpoptions&vim
          ./ftplugin/m4.vim:12:set cpo&vim
          ./ftplugin/alsaconf.vim:12:set cpo&vim
          ./ftplugin/mailaliases.vim:11:set cpo&vim
          ./ftplugin/mailcap.vim:12:set cpo&vim
          ./ftplugin/arch.vim:12:set cpo&vim
          ./ftplugin/manconf.vim:12:set cpo&vim
          ./ftplugin/automake.vim:11:set cpo&vim
          ./ftplugin/bdf.vim:12:set cpo&vim
          ./ftplugin/mf.vim:12:set cpo&vim
          ./ftplugin/modconf.vim:12:set cpo&vim
          ./ftplugin/mp.vim:12:set cpo&vim
          ./ftplugin/calendar.vim:12:set cpo&vim
          ./ftplugin/help.vim:12:set cpo&vim
          ./ftplugin/cdrdaoconf.vim:11:set cpo&vim
          ./ftplugin/mplayerconf.vim:12:set cpo&vim
          ./ftplugin/haskell.vim:12:set cpo&vim
          ./ftplugin/changelog.vim:38: set cpo&vim
          ./ftplugin/changelog.vim:245: set cpo&vim
          ./ftplugin/cobol.vim:16:set cpo&vim
          ./ftplugin/conf.vim:12:set cpo&vim
          ./ftplugin/muttrc.vim:12:set cpo&vim
          ./ftplugin/nanorc.vim:12:set cpo&vim
          ./ftplugin/context.vim:12:set cpo&vim
          ./ftplugin/netrc.vim:12:set cpo&vim
          ./ftplugin/nsis.vim:7:set cpo&vim
          ./ftplugin/crm.vim:12:set cpo&vim
          ./ftplugin/pamconf.vim:12:set cpo&vim
          ./ftplugin/css.vim:12:set cpo&vim
          ./ftplugin/passwd.vim:12:set cpo&vim
          ./ftplugin/cvsrc.vim:12:set cpo&vim
          ./ftplugin/hostconf.vim:11:set cpo&vim
          ./ftplugin/hostsaccess.vim:12:set cpo&vim
          ./ftplugin/denyhosts.vim:11:set cpo&vim
          ./ftplugin/dictconf.vim:12:set cpo&vim
          ./ftplugin/ld.vim:12:set cpo&vim
          ./ftplugin/dictdconf.vim:12:set cpo&vim
          ./ftplugin/lftp.vim:12:set cpo&vim
          ./ftplugin/dircolors.vim:12:set cpo&vim
          ./ftplugin/dosini.vim:12:set cpo&vim
          ./ftplugin/pinfo.vim:12:set cpo&vim
          ./ftplugin/plaintex.vim:17:set cpo&vim
          ./ftplugin/elinks.vim:12:set cpo&vim
          ./ftplugin/procmail.vim:12:set cpo&vim
          ./ftplugin/prolog.vim:12:set cpo&vim
          ./ftplugin/eterm.vim:12:set cpo&vim
          ./ftplugin/libao.vim:12:set cpo&vim
          ./ftplugin/fetchmail.vim:12:set cpo&vim
          ./ftplugin/protocols.vim:12:set cpo&vim
          ./ftplugin/limits.vim:12:set cpo&vim
          ./ftplugin/framescript.vim:7:set cpo&vim
          ./ftplugin/loginaccess.vim:12:set cpo&vim
          ./ftplugin/quake.vim:12:set cpo&vim
          ./ftplugin/gpg.vim:12:set cpo&vim
          ./ftplugin/racc.vim:12:set cpo&vim
          ./ftplugin/group.vim:12:set cpo&vim
          ./ftplugin/readline.vim:12:set cpo&vim
          ./ftplugin/grub.vim:12:set cpo&vim
          ./ftplugin/rnc.vim:12:set cpo&vim
          ./ftplugin/indent.vim:12:set cpo&vim
          ./ftplugin/rst.vim:12:set cpo&vim
          ./ftplugin/initex.vim:17:set cpo&vim
          ./ftplugin/ruby.vim:21:set cpo&vim
          ./ftplugin/logindefs.vim:12:set cpo&vim
          ./ftplugin/screen.vim:12:set cpo&vim
          ./ftplugin/kconfig.vim:11:set cpo&vim
          ./ftplugin/setserial.vim:12:set cpo&vim
          ./ftplugin/sensors.vim:12:set cpo&vim
          ./ftplugin/services.vim:12:set cpo&vim
          ./ftplugin/sieve.vim:12:set cpo&vim
          ./ftplugin/slpconf.vim:12:set cpo&vim
          ./ftplugin/slpreg.vim:12:set cpo&vim
          ./ftplugin/slpspi.vim:12:set cpo&vim
          ./ftplugin/sshconfig.vim:12:set cpo&vim
          ./ftplugin/sudoers.vim:12:set cpo&vim
          ./ftplugin/sysctl.vim:12:set cpo&vim
          ./ftplugin/terminfo.vim:12:set cpo&vim
          ./ftplugin/tex.vim:18:set cpo&vim
          ./ftplugin/udevconf.vim:12:set cpo&vim
          ./ftplugin/udevperm.vim:12:set cpo&vim
          ./ftplugin/udevrules.vim:12:set cpo&vim
          ./ftplugin/updatedb.vim:12:set cpo&vim
          ./ftplugin/vb.vim:21:set cpo&vim
          ./ftplugin/verilog.vim:17:set cpo&vim
          ./ftplugin/xdefaults.vim:12:set cpo&vim
          ./ftplugin/xf86conf.vim:12:set cpo&vim
          ./ftplugin/xinetd.vim:12:set cpo&vim
          ./ftplugin/xmodmap.vim:12:set cpo&vim
          ./ftplugin/yaml.vim:12:set cpo&vim
          ./ftplugin/zsh.vim:12:set cpo&vim
          ./indent/dtd.vim:7:set cpo&vim
          ./indent/sh.vim:22:set cpo&vim
          ./indent/ruby.vim:31:set cpo&vim
          ./macros/matchit.vim:48:set cpo&vim
          ./optwin.vim:23:set cpo&vim
          ./optwin.vim:1291:set cpo&vim
          ./plugin/getscriptPlugin.vim:24:set cpo&vim
          ./plugin/netrwPlugin.vim:29:set cpo&vim
          ./plugin/tarPlugin.vim:19:set cpo&vim
          ./plugin/vimballPlugin.vim:21:set cpo&vim
          ./plugin/zipPlugin.vim:25:set cpo&vim
          ./scripts.vim:27:set cpo&vim
          ./syntax/a2ps.vim:11:set cpo&vim
          ./syntax/context.vim:14:set cpo&vim
          ./syntax/aap.vim:12:set cpo&vim
          ./syntax/crm.vim:11:set cpo&vim
          ./syntax/cs.vim:17:set cpo&vim
          ./syntax/alsaconf.vim:11:set cpo&vim
          ./syntax/ant.vim:14:set cpo&vim
          ./syntax/cvsrc.vim:11:set cpo&vim
          ./syntax/arch.vim:11:set cpo&vim
          ./syntax/autohotkey.vim:11:set cpo&vim
          ./syntax/denyhosts.vim:11:set cpo&vim
          ./syntax/dictconf.vim:11:set cpo&vim
          ./syntax/dictdconf.vim:11:set cpo&vim
          ./syntax/dircolors.vim:11:set cpo&vim
          ./syntax/bdf.vim:11:set cpo&vim
          ./syntax/doxygen.vim:55: set cpo&vim
          ./syntax/calendar.vim:11:set cpo&vim
          ./syntax/dtd.vim:25: set cpo&vim
          ./syntax/cdrdaoconf.vim:11:set cpo&vim
          ./syntax/cdrtoc.vim:11:set cpo&vim
          ./syntax/chordpro.vim:13:set cpo&vim
          ./syntax/elinks.vim:11:set cpo&vim
          ./syntax/cmusrc.vim:10:set cpo&vim
          ./syntax/eterm.vim:11:set cpo&vim
          ./syntax/fetchmail.vim:11:set cpo&vim
          ./syntax/framescript.vim:11:set cpo&vim
          ./syntax/gpg.vim:11:set cpo&vim
          ./syntax/group.vim:11:set cpo&vim
          ./syntax/grub.vim:11:set cpo&vim
          ./syntax/hostconf.vim:11:set cpo&vim
          ./syntax/indent.vim:16:set cpo&vim
          ./syntax/initex.vim:11:set cpo&vim
          ./syntax/kconfig.vim:10:set cpo&vim
          ./syntax/ld.vim:11:set cpo&vim
          ./syntax/ldapconf.vim:11:set cpo&vim
          ./syntax/lftp.vim:11:set cpo&vim
          ./syntax/libao.vim:11:set cpo&vim
          ./syntax/limits.vim:11:set cpo&vim
          ./syntax/litestep.vim:11:set cpo&vim
          ./syntax/loginaccess.vim:11:set cpo&vim
          ./syntax/logindefs.vim:11:set cpo&vim
          ./syntax/lynx.vim:14:set cpo&vim
          ./syntax/mailaliases.vim:11:set cpo&vim
          ./syntax/manconf.vim:11:set cpo&vim
          ./syntax/messages.vim:12:set cpo&vim
          ./syntax/modconf.vim:13:set cpo&vim
          ./syntax/mplayerconf.vim:11:set cpo&vim
          ./syntax/nanorc.vim:11:set cpo&vim
          ./syntax/netrc.vim:11:set cpo&vim
          ./syntax/pamconf.vim:12:set cpo&vim
          ./syntax/passwd.vim:11:set cpo&vim
          ./syntax/pinfo.vim:11:set cpo&vim
          ./syntax/plaintex.vim:11:set cpo&vim
          ./syntax/privoxy.vim:14:set cpo&vim
          ./syntax/protocols.vim:11:set cpo&vim
          ./syntax/quake.vim:15:set cpo&vim
          ./syntax/racc.vim:11:set cpo&vim
          ./syntax/readline.vim:13:set cpo&vim
          ./syntax/rnc.vim:11:set cpo&vim
          ./syntax/rst.vim:11:set cpo&vim
          ./syntax/screen.vim:11:set cpo&vim
          ./syntax/sensors.vim:11:set cpo&vim
          ./syntax/services.vim:11:set cpo&vim
          ./syntax/setserial.vim:11:set cpo&vim
          ./syntax/sgml.vim:17:set cpo&vim
          ./syntax/sieve.vim:11:set cpo&vim
          ./syntax/slpconf.vim:11:set cpo&vim
          ./syntax/slpreg.vim:11:set cpo&vim
          ./syntax/slpspi.vim:11:set cpo&vim
          ./syntax/sudoers.vim:11:set cpo&vim
          ./syntax/synload.vim:26:set cpo&vim
          ./syntax/sysctl.vim:11:set cpo&vim
          ./syntax/tcsh.vim:20:set cpo&vim " Line continuation is used
          ./syntax/terminfo.vim:11:set cpo&vim
          ./syntax/udevconf.vim:11:set cpo&vim
          ./syntax/udevperm.vim:11:set cpo&vim
          ./syntax/udevrules.vim:11:set cpo&vim
          ./syntax/updatedb.vim:11:set cpo&vim
          ./syntax/wsh.vim:17:set cpo&vim
          ./syntax/xbl.vim:11:set cpo&vim
          ./syntax/xinetd.vim:11:set cpo&vim
          ./syntax/xml.vim:48:set cpo&vim
          ./syntax/xmodmap.vim:11:set cpo&vim
          ./syntax/yaml.vim:11:set cpo&vim
          ./syntax/zsh.vim:11:set cpo&vim
          ./syntax/group.vim.orig:11:set cpo&vim
          ./mswin.vim:15:set cpo&vim
          ./synmenu.vim:33:set cpo&vim
          ./menu.vim:13:set cpo&vim
          ./menu.vim:656: set cpo&vim
          ./menu.vim:743: set cpo&vim
          ./menu.vim:918: set cpo&vim

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Bram Moolenaar
          ... Good point. However, for most plugins it s fine to reset cpo , since they only setup mappings, highlighting, etc. And for these it s a lot easier to
          Message 4 of 4 , Jun 15, 2013
            Linda W wrote:

            > > This used to work, but stopped about 18 months ago, I think.
            > >
            > > Now, I've both with 'Z' and without in cpoptions, but
            > > notice when I write a file with "w!", the read-only flag
            > > is still being reset to it's initial state.
            > I have figured out at least one place that causes this..
            >
            > It seems that some .vim scripts ignore the options in cpo
            > and install '&vim' options while the file is being
            > saved, then restore cpo after the fact so it looks like
            > the cpo options have no effect.
            >
            > I don't think it would be affecting my usage, but an example of this
            > is in "menu.vim"...
            > Several places, the purpose is to make sure the "<" and "C" flags
            > are not included in cpoptions...
            > But that's not what the code does -- it resets them to some arbitrary state.
            >
            > To remove those flags, one would use
            > cpo-="<C"
            > (as far as I know)....
            >
            > Trouble is, with examples like that in the official Vim code, there's no
            > telling where else it might be a problem.
            >
            > though I noticed signs that I've edited out those problem areas before
            > (but had my changes overwritten on a subsequent update.

            Good point. However, for most plugins it's fine to reset 'cpo', since
            they only setup mappings, highlighting, etc. And for these it's a lot
            easier to just switch to a "sane state".

            Unfortunately this means we have to pinpoint individual plugins to find
            out what's wrong.

            --
            Your mouse has moved. Windows must be restarted for the change
            to take effect. Reboot now?

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ an exciting new programming language -- http://www.Zimbu.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

            --
            --
            You received this message from the "vim_use" 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_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+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.