From 30c8a8fbf2b777ace960b11fcc7b93454e94040c Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 12 Nov 2007 13:04:21 +0000 Subject: [PATCH] emacs, dot-emacs: Support for assembler programming. --- dot-emacs.el | 15 +++++++++++++-- emacs | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dot-emacs.el b/dot-emacs.el index 4780435..09c1415 100644 --- a/dot-emacs.el +++ b/dot-emacs.el @@ -489,11 +489,14 @@ doesn't cope with anything approximating a complicated case." (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 @@ strip numbers instead." (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 ee4839b..55845f6 100644 --- a/emacs +++ b/emacs @@ -361,7 +361,7 @@ (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 @@ -452,6 +452,7 @@ (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) -- 2.11.0