0

I have

(setq TeX-auto-local "subdir")
(setq TeX-macro-private '("dir/"))

I want to set TeX-auto-private to dir/subdir by joining TeX-auto-local and TeX-macro-private together. I thought it was easy but I can't find a way.

1

For the stated examples, simply concatenating the two strings can be done like so:

(setq TeX-auto-private (concat (car TeX-macro-private)
                               TeX-auto-local))
=> "dir/subdir"

However it looks to me as if TeX-auto-private also needs to be a list, rather than a string?

TeX-auto-private is a variable defined in ‘tex.el’.
Its value is ("/tmp/emacs-sandbox.ollfrTriav/HOME/.emacs.d/auctex/auto")

Documentation:
List of directories containing automatically generated AUCTeX style files.

These correspond to the personal TeX macros.

So perhaps you actually want this?

(push (concat (car TeX-macro-private) TeX-auto-local)
      TeX-auto-private)

Or, if you wish to clobber any existing list elements:

(setq TeX-auto-private (list (concat (car TeX-macro-private)
                                     TeX-auto-local)))
  • I don't understand your questions, excuse my ignorance. What do you mean with "initial values", the value the variable had before I set it? And regarding the second variable, I forgot where I first saw it set as a list element, but since it is where AUCTeX looks for private .sty files, it makes sense that it is a list that may be expanded – Arch Stanton Sep 5 '17 at 14:05
  • Never mind. I was a bit confused as to why one of the values was a list in the first place, but I've taken a look at tex.el now and can that it's expected to be so. However it looks like TeX-auto-private should also be a list, so I'll update the answer... – phils Sep 5 '17 at 22:23
  • I've found easier things in Emacs than setting up AUCTeX... I've tried your piece of code with push and I get an error: concat: Symbol's value as variable is void: TeX-macro-private edit: that's the error I got by evaluating the code in Emacs -Q. If I put the code in my init.el I get Symbol's value as variable is void: TeX-auto-private – Arch Stanton Sep 6 '17 at 8:37
  • If I put the code inside (with-eval-after-load "latex" ...) it doesn't give errors, but it does not load the auxiliary files, too. – Arch Stanton Sep 6 '17 at 9:21
  • 1
    I think the issue is related with TeX-style-path, see AUCTeX isn't loading local per-package style files, is ignoring TeX-auto-local – Arch Stanton Sep 6 '17 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.