Hello,

Martin Rubey <[EMAIL PROTECTED]> writes:

> An important thing would either be a fantastic pamphlet mode for emacs
> or the possibility to retain a little of the documentation in the
> source file.

noweb (the tool behind Tim's pamphlets) provides an emacs mode
(noweb-mode). It allows to use simultaneously two modes, latex-mode for
the LaTeX part and another mode for the program part. With most emacs
modes, font coloring and auto indentation is correct (except sometimes
the first line of a code chunk). Maybe you were thinking at more
elaborate things but this is a first start.

For what it's worth, I'm using following code in my .emacs:

;; To have noweb mode automatically
(setq auto-mode-alist
      (append '(("\\.pamphlet$"  . noweb-mode)
                ) auto-mode-alist))

;; 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)))


Yours,
david
-- 
David MENTRE <[EMAIL PROTECTED]> -- http://www.nongnu.org/axiom/



_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to