[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] imakeidx.el and a patch for latex.el
From: |
Tassilo Horn |
Subject: |
Re: [AUCTeX-devel] imakeidx.el and a patch for latex.el |
Date: |
Sun, 30 Dec 2012 11:11:52 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
"address@hidden" <address@hidden> writes:
> Hi Tassilo,
>
>>Just a bit more nitpicking:
>>
>>> ;; `firstpagestyle' and `headers' options for `indexsetup' macro are
>>> ;; available only if `fancyhdr' is not loaded. The following code
>>> ;; works only if `imakeidx' is loaded before `fancyhdr'
>>> (unless (member "fancyhdr" TeX-active-styles)
>>> ;; `firstpagestyle' key takes as value one of the available
>>> ;; pagestyles. `LaTeX-pagestyle-list' is a list of lists of
>>> ;; strings, we need a list of strings
>>> (setq LaTeX-imakeidx-firstpagestyle-values
>>> (mapcar #'car LaTeX-pagestyle-list))
>>
>>You shouldn't create new global variables just with setq. If
>>`LaTeX-imakeidx-firstpagestyle-values' is supposed to be a global
>>variable, defvar it. (I don't see why it needs to be a global
>>variable.)
>>
> I believe that `LaTeX-imakeidx-firstpagestyle-values' should be buffer
> local, like `LaTeX-pagestyle-list'. Should I use
> (make-variable-buffer-local 'LaTeX-imakeidx-firstpagestyle-values) and
> then `setq' or what?
You could defvar it first, then make it buffer local, and then setq it.
But I think you don't need to create a new global variable at all. This
should do the trick without it.
(unless (member "fancyhdr" TeX-active-styles)
;; `firstpagestyle' key takes as value one of the available
;; pagestyles. `LaTeX-pagestyle-list' is a list of lists of
;; strings, we need a list of strings
(setq LaTeX-imakeidx-indexsetup-options
(append LaTeX-imakeidx-indexsetup-options
`(("firstpagestyle" ,(mapcar #'car LaTeX-pagestyle-list)))
'(("headers")))))
>>> (setq LaTeX-imakeidx-indexsetup-options
>>> (append LaTeX-imakeidx-indexsetup-options
>>> '(("firstpagestyle" LaTeX-imakeidx-firstpagestyle-values))
>>> '(("headers")))))
>>
>>You change the global value of LaTeX-imakeidx-indexsetup-options here.
>>I think, LaTeX-imakeidx-indexsetup-options should be buffer-local, I
>>mean, I can work with one document using imakeidx and fancyhdr, and one
>>with imakeidx but without fancyhdr, right?
> Yes, it's correct. So, what should I do? Just make also `LaTeX-imakeidx-
> indexsetup-options' buffer-local?
Yes, make `LaTeX-imakeidx-indexsetup-options' buffer-local.
Bye,
Tassilo