Re: [Vim-latex-cvs] vimfiles/plugin imaps.vim,1.9.2.4,1.9.2.5
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2002-12-22 02:06:46
|
I think we are needlessly carrying this argument too far. If the text in a file already contains [bg]:PlaceHolder* strings, (such as a french user using the << strings for placeholders as well as for quotations), then the placeholder concept becomes not only useless, it will become positively painful for the end user. It is a very reasonable thing to expect the user to set his placeholder characters to some characters (or combination of characters) which will not appear in the file by themselves except as placeholders. Again, a script writer will _not_ choose the [bg]:PlaceHolder* strings. He will only do something like: > call IMAP('foo', 'bar <++> <<cursor>> <++> <<next>>', '', '<<', '>>') It is upto the user to either have let g:Imap_PlaceHolderStart = '<+' let g:Imap_PlaceHolderEnd = '+>' or to have let g:Imap_PlaceHolderStart = '<<' let g:Imap_PlaceHolderEnd = '>>' or something else in his .vimrc or ftplugin file. If he actually uses the first option, then it is guarenteed that he will soon get very annoyed indeed whether or not we use your idea. Even the cure you have for this only works for the very first time the text is inserted. The big deal about having placeholders is the <C-J> map which takes him to the next point of interest. You have still not answered how your fix will allow the user to skip past the <++> and take him to <+next+>, if he chooses '<+' as the placeholder setting in the above example. I was very happy with the simplifications you made to the IMAP and LookupCharacter functions. Now I fear you are needlessly complicating something for no real advantage at all. Plus, there was code being duplicated between IMAP_PutText... and IMAP_JumpFunc, another thing which you have objected against in other files. On Sat, 21 Dec 2002, Benji Fisher wrote: > We cannot enforce cooperation between the person who writes the > call to IMAP() and the person who inserts the text. If we can get the > intended text inserted when the user types "foo", I think it is worth a > little extra effort. > I dont buy this. We are not really making the user's job any easier at all with this fix. Refer my question about how to figure out that <++> is not a placeholder for the <C-J> map. > Remember: a script writer may make the call to IMAP() (and > another script writer may use different place holders) and we want to > allow the user to pick his or her own values independent of this. We are still doing this, right? All we are assuming is that the user has not chosen some stupid value for the placeholder settings which makes <C-J> confuse parts of his file as being placeholders. > If you want to use > > let marker = '<!--- @#% Start Here @#% ----!>' > > I guess it is OK. I see you used different numbers of - characters, > which helps. It is long enough that it might trigger an unwanted line > break, but maybe we should wait until that problem actually shows up. If What about the @#! character! I am willing to bet that there is not a single text file in the world (except the mails we have exchanged and imaps.vim) which contain these combination of characters! :) > we want to revert to my idea, "<+<++>+>" style, then we would have to > require that the two place holders be different (which seems reasonable > to me). Well, Luc Hermitte uses question marks when he edits latex. That was the first time I thought about making them customizable. So I know at least one person who will not like this restriction on placeholders... In my opinion, it is _much_ more useful now to figure out the encoding problems instead of trying to spending any more time on this. I would also like to simplify packages.vim a little... Fabio Spelta's suggestion about the quotes also sounded good. So hopefully, we can give this little thread a decent burial and move on :) I also would like to implement a feature I have heard emacs auctex.vim has. When the user presses <M-c>, \cite{} is inserted and a list of avaiable citations from the bibtex file is displayed and he can choose one... The same for references etc... In summary, unless there are some real concrete reasons to pursue this, lets worry about this next time someone reports a bug about it. Srinath |