From: Stefan Monnier <monnier@iro.umontreal.ca>
To: hcz@hczim.de
Cc: emacs-devel@gnu.org
Subject: Re: gas-mode.el - Comments welcome
Date: Wed, 30 May 2007 19:05:43 -0400 [thread overview]
Message-ID: <jwvejkyj6ep.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <f3k2nv$ke3$1@sea.gmane.org> (Heike C. Zimmerer's message of "Wed\, 30 May 2007 16\:43\:00 +0200")
> It is now time time to check it out in order to make it ready for
> inclusion with GNU Emacs. So I'm asking you for comments. If you do
> assembly language programming, you could try it out. If you know
> someone who might be interested, you could make him aware of it.
> Also, since Lisp is not the language I usually do much programming in,
> tips, hints and comments on coding style and conformance to coding
> conventions are welcome.
I don't do much asm programming (just enough to prompt me to slightly revise
asm-mode.el's indentation a few years while back), but here are some
comments:
- when you define faces used for font-locking, try to make them inherit from
font-lock's default faces. I personally hate color-based highlighting and
use font-based highlighting instead, and every mode which redefines its
own set of faces is just a pain in the <beep>, unless it does it by
inheriting from the default faces.
- I'd use word and symbol syntaxes instead of `gas-re-sym' and friends.
I.e. instead of (skip-chars-forward gas-skip-sym), I'd use
(skip-syntax-forward "w_") and I'd use "\\_>" and "\\_<" for symbol
boundaries instead of gas-re-nosym.
- it seems that comment-start, comment-start-skip, comment-end,
comment-end-skip are not defined.
- try C-u M-x checkdoc-current-buffer RET
It'll complain about things which you may rightfully decide to leave
unchanged, but it will also complain about some cosmetic things which you
need to fix, e.g. the first line should have 3 semi-colons rather than 2.
It may also tell you to use names such as "*-flag" for boolean vars, with
which I completely disagree.
- add some ;;;###autoload cookies (at least one for the major mode).
- fix naming to use the `gas-' (or `asm-') prefix for vars such as
`line-cache'. Provide defvars with docstring explaning what
they contain.
- gas-change-comment-string seems not to be used.
- your syntax-table also accepts comments of the form //...\n although this
seems to be mentioned nowhere. Is it done on purpose or is it
an oversight?
- not sure if I like the "use forward-sexp to jump to next occurrence of
highlighted symbol". In conjunction with C-M-t for example, this is odd.
The intention of forwrd-sexp-function is to allow the use of elisp code
when the syntax-table isn't flexible enough to describe some "sexps"
(e.g. sexps like "begin ... end"). If you want to extend the semantics of
C-M-f (rather than forward-sexp which may very well be called
non-interactively by other pieces of Elisp code) then rebind this
key sequence.
- The docstring of gas-mode says that gas-comment calls comment-dwim, but
I don't see where that happens. Also its description of comment-dwim
doesn't quite match my understanding of it. AFAIK it doesn't treat
"comment with leading white space" specially and it doesn't remove
comments unless provided with a C-u prefix.
- Try to present it as a patch to asm-mode.el (this one does set
comment-start and friends, so the patch would make it trivial to see that
this part was incorrectly removed).
Stefan
next prev parent reply other threads:[~2007-05-30 23:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-30 14:43 gas-mode.el - Comments welcome Heike C. Zimmerer
2007-05-30 18:23 ` Masatake YAMATO
2007-05-30 22:18 ` Heike C. Zimmerer
2007-05-31 4:11 ` Masatake YAMATO
2007-05-30 23:05 ` Stefan Monnier [this message]
2007-05-31 7:37 ` Heike C. Zimmerer
2007-05-31 9:07 ` David Kastrup
2007-05-31 9:28 ` Heike C. Zimmerer
2007-05-31 17:07 ` Stefan Monnier
2007-06-01 9:18 ` Johan Bockgård
2007-06-01 13:09 ` Heike C. Zimmerer
2008-07-22 19:27 ` Dan Nicolaescu
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvejkyj6ep.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=hcz@hczim.de \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.