all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Magnan de Bornier <jean@bornier.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Customize reftex according to auctex mode
Date: Sun, 30 Nov 2008 16:48:11 +0100	[thread overview]
Message-ID: <87fxl99pvo.fsf@bornier.net> (raw)
In-Reply-To: mailman.1549.1228057943.26697.help-gnu-emacs@gnu.org

Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote :

| Jean Magnan de Bornier wrote:
| > Hi all, I have been trying to customize reftex-cite-format to be
| > "\cite{%l}" when
| > using LaTeX, and "\cite[%l]" when using ConTeXt.
| >
| > My first attempt was simply the last line here:
| >
| > (add-hook 'ConTeXt-mode-hook
| > 	  (function
| >  	   (lambda ()  	     (reftex-mode t)
| >  	     (auto-fill-mode 1)
| >  	     (LaTeX-math-mode 1)
| >  	     ))
| > (setq reftex-cite-format "\\cite[%l]"))
| >
| > But this command once given is also applied to latex files; I then tried
| > writing the corresponding instruction in (add-hook 'LaTeX-mode-hook...
| > but then auctex has reverted to the latex behavior even for context files.
| >
| > So apparently I cannot customize reftex within aa auctex mode? Or am I
| > just clumsy?
>
| A little clumsy, yes  :-)  First, you need to move the setq form inside
| the hook function.  As it is, the setq form is being evaluated when
| add-hook runs, providing its APPEND argument.
>
| Second, you probably want to make reftex-cite-format's value local to
| the Context mode buffers.  So:
>
| (add-hook 'ConTeXt-mode-hook
| 	  (function
|  	   (lambda ()
|  	     (reftex-mode t)
|  	     (auto-fill-mode 1)
|  	     (LaTeX-math-mode 1)
| 	     (set (make-local-variable 'reftex-cite-format) "\\cite[%l]"))))

Thank you so much Kevin, this works like a charm!
-- 
Jean


      parent reply	other threads:[~2008-11-30 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-30 10:15 Customize reftex according to auctex mode Jean Magnan de Bornier
2008-11-30 15:12 ` Kevin Rodgers
     [not found] ` <mailman.1549.1228057943.26697.help-gnu-emacs@gnu.org>
2008-11-30 15:48   ` Jean Magnan de Bornier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fxl99pvo.fsf@bornier.net \
    --to=jean@bornier.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.