From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ex Newsgroups: gmane.emacs.help Subject: symbols, operators highlighting (+, -, =, <, >, etc) Date: Fri, 1 May 2009 23:43:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1241280872 8095 80.91.229.12 (2 May 2009 16:14:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 May 2009 16:14:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 02 18:14:24 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 1M0Hr5-00025K-Ir for geh-help-gnu-emacs@m.gmane.org; Sat, 02 May 2009 18:14:23 +0200 Original-Received: from localhost ([127.0.0.1]:36839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0Hr4-0000wg-U4 for geh-help-gnu-emacs@m.gmane.org; Sat, 02 May 2009 12:14:22 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!n4g2000vba.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: 190.233.54.111 Original-X-Trace: posting.google.com 1241246612 9599 127.0.0.1 (2 May 2009 06:43:32 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 2 May 2009 06:43:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n4g2000vba.googlegroups.com; posting-host=190.233.54.111; posting-account=0UusFAoAAABcVR0GxRFWeS2T8k6dkQ65 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:168866 X-Mailman-Approved-At: Sat, 02 May 2009 12:13:23 -0400 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:64142 Archived-At: Hi there! I'm pretty new to emacs and I was wondering how to add highlighting to symbols and operators in my code (I' ve been really used to that in other editors), but I couldn't find anything in the web or emacs-wiki I could figure out the next kludge in my emacs file: ;;------------------------------------------------------------------------------ ;; Highlight operators (font-lock-add-keywords 'python-mode '(("\\." . font-lock-warning-face) ("else:" . font-lock-keyword-face) ("\\+" . font-lock-warning-face) ("\\-" . font-lock-warning-face) ("\=" . font-lock-warning-face) (":" . font-lock-warning-face) ("\\[" . font-lock-warning-face) ("\\]" . font-lock-warning-face) ("," . font-lock-warning-face) ("!" . font-lock-warning-face) ("(" . font-lock-warning-face) (")" . font-lock-warning-face) ("\<" . font-lock-warning-face) ("\>" . font-lock-warning-face))) the problem is that this only works for python, and I don't want to copy/paste this to other modes, there must be a more elegant solution... the other problem is that I'm abusing the warning face (because I don't know how to create a face) Any help or advice? Many thanks. Laurens