unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* citation separation in reftex
@ 2007-02-15 16:10 Tyler Smith
  2007-02-15 20:33 ` Jim Ottaway
       [not found] ` <mailman.4566.1171571649.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Tyler Smith @ 2007-02-15 16:10 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I'm having a small problem with Auctex/Reftex. I often have multiple
citations to include, and since the default separation is a comma with
no space, the citation extends beyond the limits of the paragraph and
autofill can't deal with it. How can I set reftex to insert citations
separated by ', ' instead of ',' ?

I tried the info manuals, but I couldn't find the answer there.

-- 
Regards,

Tyler Smith

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
  2007-02-15 16:10 citation separation in reftex Tyler Smith
@ 2007-02-15 20:33 ` Jim Ottaway
       [not found] ` <mailman.4566.1171571649.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Jim Ottaway @ 2007-02-15 20:33 UTC (permalink / raw)
  To: help-gnu-emacs

Regards,

On 15 Feb 2007, Tyler Smith wrote:

> Hi,
>
> I'm having a small problem with Auctex/Reftex. I often have multiple
> citations to include, and since the default separation is a comma with
> no space, the citation extends beyond the limits of the paragraph and
> autofill can't deal with it. How can I set reftex to insert citations
> separated by ', ' instead of ',' ?
>
> I tried the info manuals, but I couldn't find the answer there.

Unfortunately, it appears to be hard-coded that way in reftex-cite.el in
the function reftex-citation and passim.  

-- 
Jim Ottaway

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
       [not found] ` <mailman.4566.1171571649.2155.help-gnu-emacs@gnu.org>
@ 2007-02-16  3:15   ` Tyler Smith
  2007-02-16  7:50     ` Kevin Rodgers
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tyler Smith @ 2007-02-16  3:15 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-02-15, Jim Ottaway <j.ottaway@lse.ac.uk> wrote:
> On 15 Feb 2007, Tyler Smith wrote:

>> I'm having a small problem with Auctex/Reftex. I often have multiple
>> citations to include, and since the default separation is a comma with
>> no space, the citation extends beyond the limits of the paragraph and
>> autofill can't deal with it. How can I set reftex to insert citations
>> separated by ', ' instead of ',' ?
>>
>> I tried the info manuals, but I couldn't find the answer there.
>
> Unfortunately, it appears to be hard-coded that way in reftex-cite.el in
> the function reftex-citation and passim.  
>

Thanks! I found the relevant section in reftex-do-citation:

      (let ((concat-keys (mapconcat 'car selected-entries ",")))

and switched it to:

      (let ((concat-keys (mapconcat 'car selected-entries ", ")))

I put the modified function in scratch and c-x c-e to run it, and now
the function works as I want. How do I get the modifed code to run
automatically? I tried putting it in .emacs but that doesn't work. 

-- 
Regards,

Tyler Smith

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
  2007-02-16  3:15   ` Tyler Smith
@ 2007-02-16  7:50     ` Kevin Rodgers
  2007-02-16  9:44     ` Jim Ottaway
       [not found]     ` <mailman.4580.1171612232.2155.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2007-02-16  7:50 UTC (permalink / raw)
  To: help-gnu-emacs

Tyler Smith wrote:
> Thanks! I found the relevant section in reftex-do-citation:
> 
>       (let ((concat-keys (mapconcat 'car selected-entries ",")))
> 
> and switched it to:
> 
>       (let ((concat-keys (mapconcat 'car selected-entries ", ")))
> 
> I put the modified function in scratch and c-x c-e to run it, and now
> the function works as I want. How do I get the modifed code to run
> automatically? I tried putting it in .emacs but that doesn't work. 

That indicates that the original function definition is loaded after
your .emacs file, probably because the reftex library isn't actually
loaded until some reftex command is used (i.e. autoloaded).

You could either explicitly load reftex before you redefine the
function:

(require 'reftex)
(defun reftex-do-citation ...)

Or defer the function redefinition until after reftex has been loaded:

(eval-after-load "reftex" '(defun reftex-do-citation ...))

-- 
Kevin Rodgers
Denver, Colorado, USA

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
  2007-02-16  3:15   ` Tyler Smith
  2007-02-16  7:50     ` Kevin Rodgers
@ 2007-02-16  9:44     ` Jim Ottaway
       [not found]     ` <mailman.4580.1171612232.2155.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 11+ messages in thread
From: Jim Ottaway @ 2007-02-16  9:44 UTC (permalink / raw)
  To: help-gnu-emacs

On 16 Feb 2007, Tyler Smith wrote:

On 2007-02-15, Jim Ottaway <j.ottaway@lse.ac.uk> wrote:
> On 15 Feb 2007, Tyler Smith wrote:

>>> I'm having a small problem with Auctex/Reftex. I often have multiple
>>> citations to include, and since the default separation is a comma
>>> with no space, the citation extends beyond the limits of the
>>> paragraph and autofill can't deal with it. How can I set reftex to
>>> insert citations separated by ', ' instead of ',' ?
>>>
>>> I tried the info manuals, but I couldn't find the answer there.
>>
>> Unfortunately, it appears to be hard-coded that way in reftex-cite.el
>> in the function reftex-citation and passim.
>>
>
> Thanks! I found the relevant section in reftex-do-citation:
>
> (let ((concat-keys (mapconcat 'car selected-entries ",")))
>
> and switched it to:
>
> (let ((concat-keys (mapconcat 'car selected-entries ", ")))

You might also want to change reftex-figure-out-cite-format similarly.  

Regards,

-- 
Jim Ottaway

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
       [not found]     ` <mailman.4580.1171612232.2155.help-gnu-emacs@gnu.org>
