From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Keller Newsgroups: gmane.emacs.help Subject: High Lighting Lisp Forms Date: 02 Feb 2010 17:56:12 GMT Organization: elsewhere Message-ID: <4b68673c$0$9898$80265adb@spool.cs.wisc.edu> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1265177993 28993 80.91.229.12 (3 Feb 2010 06:19:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Feb 2010 06:19:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 03 07:19:50 2010 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.69) (envelope-from ) id 1NcYaY-0007kD-VT for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Feb 2010 07:19:47 +0100 Original-Received: from localhost ([127.0.0.1]:45827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NcYaY-00007U-Dc for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Feb 2010 01:19:46 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!panix!newsfeed-00.mathworks.com!newsfeed.cs.wisc.edu!news.cs.wisc.edu!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/2.6.18-164.6.1.el5 (i686)) Original-Lines: 56 Original-NNTP-Posting-Host: merlin.cs.wisc.edu Original-X-Trace: 1265133372 spool.cs.wisc.edu 9898 128.105.185.17 Original-Xref: news.stanford.edu gnu.emacs.help:176553 X-Mailman-Approved-At: Wed, 03 Feb 2010 01:17:52 -0500 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:71636 Archived-At: Hello, Suppose I have some Common Lisp code like this: (setf *foo* `((1 2 3) ,thingy (4 5 6))) + ^^+ + + +^+ I've marked how I would like some characters highlighted. Suppose those characters with the + are a dark grey, and those with the + are a yellow. I'm using slime, and have hacked the crap out of my .emacs file by adding into the lisp-mode-hook in order to hilight all ANSI Common Lisp constructs in a manner that pleases me, it sort of looks like this. The #' are functions resultant from deffaces or something which produces the correct (REGEXP N FACE) form needed by font-lock-add-keywords. (add-hook 'lisp-mode-hook (lambda () (font-lock-add-keywords nil (append ;; Conventional Constant Variables '(("\\<\\([+][^ +]*[+]\\)\\>" 0 #'ansi-lisp-constant)) ;; Conventional Global Variables, including ANSI ones '(("\\<\\([*][^ *]*[*]\\)\\>" 0 #'ansi-lisp-global-variable)) ;; Lisp Numbers, simple ones, just integers '(("\\<\\([+-]?[0-9]+\\)\\>" 0 #'ansi-lisp-numbers)) ;; General Parenthesis color '(("\\([()]\\)" 0 #'ansi-lisp-parenthesis)) ;; ANSI boolean symbols (mapcar #'ansi-boolean '(nil t)) ;; many more entries for all of ANSI Common Lisp's symbols in here )))) So, given this method, if I want the '( ... ) quote and parenthesis to be higlighted _regardless of where the point is_ then how do I do it? I know how to do it when I'm moving the point around the buffer, but I want it all the time and additionally similar behavior for #( #' etc, etc, etc. Thank you. -pete