From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Heike C. Zimmerer" Newsgroups: gmane.emacs.devel Subject: Re: gas-mode.el - Comments welcome Date: Thu, 31 May 2007 09:37:03 +0200 Organization: Mostly Harmless Message-ID: References: Reply-To: hcz@hczim.de NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1180599767 26739 80.91.229.12 (31 May 2007 08:22:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 31 May 2007 08:22:47 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 31 10:22:41 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Htfva-0006FV-Mg for ged-emacs-devel@m.gmane.org; Thu, 31 May 2007 10:22:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HtfvY-0005PA-S1 for ged-emacs-devel@m.gmane.org; Thu, 31 May 2007 04:22:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HtfvV-0005P5-D7 for emacs-devel@gnu.org; Thu, 31 May 2007 04:22:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HtfvR-0005Ot-AX for emacs-devel@gnu.org; Thu, 31 May 2007 04:22:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HtfvR-0005Oq-5T for emacs-devel@gnu.org; Thu, 31 May 2007 04:22:29 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HtfvP-0003hc-I5 for emacs-devel@gnu.org; Thu, 31 May 2007 04:22:28 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HtfgP-0001ri-0s for emacs-devel@gnu.org; Thu, 31 May 2007 10:06:57 +0200 Original-Received: from p54a11d7b.dip0.t-ipconnect.de ([84.161.29.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 May 2007 10:06:57 +0200 Original-Received: from hcz by p54a11d7b.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 May 2007 10:06:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 102 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p54a11d7b.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/23.0.0 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:72007 Archived-At: Stefan Monnier writes: > - 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 , unless it does it by > inheriting from the default faces. They lack the inherit. Will be corrected. > - 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. There's a comment at the start of gas-parse-comment-really which explains why I prefer regexp over syntax tables. > - it seems that comment-start, comment-start-skip, comment-end, > comment-end-skip are not defined. Not sure where what they would be needed for. I'm providing my own fill functions. Did I overlook anything? > - 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. Yes. Didn't do that. > - add some ;;;###autoload cookies (at least one for the major mode). Yes. > - fix naming to use the `gas-' (or `asm-') prefix for vars such as > `line-cache'. Provide defvars with docstring explaning what > they contain. The caches are always buffer-local. According to what I learned from the documentation, the prefix is only required for globals. I sometimes even deliberately removed the prefix from symbols to emphasize on its local binding (as here). Anything wrong with it? > - gas-change-comment-string seems not to be used. The ultimate word on it is not spoken yet; changing the comment character is not yet tested. > - 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? Purpose. asm-mode has it too, gas accepts it. > - 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 idea why I didn't bind it to a key directly is that I wanted it to show up wherever the user has bound a syntax-based jump to. forward-sexp seemed the nearest match. I'm not too lucky with it, but couldn't come up with a better key used for a similar purpose in other programming modes. As to transpose-sexps (C-M-t), I did not check this at all, since I didn't get the idea why anybody would try that in an asm context. I'll check it to make sure it at least does no harm. > - The docstring of gas-mode says that gas-comment calls comment-dwim, but > I don't see where that happens. OK. Will be changed (either the docstring or the binding). > 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. For the latter, it does. That's part of the 'dwim'. For the former, it means that it tries to remove only the kind of comment point is on, leaving the others untouched. There are different kinds of comments, starting in different columns, thus the 'leading white space'. I don't know of an other programming mode which has this distinction so I cannot say how it treats it. > - 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). This would remove about all and replace it by a different thing. It's not by accident or incorrectly that any part has been removed. It's not been removed, but rewritten without it. There are left-overs from asm-mode in it and I tried to use its terminology where appropriate, since that was where I once started from, but I doubt there are many. - Heike