demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Demexp-dev] Emacs configuration to edit noweb files


From: David MENTRE
Subject: [Demexp-dev] Emacs configuration to edit noweb files
Date: Wed, 17 Aug 2005 21:44:22 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

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 <address@hidden> 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 <address@hidden>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A





reply via email to

[Prev in Thread] Current Thread [Next in Thread]