From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: fork Newsgroups: gmane.emacs.help Subject: Generic mode -- keywords Date: Mon, 29 Aug 2011 16:15:58 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1314634586 11721 80.91.229.12 (29 Aug 2011 16:16:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Aug 2011 16:16:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 29 18:16:22 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qy4Va-0003mm-Jd for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Aug 2011 18:16:22 +0200 Original-Received: from localhost ([::1]:46472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy4Va-00070t-1v for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Aug 2011 12:16:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy4VV-0006zn-PV for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 12:16:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qy4VU-0001g0-Qt for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 12:16:17 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy4VU-0001fi-HJ for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 12:16:16 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qy4VQ-0003he-7f for help-gnu-emacs@gnu.org; Mon, 29 Aug 2011 18:16:12 +0200 Original-Received: from 198.239.99.92 ([198.239.99.92]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Aug 2011 18:16:12 +0200 Original-Received: from forkandwait by 198.239.99.92 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Aug 2011 18:16:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 198.239.99.92 (Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/6.0) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82086 Archived-At: I have written a generic mode for sas editing (ESS sucks and is WAY to big and complex, sorry if I offend...). Below [1] is a contrived example of that code, which basically highlights comments, the keyword "and", and the funky SAS commenting style of "* blah;" (asterix followed by semicolon with commented stuff in between): When editing, if a defined keyword like "and" is contained in a "*;" type comment, the mode doesn't highlight the *; comment, but as long as there is no keyword, it works fine. Is there a way to force the *; comment pattern to override the keyword behavior? [1]: (define-generic-mode 'simple-sas-mode '(("/*" . "*/"))delimiters '( "and" ) '( ("\\(\\*[^;\\*/]*;\\)" 1 'font-lock-comment-face) ) ; ... other stuff )