chiark / gitweb /
emacs, dot-emacs: Support for assembler programming.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 12 Nov 2007 13:04:21 +0000 (13:04 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 12 Nov 2007 13:28:37 +0000 (13:28 +0000)
dot-emacs.el
emacs

index 478043581174174dce06c2a1c098f56dcc1b04f4..09c1415119ebf751256beb43c50b884c56a1a82d 100644 (file)
@@ -489,11 +489,14 @@ (defun mdw-misc-mode-config ()
   (and mdw-auto-indent
        (cond ((eq major-mode 'lisp-mode)
              (local-set-key "\C-m" 'mdw-indent-newline-and-indent))
-            ((eq major-mode 'slime-repl-mode) nil)
+            ((or (eq major-mode 'slime-repl-mode)
+                 (eq major-mode 'asm-mode))
+             nil)
             (t
              (local-set-key "\C-m" 'newline-and-indent))))
   (local-set-key [C-return] 'newline)
-  (local-set-key [?\;] 'self-insert-command)
+  (or (eq major-mode 'asm-mode)
+      (local-set-key [?\;] 'self-insert-command))
   (local-set-key [?\#] 'self-insert-command)
   (local-set-key [?\"] 'self-insert-command)
   (setq comment-column 40)
@@ -1298,6 +1301,14 @@ (defun arm-assembler-mode ()
 
   (run-hooks 'arm-assembler-mode-hook))
 
+;;;----- Assembler mode -----------------------------------------------------
+
+(defun mdw-fontify-asm ()
+  (modify-syntax-entry ?' "\"")
+  (modify-syntax-entry ?. "w")
+  (setf fill-prefix nil)
+  (mdw-standard-fill-prefix "\\([ \t]*;+[ \t]*\\)"))
+
 ;;;----- TCL configuration --------------------------------------------------
 
 (defun mdw-fontify-tcl ()
diff --git a/emacs b/emacs
index ee4839bb537db6b0d7ac48bad1f8674db60e55c1..55845f63a3adf9a774e8d65b654d9bda79745824 100644 (file)
--- a/emacs
+++ b/emacs
 (mapcar (lambda (hook) (add-hook hook 'mdw-misc-mode-config))
        '(c-mode-hook c++-mode-hook objc-mode-hook java-mode-hook
          perl-mode-hook cperl-mode-hook python-mode-hook awk-mode-hook
-         tcl-mode-hook
+         tcl-mode-hook asm-mode-hook
          TeX-mode-hook LaTeX-mode-hook TeXinfo-mode-hook
          tex-mode-hook latex-mode-hook texinfo-mode-hook
          emacs-lisp-mode-hook scheme-mode-hook
 (add-hook 'objc-mode-hook 'mdw-fontify-c-and-c++ t)
 (add-hook 'c++-mode-hook 'mdw-fontify-c-and-c++ t)
 (add-hook 'linux-c-mode-hook #'(lambda () (setq c-basic-offset 8)))
+(add-hook 'asm-mode-hook 'mdw-fontify-asm t)
 
 (add-hook 'apcalc-mode-hook 'mdw-misc-mode-config t)
 (add-hook 'apcalc-mode-hook 'mdw-fontify-apcalc t)