Bug 112735 - cmd. completion takes always precedence over bibtex completion
Summary: cmd. completion takes always precedence over bibtex completion
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: general (show other bugs)
Version: 1.7.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Jeroen Wijnhout
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-16 16:30 UTC by MarC
Modified: 2008-02-09 11:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MarC 2005-09-16 16:30:06 UTC
Version:           1.7.1 (using KDE 3.4.2, Kubuntu Package 4:3.4.2-0ubuntu0hoary2 )
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)
OS:                Linux (i686) release 2.6.12-8-686

First I suggest marking the "Auto-complete \cite command from *.bib file in \bibliography" post as resolved.

However now when I start typing \cite{ the autocomplete feature displays "\cite{key}", so, when I want to show the bib items, I have to press esc, erase the last "{" and press again {. This is  annoying. I think that once you have typed \cite{, the autocomplete should ALWAYS show the bib items.

Thanks and congratulations for such great program!
MarC
Comment 1 Thomas Braun 2006-01-14 19:36:47 UTC
Hello,

do you have the same behaviour with kile 1.9b2 ?
Just to make sure we have fixed the bug, before we release it.

Thanks
Thomas Braun
Comment 2 MarC 2006-01-15 12:08:25 UTC
first one dependency related issue:
the configure script forgets about libattr-dev and libacl-dev.

then I got the 1.9b2 installed.

and uhm, bad news...

* now the autocompleted "\cite{" never shows the bib items,
it only displays "\cite{keylist}" whatever you do

* However with \ref you didn't follow the same policy: if you press "\ref{" the autocomplete function shows "\ref{key", then if you press "backspace + esc + {" again, then it shows the existing labels. 

So I would conclude:
I don't agree with the new policy applied to \cite because I always remember the synthax of cite but I never remember the bib items.
And even if this policy was considered to be good, then the behaviour of \ref should be corrected to match the one of \cite.

hope its useful, thanks for the work!

cheers,
MarC
Comment 3 Thomas Braun 2006-01-18 17:18:03 UTC
Hi,

the are aware of the dependency issues, thanks nethertheless.

Just to be sure, you know that bibitem completion only works if:
1. both the latex file and the bibtex file are part of the same project
2. you have given the correct \bibliography command

Then it shows if the cursor is inside the curly brackets of \cite{} the bibitems.

Regards,
Thomas Braun

Comment 4 MarC 2006-01-19 00:35:38 UTC
Sorry, I didn't verify:
1. both the latex file and the bibtex file are part of the same project 

After creating a project and adding the bib file, the \cite command has the same behaviour as I reported for \ref. So nothing has changed.

However I ask myself why do you require this, I think that the point 2., should be enough to make kile handle the bib items. Otherwise Im afraid that other people will repeat my mistake "by default".
<<
\bibliography{../audio_separation}
\bibliographystyle{unsrt}
>>

Cheers,
MarC
Comment 5 Jeroen Wijnhout 2006-01-19 09:42:24 UTC
You are right. Right now Kile only tries to be smart when using projects. If you don't use projects only the current file is parsed for labels and bibitems. Perhaps this will change in the future.

best,
Jeroen
Comment 6 Thomas Braun 2006-01-22 20:35:12 UTC
*** Bug has been marked as fixed ***.
Comment 7 Vincenzo Ciancia 2006-10-30 14:24:38 UTC
This bug is not fixed!

I quote the first message:

"However now when I start typing \cite{ the autocomplete feature displays "\cite{key}", so, when I want to show the bib items, I have to press esc, erase the last "{" and press again {. This is  annoying. I think that once you have typed \cite{, the autocomplete should ALWAYS show the bib items. "

This is exactly the problem I also wished to report, and this is not fixed, command completion takes precedence over bibtex completion, this must be fixed, because right now it looks like cite completion is completely broken, while it's just a matter of precedence. I want to emphasize that I correctly create projects and include bibtex files, but the bug is unrelated to this.

Comment 8 Thomas Braun 2006-10-30 17:43:21 UTC
Yes you are right, moved to TODO list :)
Comment 9 Thomas Braun 2007-06-27 21:10:12 UTC
Hello,

this bug has been fixed by a patch from Holger Danielsson some time ago.

Bye,
Thomas
Comment 10 M_B 2008-01-30 17:49:40 UTC
Hi.

Sorry for disagreeing, but this bug appears not to be fixed. Where can I find the patch you mentioned? Correct me if I'm wrong, but shouldn't the patch be already that stable that it can be included in the stable branch?

\cite and \ref completion don't work for me yet, insofar as I experience the very same problem as MarkC described above (2006-01-15 12:08).

Note: For a slightly better understanding, Kile-related stuff (menu entries etc.) are set in double quotes ("these"), LaTeX commands are set in single quotes, e. g. '\pagebreak'.

I'm using kile 1.9.3 on a debian (stable, that is, etch) system (the kernel might not be interesting, I suppose). In the configuration menu, "use complete" is enabled ("Settings" -> "Configure Kile" -> "kile" + "complete"), as well as "place cursor", "insert bullets", "close environments" and "auto completion (LaTeX)" but not "auto completion (text)". If I understand the last two options correctly, this should suffice for bibtex autocompletion to work. "Threshold" is set to "1 letter".

I basically tried two variants I found on the internet to overcome the issue of the missing (sic!) completion (see http://www.linuxquestions.org/questions/linux-desktop-74/kile-bibtex-507168/ for further details on using symlinks for your .bib file):

- create a new project and insert all necessary files, that is, the .tex files as well as the .bib files (the latter ones being present as physical file or as symbolic link). Result: \cite autocompletion doesn't work at all, kile only displays '\cite{keylist}' when '\cite{' is typed in. Neither hitting esc, then backspace (to delete the opening curly bracket) and entering the curly bracket again nor typing the first one to five letters of the bibtex key (with proper case) makes the desired list of possible bibtex keys appear. Oh, and combining these two strategies didn't help either.

- create a simple .tex file (no project) and copy the .bib file into the same directory as the .tex file (or create a symlink). The result is described above.

Even if the symlink's name is the same as that of the .tex file, it won't work.

The kile handbook mentiones a dropdown list in the "Edit" menu which only seems to appear when you insert the 'thebibliography' environment which I intend to avoid at all cost.

So, I hope this will be fixed soon as there appear to be quite a few people who would like to have this kind of feature. Btw., what is the official bug status?

Regards,

Matthias
Comment 11 Thomas Braun 2008-01-30 19:33:08 UTC
Please try version 2.0 of kile and report back.
Comment 12 Vincenzo Ciancia 2008-01-31 16:48:14 UTC
I am running kile 2.0 (from ubuntu hardy). To have cite completion, I must create a project with the .bib inside. When I type "\cite{", the _command_ completion popup shows. If I press escape, the popup goes away. Then, pressing ctrl+space, the correct _citation_ completion pops up. This is the same behavior I have always seen on previous versions of kile.
Comment 13 Thomas Braun 2008-02-08 22:38:25 UTC
The behaviour from Comment#12 is, although not nice, the current situation. I will move this request to #157461.

The symlink problems described in #10 are also fixed in 2.0 AFAIK.

The only way to avoid the behaviour described in #12 is to let kile do the code completion for your cite/ref command also, then you immmediately get the ref/citation list.
Comment 14 Vincenzo Ciancia 2008-02-09 11:21:12 UTC
I commented on bug #157461, but repeat my comment here for reference.

To work around this bug, I tried to edit /usr/share/apps/kile/complete/tex/latex-document.cwl. I commented the following two lines 

#\cite{keylist}
#\cite[text]{keylist}

and added, immediately after, a single line containing 

\cite

without braces or anything else. This will not show any hint for \cite, nor open and close the braces, but it is in my opinion much nicer than the current situation.