@ 2007-02-16 13:12       ` Tyler Smith
  2007-02-21  3:04         ` Kevin Rodgers
       [not found]         ` <mailman.4828.1172027079.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Tyler Smith @ 2007-02-16 13:12 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-02-16, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
> Tyler Smith wrote:
>> I put the modified function in scratch and c-x c-e to run it, and now
>> the function works as I want. How do I get the modifed code to run
>> automatically? I tried putting it in .emacs but that doesn't work. 
>
> That indicates that the original function definition is loaded after
> your .emacs file, probably because the reftex library isn't actually
> loaded until some reftex command is used (i.e. autoloaded).
>
> You could either explicitly load reftex before you redefine the
> function:
>
> (require 'reftex)
> (defun reftex-do-citation ...)
>
> Or defer the function redefinition until after reftex has been loaded:
>
> (eval-after-load "reftex" '(defun reftex-do-citation ...))
>

Neither of those seems to work :( I tried adding a hook as well, but
that also didn't work:

(add-hook 'reftex-mode-hook 'reftex-do-citation)

-- 
Regards,

Tyler Smith

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
  2007-02-16 13:12       ` Tyler Smith
@ 2007-02-21  3:04         ` Kevin Rodgers
       [not found]         ` <mailman.4828.1172027079.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2007-02-21  3:04 UTC (permalink / raw)
  To: help-gnu-emacs

