title: Call a function in Vim’s `autocmd` command
body: <p>I want to use the <code>expand</code> function in an <code>autocmd</code>. In particular, I am adapting a <a href="https://stackoverflow.com/questions/1240037/recommended-build-system-for-latex/1394702#1394702">tip</a> by Paul Biggar and I wanted to use the following auto command in my <code>.gvimrc</code>:</p>
  
  <pre><code>autocmd FileType tex set makeprg=rubber-info\ expand("%:t:r").log
  </code></pre>
  
  <p>– Which of course doesn’t work. So what I actually want this to mean is that upon opening a <code>tex</code> file, the <code>makeprg</code> variable is set to the value of <code>rubber-info filename.log</code> where <code>filename</code> is the name of the TeX file without its file extension.</p>
  
  <p>How can I accomplish this?</p>