Hello,

For those wanting to edit .nw files in demexp source, I'm using
following code in my .emacs. I'm also including a setting to be under
text-mode for editing Arch log files.


;; many thanks to Hubert Canon <[EMAIL PROTECTED]> for this code
(add-hook 'noweb-mode-hook 'my-noweb-set-mode-code)
(defun my-noweb-set-mode-code ()
  (let* ((filename (file-name-nondirectory buffer-file-name))
         (mode (cond ((string-match "^Makefile" filename) 'makefile-mode)
                     ((string-match "\\.lisp\\.pamphlet$" filename) 'lisp-mode)
                     ((string-match "\\.lsp\\.pamphlet$" filename) 'lisp-mode)
                     ((string-match "\\.clisp\\.pamphlet$" filename) 'lisp-mode)
                     ((string-match "\\.c\\.pamphlet$" filename) 'c-mode)
                     ((string-match "\\.h\\.pamphlet$" filename) 'c-mode)
                     ((string-match "\\.ml\\.nw$" filename) 'caml-mode)
                     ((string-match "\\.mli\\.nw$" filename) 'caml-mode)
                     ((string-match "\\.cd\\.nw$" filename) 'caml-mode)
                     ((string-match "\\.c\\.nw$" filename) 'c-mode)
                     ((string-match "\\.h\\.nw$" filename) 'c-mode)
                     ((string-match "\\.xdr\\.nw$" filename) 'c-mode)
                     ((string-match "\\.dtd\\.nw$" filename) 'sgml-mode)
                     ((string-match "\\.ui\\.nw$" filename) 'nxml-mode)
                     (t 'fundamental-mode))))
    (noweb-set-code-mode mode)))

;; to have text mode on Arch log files
(setq auto-mode-alist
      (append '(("\\+\\+log\\..*$"  . text-mode)
                ) auto-mode-alist))



Yours,
d.
-- 
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <[EMAIL PROTECTED]>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A



_______________________________________________
Demexp-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/demexp-dev

Répondre à