title: How to move to end of temporary buffer in emacs inside function
body: <p>I am trying to write an emacs function that will run <code>make</code> in the current directory, change to another directory and run <code>make link</code> all while outputting the text to a new buffer called <strong>make-output</strong> (original, eh?). Once complete, I'd like to move to the <em>end</em> of the <strong>make-output</strong> buffer so that I can see whether the compile was successful. Here is what I've got currently:</p>
  
  <pre><code>(defun remake-libefp-interface()
    "Will run make in the current directory, change to the NWChem src directory and relink the binary."
    (interactive)
    (defvar T_pwd (getenv "PWD"))
    (defvar T_top (concat (getenv "NWCHEM_TOP") "/src"))
    (defvar cmd (concat "make; cd " T_top "; make link;cd " T_pwd))
    (with-output-to-temp-buffer "*make-output*"
      (shell-command cmd "*make-output*")
      (pop-to-buffer "*make-output*")
      (end-of-buffer)))
  </code></pre>
  
  <p>This recompiles correctly, but dumps me at the <em>beginninng</em> of <strong>make-output</strong>. I have also tried replacing the <code>(end-of-buffer)</code> with <code>(goto-char (point-max))</code>, but this also left me at the beginning.</p>