[uf-discuss] Formating Code
Edward O'Connor
hober0 at gmail.com
Tue Nov 1 08:44:56 PST 2005
> Programming languages by definition have extremely well-defined
> semantics, so it isn't necessary to mark up variables and so on in
> blocks of code.
I often mark up variables and so on, for syntax highlighting purposes.
For instance:
<pre><code class='elisp'>
(add-hook 'find-file-hook
(<span class='keyword'>lambda</span> ()
(<span class='keyword'>if</span> (and (null indent-tabs-mode)
(local-variable-p 'indent-tabs-mode) <span class='comment'>; Trust the major mode.</span>
(<span class='keyword'>save-excursion</span>
(goto-char (point-min))
<span class='comment'>;; If there are at least 10 lines with a leading TAB, use TABs.</span>
(re-search-forward <span class='string'>"^ "</span> (+ (point) 100000) t 10)))
(set (make-local-variable 'indent-tabs-mode) t))))</code></pre>
Ted
--
Edward O'Connor
hober0 at gmail.com
Ense petit placidam sub libertate quietem.
More information about the microformats-discuss
mailing list