title: How to customize emacs auc-tex function Tex-command-list?
body: <p>I'm trying to use the latex package `nomencl' which allows one to easily create a Nomenclature section in an article. So far so good.</p>
  
  <p>I'm using emacs with AucTeX and I added the nomenclature compile option to the emacs Tex-Command-list by editing my .emacs file, adding:</p>
  
  <pre><code>;;nomenclature for latex
  (eval-after-load "tex"
    '(add-to-list 'TeX-command-list 
          '("Nomenclature" "makeindex %s.nlo -s nomencl.ist -o %s.nls" TeX-run-command nil t :help "Create nomenclature file")))
  </code></pre>
  
  <p>to it, this works: when I press <code>C-c C-c</code> (the shortcut for TeX-command-list I can use the <code>Nomenclature</code> command and the appropriate file is generated. I am unhappy though, for the following reason:</p>
  
  <p>When I run BibTex (using Tex-Command-list), and then press C-c C-c again, emacs offers to run LaTeX, as appropriate, and if references have changed, it will offer LaTeX again, finally, it will offer View, once the .log doesn't report references have changed. </p>
  
  <p><strong>However</strong> When I run Nomenclature, the next command offered by Tex-command-list is View, which is alway inappropriate, since one needs to compile again after recreating the nomenclature file. </p>
  
  <blockquote>
    <p>How can I tell emacs to give LaTeX as the next TeX-command-list command after running Nomenclature (same behavior as BibTeX)?</p>
  </blockquote>