Thread: [Vim-latex-cvs] vimfiles/plugin imaps.vim,1.9.2.4,1.9.2.5
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2002-12-19 11:44:58
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv7443 Modified Files: Tag: b-newimaps imaps.vim Log Message: Comments on the last version: " Break text up into "initial <+template+> final"; any piece may be empty. let initial = substitute(text, pattern, '\1', '') let template = substitute(text, pattern, '\2', '') let final = substitute(text, pattern, '\3', '') This assumes that there is only a single <+template+> in the text. Afterwards: let final = substitute(final, startpat, escape(phs, '\'), 'g') let final = substitute(final, endpat, escape(phe, '\'), 'g') This will fail when the user uses something like: call Imap_PutTextWithMovement('bar?desc?', '?', '?') with g:Imap_Place..Start = '<+' != g:Imap_Place...End i.e when phs and phe are the same, but the [bg]:Imap_Place* settings arent. Also, I dont think let marker = phs . phs . phe . phe is a "rare" enough string. As in the previous example, this could simply be ????. We do _not_ want to accidentally delete stuff from the user's files. let marker = '<!--- @#% Start Here @#% ----!>' This sounds safer. Ofcourse, we could always make a search and be sure, but I am willing to bet that this string will never happen on purpose in some file. Changes this time: 1. Cleaned up the IMAP_PutTextWithMovement() function. This function now calls the IMAP_Jumpfunc() function instead of trying to do the same thing. 2. IMAP_Jumpfunc(): After suggestions from LH, implemented the option of . not deleting empty placeholders. . going up and down. (<C-J> and <C-K>) . option of not deleting the placeholder while moving. TODO: . command to insert placeholder at current position . command to erase all placeholders. I am going to follow up this commit with another big one renaming all the old Tex_IMAP()s to IMAP()s... After that, it is time to merge this branch into the main trunk and get working on a next release version and also solving the encoding problem once and for all... Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.9.2.4 retrieving revision 1.9.2.5 diff -C2 -d -r1.9.2.4 -r1.9.2.5 *** imaps.vim 18 Dec 2002 16:36:19 -0000 1.9.2.4 --- imaps.vim 19 Dec 2002 11:44:55 -0000 1.9.2.5 *************** *** 8,12 **** " while preserving filetype indentation. " ! " Last Change: Wed Dec 18 11:00 AM 2002 EST " " Documentation: {{{ --- 8,12 ---- " while preserving filetype indentation. " ! " Last Change: Thu Dec 19 03:00 AM 2002 PST " " Documentation: {{{ *************** *** 49,53 **** " form: " ! " call Tex_IMAP (lhs, rhs, ft) " " Some characters in the RHS have special meaning which help in cursor --- 49,53 ---- " form: " ! " call IMAP (lhs, rhs, ft) " " Some characters in the RHS have special meaning which help in cursor *************** *** 56,60 **** " Example One: " ! " call Tex_IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. --- 56,60 ---- " Example One: " ! " call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. *************** *** 83,87 **** " Example Two: " You can use the <C-r> command to insert dynamic elements such as dates. ! " call Tex_IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') " " sets up the map for date` to insert the current date. --- 83,87 ---- " Example Two: " You can use the <C-r> command to insert dynamic elements such as dates. ! " call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') " " sets up the map for date` to insert the current date. *************** *** 91,94 **** --- 91,96 ---- " '----%<----' above and below the visually selected range of lines. The " length of the string is chosen to be equal to the longest line in the range. + " Recommended Usage: + " '<,'>Snip "--------------------------------------%<-------------------------------------- " }}} *************** *** 110,114 **** " IMAP: Adds a "fake" insert mode mapping. {{{ " For example, doing ! " Tex_IMAP('abc', 'def' ft) " will mean that if the letters abc are pressed in insert mode, then " they will be replaced by def. If ft != '', then the "mapping" will be --- 112,116 ---- " IMAP: Adds a "fake" insert mode mapping. {{{ " For example, doing ! " IMAP('abc', 'def' ft) " will mean that if the letters abc are pressed in insert mode, then " they will be replaced by def. If ft != '', then the "mapping" will be *************** *** 223,309 **** function! IMAP_PutTextWithMovement(str, ...) ! " Find the place holders for the input. if a:0 < 2 let phs = '<+' let phe = '+>' else ! let phs = a:1 ! let phe = a:2 endif - let startpat = escape(phs, '\') - let endpat = escape(phe, '\') - " A very rare string: - let marker = phs . phs . phe . phe - " TODO: Maybe I need to play some games with iconv() to define marker and - " markerpat in case marker !~ marker ... let text = a:str - " If the user does not want to use place-holders, then remove them. - if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders - " a heavy-handed way to just use the first placeholder and remove the - " rest. Replace the first template with phe ... - let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, endpat, '') - " ... delete all the others ... - let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, '', 'g') - " ... and replace the first phe with phs.phe . - let text = substitute(text, '\V'.endpat, startpat.endpat, '') - endif - let pattern = '\V\(\.\{-}\)' .startpat. '\(\.\{-}\)' .endpat. '\(\.\*\)' " If there are no place holders, just return the text. ! if text !~ pattern return text endif - " Break text up into "initial <+template+> final"; any piece may be empty. - let initial = substitute(text, pattern, '\1', '') - let template = substitute(text, pattern, '\2', '') - let final = substitute(text, pattern, '\3', '') ! " Now, get the place holders for the output. ! let phs = s:PlaceHolderStart() " default <+ ! let phe = s:PlaceHolderEnd() " default +> ! let template = phs . template . phe ! let final = substitute(final, startpat, escape(phs, '\'), 'g') ! let final = substitute(final, endpat, escape(phe, '\'), 'g') ! " Now, start building the return value. ! let text = initial . marker . template . marker . final ! " Return to Normal mode: this works even if 'insertmode' is set: ! let text = text . "\<C-\>\<C-N>" ! " Move to the first marker and delete it. Cursor ends on beginning of ! " template. ! let text = text . "2?" . marker . "\<CR>" . "v/" . marker . "/e\<CR>x" ! " Enter Visual mode and move to just before the next marker. ! let text = text . "v/" . marker . "/s-1\<CR>\<C-\>\<C-N>" ! " Move to the second marker and delete it. ! let text = text . "/" . marker . "\<CR>" . "d/" . marker . "/e\<CR>" ! " Note: We use a search strategy instead of computing the length of the ! " template because strlen() returns different things depending on the ! " encoding. ! " Clean up the search history. Restore Visual selection. ! let text = text . ":" . s:RemoveLastHistoryItem . "\<CR>gv" ! " Finally, append commands to Select <+template+> or replace <++> . ! if template == phs . phe " template looks like <++> so Change it: ! let text = text . "c" ! else " Enter Select mode. ! let text = text . "\<C-G>" endif ! return text ! endfunction ! " Tex_PutTextWithMovement: old version of IMAP_PutTextWithMovement ! " Description: ! " This function is supplied to maintain backward compatibility. ! " This function is only for use in latex-suite. ! function! Tex_PutTextWithMovement(text) ! ! let phs = s:PlaceHolderStart() ! let phe = s:PlaceHolderEnd() ! let newText = substitute(a:text, '<+', phs, 'g') ! let newText = substitute(newText, '+>', phe, 'g') ! return IMAP_PutTextWithMovement(newText) ! endfunction " }}} --- 225,298 ---- function! IMAP_PutTextWithMovement(str, ...) ! " The placeholders used in the particular input string. These can be ! " different from what the user wants to use. if a:0 < 2 let phs = '<+' let phe = '+>' else ! let phs = escape(a:1, '\') ! let phe = escape(a:2, '\') endif let text = a:str " If there are no place holders, just return the text. ! if text !~ '\V'.phs.'\{-}'.phe return text endif ! " The user's placeholder settings. ! let phsUser = s:PlaceHolderStart() ! let pheUser = s:PlaceHolderEnd() ! " A very rare string: Do not use any special characters here. This is used ! " for moving to the beginning of the inserted text ! let marker = '<!--- @#% Start Here @#% ----!>' ! let markerLength = strlen(marker) ! ! " If the user does not want to use place-holders, then remove all but the ! " first placeholder ! if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders ! " a heavy-handed way to just use the first placeholder and remove the ! " rest. Replace the first placeholder with phe ... ! let text = substitute(text, '\V'.phs.'\.\{-}'.phe, phe, '') ! " ... delete all the others ... ! let text = substitute(text, '\V'.phs.'\.\{-}'.phe, '', 'g') ! " ... and replace the first phe with phsUser.pheUser . ! let text = substitute(text, '\V'.phe, phsUser.pheUser, '') endif ! " now replace all occurences of the placeholders here with the users choice ! " of placeholder settings. ! " NOTE: There can be more than 1 placeholders here. Therefore use a global ! " search and replace. ! let text = substitute(text, '\V'.phs.'\(\.\{-}\)'.phe, phsUser.'\1'.pheUser, 'g') ! " Now append the marker (the rare string) to the beginning of the text so ! " we know where the expansion started from ! let text = marker.text ! " This search will move us to the very beginning of the text to be ! " inserted. ! " The steps are: ! " 1. enter escape mode (using <C-\><C-n> so it works in insertmode as ! " well) ! " 2. Search backward for marker text. ! " 3. delete from the beginning to the end of marker into the blackhole ! " register. ! let movement = "\<C-\>\<C-N>" ! \ . "?\\V".marker."\<CR>" ! \ . '"_d/\V'.marker."/e\<CR>" ! " Now enter insert mode and call IMAP_Jumpfunc() to take us to the next ! " placeholder and get us either into visual or insert mode. Since we do ! " at least one search in this function, remove it from the search history ! " first. ! " NOTE: Even if we performed more than one search, vim will only put one ! " of them in the user's search list. ! let movement = movement.':'.s:RemoveLastHistoryItem."\<CR>" ! \ . "i\<C-r>=IMAP_Jumpfunc('', 1)\<CR>" ! ! return text.movement ! endfunction " }}} *************** *** 311,340 **** " Author: Luc Hermitte " ! function! IMAP_Jumpfunc() ! let phs = escape(s:PlaceHolderStart(), '\') ! let phe = escape(s:PlaceHolderEnd(), '\') ! if !search(phs.'.\{-}' . phe, 'W') "no more marks ! return "" else ! if strpart(getline('.'), col('.') + strlen(phs) - 1) ! \ =~ '^' . phe - return substitute(phs . phe, '.', "\<Del>", 'g') - else - if col('.') > 1 - return "\<Esc>lv/\\V" . phe . "/e\<CR>\<C-g>" - else - return "\<C-\>\<C-n>v/\\V" . phe . "/e\<CR>\<C-g>" - endif - endif endif endfunction " map only if there is no mapping already. allows for user customization. if !hasmapto('IMAP_Jumpfunc') ! inoremap <C-J> <c-r>=IMAP_Jumpfunc()<CR> nmap <C-J> i<C-J> end " }}} --- 300,383 ---- " Author: Luc Hermitte " ! function! IMAP_Jumpfunc(direction, inclusive) ! let g:Imap_DeleteEmptyPlaceHolders = 0 ! " The user's placeholder settings. ! let phsUser = s:PlaceHolderStart() ! let pheUser = s:PlaceHolderEnd() ! ! let searchOpts = a:direction ! " If the user has nowrapscan set, then do not make the search wrap around ! " the end (or beginning) of the file. ! if ! &wrapscan ! let searchOpts = direction.'W' ! endif ! ! let searchString = '' ! " If this is not an inclusive search or if it is inclusive, but the ! " current cursor position does not contain a placeholder character, then ! " search for the placeholder characters. ! if !a:inclusive || strpart(getline('.'), col('.')-1) !~ '\V^'.phsUser ! let searchString = '\V'.phsUser.'\.\{-}'.pheUser ! endif ! ! " If we didn't find any placeholders return quietly. ! if searchString != '' && !search(searchString, searchOpts) ! return '' ! endif ! ! " At this point, we are at the beginning of a placeholder. ! " Remember the position here. ! let position = line('.') . "normal! ".virtcol('.').'|' ! " Open any closed folds and make this part of the text visible. ! silent! foldopen! ! ! " Calculate if we have an empty placeholder or if it contains some ! " description. ! let template = ! \ matchstr(strpart(getline('.'), col('.')-1), ! \ '\V\^'.phsUser.'\zs\.\{-}\ze'.pheUser) ! let placeHolderEmpty = !strlen(template) ! ! " This movement command selects the placeholder text. In the forward mode, ! " we select left-right, otherwise right-left. ! if a:direction =~ 'b' ! " If we are going in the backward direction, make the selection from ! " right to left so that a backward search for phsUser doesnt get us ! " back to the same placeholder. ! let movement = "\<C-\>\<C-N>:".position."\<CR>" ! \ . "/\\V".pheUser."/e\<CR>" ! \ . "v?\\V".phsUser."?b\<CR>" else ! let movement = "\<C-\>\<C-N>:".position."\<CR>v/\\V".pheUser."/e\<CR>" ! endif ! ! if placeHolderEmpty && g:Imap_DeleteEmptyPlaceHolders ! " delete the empty placeholder into the blackhole. ! return movement."\"_c\<C-o>:".s:RemoveLastHistoryItem."\<CR>" ! ! else ! return movement."\<C-\>\<C-N>:".s:RemoveLastHistoryItem."\<CR>gv\<C-g>" endif + endfunction + " }}} + " Maps for IMAP_Jumpfunc {{{ " map only if there is no mapping already. allows for user customization. if !hasmapto('IMAP_Jumpfunc') ! inoremap <C-J> <c-r>=IMAP_Jumpfunc('', 0)<CR> ! inoremap <C-K> <c-r>=IMAP_Jumpfunc('b', 0)<CR> nmap <C-J> i<C-J> + nmap <C-K> i<C-K> + if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders + vmap <C-J> <C-\><C-N>i<C-J> + vmap <C-K> <C-\><C-N>i<C-K> + else + vmap <C-J> <Del>i<C-J> + vmap <C-K> <Del>i<C-K> + endif end " }}} |
From: Benji F. <be...@me...> - 2002-12-19 12:35:26
|
sri...@us... wrote: > Update of /cvsroot/vim-latex/vimfiles/plugin > In directory sc8-pr-cvs1:/tmp/cvs-serv7443 > > Modified Files: > Tag: b-newimaps > imaps.vim > Log Message: > Comments on the last version: > > " Break text up into "initial <+template+> final"; any piece may be empty. > let initial = substitute(text, pattern, '\1', '') > let template = substitute(text, pattern, '\2', '') > let final = substitute(text, pattern, '\3', '') > > This assumes that there is only a single <+template+> in the text. Why do you say that? The cursor should be placed on template; all the place holders in final will be replaced. > Afterwards: > > let final = substitute(final, startpat, escape(phs, '\'), 'g') > let final = substitute(final, endpat, escape(phe, '\'), 'g') > > This will fail when the user uses something like: > > call Imap_PutTextWithMovement('bar?desc?', '?', '?') > with g:Imap_Place..Start = '<+' != g:Imap_Place...End > i.e when phs and phe are the same, but the [bg]:Imap_Place* settings arent. Yes, that should be fixed. I would fix it with let final = substitute(final, '\V'.startpat.'\(\.\{-}\)'.endpat, \ escape(phs, '\') . '\1' . escape(phe, '\'), 'g') I do not like your solution. Part of the reason for these new, optional arguments is that the following should work: :call IMAP("foo", "bar <++> <<cursor>> <++> <<next>>", "", "<<", ">>") I think your method breaks this. > Also, I dont think > > let marker = phs . phs . phe . phe > > is a "rare" enough string. As in the previous example, this could simply be > ????. We do _not_ want to accidentally delete stuff from the user's files. > > let marker = '<!--- @#% Start Here @#% ----!>' > > This sounds safer. Ofcourse, we could always make a search and be sure, but > I am willing to bet that this string will never happen on purpose in some > file. We only have to worry about the marker appearing in the text inserted by IMAP_PutTextWithMovement(). Can you think of an example where my marker is still there after the substitute() commands? > > Changes this time: > > 1. Cleaned up the IMAP_PutTextWithMovement() function. This function now > calls the IMAP_Jumpfunc() function instead of trying to do the same > thing. That sounds like an improvement. > 2. IMAP_Jumpfunc(): After suggestions from LH, implemented the option of > . not deleting empty placeholders. > . going up and down. (<C-J> and <C-K>) > . option of not deleting the placeholder while moving. > > TODO: > . command to insert placeholder at current position > . command to erase all placeholders. > > I am going to follow up this commit with another big one renaming all the > old Tex_IMAP()s to IMAP()s... After that, it is time to merge this branch > into the main trunk and get working on a next release version and also > solving the encoding problem once and for all... You forgot to mention testing. --Benji |
From: Srinath A. <sr...@fa...> - 2002-12-20 09:17:00
|
On Thu, 19 Dec 2002, Benji Fisher wrote: > sri...@us... wrote: > > Update of /cvsroot/vim-latex/vimfiles/plugin > > In directory sc8-pr-cvs1:/tmp/cvs-serv7443 > > > > Modified Files: > > Tag: b-newimaps > > imaps.vim > > Log Message: > > Comments on the last version: > > > > " Break text up into "initial <+template+> final"; any piece may be empty. > > let initial = substitute(text, pattern, '\1', '') > > let template = substitute(text, pattern, '\2', '') > > let final = substitute(text, pattern, '\3', '') > > > > This assumes that there is only a single <+template+> in the text. > > Why do you say that? The cursor should be placed on template; all > the place holders in final will be replaced. What I didnt quite understand was why you treated the first placeholder seperately from the rest? Why not simply do let text = substitute(text, '\V'.phs.'\(\.\{-}\)'.phe, phsUser.'\1'.pheUser, 'g') where phs and phe are the arguments supplied to IMAP_PutTextWithMovement and phsUser and pheUser are the user's [bg]:PlaceHolder settings. (which is what was done in 1.9.2.5) In 1.9.2.4, it was done as: " Break text up into "initial <+template+> final"; any piece may be empty. let initial = substitute(text, pattern, '\1', '') let template = substitute(text, pattern, '\2', '') let final = substitute(text, pattern, '\3', '') " Now, get the place holders for the output. let phs = s:PlaceHolderStart() " default <+ let phe = s:PlaceHolderEnd() " default +> let template = phs . template . phe let final = substitute(final, startpat, escape(phs, '\'), 'g') let final = substitute(final, endpat, escape(phe, '\'), 'g') " Now, start building the return value. let text = initial . marker . template . marker . final All of this code seems to do effectively what that one substitute should be doing. (Note, I am not trying to save lines, using one substitute also seems to be clearer logically). Or is there something I am missing? > let final = substitute(final, '\V'.startpat.'\(\.\{-}\)'.endpat, > \ escape(phs, '\') . '\1' . escape(phe, '\'), 'g') Precisely what I do in the latest version! escape(phs, '\') is phsUser and so on... > I do not like your solution. Part of the reason for these new, optional > arguments is that the following should work: > > :call IMAP("foo", "bar <++> <<cursor>> <++> <<next>>", "", "<<", ">>") > > I think your method breaks this. > This does work in the latest version! Okay, I'll admit there was still a bug, but it was not a big deal... I originally had: " If there are no place holders, just return the text. if text !~ '\V'.phs.'\{-}'.phe return text endif The test statement should actually be: (I will be commiting this bug fix now). if text !~ '\V'.phs.'\.\{-}'.phe But with this fix, the example you give works just fine for me. I _do_ use the optional arguments in the latest version too... Never ignored them. In the example above, after pressing foo, I end up with bar | <+cursor+> <++> <+next+> with the cursor shown at | if g:Imap_PlaceHolder's are left at default values. If they are changed to something like '?' and '?', then I get bar <++> ?cursor? <++> ?next? with ?cursor? highlighted in select mode. Did your version do something different? I just checked and at least for the example you mention it seems to work the same... > > This sounds safer. Ofcourse, we could always make a search and be sure, but > > I am willing to bet that this string will never happen on purpose in some > > file. > > We only have to worry about the marker appearing in the text > inserted by IMAP_PutTextWithMovement(). Can you think of an example > where my marker is still there after the substitute() commands? > Note that we could have let g:Imap_PlaceHolderStart = '?' let g:Imap_PlaceHolderEnd = '?' call IMAP('foo', 'bar ?template? and 2 empty templates: ???? bar', '', '?', '?') Then when we search backward from the end, we will not land at the beginning... Ofcourse, this is an improbable scenario, but why take the chance? > > into the main trunk and get working on a next release version and also > > solving the encoding problem once and for all... > > You forgot to mention testing. Absolutely. But I am wondering how to apply patches to the other parts of the suite which need a stable interface to IMAP() and IMAP_PutTextWithMovement(). I agree that we can take time testing on the branch, but its somewhat essential to at least fix on a good prototype. The internals can be optimized without hurrying... Srinath |
From: Srinath A. <sr...@fa...> - 2002-12-20 10:11:18
|
This has to be the single most useless thing I have done all of today. But you might have a little fun looking at it anyway. The following is a chart of the "comment percentage" in the various files of latex-suite. Overall, approximately 70% of our files are actual vim code, the rest being comments or empty lines... which actually doesn't look high enough... If you take out all the package files and the dictionaries and stuff then the percentage comes to something like 60%. I feel _really_ guilty having spent time on this. but heck. I just finished with my semester... But no more of such timepass! :) Srinath compiler/tex.vim :---------------------+ (0.43) ftplugin/latex-suite/bibtex.vim :---------------------------------------------+ (0.89) ftplugin/latex-suite/compiler.vim :-----------------------------+ (0.57) ftplugin/latex-suite/custommacros.vim :---------------------------------+ (0.66) ftplugin/latex-suite/diacritics.vim :--------------------------------------------+ (0.87) ftplugin/latex-suite/dictionaries/dictionary :--------------------------------------------------+ (1) ftplugin/latex-suite/dictionaries/SIunits :--------------------------------------------------+ (1) ftplugin/latex-suite/elementmacros.vim :-------------------------------------+ (0.73) ftplugin/latex-suite/envmacros.vim :------------------------------------+ (0.72) ftplugin/latex-suite/folding.vim :---------------------+ (0.42) ftplugin/latex-suite/macros/example :--------------------------------------------------+ (1) ftplugin/latex-suite/main.vim :--------------------------------+ (0.64) ftplugin/latex-suite/mathmacros.vim :---------------------------------------------+ (0.9) ftplugin/latex-suite/packages/accents :-------------------------------------------+ (0.87) ftplugin/latex-suite/packages/amsmath :-------------------------------------------------+ (0.98) ftplugin/latex-suite/packages/amsthm :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/amsxtra :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/bar :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/caption2 :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/changebar :------------------------------------------------+ (0.96) ftplugin/latex-suite/packages/chapterbib :--------------------------------------------+ (0.89) ftplugin/latex-suite/packages/cite :---------------------------------------------+ (0.91) ftplugin/latex-suite/packages/color :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/drftcite :---------------------------------------------+ (0.9) ftplugin/latex-suite/packages/eqlist :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/eqparbox :---------------------------------+ (0.67) ftplugin/latex-suite/packages/exmpl :------------+ (0.24) ftplugin/latex-suite/packages/float :------------------------------------+ (0.73) ftplugin/latex-suite/packages/footmisc :-----------------------------------------+ (0.81) ftplugin/latex-suite/packages/geometry :-------------------------------------------------+ (0.98) ftplugin/latex-suite/packages/graphicx :------------------------------------------------+ (0.95) ftplugin/latex-suite/packages/harpoon :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/hhline :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/hyperref :-------------------------------------------------+ (0.98) ftplugin/latex-suite/packages/ifthen :-----------------------------------------+ (0.81) ftplugin/latex-suite/packages/inputenc :------------------------------------------------+ (0.95) ftplugin/latex-suite/packages/lineno :-----------------------------------------------+ (0.95) ftplugin/latex-suite/packages/longtable :------------------------------------------------+ (0.96) ftplugin/latex-suite/packages/manyfoot :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/moreverbatim :--------------------------------------+ (0.76) ftplugin/latex-suite/packages/multicol :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/newalg :-----------------------------------------------+ (0.95) ftplugin/latex-suite/packages/outliner :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/overcite :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/parallel :--------------------------------------------+ (0.88) ftplugin/latex-suite/packages/polski :--------------------------------+ (0.64) ftplugin/latex-suite/packages/schedule :----------------------------------------+ (0.8) ftplugin/latex-suite/packages/SIunits :--------------------------------------------------+ (0.99) ftplugin/latex-suite/packages/tipa :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/ulem :----------------------------------------------+ (0.93) ftplugin/latex-suite/packages.vim :------------------------------------------+ (0.84) ftplugin/latex-suite/templates.vim :-------------------------------+ (0.62) ftplugin/latex-suite/texmenuconf.vim :-----------------------------------+ (0.7) ftplugin/latex-suite/texrc :---------+ (0.19) ftplugin/latex-suite/wizardfuncs.vim :------------------------------------------+ (0.84) ftplugin/tex/brackets.vim :----------------------+ (0.44) ftplugin/tex/smartspace.vim :-------------------------------+ (0.61) ftplugin/tex.vim :-------------------------+ (0.5) ftplugin/tex_latexSuite.vim :---------------------+ (0.42) indent/tex.vim :------------------+ (0.36) latextags :---------------------------------------------+ (0.91) ltags :--------------------------------------------+ (0.88) makefile :--------------------------------------------+ (0.87) plugin/imaps.vim :---------------------+ (0.42) plugin/libList.vim :-----------------+ (0.34) plugin/SyntaxFolds.vim :-------------------------+ (0.49) lines: 272 codelines: 116 compiler/tex.vim lines: 270 codelines: 241 ftplugin/latex-suite/bibtex.vim lines: 410 codelines: 234 ftplugin/latex-suite/compiler.vim lines: 137 codelines: 91 ftplugin/latex-suite/custommacros.vim lines: 125 codelines: 109 ftplugin/latex-suite/diacritics.vim lines: 677 codelines: 677 ftplugin/latex-suite/dictionaries/dictionary lines: 289 codelines: 289 ftplugin/latex-suite/dictionaries/SIunits lines: 339 codelines: 248 ftplugin/latex-suite/elementmacros.vim lines: 833 codelines: 598 ftplugin/latex-suite/envmacros.vim lines: 250 codelines: 105 ftplugin/latex-suite/folding.vim lines: 11 codelines: 11 ftplugin/latex-suite/macros/example lines: 501 codelines: 320 ftplugin/latex-suite/main.vim lines: 695 codelines: 624 ftplugin/latex-suite/mathmacros.vim lines: 23 codelines: 20 ftplugin/latex-suite/packages/accents lines: 98 codelines: 96 ftplugin/latex-suite/packages/amsmath lines: 13 codelines: 13 ftplugin/latex-suite/packages/amsthm lines: 4 codelines: 4 ftplugin/latex-suite/packages/amsxtra lines: 19 codelines: 19 ftplugin/latex-suite/packages/bar lines: 38 codelines: 35 ftplugin/latex-suite/packages/caption2 lines: 28 codelines: 27 ftplugin/latex-suite/packages/changebar lines: 18 codelines: 16 ftplugin/latex-suite/packages/chapterbib lines: 22 codelines: 20 ftplugin/latex-suite/packages/cite lines: 38 codelines: 35 ftplugin/latex-suite/packages/color lines: 21 codelines: 19 ftplugin/latex-suite/packages/drftcite lines: 12 codelines: 11 ftplugin/latex-suite/packages/eqlist lines: 6 codelines: 4 ftplugin/latex-suite/packages/eqparbox lines: 50 codelines: 12 ftplugin/latex-suite/packages/exmpl lines: 11 codelines: 8 ftplugin/latex-suite/packages/float lines: 16 codelines: 13 ftplugin/latex-suite/packages/footmisc lines: 87 codelines: 85 ftplugin/latex-suite/packages/geometry lines: 64 codelines: 61 ftplugin/latex-suite/packages/graphicx lines: 10 codelines: 10 ftplugin/latex-suite/packages/harpoon lines: 13 codelines: 13 ftplugin/latex-suite/packages/hhline lines: 163 codelines: 159 ftplugin/latex-suite/packages/hyperref lines: 16 codelines: 13 ftplugin/latex-suite/packages/ifthen lines: 22 codelines: 21 ftplugin/latex-suite/packages/inputenc lines: 55 codelines: 52 ftplugin/latex-suite/packages/lineno lines: 28 codelines: 27 ftplugin/latex-suite/packages/longtable lines: 6 codelines: 6 ftplugin/latex-suite/packages/manyfoot lines: 21 codelines: 16 ftplugin/latex-suite/packages/moreverbatim lines: 13 codelines: 13 ftplugin/latex-suite/packages/multicol lines: 19 codelines: 18 ftplugin/latex-suite/packages/newalg lines: 12 codelines: 11 ftplugin/latex-suite/packages/outliner lines: 24 codelines: 22 ftplugin/latex-suite/packages/overcite lines: 8 codelines: 7 ftplugin/latex-suite/packages/parallel lines: 154 codelines: 99 ftplugin/latex-suite/packages/polski lines: 15 codelines: 12 ftplugin/latex-suite/packages/schedule lines: 310 codelines: 307 ftplugin/latex-suite/packages/SIunits lines: 357 codelines: 356 ftplugin/latex-suite/packages/tipa lines: 14 codelines: 13 ftplugin/latex-suite/packages/ulem lines: 396 codelines: 334 ftplugin/latex-suite/packages.vim lines: 8 codelines: 8 ftplugin/latex-suite/templates/article.tex lines: 8 codelines: 8 ftplugin/latex-suite/templates/report.tex lines: 8 codelines: 8 ftplugin/latex-suite/templates/report_two_column.tex lines: 92 codelines: 57 ftplugin/latex-suite/templates.vim lines: 129 codelines: 90 ftplugin/latex-suite/texmenuconf.vim lines: 465 codelines: 88 ftplugin/latex-suite/texrc lines: 203 codelines: 171 ftplugin/latex-suite/wizardfuncs.vim lines: 151 codelines: 66 ftplugin/tex/brackets.vim lines: 95 codelines: 58 ftplugin/tex/smartspace.vim lines: 4 codelines: 2 ftplugin/tex.vim lines: 12 codelines: 5 ftplugin/tex_latexSuite.vim lines: 135 codelines: 48 indent/tex.vim lines: 11 codelines: 10 latextags lines: 78 codelines: 69 ltags lines: 87 codelines: 76 makefile lines: 596 codelines: 253 plugin/imaps.vim lines: 249 codelines: 84 plugin/libList.vim lines: 323 codelines: 159 plugin/SyntaxFolds.vim compiler/tex.vim :---------------------+ (0.43) ftplugin/latex-suite/bibtex.vim :---------------------------------------------+ (0.89) ftplugin/latex-suite/compiler.vim :-----------------------------+ (0.57) ftplugin/latex-suite/custommacros.vim :---------------------------------+ (0.66) ftplugin/latex-suite/diacritics.vim :--------------------------------------------+ (0.87) ftplugin/latex-suite/dictionaries/dictionary :--------------------------------------------------+ (1) ftplugin/latex-suite/dictionaries/SIunits :--------------------------------------------------+ (1) ftplugin/latex-suite/elementmacros.vim :-------------------------------------+ (0.73) ftplugin/latex-suite/envmacros.vim :------------------------------------+ (0.72) ftplugin/latex-suite/folding.vim :---------------------+ (0.42) ftplugin/latex-suite/macros/example :--------------------------------------------------+ (1) ftplugin/latex-suite/main.vim :--------------------------------+ (0.64) ftplugin/latex-suite/mathmacros.vim :---------------------------------------------+ (0.9) ftplugin/latex-suite/packages/accents :-------------------------------------------+ (0.87) ftplugin/latex-suite/packages/amsmath :-------------------------------------------------+ (0.98) ftplugin/latex-suite/packages/amsthm :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/amsxtra :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/bar :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/caption2 :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/changebar :------------------------------------------------+ (0.96) ftplugin/latex-suite/packages/chapterbib :--------------------------------------------+ (0.89) ftplugin/latex-suite/packages/cite :---------------------------------------------+ (0.91) ftplugin/latex-suite/packages/color :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/drftcite :---------------------------------------------+ (0.9) ftplugin/latex-suite/packages/eqlist :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/eqparbox :---------------------------------+ (0.67) ftplugin/latex-suite/packages/exmpl :------------+ (0.24) ftplugin/latex-suite/packages/float :------------------------------------+ (0.73) ftplugin/latex-suite/packages/footmisc :-----------------------------------------+ (0.81) ftplugin/latex-suite/packages/geometry :-------------------------------------------------+ (0.98) ftplugin/latex-suite/packages/graphicx :------------------------------------------------+ (0.95) ftplugin/latex-suite/packages/harpoon :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/hhline :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/hyperref :-------------------------------------------------+ (0.98) ftplugin/latex-suite/packages/ifthen :-----------------------------------------+ (0.81) ftplugin/latex-suite/packages/inputenc :------------------------------------------------+ (0.95) ftplugin/latex-suite/packages/lineno :-----------------------------------------------+ (0.95) ftplugin/latex-suite/packages/longtable :------------------------------------------------+ (0.96) ftplugin/latex-suite/packages/manyfoot :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/moreverbatim :--------------------------------------+ (0.76) ftplugin/latex-suite/packages/multicol :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/newalg :-----------------------------------------------+ (0.95) ftplugin/latex-suite/packages/outliner :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/overcite :----------------------------------------------+ (0.92) ftplugin/latex-suite/packages/parallel :--------------------------------------------+ (0.88) ftplugin/latex-suite/packages/polski :--------------------------------+ (0.64) ftplugin/latex-suite/packages/schedule :----------------------------------------+ (0.8) ftplugin/latex-suite/packages/SIunits :--------------------------------------------------+ (0.99) ftplugin/latex-suite/packages/tipa :--------------------------------------------------+ (1) ftplugin/latex-suite/packages/ulem :----------------------------------------------+ (0.93) ftplugin/latex-suite/packages.vim :------------------------------------------+ (0.84) ftplugin/latex-suite/templates.vim :-------------------------------+ (0.62) ftplugin/latex-suite/texmenuconf.vim :-----------------------------------+ (0.7) ftplugin/latex-suite/texrc :---------+ (0.19) ftplugin/latex-suite/wizardfuncs.vim :------------------------------------------+ (0.84) ftplugin/tex/brackets.vim :----------------------+ (0.44) ftplugin/tex/smartspace.vim :-------------------------------+ (0.61) ftplugin/tex.vim :-------------------------+ (0.5) ftplugin/tex_latexSuite.vim :---------------------+ (0.42) indent/tex.vim :------------------+ (0.36) latextags :---------------------------------------------+ (0.91) ltags :--------------------------------------------+ (0.88) makefile :--------------------------------------------+ (0.87) plugin/imaps.vim :---------------------+ (0.42) plugin/libList.vim :-----------------+ (0.34) plugin/SyntaxFolds.vim :-------------------------+ (0.49) |
From: Benji F. <be...@me...> - 2002-12-20 14:37:36
|
Srinath Avadhanula wrote: > On Thu, 19 Dec 2002, Benji Fisher wrote: Item 1: ====== >>> " Break text up into "initial <+template+> final"; any piece may >>> be empty. let initial = substitute(text, pattern, '\1', '') let >>> template = substitute(text, pattern, '\2', '') let final = >>> substitute(text, pattern, '\3', '') >>> >>> This assumes that there is only a single <+template+> in the >>> text. >> >> Why do you say that? The cursor should be placed on template; all >> the place holders in final will be replaced. This question still stands. > What I didnt quite understand was why you treated the first > placeholder seperately from the rest? > > Why not simply do > > let text = substitute(text, '\V'.phs.'\(\.\{-}\)'.phe, > phsUser.'\1'.pheUser, 'g') [snip] > All of this code seems to do effectively what that one substitute > should be doing. (Note, I am not trying to save lines, using one > substitute also seems to be clearer logically). Or is there something > I am missing? Yes, I think you are missing something. See the example below. >> let final = substitute(final, '\V'.startpat.'\(\.\{-}\)'.endpat, \ >> escape(phs, '\') . '\1' . escape(phe, '\'), 'g') > > Precisely what I do in the latest version! escape(phs, '\') is > phsUser and so on... > >> I do not like your solution. Part of the reason for these new, >> optional arguments is that the following should work: >> >> :call IMAP("foo", "bar <++> <<cursor>> <++> <<next>>", "", "<<", >> ">>") >> >> I think your method breaks this. > [snip] > But with this fix, the example you give works just fine for me. I > _do_ use the optional arguments in the latest version too... Never > ignored them. In the example above, after pressing foo, I end up with > > > bar | <+cursor+> <++> <+next+> > > with the cursor shown at | if g:Imap_PlaceHolder's are left at > default values. If they are changed to something like '?' and '?', > then I get [snip] > > Did your version do something different? I just checked and at least > for the example you mention it seems to work the same... I get bar <++> <+cursor+> <++> <+next+> with "<+cursor+>" highlighted in Select mode. I think the intention of the above call to IMAP() is to insert a literal "<++>" into the buffer, and position the cursor on "<<cursor>>" (modified to "<+cursor+>"). This is why I broke the string into initial, template, and final. Item 2: ====== >>> Also, I dont think >>> let marker = phs . phs . phe . phe >>> >>> is a "rare" enough string. As in the previous example, this could simply be >>> ????. We do _not_ want to accidentally delete stuff from the user's files. >>> >>> let marker = '<!--- @#% Start Here @#% ----!>' >>> This sounds safer. Ofcourse, we could always make a search and be >>> sure, but I am willing to bet that this string will never happen >>> on purpose in some file. >> >> We only have to worry about the marker appearing in the text >> inserted by IMAP_PutTextWithMovement(). Can you think of an >> example where my marker is still there after the substitute() >> commands? > > Note that we could have > > let g:Imap_PlaceHolderStart = '?' let g:Imap_PlaceHolderEnd = '?' > call IMAP('foo', 'bar ?template? and 2 empty templates: ???? bar', > '', '?', '?') > > Then when we search backward from the end, we will not land at the > beginning... Ofcourse, this is an improbable scenario, but why take > the chance? I get "?" for the characters you are using, but I assume that your "2 empty templates" should look something like "<--><-->". (I'll pretend tha the call to IMAP() gives "<-" and "->" as the place-holder arguments.) My proposed marker is "<-<-->->", nested place holders. We do not intend to support nested markers, and none of our substitutions respect them; this is why I think this is safe. If "<-<-->->" did occur in the rhs argument, it would be not be there any more after the substitute() steps. Item 3: ====== >>> into the main trunk and get working on a next release version and >>> also solving the encoding problem once and for all... >> >> You forgot to mention testing. > > Absolutely. But I am wondering how to apply patches to the other > parts of the suite which need a stable interface to IMAP() and > IMAP_PutTextWithMovement(). I agree that we can take time testing on > the branch, but its somewhat essential to at least fix on a good > prototype. The internals can be optimized without hurrying... I think you are right: the two items above are internal, and we can decide on what to do after merging the changed into the main branch. I am done with grading, so I can do some more coding; but I do not want to make changes until we agree on what to do. As the CVS docs say, "log messages are not a substitute for communication." ;) --Benji |
From: Srinath A. <sr...@fa...> - 2002-12-20 17:59:01
|
On Fri, 20 Dec 2002, Benji Fisher wrote: > > Did your version do something different? I just checked and at least > > for the example you mention it seems to work the same... > > I get > > bar <++> <+cursor+> <++> <+next+> > > with "<+cursor+>" highlighted in Select mode. I think the intention of > the above call to IMAP() is to insert a literal "<++>" into the buffer, > and position the cursor on "<<cursor>>" (modified to "<+cursor+>"). > This is why I broke the string into initial, template, and final. > Okay, I just checked again... With the [bg]:Place* settings left at '<+' and '+>', it does go to <+cursor+> (which is nice :) But I don't quite get how making it jump to <+cursor+> is better. After all, what is the next <C-J> going to do? Take him to <+next+> instead of <++> by somehow magically remembering that it was the <+next+> which the user meant as a placeholder. What about the new <C-K> map? Even if he does land up in <+cursor+> is searching for the previous placeholder supposed to skip the first <++>? Ofcourse, if the user does something like: let g:Imap_PlaceHolderStart = '<<' let g:Imap_PlaceHolderEnd = '>>' call IMAP('foo', 'bar <++> <<cursor>> <++> next', '', '<<', '>>') then your version and the latest version both take the user to <<cursor>> instead of <++> and then we do not have problems anyway because <++> will not be confused for a placeholder... > > Note that we could have > > > > let g:Imap_PlaceHolderStart = '?' let g:Imap_PlaceHolderEnd = '?' > > call IMAP('foo', 'bar ?template? and 2 empty templates: ???? bar', > > '', '?', '?') > > > > Then when we search backward from the end, we will not land at the > > beginning... Ofcourse, this is an improbable scenario, but why take > > the chance? > > I get "?" for the characters you are using, but I assume that your > "2 empty templates" should look something like "<--><-->". (I'll No. There was no utf screw up here... I actually meant single question marks as the arguments to IMAP and using them in the [bg]:Place* settings as well... Using '<-' and '->' will not ofcourse cause problems... This example is ofcourse a little contrived, but so is the one you had with the <<cursor>> ;) Okay just to make things clearer, try the following example on 1.9.2.4 (this is not too contrived). let g:Imap_PlaceHolderStart = '?' let g:Imap_PlaceHolderEnd = '?' call IMAP('foo', 'bar ??something?? something next', '', '?', '?') Here the user would expect to be taken to the first ?? and then to the next ?? For me, this causes a problem with 1.9.2.4. Check it... > I think you are right: the two items above are internal, and we > can decide on what to do after merging the changed into the main branch. Yes. There were a couple of bugs in packages.vim which needed to be fixed. I could then tell Mikolaj the problem... > I am done with grading, so I can do some more coding; but I do not > want to make changes until we agree on what to do. As the CVS docs say, > "log messages are not a substitute for communication." ;) > Hehe :) Sorry about the really long log message of 1.9.2.5 then. I will email those kinds of things to you from next time on... (Should I do an admin -m and change that log message too?) Srinath PS: You can jump back and forth between revisions using cvs update -r 1.9.2.4 imaps.vim cvs update -r b-newimaps imaps.vim When a branch tag is specified, then the tip of the branch is used. |
From: Benji F. <be...@me...> - 2002-12-21 14:58:53
|
Srinath Avadhanula wrote: On Fri, 20 Dec 2002, Benji Fisher wrote: :call IMAP("foo", "bar <++> <<cursor>> <++> <<next>>", "", "<<", ">>") Okay, I just checked again... With the [bg]:Place* settings left at '<+' and '+>', it does go to <+cursor+> (which is nice :) But I don't quite get how making it jump to <+cursor+> is better. After all, what is the next <C-J> going to do? Take him to <+next+> instead of <++> by somehow magically remembering that it was the <+next+> which the user meant as a placeholder. What about the new <C-K> map? Even if he does land up in <+cursor+> is searching for the previous placeholder supposed to skip the first <++>? 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. Ofcourse, if the user does something like: let g:Imap_PlaceHolderStart = '<<' let g:Imap_PlaceHolderEnd = '>>' call IMAP('foo', 'bar <++> <<cursor>> <++> next', '', '<<', '>>') [snip] 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. No. There was no utf screw up here... I actually meant single question marks as the arguments to IMAP and using them in the [bg]:Place* settings as well... Using '<-' and '->' will not ofcourse cause problems... This example is ofcourse a little contrived, but so is the one you had with the <<cursor>> ;) Okay just to make things clearer, try the following example on 1.9.2.4 (this is not too contrived). let g:Imap_PlaceHolderStart = '?' let g:Imap_PlaceHolderEnd = '?' call IMAP('foo', 'bar ??something?? something next', '', '?', '?') Here the user would expect to be taken to the first ?? and then to the next ?? For me, this causes a problem with 1.9.2.4. Check it... We already agreed that this can be fixed by replacing the place holders in pairs instead of one substitute for phs and another for phe. I think you are right: the two items above are internal, and we can decide on what to do after merging the changed into the main branch. Yes. There were a couple of bugs in packages.vim which needed to be fixed. I could then tell Mikolaj the problem... PS: You can jump back and forth between revisions using cvs update -r 1.9.2.4 imaps.vim cvs update -r b-newimaps imaps.vim When a branch tag is specified, then the tip of the branch is used. Thanks. 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 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). --Benji |
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 |
From: Benji F. <be...@me...> - 2002-12-22 02:40:11
|
Srinath Avadhanula wrote: > 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. [snip] > > In summary, unless there are some real concrete reasons to pursue this, > lets worry about this next time someone reports a bug about it. Fair enough. I have already volunteered to look at the encoding problems. It will help if someone can tell me exactly what encoding problems (actual, not potential) there are. --Benji |