; Macros for editing m3makefiles ; Created by Jorge Stolfi on 93-04-02 ; Last edited on 2001-09-30 19:29:06 by stolfi (defvar last-make-command nil "The last `make' command that was executed") (defvar m3mk-build-command "m3build -d .." "Command to build the package") (defvar m3mk-ship-command "m3build -d .. && m3ship -d .." "Command to build and ship the package") (defvar m3mk-keymap nil "Keymap used in m3makefile-mode.") (if m3mk-keymap () (let ((map (make-sparse-keymap))) (define-key map "\C-c\C-c" 'm3mk-build) (define-key map "\C-c\C-a" 'm3mk-build) (define-key map "\C-c\C-s" 'm3mk-ship) (define-key map "\C-c`" 'next-error) ; also (usually) on "\C-x`" (setq m3mk-keymap map) ) ) (defun m3makefile-mode () "This is a mode for editing m3makefiles. \\{m3mk-keymap} m3mk-build-command holds the command to build the package. m3mk-ship-command holds the command to build and ship the package." (interactive) (kill-all-local-variables) ; (setq debug-on-error t) ; DEBUG (use-local-map m3mk-keymap) (setq major-mode 'm3makefile-mode) (setq mode-name "M3makefile") (setq indent-tabs-mode nil) (make-local-variable 'require-final-newline) (setq require-final-newline t) (make-local-variable 'comment-start) (setq comment-start "# ") (make-local-variable 'comment-end) (setq comment-end "") (make-local-variable 'comment-column) (setq comment-column 1) (make-local-variable 'comment-start-skip) (setq comment-start-skip "\\*+ *") (make-local-variable 'comment-indent-hook) (setq comment-indent-hook 'c-comment-indent) (make-local-variable 'parse-sexp-ignore-comments) (setq parse-sexp-ignore-comments t) (run-hooks 'm3makefile-mode-hook)) (defun m3mk-build () "Build the Modula-3 package whose source directory is the current directory" (interactive) (setq last-make-command m3mk-build-command) (compile m3mk-build-command) ) (defun m3mk-ship () "Build ad ship the Modula-3 package whose source directory is the current directory" (interactive) (compile m3mk-ship-command) )