auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Customizing "%cS" in TeX-expand-list


From: Mosè Giordano
Subject: Re: [AUCTeX] Customizing "%cS" in TeX-expand-list
Date: Thu, 20 Nov 2014 10:19:26 +0100

Hi Jean-Francois,

2014-11-19 19:11 GMT+01:00 jfbu <address@hidden>:
> Hi,
>
> I have upgraded to AUCTeX 11.88 via Elpa. Thanks to all who
> worked on it, as for the first time since quite a few years
> I experience the joy of not having C-c ` open some "TeXLive 20xx"
> window or, worse, tell me "Error occured after last TeX file closed"
>
> (the few times I tried an upgrade since 2011, it
> made things worse, and I had to revert to an ancient auctex
> installation copied-pasted from some other machine).
>
> I was quite elated to see that C-c ` works as expected with 11.88,
> (it probably does since a long time, I was just unable to upgrade
> earlier)
> and there is a very nice Error Overview menu entry which I didn't
> know about until now. (or did I just not see it? possible)

The error overview is a new feature in AUCTeX 11.88 ;-)

> Thanks to the experts who made this happen: Mosè, Tassilo, ..., sorry
> for the people I do not cite but I subscribe to the mailing list
> since only very recently. Great job!

Thanks!

> This message is about some customizations which I did some years back,
> at a time when I very temporarily to some vague elisp understanding,
> and that I am re-integrating to my custom-file (the understanding having
> vanished)
>
> My question is about how doing the things more effciently than my
> current method, which is to customize the full TeX-expand-list variable
> for only one change.
> The
> default definition of %cS as found in TeX-expand-list is
>
> ("%cS" TeX-source-specials-view-expand-client)
>
> I replace it by
> ("%cS" (lambda nil "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient
> --no-wait +%%l %%f"))
>
> This is to avoid having to put an alias to emacsclient in /usr/bin (which
> would quite possibly be wiped away by system upgrades) or more generally in
> $PATH
>
> Also this spares me having to put an editor entry in .xdvirc
>
> (I also configured the program for output-dvi to be, in case source-specials
> is on:
>
> open -a XQuartz && %(o?)xdvi -sourceposition \"%n %b\" -editor \"%cS\" [some
> paper option] %d
>
> and for output-pdf:
>
> /Applications/Skim.app/Contents/SharedSupport/displayline -b %n %o %b
>
> This is all on Mac OS X, and my Emacs is recently upgraded "Emacs Mac Port":
> GNU Emacs 24.4.3  from https://github.com/railwaycat/emacs-mac-port
> )
>
> What I do currently is to have the full TeX-expand-list
> customized in order to apply this single replacement of "%cS"
>
> Is there a Lisp-way to do this more economically?
> Could I just overwrite the TeX-source-specials-view-expand-client function?

You have two options: add

(add-to-list
 'TeX-expand-list
 '("%cS"
   (lambda nil
     "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --no-wait
+%%l %%f")))

(sorry for hard-wrapping of the code above) to your init file.  This
will add a new "%cS" entry to `TeX-expand-list' and only the first one
will be actually used.  Or, as you suggested, you can redefine the
`TeX-source-specials-view-expand-client' function after loading
tex.el:

(eval-after-load "tex"
  '(defun TeX-source-specials-view-expand-client ()
     "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --no-wait
+%%l %%f"))

> A second question:
>
> I know AUCTeX has many many features, and I am only using a small
> fraction. Currently I observe that the first loading when I launch
> Emacs and open a first .tex file takes noticeable time (about five seconds).
>
> Is there a "mode-for-the-dumb-guy-who-thinks-he-needs-only-a-few-things"
> which would load faster?

What makes AUCTeX slow should be the loading of style files, you can
try disabling file parsing and saving auto/*.el files, but then you'll
lose many features of AUCTeX.  This may be ok if you want just to open
a *TeX source and do minimal editing.

Bye,
Mosè



reply via email to

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