auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] auctex Digest, Vol 92, Issue 16


From: Ivan Andrus
Subject: Re: [AUCTeX] auctex Digest, Vol 92, Issue 16
Date: Wed, 24 Oct 2012 22:07:28 +0200

Oops.  Sorry, that's from my .emacs:

(defun alist-set (alist-symbol key value &optional search-cdr)
  "e.g. (alist-set 'interpreter-mode-alist 'perl-mode 'cperl-mode t)"
  (let ((cons-cell (if search-cdr
                       (rassoc key (symbol-value alist-symbol))
                     (assoc key (symbol-value alist-symbol)))))
    (if cons-cell
        (if search-cdr
            (setcar cons-cell key)
          (setcdr cons-cell value))
      (set alist-symbol (cons (cons key value)
                              (symbol-value alist-symbol))))))

However, it's probably just easier to use add-to-list if you
don't need to overwrite values.  Namely:

    (add-to-list 'TeX-expand-list
                 '("%(-PDF)"
                   (lambda ()
                     (if (and (not TeX-Omega-mode)
                              (or TeX-PDF-mode TeX-DVI-via-PDFTeX))
                         "-pdf" "-dvi"))))

    (add-to-list 'TeX-command-list
                 '("Latexmk" "latexmk %(-PDF) %s"
                   TeX-run-TeX nil t
                   :help "Run Latexmk on file to build everything."))

-Ivan

On Oct 24, 2012, at 7:34 PM, Benjamin Slade wrote:

> Thanks for this.
> 
> However, I get an error when I try to evaluate it. Emacs doesn't know
> what function alist-set is?  I'm guessing this is taken from a larger
> bit of elisp? (Where alist-set is defined?) 
> 
> Thanks again.
> 
>> ----------------------------------------------------------------------
>> 
>> Message: 1
>> Date: Wed, 24 Oct 2012 10:05:56 +0200
>> From: Ivan Andrus <address@hidden>
>> To: Benjamin Slade <address@hidden>
>> Cc: address@hidden
>> Subject: Re: [AUCTeX] set up latexmk as default engine + automatically
>>      add     flags for lualatex, xelatex
>> Message-ID: <address@hidden>
>> Content-Type: text/plain; charset=us-ascii
>> 
>> On Oct 22, 2012, at 6:57 PM, Benjamin Slade wrote:
>> 
>>> For orgmode, I have a setup that calls up latexmk and automatically
>>> provides the proper flags for luatex and xetex based on detection of a
>>> string in the buffer like "#+LATEX_CMD: lualatex".*
>>> 
>>> I'm wondering how to:
>>> 
>>> (1) Add Latexmk as a C-c C-c command for AUCTeX, and set it as default.
>> 
>> Here is what I use (except that I don't actually make Latexmk the default in 
>> my .emacs):
>> 
>>    (alist-set 'TeX-expand-list
>>               "%(-PDF)"
>>               (list (lambda ()
>>                       (if (and (not TeX-Omega-mode)
>>                                (or TeX-PDF-mode TeX-DVI-via-PDFTeX))
>>                           "-pdf" "-dvi"))))
>> 
>>    (alist-set 'TeX-command-list
>>               "Latexmk" '("latexmk %(-PDF) %s"
>>                           TeX-run-TeX nil t
>>                           :help "Run Latexmk on file to build everything."))
>> 
>>    (setq TeX-command-default "Latexmk")
>> 
>>> (2) Institute something similar which searches the buffer for something
>>> like "LATEX_CMD: lualatex" and set the flags for running latexmk
>>> accordingly.
>> 
>> % Local Variables:
>> % TeX-engine: luatex
>> % End:
>> 
>> -Ivan
>> 
>> 
>> 
>> 
>> ------------------------------
>> 
>> _______________________________________________
>> auctex mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/auctex
>> 
>> 
>> End of auctex Digest, Vol 92, Issue 16
>> **************************************
> 
> 
> -- 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> {sent by mu4e on Emacs running under GNU/Linux}

-Ivan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]