Thread: [Vim-latex-devel] search for bibtex entry by regexp
Brought to you by:
srinathava,
tmaas
From: Fabian B. <f.b...@gm...> - 2006-01-25 19:06:19
|
Hi, I am a happy user of vim-latex, but I am missing a feature like searching for bibtex-entry by an regular expression. As far as I understand the manual, <F9> is looking just for corresponding keys and e.g. not for any word in the title. I would like to know, if anybody has a work-around for searching the keys by regexp in vim or maybe an external script? Greetings! Fabian -- |
From: Srinath A. <sri...@gm...> - 2006-02-04 00:08:26
|
Hi, On 1/25/06, Fabian Braennstroem <f.b...@gm...> wrote: > > I am a happy user of vim-latex, but I am missing a feature > like searching for bibtex-entry by an regular expression. > As far as I understand the manual, <F9> is looking just for > corresponding keys and e.g. not for any word in the title. > > I would like to know, if anybody has a work-around for > searching the keys by regexp in vim or maybe an external > script? > I can see that this will definitely be very useful. It will take quite a bit of extra code to get right though, so it might be a little while before its implemented. I am working on it (slowly) in my spare time, but I do not know how long this might take. The thing is that vim-latex does not parse any of the bibtex files, but instead just :grep's the pattern '@\w+' in all the bibtex files found. To do something like this while accounting for the fact that there could be multiple bibtex files will be a little hard. Srinath |
From: Fabian B. <f.b...@gm...> - 2006-03-02 19:58:58
|
Hi Srinath, * On 03 Feb 2006 * Srinath Avadhanula wrote: > Hi, > > On 1/25/06, Fabian Braennstroem <f.b...@gm...> wrote: > > > > I am a happy user of vim-latex, but I am missing a feature > > like searching for bibtex-entry by an regular expression. > > As far as I understand the manual, <F9> is looking just for > > corresponding keys and e.g. not for any word in the title. > > > > I would like to know, if anybody has a work-around for > > searching the keys by regexp in vim or maybe an external > > script? > > > > I can see that this will definitely be very useful. It will take quite > a bit of extra code to get right though, so it might be a little while > before its implemented. I am working on it (slowly) in my spare time, > but I do not know how long this might take. The thing is that > vim-latex does not parse any of the bibtex files, but instead just > :grep's the pattern '@\w+' in all the bibtex files found. To do > something like this while accounting for the fact that there could be > multiple bibtex files will be a little hard. little bit late, but as you see, I can wait ... but not too long ;-) Greetings! Fabian -- |
From: Srinath A. <sri...@gm...> - 2006-03-03 01:19:15
|
Hi, On 3/2/06, Fabian Braennstroem <f.b...@gm...> wrote: > Hi Srinath, > > > something like this while accounting for the fact that there could be > > multiple bibtex files will be a little hard. > > little bit late, but as you see, I can wait ... but not too > long ;-) > :) So I can give you what you want on one condition. There is almost no documentation for this feature written yet. This means that I am not ready to make a release yet. But I commited to CVS already, so if you wish, update to the latest CVS. (See the download section of vim-latex.sf.net for instructions). Then when you press <F9> after \cite, you will see a completely different screen. Something like: -----------------------------------%<----------------------------------- Masters [avadhanula:ms:01] TI "The Design and fabrication of a dynamically tuned {MFI} thorax" AU S. Avadhanula IN In University of California, Berkeley, 2001 Conference [avadhanula:icra:02] TI "Dynamically tuned design of the {MFI} thorax" AU S. Avadhanula and R. J. Wood and D. Campolo and R. S. Fearing IN In Proc. IEEE Int. Conf. on Robotics and Automation, 2002 Conference [avadhanula:iros:03] TI "Lift Force improvements for the Micromechanical Flying Insect" AU S. Avadhanula and R. J. Wood and E. Steltz and J. Yan and R. S. Fearing IN In IEE Conf. on Intelligent Robots and Systems, 2003 -----------------------------------%<----------------------------------- Note that syntax highlighting will hide some of these. Once in this screen, you can use <n>, <p> to move back and forth. Press <enter> once you are on the required entry. To filter, press <f>. This allows you to specify a "filter". A filter is basically a string like "a ellington". This filters out all results where the author field matches the string ellington. (You can ofcourse use partial words). Press <a> to show all results. You can also sort by pressing <s>. Note that this whole functionality although algorithmically stable is still a little raw around the edges. Unfortunately, I cannot take a look at this for at least 20 days or so because I am _really_ busy with something else. Oh! You will need Vim with python support builtin to use this. Doing this in Vim-script would have doubled my work. Let me know how it goes. HTH Srinath |
From: Fabian B. <f.b...@gm...> - 2006-03-03 11:53:34
|
Hi Srinath, * On 02 Mar 2006 * Srinath Avadhanula wrote: > Hi, > > On 3/2/06, Fabian Braennstroem <f.b...@gm...> wrote: > > Hi Srinath, > > > > > something like this while accounting for the fact that there could be > > > multiple bibtex files will be a little hard. > > > > little bit late, but as you see, I can wait ... but not too > > long ;-) > > > > :) So I can give you what you want on one condition. There is almost no > documentation for this feature written yet. This means that I am not > ready to make a release yet. But I commited to CVS already, so if you > wish, update to the latest CVS. (See the download section of > vim-latex.sf.net for instructions). Then when you press <F9> after > \cite, you will see a completely different screen. Something like: > > -----------------------------------%<----------------------------------- > Masters [avadhanula:ms:01] > TI "The Design and fabrication of a dynamically tuned {MFI} thorax" > AU S. Avadhanula > IN In University of California, Berkeley, 2001 > > Conference [avadhanula:icra:02] > TI "Dynamically tuned design of the {MFI} thorax" > AU S. Avadhanula and R. J. Wood and D. Campolo and R. S. Fearing > IN In Proc. IEEE Int. Conf. on Robotics and Automation, 2002 > > Conference [avadhanula:iros:03] > TI "Lift Force improvements for the Micromechanical Flying Insect" > AU S. Avadhanula and R. J. Wood and E. Steltz and J. Yan and R. S. Fearing > IN In IEE Conf. on Intelligent Robots and Systems, 2003 > -----------------------------------%<----------------------------------- > > Note that syntax highlighting will hide some of these. Once in this > screen, you can use <n>, <p> to move back and forth. Press <enter> once > you are on the required entry. To filter, press <f>. This allows you to > specify a "filter". A filter is basically a string like "a ellington". > This filters out all results where the author field matches the string > ellington. (You can ofcourse use partial words). Press <a> to show all > results. You can also sort by pressing <s>. Nice! > > Note that this whole functionality although algorithmically stable is > still a little raw around the edges. Unfortunately, I cannot take a look > at this for at least 20 days or so because I am _really_ busy with > something else. I can wait. > > Oh! You will need Vim with python support builtin to use this. Doing > this in Vim-script would have doubled my work. Until now, I did not know, that you can use python for scripting. Can you recommend any pages on the web with some vim/python introductions? > > Let me know how it goes. As soon as I am able to get access, I will let you know. It seems that the server is down!? Greetings! Fabian |
From: Fabian B. <f.b...@gm...> - 2006-03-23 10:59:47
|
Hi Srinath, took a while to test it :-) * On 02 Mar 2006 * Srinath Avadhanula wrote: > Hi, > > On 3/2/06, Fabian Braennstroem <f.b...@gm...> wrote: > > Hi Srinath, > > > > > something like this while accounting for the fact that there could be > > > multiple bibtex files will be a little hard. > > > > little bit late, but as you see, I can wait ... but not too > > long ;-) > > > > :) So I can give you what you want on one condition. There is almost no > documentation for this feature written yet. This means that I am not > ready to make a release yet. But I commited to CVS already, so if you > wish, update to the latest CVS. (See the download section of > vim-latex.sf.net for instructions). Then when you press <F9> after > \cite, you will see a completely different screen. Something like: > > -----------------------------------%<----------------------------------- > Masters [avadhanula:ms:01] > TI "The Design and fabrication of a dynamically tuned {MFI} thorax" > AU S. Avadhanula > IN In University of California, Berkeley, 2001 > > Conference [avadhanula:icra:02] > TI "Dynamically tuned design of the {MFI} thorax" > AU S. Avadhanula and R. J. Wood and D. Campolo and R. S. Fearing > IN In Proc. IEEE Int. Conf. on Robotics and Automation, 2002 > > Conference [avadhanula:iros:03] > TI "Lift Force improvements for the Micromechanical Flying Insect" > AU S. Avadhanula and R. J. Wood and E. Steltz and J. Yan and R. S. Fearing > IN In IEE Conf. on Intelligent Robots and Systems, 2003 > -----------------------------------%<----------------------------------- > > Note that syntax highlighting will hide some of these. Once in this > screen, you can use <n>, <p> to move back and forth. Press <enter> once > you are on the required entry. To filter, press <f>. This allows you to > specify a "filter". A filter is basically a string like "a ellington". > This filters out all results where the author field matches the string > ellington. (You can ofcourse use partial words). Press <a> to show all > results. You can also sort by pressing <s>. > > Note that this whole functionality although algorithmically stable is > still a little raw around the edges. Unfortunately, I cannot take a look > at this for at least 20 days or so because I am _really_ busy with > something else. > > Oh! You will need Vim with python support builtin to use this. Doing > this in Vim-script would have doubled my work. > > Let me know how it goes. It does not real work for me. When I press M-c to write '\cite{}' and press F9 a buffer '__OUTLINE__' opens up, but without any bibtex items; it is empty. The pressing 'f' or 'a' I get: Error detected while processing function Tex_HandleBibShortcuts: line 37: Traceback (most recent call last): File "<string>", line 1, in ? NameError: name 'Tex_BibFile' is not defined line 38: Traceback (most recent call last): File "<string>", line 1, in ? NameError: name 'Tex_BibFile' is not defined Error detected while processing function Tex_HandleBibShortcuts..Tex_DisplayBibList: line 22: Traceback (most recent call last): File "<string>", line 1, in ? NameError: name 'Tex_BibFile' is not defined (a) all (f) filter (s) sort (n) next (p) previous (q) quit (<CR>) choose Hit ENTER or type command to continue It seems that the Bibtexfile is not found. I include it in the latex code with: \bibliographystyle{plain} %jfm plain, dinat %\bibliography{biballsed} \bibliography{/home/fab/HOME/Dissertation/TeX/Bibliography/biballsed} I tried it with vim 6.3 and vim 7.something. Do you have an idea? Greetings! Fabian |
From: Srinath A. <sri...@gm...> - 2006-03-23 21:44:59
|
Hi Fabian, Glad to see someone testing this :) On 3/23/06, Fabian Braennstroem <f.b...@gm...> wrote: > Hi Srinath, > > took a while to test it :-) > > * On 02 Mar 2006 * Srinath Avadhanula wrote: > [snip] > > It does not real work for me. When I press M-c to write > '\cite{}' and press F9 a buffer '__OUTLINE__' opens up, but > without any bibtex items; it is empty. The pressing 'f' or > 'a' I get: > The errors due to pressing 'f' and 'a' are a symptom of the problem that __OUTLINE__ does not show any bibtex items, which is what the real problem is. Tex_BibFile is actually a python variable which should be created via Tex_StartCiteCompletion(). However, it doesn't seem to be. If its not, in subsequent calls, all hell will break loose. If you are interested in helping debug this: 1. Which release of latex-suite are you using? If you are not using the latest release, please update. 2. What is the value of: 1. g:Tex_UsePython 2. g:Tex_UseCiteCompletionVer2 3. When you open up the latex file, what happens when you type: :echo Tex_FindBibFiles() This should be a newline seperated list of all the bibtex files found in the main file. If this is not working, its a source of the error. 4. What happens if you go to the ~/.vim/ftplugin/latex-suite directory and type: $python bibtools.py /path/to/bibtex/file You should get a semi-formatted list of all the bibtex entries in the given file. I'd like to know any errors this might generate. Answers to these questions will help me greatly in debugging what might be going wrong. Srinath |
From: Fabian B. <f.b...@gm...> - 2006-03-23 22:39:22
|
Hi Srinath, * On 23 Mar 2006 * Srinath Avadhanula wrote: > Hi Fabian, > > Glad to see someone testing this :) > > On 3/23/06, Fabian Braennstroem <f.b...@gm...> wrote: > > Hi Srinath, > > > > took a while to test it :-) > > > > * On 02 Mar 2006 * Srinath Avadhanula wrote: > > > [snip] > > > > It does not real work for me. When I press M-c to write > > '\cite{}' and press F9 a buffer '__OUTLINE__' opens up, but > > without any bibtex items; it is empty. The pressing 'f' or > > 'a' I get: > > > > The errors due to pressing 'f' and 'a' are a symptom of the problem that > __OUTLINE__ does not show any bibtex items, which is what the real > problem is. Tex_BibFile is actually a python variable which should be > created via Tex_StartCiteCompletion(). However, it doesn't seem to be. > If its not, in subsequent calls, all hell will break loose. I forgot to mention that after pressing 'f' it takes a while until the 'filter menu' pops up; but this should not be the problem. > > If you are interested in helping debug this: > > 1. Which release of latex-suite are you using? If you are not using the > latest release, please update. Just updated using svn. > > 2. What is the value of: > 1. g:Tex_UsePython 1 > 2. g:Tex_UseCiteCompletionVer2 1 > > 3. When you open up the latex file, what happens when you type: > :echo Tex_FindBibFiles() > This should be a newline seperated list of all the bibtex files found > in the main file. If this is not working, its a source of the error. This works: /home/fab/HOME/Dissertation/CFD/Projects/Building_airflow/Paper/Vergleich_RANS-LES/biballsed.bib > > 4. What happens if you go to the ~/.vim/ftplugin/latex-suite directory > and type: > $python bibtools.py /path/to/bibtex/file > You should get a semi-formatted list of all the bibtex entries in the > given file. I'd like to know any errors this might generate. I get: `--> python bibtools.py /home/fab/HOME/Dissertation/CFD/Projects/Building_airflow/Paper/Ve rgleich_RANS-LES/biballsed.bib Traceback (most recent call last): File "bibtools.py", line 218, in ? bf = BibFile(sys.argv[1]) File "bibtools.py", line 165, in __init__ self.addfile(f) File "bibtools.py", line 180, in addfile b = Bibliography('@' + f, self.macros) File "bibtools.py", line 83, in __init__ raise "Only completely numeral fields can be left unquoted" Only completely numeral fields can be left unquoted Hope this helps! Greetings! Fabian |
From: Srinath A. <sri...@gm...> - 2006-03-24 03:03:28
Attachments:
bibtools.py
|
Hi Fabian, On 3/23/06, Fabian Braennstroem <f.b...@gm...> wrote: > > 4. What happens if you go to the ~/.vim/ftplugin/latex-suite directory > > and type: > > $python bibtools.py /path/to/bibtex/file > > You should get a semi-formatted list of all the bibtex entries in > > the given file. I'd like to know any errors this might generate. > > I get: > > `--> python bibtools.py /home/fab/HOME/Dissertation/CFD/Projects/Building= _airflow/Paper/Ve = rgleich_RANS-LES/biballsed.bib > Traceback (most recent call last): > File "bibtools.py", line 218, in ? > bf =3D BibFile(sys.argv[1]) > File "bibtools.py", line 165, in __init__ > self.addfile(f) > File "bibtools.py", line 180, in addfile > b =3D Bibliography('@' + f, self.macros) > File "bibtools.py", line 83, in __init__ > raise "Only completely numeral fields can be left unquoted" > Only completely numeral fields can be left unquoted > Yup... This is most definitely where the problem stems from... It looks like I was a little too strict in parsing the bibtex file. I relaxed the parsing a little just now. Could you try replacing bibtools.py with the following (see attached) version? If this makes things work (i.e you get a formatted list), could you try if the \cite completion works? I don't want to do an svn commit because there might still be outstanding issues. Thanks, Srinath |
From: Fabian B. <f.b...@gm...> - 2006-03-24 06:07:48
|
Hi Srinath, * On 23 Mar 2006 * Srinath Avadhanula wrote: > Hi Fabian, > > On 3/23/06, Fabian Braennstroem <f.b...@gm...> wrote: > > > 4. What happens if you go to the ~/.vim/ftplugin/latex-suite directory > > > and type: > > > $python bibtools.py /path/to/bibtex/file > > > You should get a semi-formatted list of all the bibtex entries in > > > the given file. I'd like to know any errors this might generate. > > > > I get: > > > > `--> python bibtools.py /home/fab/HOME/Dissertation/CFD/Projects/Building_airflow/Paper/Ve rgleich_RANS-LES/biballsed.bib > > Traceback (most recent call last): > > File "bibtools.py", line 218, in ? > > bf = BibFile(sys.argv[1]) > > File "bibtools.py", line 165, in __init__ > > self.addfile(f) > > File "bibtools.py", line 180, in addfile > > b = Bibliography('@' + f, self.macros) > > File "bibtools.py", line 83, in __init__ > > raise "Only completely numeral fields can be left unquoted" > > Only completely numeral fields can be left unquoted > > > > Yup... This is most definitely where the problem stems from... It looks > like I was a little too strict in parsing the bibtex file. I relaxed the > parsing a little just now. Could you try replacing bibtools.py with the > following (see attached) version? If this makes things work (i.e you get > a formatted list), could you try if the \cite completion works? I don't > want to do an svn commit because there might still be outstanding > issues. Now, I get: `--> python bibtools.py /home/fab/HOME/Dissertation/CFD/Projects/Building_airflow/Paper/Vergleich_RANS-LES/biballsed.bib Traceback (most recent call last): File "bibtools.py", line 227, in ? bf = BibFile(sys.argv[1]) File "bibtools.py", line 174, in __init__ self.addfile(f) File "bibtools.py", line 189, in addfile b = Bibliography('@' + f, self.macros) File "bibtools.py", line 86, in __init__ value = m.group(2) + mn.group(0) AttributeError: 'NoneType' object has no attribute 'group' I just took a deeper look in my bib file and removed two entries, which had some problems with emacs/auctex' function 'validate bibtex entries'; but it does not change the output. Greetings! Fabian |
From: Srinath A. <sri...@gm...> - 2006-03-24 09:16:18
Attachments:
bibtools.py
|
Hi Fabian, On 3/23/06, Fabian Braennstroem <f.b...@gm...> wrote: > > `--> python bibtools.py /home/fab/HOME/Dissertation/CFD/Projects/Buildin= g_airflow/Paper/Vergleich_RANS-LES/biballsed.bib > Traceback (most recent call last): > File "bibtools.py", line 227, in ? > bf =3D BibFile(sys.argv[1]) > File "bibtools.py", line 174, in __init__ > self.addfile(f) > File "bibtools.py", line 189, in addfile > b =3D Bibliography('@' + f, self.macros) > File "bibtools.py", line 86, in __init__ > value =3D m.group(2) + mn.group(0) > AttributeError: 'NoneType' object has no attribute 'group' > Okay, I relaxed the parsing pretty much the whole way... Hopefully things work now. Try the attached file... Srinath |
From: Christian E. <bla...@gm...> - 2006-03-24 10:04:54
|
* Srinath Avadhanula on Friday, March 24, 2006 at 01:16:14 -0800: > Okay, I relaxed the parsing pretty much the whole way... Hopefully > things work now. Try the attached file... Works with the "python bibtools.py /path/to/bibfile" but here I still get an empty __OUTLINE__ window. Apparently my bib file is not found. I'll try and dig into this. c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html> |
From: Christian E. <bla...@gm...> - 2006-03-25 01:15:29
|
* Christian Ebert on Friday, March 24, 2006 at 11:04:35 +0100: > Apparently my bib file is not found. I'll try and dig into this. Something went wrong with my Tex_BIBINPUTS setting. Sorry for the noise. All works fine now. c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html> |
From: Srinath A. <sri...@gm...> - 2006-03-25 04:51:27
|
Hi Chris, On 3/24/06, Christian Ebert <bla...@gm...> wrote: > * Christian Ebert on Friday, March 24, 2006 at 11:04:35 +0100: > > Apparently my bib file is not found. I'll try and dig into this. > > Something went wrong with my Tex_BIBINPUTS setting. Sorry for the > noise. All works fine now. > Thanks for confirming that it works for you. That makes you the first documented evidence of my programming working for someone other than me :) I'm going to assume that both bibtools.py and the \cite completion from within Vim work for you, i.e., the whole thing. Srinath |
From: Christian E. <bla...@gm...> - 2006-03-25 09:33:55
|
Hi Srinath, * Srinath Avadhanula on Friday, March 24, 2006 at 20:44:45 -0800: > On 3/24/06, Christian Ebert <bla...@gm...> wrote: >> Something went wrong with my Tex_BIBINPUTS setting. Sorry for the >> noise. All works fine now. >> > Thanks for confirming that it works for you. That makes you the first > documented evidence of my programming working for someone other than me > :) hehe > I'm going to assume that both bibtools.py and the \cite completion from > within Vim work for you, i.e., the whole thing. Yes. Under the condition that I do not use "~" in Tex_BIBINPUTS. I have to include the full path to my $HOME -- $HOME is not expanded either. Either the docs are misleading or again I misunderstood. latex-suite.txt, line 1126f.: |Example: > | let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**' As h:file-searching does not say anything about variable expansion it might only be a matter of correcting the docs. As file-searching can be quite time consuming perhaps the example could be changed to something like Example: > let g:Tex_TEXINPUTS = '/full/path/to/home/texmf/mypackages/**2,./**' While I was at it I set Tex_ImageDir for the first time. But it doesn't seem to work for me. I have let g:Tex_ImageDir = '/Users/chris/texinputs' where my images are stored. So I believed that when doing \includegraphics{ and pressing <F9> the explorer would also show me the contents of /Users/chris/texinputs but I only get the current directory. What am I doing wrong? Anyway, thanks for latex-suite. Perhaps you don't get as much feedback as you sometimes whish because people are too busy using it and it just works ;-) c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html> |
From: Srinath A. <sri...@gm...> - 2006-03-26 17:18:54
|
Hi Christian, On 3/25/06, Christian Ebert <bla...@gm...> wrote: > > Yes. Under the condition that I do not use "~" in Tex_BIBINPUTS. > I have to include the full path to my $HOME -- $HOME is not > expanded either. Either the docs are misleading or again I > misunderstood. > > latex-suite.txt, line 1126f.: > > |Example: > > | let g:Tex_TEXINPUTS =3D '~/texmf/mypackages/**,./**' > > As h:file-searching does not say anything about variable > expansion it might only be a matter of correcting the docs. Yes, I mistakenly assumed that Vim's file-searching used expansion. This might be a good time to convince Bram to support it since he's making a new release. > As file-searching can be quite time consuming perhaps the example > could be changed to something like > > Example: > > let g:Tex_TEXINPUTS =3D '/full/path/to/home/texmf/mypackages/**2,./**= ' > This makes sense as well. I'll change the docs for both cases. > While I was at it I set Tex_ImageDir for the first time. But it > doesn't seem to work for me. I have > > let g:Tex_ImageDir =3D '/Users/chris/texinputs' > > where my images are stored. So I believed that when doing > > \includegraphics{ > > and pressing <F9> the explorer would also show me the contents of > /Users/chris/texinputs but I only get the current directory. What > am I doing wrong? In some release of latex-suite, support for Tex_ImageDir() got taken out! :( I don't know how it happened. Its an easy fix though... I'll make the required change in SVN. > Anyway, thanks for latex-suite. Perhaps you don't get as much > feedback as you sometimes whish because people are too busy using > it and it just works ;-) > Thanks :) I hope thats the case. Srinath |
From: Christian E. <bla...@gm...> - 2006-03-28 11:22:17
|
Hi Srinath, * Srinath Avadhanula on Sunday, March 26, 2006 at 09:18:48 -0800: > In some release of latex-suite, support for Tex_ImageDir() got taken > out! :( I don't know how it happened. Its an easy fix though... I'll > make the required change in SVN. r1005 works -- up to a certain extent: 1. It almost freezes vim; symptoms: a) It takes ages (ca. 20 secs) to display the explorer. b) Reaction to pressing eg. "C" or "?" takes about the same amount of time. c) Choosing a file with <CR> works instantly. d) What does "C" actually do? I don't see a difference. [ collect files with python? ] 2. Feature proposal: At the moment it inserts the relative path. I might not be the only one who puts (links to) the image file in $TEXINPUTS (that's what it's for after all) or (less friendly on resources) declares \graphicspath. That way you can move around your source-file and don't have to worry about paths. Wouldn't it make sense to have an option to get just the basename (w/o suffix) of the image? -- Unless that's what's "C" for. My platform is MacOS 10.3.9 and I only use vim7 without gui. I am awaiting debugging instructions ;-) c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html> |
From: Srinath A. <sri...@gm...> - 2006-03-28 18:41:05
|
Hi Christian, On 3/28/06, Christian Ebert <bla...@gm...> wrote: > r1005 works -- up to a certain extent: > > 1. It almost freezes vim; symptoms: > > a) It takes ages (ca. 20 secs) to display the explorer. > > b) Reaction to pressing eg. "C" or "?" takes about the same > amount of time. > > c) Choosing a file with <CR> works instantly. > > d) What does "C" actually do? I don't see a difference. > It looks like maybe your setting of Tex_ImageDir points to a directory with a _lot_ of files. Basically, all of these symptoms point to the function FB_DisplayFiles() taking a lot of time. This function basically does a glob('*'), i.e, gets a list of all files and then "filters" them according to FB_AllowRegexp and FB_RejectRegexp. This function is in ~/.vim/plugin/filebrowser.vim, which ships with latex-suite. Its actually a small function, so you could if you want take a look at it. The most probable cause of the slow-down is the FB_Strntok() function, which FB_DisplayFiles() files uses to get the i^th line of the <NL> seperated string returned by glob('*'). If the string is huge, the time it takes to split the list grows exponentially. I tested that on my computer, if I say: :call FB_OpenFileBrowser('c:/WINDOWS/system32') which contains about 2200 files, then the time it takes is around 20 seconds or so. So if you have on the order of these many files then it will take a lot of time. The maps are: C: display the files in the current directory. i.e, if you do :cd /some/dir and then press "C" it will display the contents of /some/dir. ?: Basically expands the help section. Unfortunately, since I wrote it very inefficiently, it also completely re-reads and re-parses the file list. Both these functions call FB_DisplayFiles(). I remember that in another place in latex-suite, I got a very significant speed up by using stridx() rather than *Strntok(). Maybe thats the way to go here. > [ collect files with python? ] > ?? > 2. Feature proposal: > > At the moment it inserts the relative path. I might not be the > only one who puts (links to) the image file in $TEXINPUTS (that's > what it's for after all) or (less friendly on resources) declares > \graphicspath. That way you can move around your source-file and > don't have to worry about paths. Wouldn't it make sense to have > an option to get just the basename (w/o suffix) of the image? -- > Unless that's what's "C" for. No thats not what C is for... This seems like an easy thing to add though... I'm personally do not use this feature of latex though, so you'll have to explain this in a little bit more detail to have it become a feature. HTH Srinath |
From: Srinath A. <sri...@gm...> - 2006-03-28 19:26:05
|
Hi Christian, On 3/28/06, Srinath Avadhanula <sri...@gm...> wrote: > which contains about 2200 files, then the time it takes is around 20 > seconds or so. So if you have on the order of these many files then it > will take a lot of time. I timed it more carefully. It looks like FB_DisplayFiles() takes 104 seconds to display 2300 files! I therefore changed the way FB_DisplayFiles() works. With the improvement, it takes about 0.6s econds with vim7 and 1.0 second with vim6. I checked the modification to SVN. See if it improves things in your case as well. I think it should unless the slowdown was caused by something else in your case. Srinath |
From: Christian E. <bla...@gm...> - 2006-03-28 21:16:25
|
* Srinath Avadhanula on Tuesday, March 28, 2006 at 11:19:01 -0800: > I timed it more carefully. It looks like FB_DisplayFiles() takes 104 > seconds to display 2300 files! My estimated 20 secs were for 430 files. > I therefore changed the way FB_DisplayFiles() works. With the > improvement, it takes about 0.6s econds with vim7 and 1.0 > second with vim6. > > I checked the modification to SVN. See if it improves things in your > case as well. Works like a charm, unfortunately it is too fast to give me enough time to time it ;-) Thank you. c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html> |
From: Christian E. <bla...@gm...> - 2006-03-28 21:46:54
|
Hi Srinath, * Srinath Avadhanula on Tuesday, March 28, 2006 at 10:33:56 -0800: > On 3/28/06, Christian Ebert <bla...@gm...> wrote: <snipped problems already solved in svn HEAD> > The maps are: > C: display the files in the current directory. i.e, if you do > :cd /some/dir > and then press "C" it will display the contents of /some/dir. Ok, I get it, and it works exactly like that with new version. >> [ collect files with python? ] >> > ?? Just mumbling to myself that perhaps something like python's os.walk() might be faster than vim. So, forget it, as, at least for me it's fast enough now. >> 2. Feature proposal: >> >> At the moment it inserts the relative path. I might not be the >> only one who puts (links to) the image file in $TEXINPUTS (that's >> what it's for after all) or (less friendly on resources) declares >> \graphicspath. That way you can move around your source-file and >> don't have to worry about paths. Wouldn't it make sense to have >> an option to get just the basename (w/o suffix) of the image? -- >> Unless that's what's "C" for. > > No thats not what C is for... This seems like an easy thing to add > though... I'm personally do not use this feature of latex though, so > you'll have to explain this in a little bit more detail to have it > become a feature. Example: I put my images (or links to them) in the directory $HOME/texinputs I have set the environment variable $TEXINPUTS to the above directory. This means LaTeX will include the files in that directory in its filename database. Suppose I have a Document at $HOME/Testdir/test.tex Now, I write into test.tex: \includegraphics{image} [ just the basename ] and if $HOME/texinputs/image.jpg exists, it is found and included in the (pdf)output. Same thing happens if I have declared \graphicspath{{/path/to/home/texinputs}} [ See grfguide.ps ] in my document (it only eats loads of LaTeX' resources when there many files in that directory, or several directories). This has the big advantage over declaring an absolute path that in the case I move test.tex to eg. $HOME/Anotherdirectory/test.tex the document still compiles without changes. Similarly when I decide to move the images to $HOME/Images I simply change $TEXINPUTS to $HOME/Images. Whereas when I have absolute paths in my document I have to change every path to every image. Hope it has become clearer instead of more confusing. c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html> |
From: Srinath A. <sri...@gm...> - 2006-03-29 21:49:06
|
Hi Christian, On 3/28/06, Christian Ebert <bla...@gm...> wrote: [snip description of what Tex_ImageDir is used for] > > Hope it has become clearer instead of more confusing. > Yes... Its become clearer. I have enabled this feature in SVN in the latest release. Srinath |
From: Christian E. <bla...@gm...> - 2006-03-29 23:32:00
|
Hi Srinath, * Srinath Avadhanula on Wednesday, March 29, 2006 at 13:42:52 -0800: > On 3/28/06, Christian Ebert <bla...@gm...> wrote: > [snip description of what Tex_ImageDir is used for] > >> Hope it has become clearer instead of more confusing. >> > Yes... Its become clearer. I have enabled this feature in SVN in the > latest release. Great, works fine; now I've run out of criticisism ... Thanks c -- _B A U S T E L L E N_ lesen! --->> <http://www.blacktrash.org/baustellen.html> |
From: Fabian B. <f.b...@gm...> - 2006-03-24 11:10:04
|
Hi Srinath, * On 24 Mar 2006 * Srinath Avadhanula wrote: > Hi Fabian, > > On 3/23/06, Fabian Braennstroem <f.b...@gm...> wrote: > > > > `--> python bibtools.py /home/fab/HOME/Dissertation/CFD/Projects/Building_airflow/Paper/Vergleich_RANS-LES/biballsed.bib > > Traceback (most recent call last): > > File "bibtools.py", line 227, in ? > > bf = BibFile(sys.argv[1]) > > File "bibtools.py", line 174, in __init__ > > self.addfile(f) > > File "bibtools.py", line 189, in addfile > > b = Bibliography('@' + f, self.macros) > > File "bibtools.py", line 86, in __init__ > > value = m.group(2) + mn.group(0) > > AttributeError: 'NoneType' object has no attribute 'group' > > > Okay, I relaxed the parsing pretty much the whole way... Hopefully > things work now. Try the attached file... It works for me, thanks :-) ... but when I try to display all entries after I used the filter, I get: Error detected while processing function Tex_HandleBibShortcuts..Tex_DisplayBibList: line 22: Traceback (most recent call last): File "<string>", line 1, in ? File "/home/fab/.vim/ftplugin/latex-suite/bibtools.py", line 198, in __str__ if b['key'] and b.satisfies(self.filters): File "/home/fab/.vim/ftplugin/latex-suite/bibtools.py", line 152, in satisfies for field, regexp in filters: ValueError: need more than 1 value to unpack (a) all (f) filter (s) sort (n) next (p) previous (q) quit (<CR>) choose Hit ENTER or type command to continue and one small feature request :-) When I use the filter like 'a Searched_Author <CR>', I get and have to press <CR> again to display the results: (a) all (f) filter (s) sort (n) next (p) previous (q) quit (<CR>) choose Hit ENTER or type command to continue Would that work without a second <CR>,too? Thanks! Fabian -- |
From: Srinath A. <sri...@gm...> - 2006-03-25 09:10:30
|
Hi Fabian, On 3/24/06, Fabian Braennstroem <f.b...@gm...> wrote: > ... but when I try to display all entries after I used the > filter, I get: > > Error detected while processing function > Tex_HandleBibShortcuts..Tex_DisplayBibList: > line 22: > Traceback (most recent call last): > File "<string>", line 1, in ? > File "/home/fab/.vim/ftplugin/latex-suite/bibtools.py", > line 198, in __str__ > if b['key'] and b.satisfies(self.filters): > File "/home/fab/.vim/ftplugin/latex-suite/bibtools.py", > line 152, in satisfies > for field, regexp in filters: > ValueError: need more than 1 value to unpack This problem has been fixed in SVN. > and one small feature request :-) When I use the filter like > 'a Searched_Author <CR>', I get and have to press <CR> again > to display the results: > > (a) all (f) filter (s) sort (n) next (p) previous (q) quit (<CR>) choose > Hit ENTER or type command to continue > > Would that work without a second <CR>,too? This has been fixed as well. Srinath |