Bug 754801 - Unnecessary patch overrides user settings
Summary: Unnecessary patch overrides user settings
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: rawhide
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-17 19:02 UTC by Kevin Goodsell
Modified: 2012-08-09 09:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-09 09:15:26 UTC
Type: ---


Attachments (Terms of Use)
The problematic patch (317 bytes, patch)
2011-11-17 19:06 UTC, Kevin Goodsell
no flags Details | Diff

Description Kevin Goodsell 2011-11-17 19:02:10 UTC
Description of problem:

The patch vim-6.1-rh3.patch does not appear to serve any useful purpose, and changes settings that the user should have control over. Specifically, because of this patch, any time scripts.vim executes (e.g., when content examination is used to determine the filetype) the settings 'formatoptions', 'cindent', and 'comments' are changed from the user's preference to the values given in the patch.

Version-Release number of selected component (if applicable):

vim-common-7.3.315-1.fc15.i686

:version reports:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 21 2011 09:32:10)
Included patches: 1-315
Modified by <bugzilla>
Compiled by <bugzilla>
Huge version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard 
+cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape 
+dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path 
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap 
+langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse 
+mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte 
+multi_lang -mzscheme +netbeans_intg +path_extra +perl +persistent_undo +postscript +printer +profile +python
 -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline
 -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects 
+title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore 
+wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save 
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim73"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/local/include  -O2 -g -pipe -Wall  -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -D_FORTIFY_SOURCE=1      
Linking: gcc   -L.  -rdynamic -Wl,-export-dynamic  -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib/perl5/CORE   -L/usr/local/lib -Wl,--as-needed -o vim   -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpng12 -lm -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lSM -lICE -lXpm -lXt -lX11 -lSM -lICE -lm -lnsl  -lselinux  -lncurses -lacl -lattr -lgpm -ldl    -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib/perl5/CORE  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   -lruby -lpthread -lrt -ldl -lcrypt -lm    

How reproducible:

Always.

Steps to Reproduce:
1. In ~/.vimrc, add the following settings:

set formatoptions=ro
set cindent
set comments=n:#

2. Create an empty file with no recognizable name or extension:

touch foo

3. Edit the file in vim:

vim foo

4. Verify the filetype is not set:

:set filetype?

If 'foo' happens to be a recognized file in your configuration you can use something different.

5. Check the settings in vim:

:set formatoptions? cindent? comments?
  
Actual results:

The settings in question have been modified and no longer reflect the user's preferences:

  formatoptions=tcql
nocindent
  comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-

Expected results:

The settings should stay as they were given in the user's .vimrc. It's expected that settings may be modified to be appropriate for a particular type of file, as this is the intent of the filetype feature, but in this case 1) the changes apply to many unrelated filetypes and have no apparent usefulness for any of them, and 2) the changes apply even with no recognized filetype.

Additional info:

Commenting out the single line added by the patch gives the expected results. I have to make this change every time Vim gets updated. I use it daily and haven't encountered any problems as a result of making this change.

I'm completely stumped about why this patch exists. Is the intent documented somewhere? Unlike the 'cpo' setting, which has to be set to the vim default to ensure the script is interpreted properly (particularly with regard to line continuation), these settings seem to relate solely to interactive use and have no bearing on the interpretation of the script. It's almost as if someone copied a line from their personal ~/.vimrc. If a user wanted these settings, surely he or she would include them in that file.

Please remove this patch, or provide some reason for its existence so we can discuss ways of addressing the problem while respecting user choices.

Comment 1 Kevin Goodsell 2011-11-17 19:06:37 UTC
Created attachment 534291 [details]
The problematic patch

I'm attaching the problematic patch for reference. Please note that this patch is NOT a proposed fix, even if bugzilla presents it that way.

Comment 2 Corinna Vinschen 2012-07-12 07:44:22 UTC
This problem is still not fixed in Fedora 17.

It's really annoying since it requires to change the scripts.vim
file every time a new vim version is released.

This really needs to be fixed.


Corinna

Comment 3 Corinna Vinschen 2012-07-22 18:10:22 UTC
The patch is also still in rawhide.

I don't know what this patch was supposed to fix, but this is quite
definitely not the right way to fix it.  Please remove it to allow
the user to change the setting in her personal vim settings.


Thanks,
Corinna

Comment 4 Karsten Hopp 2012-08-09 09:15:26 UTC
fixed in vim-7.3.622-2.fc18


Note You need to log in before you can comment on or make changes to this bug.