1

Some background, I have some code that sets a default compile command depending on the mode. However, in some files, I've used the add-file-local-variable-prop-line to create a more specific command, and this overwrites that. I need to check if compile-command has been defined for the file, so I don't assign a default value when the file already has a compile-command.

I've tried using file-local-variables-alist, but it's value is nil, even when there are local variables.

0

1 Answer 1

2

Where are you trying to use file-local-variables-alist?

If you're using a mode hook, local variables haven't been processed yet.

Use hack-local-variables-hook.

4
  • I'm not using a mode hook, so I expect it's something else. Commented Oct 20, 2015 at 20:22
  • That doesn't answer my question, though. Commented Oct 20, 2015 at 23:24
  • Oh, I'm trying to use it a function bound to a keyboard shortcut. It looks like something in my init file was causing some file local variables to not be processed. Commented Oct 21, 2015 at 19:38
  • 1
    I guess. Check with C-h v to see whether the variable has a buffer-local value or not. If not, then you could use recursive bisection on your config until you figure out the cause. Commented Oct 22, 2015 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.