Thread: [Vim-latex-devel] German quotation marks and `
Brought to you by:
srinathava,
tmaas
From: Bernhard W. <ber...@gm...> - 2003-01-14 19:01:05
|
Hello, in german.sty the correct quotation marks are "` and "' (instead of `` and ''). But if I type "`gut"' for example it's expanded to "\gammaut. Is there any solution for this? Regards, Bernhard |
From: Srinath A. <sr...@fa...> - 2003-01-14 19:13:05
|
Sorry about that. The problem is due to `g being mapped to \gamma. I will fix this now. [To Vim devel] More unprotected quote maps!!! Ouch! As of now, `g doesnt get expanded in the following scenarios: ``g \`g Now it looks like it should also be protected in "`g As of now, the way to protect against these expansions is to define: call IMAP('`g', '\gamma', 'tex') " The following fake maps are just to make `g not expand when preceded " \ or `. call IMAP('``g', '``g', 'tex') call IMAP('\`g', '\`g', 'tex') and so on and so forth... Is this really the correct way to attack this problem? Or can someone think of something more elegant? Thanks, Srinath On Tue, 14 Jan 2003, Bernhard Walle wrote: > Hello, > > in german.sty the correct quotation marks are "` and "' (instead of `` > and ''). But if I type "`gut"' for example it's expanded to > "\gammaut. Is there any solution for this? > > Regards, > Bernhard > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: Take your first step towards giving > your online business a competitive advantage. Test-drive a Thawte SSL > certificate - our easy online guide will show you how. Click here to get > started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en > _______________________________________________ > Vim-latex-devel mailing list > Vim...@li... > https://lists.sourceforge.net/lists/listinfo/vim-latex-devel > > |
From: Benji F. <be...@me...> - 2003-01-14 19:24:18
|
Srinath Avadhanula wrote: > Sorry about that. The problem is due to `g being mapped to \gamma. I > will fix this now. > > [To Vim devel] > More unprotected quote maps!!! Ouch! As of now, `g doesnt get expanded > in the following scenarios: > > ``g > \`g > > Now it looks like it should also be protected in > > "`g > > As of now, the way to protect against these expansions is to define: > > call IMAP('`g', '\gamma', 'tex') > " The following fake maps are just to make `g not expand when preceded > " \ or `. > call IMAP('``g', '``g', 'tex') > call IMAP('\`g', '\`g', 'tex') > > and so on and so forth... Is this really the correct way to attack this > problem? Or can someone think of something more elegant? Change the defaults. Almost all Insert-mode mappings should be off by default. --Benji |
From: Srinath A. <sr...@fa...> - 2003-01-14 20:35:26
|
On Tue, 14 Jan 2003, Benji Fisher wrote: > Change the defaults. Almost all Insert-mode mappings should be > off by default. > That was not what I was looking for. I would still like German writers to use `g for \gamma. Changing defaults only means that either we hide the problems by default, or just ignore german users... I dont think either is a solution. What I was looking for was ways to "solve" the problem of things like `g getting expanded in unexpected places... Moreover, I think if we actually have a system where `g expands to \gamma very intelligently based on context, then leaving it on by default is not a bad idea at all... "very intelligently" ofcourse depends on programming effort. Right now we only check for english quotes and diacritics, but in the future, we might be able to check if we are in math mode and only then expand... If we can do something like that, then having this feature on by default is a good thing, imo. Another thing: Although its a good thing not to get too invasive with mappings, its also necessary to make something which functions well out of the box. I dont think its good to make it necessary for the user to define lots of variables... The same thing applies to the smart quotes feature... We will definitely have a few bug reports from a few users every now and then, but we should weigh that against how probable it is that an average user would like this feature on (by default). For example, we disabled diacritics by default, because we decided mutually that most users find this too invasive... Before disabling anything by default, we should decide whether the majority would have liked it enabled by defualt... Srinath |
From: Luc H. <her...@fr...> - 2003-01-15 17:41:30
|
* On Tue, Jan 14, 2003 at 12:35:23PM -0800, Srinath Avadhanula <sr...@fa...> wrote: > On Tue, 14 Jan 2003, Benji Fisher wrote: > > > Change the defaults. Almost all Insert-mode mappings should be > > off by default. > > > > That was not what I was looking for. I would still like German writers > to use `g for \gamma. Changing defaults only means that either we hide > the problems by default, or just ignore german users... There is a problem here with many non-English people. By default, '`' is a dead key on my system. > I dont think either is a solution. What I was looking for was ways to > "solve" the problem of things like `g getting expanded in unexpected > places... BTW, the mappings are not synchronized with the actual mappings for greek letters -- when we change, like I do, the TeX leader '`' to something else. -- Luc Hermitte http://hermitte.free.fr/vim/ |
From: Srinath A. <sr...@fa...> - 2003-01-16 03:50:07
|
On Wed, 15 Jan 2003, Luc Hermitte wrote: > BTW, the mappings are not synchronized with the actual mappings for > greek letters -- when we change, like I do, the TeX leader '`' to > something else. Sorry about that... It was some legacy code... I changed it to use g:Tex_Leader like the other stuff like `/. It looks like sourceforge's pserver/webcvs access is down for the moment. I'll make a release after it resumes... Srinath |
From: Benji F. <be...@me...> - 2003-01-16 17:35:21
|
Srinath Avadhanula wrote: > On Tue, 14 Jan 2003, Benji Fisher wrote: > > >> Change the defaults. Almost all Insert-mode mappings should be >>off by default. >> > > > That was not what I was looking for. I would still like German writers > to use `g for \gamma. Changing defaults only means that either we hide > the problems by default, or just ignore german users... I dont think > either is a solution. What I was looking for was ways to "solve" the > problem of things like `g getting expanded in unexpected places... OK, how about this: Introduce a new function in imaps.vim so that we can :call IMAP_Protect('\`') to protect an escaped single-open-quote. This new function will save the string '\`' in a script variable. Then, when IMAP_LookupCharacter() is deciding whether there is anything to be expanded, it will do something like " maybe off by one: :let line = strpart(getline("."), col(".")).a:char :let line = substitute(line, '\V\.\*\('.s:ProtectStrings.'\)', '', '') (I am not sure whether a:char should be appended before or after the substitute() line.) The script variable can have the form s:ProtectStrings = '\\`' . '\|' . '"`' (note that IMAP_Protect() applies escape(..., '\') before adding something to the script variable). Then, if the line up to the cursor contains either of the strings '\`' or '"`', everything up to and including the last occurrence will be removed by the substitute(). --Benji |
From: Srinath A. <sr...@fa...> - 2003-01-16 19:52:47
|
On Thu, 16 Jan 2003, Benji Fisher wrote: > " maybe off by one: > :let line = strpart(getline("."), col(".")).a:char > :let line = substitute(line, '\V\.\*\('.s:ProtectStrings.'\)', '', '') > > (I am not sure whether a:char should be appended before or after the > substitute() line.) The script variable can have the form > > s:ProtectStrings = '\\`' . '\|' . '"`' > > (note that IMAP_Protect() applies escape(..., '\') before adding > something to the script variable). Then, if the line up to the cursor > contains either of the strings '\`' or '"`', everything up to and > including the last occurrence will be removed by the substitute(). > Okay, after reading this a few times, I see what you mean... Just to clarify, when we press a letter 'a' at the end of a line like A quote starts `` then, instead of trying to find out if the string "A quote starts ``a" matches with an LHS, we first remove the `` and then try to see if "A quote starts a" matches with an available lhs? That will certainly work. (Although removing s:ProtectStrings everywhere is not necessary, only from the end no?) Do you think we need to do this still? The present system of creating fake maps seems to work as of now... If you still think we need this, please go ahead and add this... You'll also need to remove the s:ProtectLetters() function from main.vim and add in a couple of IMAP_Protect()'s instead.... Srinath |
From: Benji F. <be...@me...> - 2003-01-16 20:49:17
|
Srinath Avadhanula wrote: > On Thu, 16 Jan 2003, Benji Fisher wrote: > > >>" maybe off by one: >>:let line = strpart(getline("."), col(".")).a:char >>:let line = substitute(line, '\V\.\*\('.s:ProtectStrings.'\)', '', '') >> >>(I am not sure whether a:char should be appended before or after the >>substitute() line.) The script variable can have the form >> >>s:ProtectStrings = '\\`' . '\|' . '"`' >> >>(note that IMAP_Protect() applies escape(..., '\') before adding >>something to the script variable). Then, if the line up to the cursor >>contains either of the strings '\`' or '"`', everything up to and >>including the last occurrence will be removed by the substitute(). > > Okay, after reading this a few times, I see what you mean... Just to > clarify, when we press a letter 'a' at the end of a line like > > A quote starts `` > > then, instead of trying to find out if the string > "A quote starts ``a" matches with an LHS, we first remove the `` and > then try to see if "A quote starts a" matches with an available lhs? No: strip off '.*``' and check whether "a" matches any lhs. > That will certainly work. (Although removing s:ProtectStrings everywhere > is not necessary, only from the end no?) > > Do you think we need to do this still? The present system of creating > fake maps seems to work as of now... If you still think we need this, > please go ahead and add this... You'll also need to remove the > s:ProtectLetters() function from main.vim and add in a couple of > IMAP_Protect()'s instead.... Which version is more scalable? If the current system is working and is easy to extend, I will not try to fix it. --Benji |
From: Srinath A. <sr...@fa...> - 2003-01-15 04:35:04
|
On Tue, 14 Jan 2003, Bernhard Walle wrote: > Hello, > > in german.sty the correct quotation marks are "` and "' (instead of `` > and ''). But if I type "`gut"' for example it's expanded to > "\gammaut. Is there any solution for this? > Hello Bernhard, I've fixed this problem in the latest version. Also, in the present version, if \usepackage{german} is detected, then " expands to "` or '" depending on whether its opening or closing. As of now, editing both german and english files in the same vim session is not supported, but that will come soon... Note that `g will still expand to \gamma (and similarly for other english alphabets) if its not preceded by ", ` or \. This is for typing greek letters. You cannot completeley disable this feature with an option right now. In the future, I'll make this an option... If you really want to disable such expansions, you'll need to comment out lines 96-131 of ftplugin/latex-suite/main.vim Thanks, Srinath |
From: Bernhard W. <ber...@gm...> - 2003-01-15 13:50:35
|
Hello, On Tue, 14 Jan 2003 at 20:35 (-0800), Srinath Avadhanula wrote: > On Tue, 14 Jan 2003, Bernhard Walle wrote: > > > in german.sty the correct quotation marks are "` and "' (instead of `` > > and ''). But if I type "`gut"' for example it's expanded to > > "\gammaut. Is there any solution for this? > > > I've fixed this problem in the latest version. Also, in the present > version, if \usepackage{german} is detected, then " expands to "` or '" > depending on whether its opening or closing. As of now, editing both > german and english files in the same vim session is not supported, but > that will come soon... It does not work here with the latest version from the download page. And, please recognize also \usepackage{ngerman} (it's the same as german but with the new hypenation rules). Thanks. > Note that `g will still expand to \gamma (and similarly for other > english alphabets) if its not preceded by ", ` or \. This is for typing > greek letters. You cannot completeley disable this feature with an > option right now. In the future, I'll make this an option... If you > really want to disable such expansions, you'll need to comment out lines > 96-131 of ftplugin/latex-suite/main.vim The feature is great but it should work with "`..."'. I think it would also be good to get a '"' by typing " twice as like in XEmacs if this is possible but it's not very important. Regards, Bernhard |
From: Benji F. <be...@me...> - 2003-01-15 16:43:36
|
Bernhard Walle wrote: > Hello, > > On Tue, 14 Jan 2003 at 20:35 (-0800), Srinath Avadhanula wrote: > >>On Tue, 14 Jan 2003, Bernhard Walle wrote: >> >> >>>in german.sty the correct quotation marks are "` and "' (instead of `` >>>and ''). But if I type "`gut"' for example it's expanded to >>>"\gammaut. Is there any solution for this? >>> >> >>I've fixed this problem in the latest version. Also, in the present >>version, if \usepackage{german} is detected, then " expands to "` or '" >>depending on whether its opening or closing. As of now, editing both >>german and english files in the same vim session is not supported, but >>that will come soon... > > It does not work here with the latest version from the download page. > And, please recognize also \usepackage{ngerman} (it's the same as german > but with the new hypenation rules). > > Thanks. I fixed the fix (I hope). It was inserting '" instead of "', right? If you are willing to get the latest (minutes-old) version from CVS, I would appreciate further testing. Otherwise, wait unitl the next release. If there is still a problem, please give a little more detail than in your last note. This version also switches between ``English quotes'' and "`German quotes"' if you switch between two files, one with \usepackage{german} and one without. I hope someone else will add support for the ngerman package. It is probably easy, but I have not dealt with packages before. >>Note that `g will still expand to \gamma (and similarly for other >>english alphabets) if its not preceded by ", ` or \. This is for typing >>greek letters. You cannot completeley disable this feature with an >>option right now. In the future, I'll make this an option... If you >>really want to disable such expansions, you'll need to comment out lines >>96-131 of ftplugin/latex-suite/main.vim > > > The feature is great but it should work with "`..."'. I think it would > also be good to get a '"' by typing " twice as like in XEmacs if this is > possible but it's not very important. You can now get "`german"' easily. We recently made it so that typing "" will insert "`"'<++> with the cursor inside the quotation marks. This is for those who are afraid of getting unbalanced quotes; the same thing works for () and so on. You can then type <C-J> to go to the <++> marker. The general vim method for inserting a character without any mappings is to precede it with <C-V>, so if you want a " character, and it is not one of the situations (after \ or in math mode) that we have already thought of, you can use <C-V>". HTH --Benji Fisher |
From: Bernhard W. <ber...@gm...> - 2003-01-15 18:05:13
|
On Wed, 15 Jan 2003 at 11:53 (-0500), Benji Fisher wrote: > Bernhard Walle wrote: > >On Tue, 14 Jan 2003 at 20:35 (-0800), Srinath Avadhanula wrote: > >>On Tue, 14 Jan 2003, Bernhard Walle wrote: > >> > >>>in german.sty the correct quotation marks are "` and "' (instead of `` > >>>and ''). But if I type "`gut"' for example it's expanded to > >>>"\gammaut. Is there any solution for this? > >>> > >> > >>I've fixed this problem in the latest version. Also, in the present > >>version, if \usepackage{german} is detected, then " expands to "` or '" > >>depending on whether its opening or closing. As of now, editing both > >>german and english files in the same vim session is not supported, but > >>that will come soon... > > > >It does not work here with the latest version from the download page. > >And, please recognize also \usepackage{ngerman} (it's the same as german > >but with the new hypenation rules). > > > >Thanks. > > I fixed the fix (I hope). It was inserting '" instead of "', > right? No, it was insertig ``''. And "`e still expands to "`epsilon. I updated to the most recent version (http://vim-latex.sourceforge.net/download/latexSuite.tar.gz) and I have no user-configuration file. > If you are willing to get the latest (minutes-old) version from > CVS, I would appreciate further testing. Otherwise, wait unitl the next > release. If there is still a problem, please give a little more detail > than in your last note. This version also switches between ``English > quotes'' and "`German quotes"' if you switch between two files, one with > \usepackage{german} and one without. The Sourceforge CVS server seems to be down so I cannot do this. Maybe next days. > I hope someone else will add support for the ngerman package. It > is probably easy, but I have not dealt with packages before. There's no difference between ngerman and german. And you might also consider \usepackage[ngerman]{babel} but that's less important. > > >>Note that `g will still expand to \gamma (and similarly for other > >>english alphabets) if its not preceded by ", ` or \. This is for typing > >>greek letters. You cannot completeley disable this feature with an > >>option right now. In the future, I'll make this an option... If you > >>really want to disable such expansions, you'll need to comment out lines > >>96-131 of ftplugin/latex-suite/main.vim > > > > > >The feature is great but it should work with "`..."'. I think it would > >also be good to get a '"' by typing " twice as like in XEmacs if this is > >possible but it's not very important. > > You can now get "`german"' easily. We recently made it so that > typing "" will insert "`"'<++> with the cursor inside the quotation > marks. This is for those who are afraid of getting unbalanced quotes; > the same thing works for () and so on. You can then type <C-J> to go to > the <++> marker. The general vim method for inserting a character > without any mappings is to precede it with <C-V>, so if you want a " > character, and it is not one of the situations (after \ or in math mode) > that we have already thought of, you can use <C-V>". Thanks. I didn't know this. Regards, Bernhard |
From: Srinath A. <sr...@fa...> - 2003-01-15 19:03:13
|
Hello Bernhard, I've uploaded the fixed version now. It looks like the CVS problem you mentioned created problems with my last release... (I hope sf.net's CVS shell cvs server comes back up soon... Its a royal pain to make releases otherwise). Please try out the latest version... Let me know if you have more problems... On Wed, 15 Jan 2003, Bernhard Walle wrote: > No, it was insertig ``''. And "`e still expands to "`epsilon. I updated > to the most recent version > (http://vim-latex.sourceforge.net/download/latexSuite.tar.gz) and I have > no user-configuration file. Benji meant ~/.vim/ftplugin/latex-suite/texrc (use ~/vimfiles instead of ~/.vim if you are on windows) > There's no difference between ngerman and german. And you might also > consider \usepackage[ngerman]{babel} but that's less important. > We'll do these things in the next few days. As of now, there is no mechanism to change behavior based on options used in packages... I'll make this a feature request. Srinath |
From: Bernhard W. <ber...@bw...> - 2003-01-15 19:19:28
|
On Wed, 15 Jan 2003 at 11:03 (-0800), Srinath Avadhanula wrote: > > I've uploaded the fixed version now. It looks like the CVS problem you > mentioned created problems with my last release... (I hope sf.net's CVS > shell cvs server comes back up soon... Its a royal pain to make releases > otherwise). It works fine now. Thanks for quick response! Regards, Bernhard |
From: Luc H. <her...@fr...> - 2003-01-16 13:35:52
|
* On Wed, Jan 15, 2003 at 07:50:05PM -0800, Srinath Avadhanula <sr...@fa...> wrote: > > BTW, the mappings are not synchronized with the actual mappings for > > greek letters -- when we change, like I do, the TeX leader '`' to > > something else. Oups ! I meant the _menus_ are not synchronized with the mappings. > Sorry about that... It was some legacy code... I changed it to use > g:Tex_Leader like the other stuff like `/. There was another problem with the mappings ? -- Luc Hermitte http://hermitte.free.fr/vim/ |
From: Srinath A. <sr...@fa...> - 2003-01-16 17:08:12
|
On Thu, 16 Jan 2003, Luc Hermitte wrote: > > Sorry about that... It was some legacy code... I changed it to use > > g:Tex_Leader like the other stuff like `/. > > There was another problem with the mappings ? Yes. The greek letter mappings always used ` irrespective of the g:Tex_Leader setting... I'll put synchronizing the menus on the TODO. Srinath |