help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Configuring asm-mode


From: Pascal Bourguignon
Subject: Re: Configuring asm-mode
Date: Thu, 24 Nov 2005 19:17:44 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Kenneth Jacker <khj@be.cs.appstate.edu> writes:

> [ I posted this on comp.emacs over a week ago, but got no response(s) ]
> [ ... please forgive it you've already seen it!  -khj                 ]
>
> It appears that the only aspect of 'asm-mode' that is easy to
> configure is the "comment character".
>
> How might I change the default comment and indentation rules?
>
> Is my only option to modify or override what's in the "asm-mode.el"?

Well, when I typed in some 7090 assembler, I wrote my own font-locking
and setting tabs and comment character:

;; ...

(defun asm7090-font-lock ()
  (interactive)
  (setq font-lock-defaults nil
        font-lock-keywords nil)
  (font-lock-add-keywords 
   nil
   (list
    (list
     (function search-asm7090-fields) ; parses an asm line.
     '(1 font-lock-function-name-face)       ; labels
     '(2 font-lock-keyword-face)             ; operation codes
     '(3 font-lock-reference-face)           ; arguments
     '(4 font-lock-comment-face)             ; comments
     '(5 font-lock-preprocessor-face)        ; ibsys
     '(6 font-lock-type-face)                ; cols 72-80
     ))))


(defun asm7090 ()
  (interactive)
  (asm7090-font-lock)
  (make-local-variable 'tab-stop-list)
  (setf tab-stop-list     '(0 7 15 34 72)
        asm-comment-char   ?*)
  (local-set-key (kbd "TAB") (function tab-to-tab-stop))
  (local-set-key (kbd "RET") (lambda ()
                               (interactive) 
                               (asm7090-describe-codop) 
                               (newline-and-indent)))
  (font-lock-mode 1)
  (message "asm7090 activated"))



You can fetch it with:

cvs -z3 -d 
:pserver:anonymous@cvs.informatimago.com:/usr/local/cvs/public/chrooted-cvs/cvs 
co emacs/
http://www.informatimago.com/develop/emacs/index.html


-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
__Pascal Bourguignon__                     http://www.informatimago.com/


reply via email to

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