title: How do I associate a minor mode to a particular file or a set of files based on extension?
body: <p>Currently, every time I open a text file in emacs, I have to <code>M-x longlines-mode</code> in order to get my line-wrapping turned on. Likewise in clojure, I have to <code>M-x paredit-mode</code> (although it does automatically set the major modes to text and clojure, respectively). </p>
  
  <p>I am hazy on the difference between major and minor modes, but I'm thinking the above-mentioned modes are minor. Is there a way to:</p>
  
  <ol>
  <li>configure emacs to open all clojure (*.clj) files with <code>paredit-mode</code> automatically?</li>
  <li>configure a particular file (say, notes.txt) to open with <code>longlines-mode</code>. I have tried adding <code>-^- mode: longlines -^-</code> or <code>-^- mode: longlines-mode -^-</code> as suggested in other threads, but it doesn't seem to work. I can't search for documentation on the <code>-^-</code> syntax because I don't know what it's called.</li>
  </ol>