Tyler Smith | 17 Jul 2012 20:21
Picon

reftex completing bibtex keys

Hi,

In the Reftex manual, section 4.1 Creating Citations, it says:

  In order to create a citation, press `C-c [' ...
  When entering the regular expression, you can complete on known
  citation keys.

When I am running Auctex with Reftex running, pressing C-c [ brings
up the citation style buffer, followed by the Regexp prompt. I can enter
search terms and get the expected list of refences from my .bib file.

However, I can't get any sort of completion. Pressing tab produces the
message [No match], regardless of whether I started entering a key or
not. Should I be able to get tab-completion of bibtex keys? If so, how
do I set it up?

Thanks,

Tyler

Reftex 4.31
Auctex 11.86
Emacs 24.0.94.1
Tassilo Horn | 18 Jul 2012 09:32
Picon
Gravatar

Re: reftex completing bibtex keys

Tyler Smith <tyler.smith <at> mail.mcgill.ca> writes:

Hi Tyler,

> In the Reftex manual, section 4.1 Creating Citations, it says:
>
>   In order to create a citation, press `C-c [' ...
>   When entering the regular expression, you can complete on known
>   citation keys.
>
> When I am running Auctex with Reftex running, pressing C-c [ brings
> up the citation style buffer, followed by the Regexp prompt. I can enter
> search terms and get the expected list of refences from my .bib file.
>
> However, I can't get any sort of completion.

No, I don't think there is completion.  The docs of the CVS development
version also don't have that statement anymore.

,----[ (info "(reftex)Creating Citations") ]
| 4.1 Creating Citations
| ======================
| 
| In order to create a citation, press `C-c ['.  RefTeX then prompts for
| a regular expression which will be used to search through the database
| and present the list of matches to choose from in a selection process
| similar to that for selecting labels (*note Referencing Labels::).
`----

Bye,
(Continue reading)

Guilhem Bourrié | 18 Jul 2012 10:10
Picon
Picon
Favicon

reftex compatibility with biblatex and biber


Hello,

is reftex compatible with biblatex package and biber ?

Best regards,

Guilhem Bourrié 

UMR 1114 Emmah
INRA - Université d'Avignon et des Pays du Vaucluse
Environnement Méditerranéen et Modélisation des Agrohydrosystèmes
Domaine Saint-Paul, Site Agroparc
Bâtiment Sol
F-84914 Avignon cedex 9 (France)
Tél.: +33 4 32 72 22 28 Fax: +33 4 32 72 22 12
_______________________________________________
auctex mailing list
auctex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/auctex
Tassilo Horn | 18 Jul 2012 12:47
Picon
Gravatar

Re: reftex compatibility with biblatex and biber

Guilhem Bourrié <bourrie <at> paca.inra.fr> writes:

Hi!

> is reftex compatible with biblatex package and biber ?

Not yet, I think.  There were some patches on the development list, but
nobody had the time to test and commit them.  I myself don't use biber,
so it's hard for me to do that.

Bye,
Tassilo

_______________________________________________
auctex mailing list
auctex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/auctex
Marcus Frings | 18 Jul 2012 16:11
Face

Re: reftex compatibility with biblatex and biber

* Tassilo Horn <tassilo <at> member.fsf.org> wrote:
> Guilhem Bourrié <bourrie <at> paca.inra.fr> writes:

>> is reftex compatible with biblatex package and biber ?

> Not yet, I think.  There were some patches on the development list, but
> nobody had the time to test and commit them.  I myself don't use biber,
> so it's hard for me to do that.

I use Philips patches (you can get them from the homepage of the biber
project) for biblatex/biber and they work very well, hence I do
recommend to add them, Guilhem.

I wish they would have become official and got incorporated into (the
CVS version of) AUCTeX.

Gruß,
Marcus
--

-- 
"To call up a demon you must learn its name. Men dreamed that, once, but now it
is real in another way. You know that, Case. Your business is to learn the names
of programs, the long formal names, names the owners seek to conceal. True
names ..." - "A Turing code's not your name." - "Neuromancer", the boy said.

_______________________________________________
auctex mailing list
auctex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/auctex
Ken Brown | 19 Jul 2012 00:25
Picon
Favicon

Re: reftex compatibility with biblatex and biber

On 7/18/2012 10:11 AM, Marcus Frings wrote:
> * Tassilo Horn <tassilo <at> member.fsf.org> wrote:
>> Guilhem Bourrié <bourrie <at> paca.inra.fr> writes:
>
>>> is reftex compatible with biblatex package and biber ?
>
>> Not yet, I think.  There were some patches on the development list, but
>> nobody had the time to test and commit them.  I myself don't use biber,
>> so it's hard for me to do that.
>
> I use Philips patches (you can get them from the homepage of the biber
> project) for biblatex/biber and they work very well, hence I do
> recommend to add them, Guilhem.
>
> I wish they would have become official and got incorporated into (the
> CVS version of) AUCTeX.

I agree.  I've used the patches quite a bit with auctex-11.86 and they 
worked very well.  Unfortunately, the patches don't apply cleanly to CVS 
Head, so some tweaking will be necessary.  It should be pretty easy, but 
I'm not expert enough to do it myself.  I'm cc-ing Philip; I don't know 
if he's interested in doing this.

Ken

_______________________________________________
auctex mailing list
auctex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/auctex
Tassilo Horn | 19 Jul 2012 08:06
Picon
Gravatar

Re: reftex compatibility with biblatex and biber

Ken Brown <kbrown <at> cornell.edu> writes:

>>> Not yet, I think.  There were some patches on the development list,
>>> but nobody had the time to test and commit them.  I myself don't use
>>> biber, so it's hard for me to do that.
>>
>> I use Philips patches (you can get them from the homepage of the
>> biber project) for biblatex/biber and they work very well, hence I do
>> recommend to add them, Guilhem.
>>
>> I wish they would have become official and got incorporated into (the
>> CVS version of) AUCTeX.
>
> I agree.  I've used the patches quite a bit with auctex-11.86 and they worked
> very well.  Unfortunately, the patches don't apply cleanly to CVS Head, so some
> tweaking will be necessary.

BTW, I couldn't find them on the biber homepage.

> It should be pretty easy, but I'm not expert enough to do it myself.
> I'm cc-ing Philip; I don't know if he's interested in doing this.

That would be great.  Philip, do you have signed a CA?

If yes, I'll simply trust Ken's and Marcus' positive experiences, review
them a bit by myself (although I don't have too much knowledge of that
code), and then commit them as soon as possible if Ralf or David don't
jump in.

Bye,
Tassilo
Philip Kime | 19 Jul 2012 08:17
Picon

Re: reftex compatibility with biblatex and biber

Greetings,

On 19 July 2012 08:06, Tassilo Horn <tassilo <at> member.fsf.org> wrote:

> BTW, I couldn't find them on the biber homepage.
>
>> It should be pretty easy, but I'm not expert enough to do it myself.
>> I'm cc-ing Philip; I don't know if he's interested in doing this.
>
> That would be great.  Philip, do you have signed a CA?
>
> If yes, I'll simply trust Ken's and Marcus' positive experiences, review
> them a bit by myself (although I don't have too much knowledge of that
> code), and then commit them as soon as possible if Ralf or David don't
> jump in.

Greetings, yes, I have signed a CA so that's all ok. If you could do
this, it would be great as I'm really snowed under at the moment. I've
been meaning to commit these for quite a while. You can find them
here:

http://sourceforge.net/projects/biblatex-biber/files/auctex-biber.zip

PK
--

-- 
Dr Philip Kime
Tassilo Horn | 19 Jul 2012 09:08
Picon
Gravatar

Re: reftex compatibility with biblatex and biber

Philip Kime <philkime <at> kime.org.uk> writes:

Hi Philip,

>> If yes, I'll simply trust Ken's and Marcus' positive experiences,
>> review them a bit by myself (although I don't have too much knowledge
>> of that code), and then commit them as soon as possible if Ralf or
>> David don't jump in.
>
> Greetings, yes, I have signed a CA so that's all ok. If you could do
> this, it would be great as I'm really snowed under at the moment. I've
> been meaning to commit these for quite a while. You can find them
> here:
>
> http://sourceforge.net/projects/biblatex-biber/files/auctex-biber.zip

Great, I'll have a look ASAP.

Bye,
Tassilo
Marcus Frings | 18 Jul 2012 16:21
Face

Re: reftex completing bibtex keys

* Tassilo Horn <tassilo <at> member.fsf.org> wrote:
> Tyler Smith <tyler.smith <at> mail.mcgill.ca> writes:

>>   In order to create a citation, press `C-c [' ...
>>   When entering the regular expression, you can complete on known
>>   citation keys.

>> When I am running Auctex with Reftex running, pressing C-c [ brings
>> up the citation style buffer, followed by the Regexp prompt. I can enter
>> search terms and get the expected list of refences from my .bib file.

>> However, I can't get any sort of completion.

> No, I don't think there is completion.  The docs of the CVS development
> version also don't have that statement anymore.

> ,----[ (info "(reftex)Creating Citations") ]
> | 4.1 Creating Citations
> | ======================
> | 
> | In order to create a citation, press `C-c ['.  RefTeX then prompts for
> | a regular expression which will be used to search through the database
> | and present the list of matches to choose from in a selection process
> | similar to that for selecting labels (*note Referencing Labels::).
> `----

Huh, that is weird because I have tab completion here (CVS AUCTeX). I
use `C-C [' and then start to type the first letters of a key and after
pressing TAB I get a *Completions* buffer showing possible keys.

Gruß,
Marcus
--

-- 
"On the third day he took me to the river
he showed me the roses and we kissed
and the last thing I heard was a muttered word
as he stood smiling above me with a rock in his fist."

_______________________________________________
auctex mailing list
auctex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/auctex
Tassilo Horn | 18 Jul 2012 17:25
Picon
Gravatar

Re: reftex completing bibtex keys

Marcus Frings <iam-est-hora-surgere <at> despammed.com> writes:

>> No, I don't think there is completion.  The docs of the CVS development
>> version also don't have that statement anymore.
>
>> ,----[ (info "(reftex)Creating Citations") ]
>> | 4.1 Creating Citations
>> | ======================
>> | 
>> | In order to create a citation, press `C-c ['.  RefTeX then prompts for
>> | a regular expression which will be used to search through the database
>> | and present the list of matches to choose from in a selection process
>> | similar to that for selecting labels (*note Referencing Labels::).
>> `----
>
> Huh, that is weird because I have tab completion here (CVS AUCTeX). I
> use `C-C [' and then start to type the first letters of a key and after
> pressing TAB I get a *Completions* buffer showing possible keys.

Really?  Does `C-c [' run the very same function?

,----[ C-h k C-c [ ]
| C-c [ runs the command reftex-citation, which is an interactive autoloaded
| compiled Lisp function in `reftex-cite.el'.
| 
| It is bound to C-c [, <menu-bar> <Ref> <\cite>.
| 
| (reftex-citation &optional NO-INSERT FORMAT-KEY)
| 
| Make a citation using BibTeX database files.
| After prompting for a regular expression, scans the buffers with
| bibtex entries (taken from the \bibliography command) and offers the
| matching entries for selection.  The selected entry is formatted according
| to `reftex-cite-format' and inserted into the buffer.
| 
| If NO-INSERT is non-nil, nothing is inserted, only the selected key returned.
| 
| FORMAT-KEY can be used to pre-select a citation format.
| 
| When called with a `C-u' prefix, prompt for optional arguments in
| cite macros.  When called with a numeric prefix, make that many
| citations.  When called with point inside the braces of a `\cite'
| command, it will add another key, ignoring the value of
| `reftex-cite-format'.
| 
| The regular expression uses an expanded syntax: && is interpreted as `and'.
| Thus, `aaaa&&bbb' matches entries which contain both `aaaa' and `bbb'.
| While entering the regexp, completion on knows citation keys is possible.
| `=' is a good regular expression to match all entries in all files.
`----

And does regex search work in addition to completion?

Maybe the difference is that you use the biber patches?

Bye,
Tassilo
Marcus Frings | 18 Jul 2012 17:49
Face

Re: reftex completing bibtex keys

* Tassilo Horn <tassilo <at> member.fsf.org> wrote:
> Marcus Frings <iam-est-hora-surgere <at> despammed.com> writes:

>> Huh, that is weird because I have tab completion here (CVS AUCTeX). I
>> use `C-C [' and then start to type the first letters of a key and after
>> pressing TAB I get a *Completions* buffer showing possible keys.

> Really?  Does `C-c [' run the very same function?

> ,----[ C-h k C-c [ ]
> | C-c [ runs the command reftex-citation, which is an interactive autoloaded
> | compiled Lisp function in `reftex-cite.el'.
> | 

Yes, it runs the same function, the only difference is the output of the
first two lines:

,----[ C-h k C-c [ ]
| C-c [ runs the command reftex-citation, which is an interactive
| compiled Lisp function.
`----

(The rest of the description is the same.)

> And does regex search work in addition to completion?

Yes, I can either type "FringsTAB" to get a *completions* buffer with a
possible list of keys like Frings2009, Frings2010 and so on or I just
type "fringsENTER" and get the *RefTeX Select* buffer where I can mark,
select complete entries matching "frings".

> Maybe the difference is that you use the biber patches?

No idea. :-) I'm just happy that everything is working, hahaha. If
anyone wants, I can send my emacs_tex.el where I have all my AUCTeX
configuration stuff.

My environment is (always):

Latest snapshot of GNU Emacs and AUCTeX plus Philips biber/biblatex
patches for AUCTeX.

Gruß,
Marcus
--

-- 
"Wo würdest Du Dich verstecken, wenn Du eine Seele wärst?" - "Möglichst weit
weg von Dir?"

_______________________________________________
auctex mailing list
auctex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/auctex
Tassilo Horn | 18 Jul 2012 21:35
Picon
Gravatar

Re: reftex completing bibtex keys

Marcus Frings <iam-est-hora-surgere <at> despammed.com> writes:

>>> Huh, that is weird because I have tab completion here (CVS AUCTeX). I
>>> use `C-C [' and then start to type the first letters of a key and after
>>> pressing TAB I get a *Completions* buffer showing possible keys.
>
>> Really?  Does `C-c [' run the very same function?
>
>> ,----[ C-h k C-c [ ]
>> | C-c [ runs the command reftex-citation, which is an interactive autoloaded
>> | compiled Lisp function in `reftex-cite.el'.
>> | 
>
> Yes, it runs the same function, the only difference is the output of the
> first two lines:
>
> ,----[ C-h k C-c [ ]
> | C-c [ runs the command reftex-citation, which is an interactive
> | compiled Lisp function.
> `----
>
> (The rest of the description is the same.)
>
>> And does regex search work in addition to completion?
>
> Yes, I can either type "FringsTAB" to get a *completions* buffer with a
> possible list of keys like Frings2009, Frings2010 and so on or I just
> type "fringsENTER" and get the *RefTeX Select* buffer where I can mark,
> select complete entries matching "frings".
>
>> Maybe the difference is that you use the biber patches?
>
> No idea. :-) I'm just happy that everything is working, hahaha. If
> anyone wants, I can send my emacs_tex.el where I have all my AUCTeX
> configuration stuff.

Not needed, I've isolated the problem.  The call (LaTeX-bibitem-list) in
`reftex-extract-bib-entries' returns nil here.  `LaTeX-bibitem-list' is
a generated function which calls (TeX-auto-list-information 'bibitem).
That tries to lookup something in `TeX-auto-parser', whose value is:

,----[ C-h v TeX-auto-parser RET ]
| TeX-auto-parser is a variable defined in `tex.el'.
| Its value is (("index-entry" LaTeX-auto-index-entry LaTeX-add-index-entries
LaTeX-index-entry-list LaTeX-index-entry-changed)
|  ("bibliography" LaTeX-auto-bibliography LaTeX-add-bibliographies LaTeX-bibliography-list LaTeX-bibliography-changed)
|  ("environment" LaTeX-auto-environment LaTeX-add-environments LaTeX-environment-list LaTeX-environment-changed)
|  ("bibitem" LaTeX-auto-bibitem LaTeX-add-bibitems LaTeX-bibitem-list LaTeX-bibitem-changed)
|  ("label" LaTeX-auto-label LaTeX-add-labels LaTeX-label-list LaTeX-label-changed)
|  ("symbol" TeX-auto-symbol TeX-add-symbols TeX-symbol-list TeX-symbol-changed)
|  (styles TeX-auto-file TeX-run-style-hooks))
`----

1. Observation: The generated function wants to look up a symbol, but
   the alist has string keys for everything except styles?  Intended?

2. Even if I change the lookup so that it gets "bibitem" as string,
   `reftex-extract-bib-entries' returns nil.  It can find an entry, but
   the symbol-value of LaTeX-bibitem-list is nil.

All in all, I don't really understand the code and how that auto-stuff
is supposed to work.  So please, someone with deeper knowledge of that
code should take a look.

Bye,
Tassilo

Gmane