title: How can I make variable local in a buffer with global default in Emacs
body: <p>In .emacs I have variable defined as:</p>
  
  <pre><code>(setq-default prevent-highlight-symbol-mode nil)
  </code></pre>
  
  <p>I use it to disable red tabs:</p>
  
  <pre><code>(add-hook 'font-lock-mode-hook
            (lambda()
              (if (and (null (memql major-mode highlight-chars-disable))
                       (not prevent-highlight-symbol-mode))
                   (hc-highlight-tabs))))
  </code></pre>
  
  <p>and use it in <a href="https://stackoverflow.com/questions/22671045/function-that-remove-specific-lambda-from-a-hook-in-emacs">project-specifics macro</a></p>
  
  <pre><code>(project-specifics "projects/some-project"
    (setq prevent-highlight-symbol-mode t)
    (setq indent-tabs-mode t))
  </code></pre>
  
  <p>but when I open a file in some-project directory and I check for <code>prevent-highlight-symbol-mode</code> in any buffer I've got <code>t</code> not <code>nil</code>, it's set globaly. How can I make that variable local in a buffer?</p>