Re: [AUCTeX] Is it possible to use the buffer-file-name in a local variable ?

2015-02-02 Thread Tassilo Horn
Denis Bitouzé dbito...@wanadoo.fr writes:

 I'd like to use the buffer-file-name in a local variable, like this:

   ┌
   │ %%% Local Variables:
   │ %%% mode: latex
   │ %%% TeX-master: main
   │ %%% LaTeX-command: pdflatex 
 '\includeonly{buffer-file-name}\input{main}'
   │ %%% End:   ^^
   └

 Is it possible?

Yes, I think so.  You would use a local variable section with something
like

  %%% eval: (setq-local LaTeX-command
  %%%   (concat pdflatex '\includeonly{
  %%%   (buffer-file-name)
  %%%   }\input{main}')

But I don't think `LaTeX-command' is the right variable.  Wouldn't it
suffice to add the \includeonly to `TeX-command-extra-options'?

And as yet another alternative: As I understand, your goal is to speed
up compilation by only compiling the chapter you're currently writing
on.  In that case, there are already predefined commands to do exactly
that.  See especially

,[ (info (auctex)Starting a Command) ]
| -- Command: LaTeX-command-section
|  ('C-c C-z') Query the user for a command, and apply it to the
|  current section (or part, chapter, subsection, paragraph, or
|  subparagraph).  What makes the current section is determined by
|  'LaTeX-command-section-level' which can be enlarged/shrunken using
|  'LaTeX-command-section-change-level' ('C-c M-z').  The given
|  numeric prefix arg is added to the current value of
|  'LaTeX-command-section-level'.  By default,
|  'LaTeX-command-section-level' is initialized with the current
|  document's 'LaTeX-largest-level'.  The buffer contents are written
|  into the region file, after extracting the header and trailer from
|  the master file.  The command is then actually run on the region
|  file.  See 'TeX-command-region' for details.
`

And that doesn't even require that you split your document into one file
per chapter.

Bye,
Tassilo


___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX-devel] color.el: RFC and a question

2015-02-02 Thread Tassilo Horn
Arash Esbati esb...@gmx.de writes:

Hi Arash,

  Besides, I don't understand why 
 
  (LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)
 
  does not work -- it confuses any `completing-read' call.
 
 I don't see where `LaTeX-add-color-definecolors' is defined.  My
 AUCTeX copy doesn't have it, and neither does your style decare it.

 Thanks for your response.  `LaTeX-add-color-definecolors' is definded
 after invoking `TeX-auto-add-type' with arguments (cf. tex.el, line
 3508).  For my use case, it is this line:

 (TeX-auto-add-type color-definecolor LaTeX)

Ah, stupid me. ;-)

So to your original question.  The generated
`LaTeX-add-color-definecolors' has the signature

  (LaTeX-add-color-definecolors rest COLOR-DEFINECOLORS)

so it accepts zero or many color arguments (that's the meaning of
rest).  But when you call it like

  (LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)

what it gets is one list of colors.  I.e., the call is equivalent to

  (LaTeX-add-color-definecolors (list color1 color2...))

instead of

  (LaTeX-add-color-definecolors color1 color2...)

which would be correct.  So what you have to do is `apply' the function
to the list of dvi colors like so:

  (apply #'LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)

Otherwise, your style looks good and a quick test drive suggests that it
works as intended.  So please integrate the change above and resubmit,
then I'll instantly commit it.

Bye,
Tassilo

PS: Wow, it seems like this is going to be your 19th style contributed
to AUCTeX!  That makes you the top-third style contributor, and you're
already close to the top two Mads and Ralf. ;-)


___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] color.el: RFC and a question

2015-02-02 Thread Arash Esbati
Tassilo Horn tsdh at gnu.org writes:

Hi Tassilo,

 Arash Esbati esbati at gmx.de writes:

  Besides, I don't understand why 
 
  (LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors)
 
  does not work -- it confuses any `completing-read' call.
 
 I don't see where `LaTeX-add-color-definecolors' is defined.  My AUCTeX
 copy doesn't have it, and neither does your style decare it.

Thanks for your response.  `LaTeX-add-color-definecolors' is definded after
invoking `TeX-auto-add-type' with arguments (cf. tex.el, line 3508).  For my
use case, it is this line:

(TeX-auto-add-type color-definecolor LaTeX)

Best, Arash

PS: Thanks for installing my other patch.







___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel