Hi!
Right now I'm writing on the concept for a thesis and it seems that the bibliography-autocompletion stopped to work. I openend the bundle-editor and saw that there was no key assigned it. When I assign Escape I get text-autocompletion, if I assign alt +esc I get the same, if I assign anything else nothing happens.
Can anyone verify that? I use built 1258 with an actual SVN-checkout and Bibdesk 1.2.9 for my bibliographies (but the last one shouldn't be important, should it?)
Niels
--
“If one would give me six lines written by the hand of the most honest man, I would find something in them to have him hanged.” -- Cardinal Richelieu
On Sep 24, 2006, at 1:49 AM, Niels Kobschaetzki wrote:
Hi!
Right now I'm writing on the concept for a thesis and it seems that the bibliography-autocompletion stopped to work. I openend the bundle-editor and saw that there was no key assigned it. When I assign Escape I get text-autocompletion, if I assign alt +esc I get the same, if I assign anything else nothing happens.
Is this the command called "Bibliography Completion"? If so, it should still have its key equivalent, option-esc. Its scope selector should be meta.citation.latex. The only change we made to it recently is the scope selector. Is it possible you have local modifications of the command? Does the problem persist if you remove them?
If it is the command called "BibDesk Completion", we have been phasing it out for a while now, and I think we have actually removed it by now, but Bibliography Completion should do what you need it to. Its main difference though is that it requires a \bibliography {filename} command present.
Also, what is the scope inside the braces of a \cite{} command? (ctrl- shift-P will show the scope at the caret's location.) There was a major scope renaming in the LaTeX bundle, so there is a chance some things are not up to sync yet, though
Niels
Haris
On Sep 24, 2006, at 00:02, Charilaos Skiadas wrote:
On Sep 24, 2006, at 1:49 AM, Niels Kobschaetzki wrote:
Hi!
Right now I'm writing on the concept for a thesis and it seems that the bibliography-autocompletion stopped to work. I openend the bundle-editor and saw that there was no key assigned it. When I assign Escape I get text-autocompletion, if I assign alt +esc I get the same, if I assign anything else nothing happens.
Is this the command called "Bibliography Completion"? If so, it should still have its key equivalent, option-esc. Its scope selector should be meta.citation.latex. The only change we made to it recently is the scope selector. Is it possible you have local modifications of the command? Does the problem persist if you remove them?
If it is the command called "BibDesk Completion", we have been phasing it out for a while now, and I think we have actually removed it by now, but Bibliography Completion should do what you need it to. Its main difference though is that it requires a \bibliography {filename} command present.
I think I started using TM about the time this transition occurred. Is there any way to get the BibDesk Completion command back for personal usage? The advantage for me is that BibDesk searches based on title, keywords, author/editor names, and citekey (at least through the standard AS interface). I'm also a BibDesk developer, so I'm very biased ;).
thanks, Adam
Hi Adam, On Sep 24, 2006, at 10:50 AM, Adam R. Maxwell wrote:
I think I started using TM about the time this transition occurred. Is there any way to get the BibDesk Completion command back for personal usage? The advantage for me is that BibDesk searches based on title, keywords, author/editor names, and citekey (at least through the standard AS interface). I'm also a BibDesk developer, so I'm very biased ;).
Actually the command is still part of the bundle, but just disabled. We were planning to eventually remove it if no-one complained, but it looks like we'll be keeping it ;) (Of course, one could alter the current label completion command to look at other fields as well, it really just parses the bib files.) Anyway, to enable the bibdesk completion command, open the bundle editor and go to the LaTeX bundle. Then make sure the actual LaTeX bundle item is selected. You should, in that event, see on the right the structure of the bundle menu, and where each command goes in subgroups like Insert and Format etc. You will see BibDesk completion in the list of excluded items all the way to the right. Just drag it back into a desired location in the menu structure area, probably under the "insert" group. Give it a key equivalent, and you should be good to go.
thanks, Adam
Haris
Hi Haris,
On Sep 24, 2006, at 08:53, Charilaos Skiadas wrote:
On Sep 24, 2006, at 10:50 AM, Adam R. Maxwell wrote:
I think I started using TM about the time this transition occurred. Is there any way to get the BibDesk Completion command back for personal usage? The advantage for me is that BibDesk searches based on title, keywords, author/editor names, and citekey (at least through the standard AS interface). I'm also a BibDesk developer, so I'm very biased ;).
Actually the command is still part of the bundle, but just disabled. We were planning to eventually remove it if no-one complained, but it looks like we'll be keeping it ;) (Of course, one could alter the current label completion command to look at other fields as well, it really just parses the bib files.)
Well, I happen to think that parsing BibTeX is fairly difficult to do correctly. As a trivial example,
@article(citekey, title = "title", author = "m{"e} and myself")
and
@article{citekey, title = {title}, author = {me{"e} and myself}}
are both valid BibTeX (note the use of () and "" instead of {} pairs). Add whitespace and remove newlines for extra fun. You can write an ad-hoc parser that's probably adequate for completion (although even then I can imagine some difficulty with encodings).
Anyway, to enable the bibdesk completion command, open the bundle editor and go to the LaTeX bundle. Then make sure the actual LaTeX bundle item is selected. You should, in that event, see on the right the structure of the bundle menu, and where each command goes in subgroups like Insert and Format etc. You will see BibDesk completion in the list of excluded items all the way to the right. Just drag it back into a desired location in the menu structure area, probably under the "insert" group. Give it a key equivalent, and you should be good to go.
Ah, that's easier than I thought; thanks! The LaTeX bundle is nice, and thanks to all who've worked on it. I've made a few additions locally: png as a graphics file, width=0.8\textwidth for \includegraphics, and dropping a .bib file inserts its path.
I'd like to write a plugin that adds NSTextView-style completion for \cite and \ref, but my first attempt was a complete failure. This is the one thing that I really miss from other editors :(.
regards, Adam
On Sep 24, 2006, at 9:20 AM, Adam R. Maxwell wrote:
I'd like to write a plugin that adds NSTextView-style completion for \cite and \ref, but my first attempt was a complete failure. This is the one thing that I really miss from other editors :(.
Just about the only thing I still miss is reftex: Invoke, choose cite type, enter search text, mark ref(s), and insert -- such a sweet way to add citations. I tinkered with replicating it in AppleScript, but it was doomed from the start.
-Alan
On Sep 24, 2006, at 12:20 PM, Adam R. Maxwell wrote:
Well, I happen to think that parsing BibTeX is fairly difficult to do correctly. As a trivial example,
@article(citekey, title = "title", author = "m{"e} and myself")
and
@article{citekey, title = {title}, author = {me{"e} and myself}}
are both valid BibTeX (note the use of () and "" instead of {} pairs). Add whitespace and remove newlines for extra fun. You can write an ad-hoc parser that's probably adequate for completion (although even then I can imagine some difficulty with encodings).
Do I understand correctly though, that if the bib file is saved from within BibDesk, then it has kind of a standardized format, that would avoid both of the above cases?
My parser is certainly extremely weak, and it assumes that the bibfile is pretty well formatted, which is the case with my bib files. They are however very small. I agree it would be extremely difficult to write a parser that actually parses the entire bib file to recover all the information. To begin with, I haven't even been able to find a complete and clear reference for the BibTeX syntax.
For me the main/only disadvantage of the bibdesk completion command is that it needs BibDesk to be running, with the current file open and up front, unless I'm mistaken. It's been a while since I've used it.
Haris
PS: BibDesk is an awesome program, I can't even imagine managing bib files without it.
On Sep 24, 2006, at 10:59, Charilaos Skiadas wrote:
On Sep 24, 2006, at 12:20 PM, Adam R. Maxwell wrote:
Well, I happen to think that parsing BibTeX is fairly difficult to do correctly. As a trivial example,
@article(citekey, title = "title", author = "m{"e} and myself")
and
@article{citekey, title = {title}, author = {me{"e} and myself}}
are both valid BibTeX (note the use of () and "" instead of {} pairs). Add whitespace and remove newlines for extra fun. You can write an ad-hoc parser that's probably adequate for completion (although even then I can imagine some difficulty with encodings).
Do I understand correctly though, that if the bib file is saved from within BibDesk, then it has kind of a standardized format, that would avoid both of the above cases?
Yes, that's correct; BibDesk reads any of the above (thanks to btparse!), but saves using {} as delimiters.
My parser is certainly extremely weak, and it assumes that the bibfile is pretty well formatted, which is the case with my bib files. They are however very small.
In that case, just grabbing citekeys is pretty straightforward. My bib files are fairly large, so I'm not sure how well it scales to read the file every time (if that's what you do?).
I agree it would be extremely difficult to write a parser that actually parses the entire bib file to recover all the information. To begin with, I haven't even been able to find a complete and clear reference for the BibTeX syntax.
The only reference is the WEB source for BibTeX itself, but the docs with btparse have a pretty good explanation, and Nelson Beebe wrote a paper on bibclean that's helpful. The bottom line is that BibTeX sucks because of the variations in syntax.
For me the main/only disadvantage of the bibdesk completion command is that it needs BibDesk to be running, with the current file open and up front, unless I'm mistaken. It's been a while since I've used it.
That's partially correct; it uses AppleScript to get the list of completions, so BibDesk has to be running, but it searches all open documents. There are also some features that help searching (you can search for "Bü" instead of "B{"u} for author name completion).
We actually rewrote NSTextView's completion window/controller from scratch for BibDesk, and that's what I was trying to wedge into TextMate (to avoid any use of the mouse). Since there's no published API for TextMate's main textview, that may be impossible for me.
Haris
PS: BibDesk is an awesome program, I can't even imagine managing bib files without it.
Thanks! I'll try to avoid promoting it on this list, though ;).
regards, Adam
On Sep 24, 2006, at 2:54 PM, Adam R. Maxwell wrote:
Yes, that's correct; BibDesk reads any of the above (thanks to btparse!), but saves using {} as delimiters.
Hm, perhaps we could change things so as to use btparse as well. We'll see.
In that case, just grabbing citekeys is pretty straightforward. My bib files are fairly large, so I'm not sure how well it scales to read the file every time (if that's what you do?).
Yes I just search recursively starting either from the current file or TM_LATEX_MASTER, and descending into all \include'd and \input'd files, and searching in there for all \bibliography{} entries, and then parsing all those. It looks for the keyword in citekey, author/ editor and title fields.
The only reference is the WEB source for BibTeX itself, but the docs with btparse have a pretty good explanation, and Nelson Beebe wrote a paper on bibclean that's helpful. The bottom line is that BibTeX sucks because of the variations in syntax.
But we can always have it cleaned up by BibDesk first ;)
That's partially correct; it uses AppleScript to get the list of completions, so BibDesk has to be running, but it searches all open documents. There are also some features that help searching (you can search for "Bü" instead of "B{"u} for author name completion).
Ah that last one is probably tricky for our parser to do correctly. Of course, if this is basically inherited from btparse, then it just might be doable.
We actually rewrote NSTextView's completion window/controller from scratch for BibDesk, and that's what I was trying to wedge into TextMate (to avoid any use of the mouse). Since there's no published API for TextMate's main textview, that may be impossible for me.
That would indeed be really sweet. I think we might have a better chance at it in TextMate 2.0, where I think a lot of these internals might be more attainable. As it is, the best we can do really is the current behavior of esc, which using only citekeys I'm afraid (because it can't alter the word that is being completed, it can only complete it).
Haris
PS: BibDesk is an awesome program, I can't even imagine managing bib files without it.
Thanks! I'll try to avoid promoting it on this list, though ;).
Well, BibDesk is a free product and TextMate doesn't really offer great support for managing bib files, so I don't see any harm in some occasional mention of it ;). I actually would expect that most of us working with bib files use BibDesk for them. I have often considered improving TextMate's bib file functionality, but frankly I find my needs satisfied with BibDesk, so I don't have much incentive to do it.
regards, Adam
Haris
On Sep 24, 2006, at 14:30, Charilaos Skiadas wrote:
On Sep 24, 2006, at 2:54 PM, Adam R. Maxwell wrote:
Yes, that's correct; BibDesk reads any of the above (thanks to btparse!), but saves using {} as delimiters.
Hm, perhaps we could change things so as to use btparse as well. We'll see.
It's available here http://sourceforge.net/projects/btool. Have fun :).
In that case, just grabbing citekeys is pretty straightforward. My bib files are fairly large, so I'm not sure how well it scales to read the file every time (if that's what you do?).
Yes I just search recursively starting either from the current file or TM_LATEX_MASTER, and descending into all \include'd and \input'd files, and searching in there for all \bibliography{} entries, and then parsing all those. It looks for the keyword in citekey, author/ editor and title fields.
That sounds pretty good. One of the limitations of my input manager hack is that it only searches the current NSTextView for \label completions, since it has no way to get the master document.
[...]
That's partially correct; it uses AppleScript to get the list of completions, so BibDesk has to be running, but it searches all open documents. There are also some features that help searching (you can search for "Bü" instead of "B{"u} for author name completion).
Ah that last one is probably tricky for our parser to do correctly. Of course, if this is basically inherited from btparse, then it just might be doable.
Nope, it's some moderately hairy Obj-C code in BibDesk proper <https://svn.sourceforge.net/svnroot/bibdesk/trunk/bibdesk/BDSKConverter.m
.
We actually rewrote NSTextView's completion window/controller from scratch for BibDesk, and that's what I was trying to wedge into TextMate (to avoid any use of the mouse). Since there's no published API for TextMate's main textview, that may be impossible for me.
That would indeed be really sweet. I think we might have a better chance at it in TextMate 2.0, where I think a lot of these internals might be more attainable. As it is, the best we can do really is the current behavior of esc, which using only citekeys I'm afraid (because it can't alter the word that is being completed, it can only complete it).
Yeah, I think it's something Allan would have to do, if he's interested (and likes popup completion). It seems like it would be extensible so that bundles could provide the possible completions as they do now.
thanks, Adam
On Sep 24, 2006, at 9:02 AM, Charilaos Skiadas wrote:
On Sep 24, 2006, at 1:49 AM, Niels Kobschaetzki wrote:
<snip Bibliography Completion doesn't work>
Is this the command called "Bibliography Completion"?
yp
If so, it should still have its key equivalent, option-esc. Its scope selector should be meta.citation.latex. The only change we made to it recently is the scope selector. Is it possible you have local modifications of the command? Does the problem persist if you remove them?
no local modifications here
If it is the command called "BibDesk Completion", we have been phasing it out for a while now, and I think we have actually removed it by now, but Bibliography Completion should do what you need it to. Its main difference though is that it requires a \bibliography{filename} command present.
it's Bibliography Completion - didn't notice the change before But I tried right now if "BibDesk Completion" works and it does like before. It seems that just "Bibliography Completion" does not work
Also, what is the scope inside the braces of a \cite{} command? (ctrl-shift-P will show the scope at the caret's location.) There was a major scope renaming in the LaTeX bundle, so there is a chance some things are not up to sync yet, though
The scope is: text.tex.latex meta.citation.latex punctuation.definition.arguments.latex
Niels
-- Elizabeth Swann: It's real! Norrington: My God. You actually were telling the truth. Jack Sparrow: I do that quite a lot. Yet people are always surprised. Will Turner: With good reason -- Pirates of the Carribean: Dead Man's Chest
Well, that sounds like it should be. The only other thing I can think of is that your file, or the file that TM_LATEX_MASTER points to, if any, doesn't contain the proper \bibliography{} instructions. Can you perhaps send me your file, or place it in the Pastie service via selecting the text and pressing shift-ctrl-option-V, and post the link here?
What happens if you run the command from the menu? Is it executed properly then? This way we'll know if the problem is with the shortcut or with the actual command not doing the right thing. On Sep 24, 2006, at 3:40 PM, Niels Kobschaetzki wrote:
The scope is: text.tex.latex meta.citation.latex punctuation.definition.arguments.latex
Niels
Haris