Tyler Smith wrote:
> On 2007-02-16, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>> Tyler Smith wrote:
>>> I put the modified function in scratch and c-x c-e to run it, and now
>>> the function works as I want. How do I get the modifed code to run
>>> automatically? I tried putting it in .emacs but that doesn't work. 
>> That indicates that the original function definition is loaded after
>> your .emacs file, probably because the reftex library isn't actually
>> loaded until some reftex command is used (i.e. autoloaded).
>>
>> You could either explicitly load reftex before you redefine the
>> function:
>>
>> (require 'reftex)
>> (defun reftex-do-citation ...)
>>
>> Or defer the function redefinition until after reftex has been loaded:
>>
>> (eval-after-load "reftex" '(defun reftex-do-citation ...))
>>
> 
> Neither of those seems to work :( I tried adding a hook as well, but
> that also didn't work:
> 
> (add-hook 'reftex-mode-hook 'reftex-do-citation)

Before you've redefined the function and the original has been loaded
(i.e. it's working, but not the way you want), where does `C-h f' say
it is defined?


-- 
Kevin Rodgers
Denver, Colorado, USA

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
       [not found]         ` <mailman.4828.1172027079.2155.help-gnu-emacs@gnu.org>
@ 2007-02-21 15:49           ` Tyler Smith
  2007-02-21 17:00             ` Jim Ottaway
       [not found]             ` <mailman.4855.1172077233.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Tyler Smith @ 2007-02-21 15:49 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-02-21, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
> Tyler Smith wrote:
>> On 2007-02-16, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>>> Tyler Smith wrote:
>>>> I put the modified function in scratch and c-x c-e to run it, and now
>>>> the function works as I want. How do I get the modifed code to run
>>>> automatically? I tried putting it in .emacs but that doesn't work. 
>>> That indicates that the original function definition is loaded after
>>> your .emacs file, probably because the reftex library isn't actually
>>> loaded until some reftex command is used (i.e. autoloaded).
>>>
>>> You could either explicitly load reftex before you redefine the
>>> function:
>>>
>>> (require 'reftex)
>>> (defun reftex-do-citation ...)
>>>
>>> Or defer the function redefinition until after reftex has been loaded:
>>>
>>> (eval-after-load "reftex" '(defun reftex-do-citation ...))
>>>
>> 
>> Neither of those seems to work :( I tried adding a hook as well, but
>> that also didn't work:
>> 
>> (add-hook 'reftex-mode-hook 'reftex-do-citation)
>
> Before you've redefined the function and the original has been loaded
> (i.e. it's working, but not the way you want), where does `C-h f' say
> it is defined?
>
I can't see reftex-do-citation with C-h f, as it's not
interactive. reftex-citation is the function that calls it, and for
that:

reftex-citation is an interactive autoloaded Lisp function in `reftex-cite'.


-- 
Regards,

Tyler Smith

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
  2007-02-21 15:49           ` Tyler Smith
@ 2007-02-21 17:00             ` Jim Ottaway
       [not found]             ` <mailman.4855.1172077233.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Jim Ottaway @ 2007-02-21 17:00 UTC (permalink / raw)
  To: help-gnu-emacs

> On 21 Feb 2007, Tyler Smith wrote:
> I can't see reftex-do-citation with C-h f, as it's not
> interactive. reftex-citation is the function that calls it, and for
> that:
> 
> reftex-citation is an interactive autoloaded Lisp function in `reftex-cite'.

C-h f works for non-interactive functions too. However, you need to load
reftex first: unlike reftex-citation, reftex-do-citation is not
autoloaded.

Regards,

-- 
Jim Ottaway

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
       [not found]             ` <mailman.4855.1172077233.2155.help-gnu-emacs@gnu.org>
@ 2007-02-21 20:38               ` Tyler Smith
  2007-02-22  4:44                 ` Kevin Rodgers
  0 siblings, 1 reply; 11+ messages in thread
From: Tyler Smith @ 2007-02-21 20:38 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-02-21, Jim Ottaway <j.ottaway@lse.ac.uk> wrote:
>> On 21 Feb 2007, Tyler Smith wrote:
>> I can't see reftex-do-citation with C-h f, as it's not
>> interactive. reftex-citation is the function that calls it, and for
>> that:
>> 
>> reftex-citation is an interactive autoloaded Lisp function in `reftex-cite'.
>
> C-h f works for non-interactive functions too. However, you need to load
> reftex first: unlike reftex-citation, reftex-do-citation is not
> autoloaded.
>
oh, ok then. I opened a new emacs, opened a .tex file which poppped me
into LaTeX, and discovered this:

reftex-do-citation is a compiled Lisp function in `reftex-cite'.


-- 
Regards,

Tyler Smith

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: citation separation in reftex
  2007-02-21 20:38               ` Tyler Smith
@ 2007-02-22  4:44                 ` Kevin Rodgers
  0 siblings, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2007-02-22  4:44 UTC (permalink / raw)
  To: help-gnu-emacs

Tyler Smith wrote:
> On 2007-02-21, Jim Ottaway <j.ottaway@lse.ac.uk> wrote:
>> C-h f works for non-interactive functions too. However, you need to load
>> reftex first: unlike reftex-citation, reftex-do-citation is not
>> autoloaded.
>>
> oh, ok then. I opened a new emacs, opened a .tex file which poppped me
> into LaTeX, and discovered this:
> 
> reftex-do-citation is a compiled Lisp function in `reftex-cite'.

So my original suggestions should be modified to either:

(require 'reftex-cite)
(defun reftex-do-citation ...)

or:

(eval-after-load "reftex-cite" '(defun reftex-do-citation ...))

-- 
Kevin Rodgers
Denver, Colorado, USA

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-02-22  4:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-15 16:10 citation separation in reftex Tyler Smith
2007-02-15 20:33 ` Jim Ottaway
     [not found] ` <mailman.4566.1171571649.2155.help-gnu-emacs@gnu.org>
2007-02-16  3:15   ` Tyler Smith
2007-02-16  7:50     ` Kevin Rodgers
2007-02-16  9:44     ` Jim Ottaway
     [not found]     ` <mailman.4580.1171612232.2155.help-gnu-emacs@gnu.org>
2007-02-16 13:12       ` Tyler Smith
2007-02-21  3:04         ` Kevin Rodgers
     [not found]         ` <mailman.4828.1172027079.2155.help-gnu-emacs@gnu.org>
2007-02-21 15:49           ` Tyler Smith
2007-02-21 17:00             ` Jim Ottaway
     [not found]             ` <mailman.4855.1172077233.2155.help-gnu-emacs@gnu.org>
2007-02-21 20:38               ` Tyler Smith
2007-02-22  4:44                 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).