From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Scott Frazer Newsgroups: gmane.emacs.help Subject: Re: Adding multi-group regexps to align-rules-list Date: Thu, 21 May 2009 09:49:41 -0400 Organization: Ye 'Ol Disorganized NNTPCache groupie Message-ID: <1242913794.51233@sj-nntpcache-3.cisco.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1242916894 11175 80.91.229.12 (21 May 2009 14:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2009 14:41:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 21 16:41:27 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M79SY-0004kI-4l for geh-help-gnu-emacs@m.gmane.org; Thu, 21 May 2009 16:41:26 +0200 Original-Received: from localhost ([127.0.0.1]:46154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M79SX-0003ql-Is for geh-help-gnu-emacs@m.gmane.org; Thu, 21 May 2009 10:41:25 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe12.iad.POSTED!7564ea0f!not-for-mail User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) Original-Newsgroups: gnu.emacs.help In-Reply-To: Cache-Post-Path: sj-nntpcache-3.cisco.com!unknown@scfrazer-wxp.cisco.com X-Cache: nntpcache 3.0.2 (see http://www.nntpcache.com/) Original-Lines: 96 Original-X-Complaints-To: newsadmin@cisco.com Original-NNTP-Posting-Date: Thu, 21 May 2009 13:49:42 UTC Original-Xref: news.stanford.edu gnu.emacs.help:169361 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64610 Archived-At: Peter Monsson wrote: > I'm trying to extend verilog mode with an alignment of input and > output ports such that > > ( > input test, > output test, > input [13:0] gfdgtrg, > output [112:1] dsfsf, > output control > ); > > becomes > > ( > input test, > output test, > input [13:0] gfdgtrg, > output [112:1] dsfsf, > output control > ); > > But I keep getting wrong type argument: integer-or-marker-p on the > group list. I've tried quoting, backtick, cons cells, lists, etc. but > nothing works. The documentation says that lists are allowed in group > and from skimming the source code it seems to be implemented as well. > So what am I doing wrong? > > (add-hook 'align-load-hook (lambda () > (add-to-list 'align-rules-list > '(verilog-port-args > (regexp . "\\(?:in\\|out\\)put\\(?:\\(\\s-+\\)\\ > (?:\\[.*\\]\\(\\s-+\\)\\)?\\)") > (group . (1 . (2 . ( 3 . 4)))) > (modes . '(verilog-mode)) > (repeat . t))))) > Here's what I have (although written long ago when my elisp was more naive): (defcustom align-verilog-rules-list `( (verilog-declaration (regexp . "\\(logic\\|input\\|output\\|inout\\|wire\\|reg\\)\\(\\s-+[[][^]]+[]]\\|\\)\\(\\s-+\\)\\S-") (group . (3))) (verilog-asgn_param (regexp . "\\(assign\\|parameter\\)\\(\\s-+\\)\\S-") (group . (2))) (verilog-assign (regexp . "\\S-+\\(\\s-*\\)[!=><]+\\(\\s-*\\)\\S-") (group . (1 2))) (verilog-ports-no-comment (regexp . "[.][a-zA-Z0-9_]+\\(\\s-+\\)\\S-") (group . (1))) (verilog-ports-comment (regexp . "[.][a-zA-Z0-9_]+\\(\\s-+\\)\\S-.*\\(\\s-+\\)[/]+") (group . (1 2))) ) "Verilog alignment rules." :type align-rules-list-type :group 'align) (defcustom align-exclude-verilog-rules-list `( (exc-dq-string (regexp . "\"\\([^\"\n]+\\)\"") (repeat . t) (modes . align-dq-string-modes)) (exc-open-comment (regexp . ,(function (lambda (end reverse) (funcall (if reverse 're-search-backward 're-search-forward) (concat "[^ \t\n\\\\]" (regexp-quote comment-start) "\\(.+\\)$") end t)))) (modes . align-open-comment-modes)) ) "Verilog alignment exclusion rules." :type align-exclude-rules-list-type :group 'align) (put 'align-verilog-rules-list 'risky-local-variable t) (put 'align-exclude-verilog-rules-list 'risky-local-variable t) (add-to-list 'align-dq-string-modes 'verilog-mode) (add-to-list 'align-open-comment-modes 'verilog-mode) (defun verilog-extras-hook () (setq align-mode-rules-list align-verilog-rules-list) (setq align-exclude-rules-list align-exclude-verilog-rules-list)) (add-hook 'verilog-mode-hook 'verilog-extras-hook t)