unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Pascal Bourguignon <spam@mouse-potato.com>
Subject: Re: Configuring asm-mode
Date: Thu, 24 Nov 2005 19:17:44 +0100	[thread overview]
Message-ID: <878xvd52rb.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: 87psoqw1ab.fsf@be.cs.appstate.edu

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/

  parent reply	other threads:[~2005-11-24 18:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-24 14:47 Configuring asm-mode Kenneth Jacker
2005-11-24 16:04 ` Thien-Thi Nguyen
2005-11-24 18:17 ` Pascal Bourguignon [this message]
2005-11-25 17:10   ` khjacker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878xvd52rb.fsf@thalassa.informatimago.com \
    --to=spam@mouse-potato.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).