Sebastian Geerken wrote:
(Emacs' use of tabs messes up things sometimes, and the 2-space indent it uses are not consistent with Dillo's conventions).
Emacs users, put the following code into ~/.emacs:
---------------------------------------------------------------------- (defun array-find (a1 a2 &optional index-or-nil) (let ((index (if index-or-nil index-or-nil 0)) (l1 (length a1)) (l2 (length a2))) (if (> (+ index l2) l1) nil (let ((i 0)) (while (and (< i l2) (= (aref a1 (+ index i)) (aref a2 i))) (setq i (+ i 1))) (if (= i l2) index (array-find a1 a2 (+ index 1)))))))
(defun my-c-hook () (if (array-find (buffer-file-name) "/dillo") (progn ;; dillo conventions (set-variable 'indent-tabs-mode nil) (set-variable 'c-basic-offset 3)) ;; conventions for other code (set-variable 'indent-tabs-mode t) (set-variable 'c-basic-offset 2)))
(add-hook 'c-mode-hook 'my-c-hook)
Thanks... Makes it a bit easier to be Dillo-compliant... Cheers//Frank -- WWWWW ________________________ ## o o\ / Frank de Lange \ }# \| / +46-734352015 \ \ `--| _/ <Hacker for Hire> \ `---' \ +31-640037120 / \ frank@unternet.org / `------------------------' [ "Omnis enim res, quae dando non deficit, dum habetur et non datur, nondum habetur, quomodo habenda est." ]