LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-25-2005, 07:48 PM   #1
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Syntax Highlighting in Emacs with Lisp question


Hey,
I'm doing some syntax highlighting in lisp for emacs. It works good so far, but I have a few questions... What's the expression for a . (just a period). . obviously matches any character, but I can't figure out how to match a period. I've tried \. and \\.
Any help is appreciated. Also, is there a way to match a string, but highlight only part of it.
For instance. Say the string:
doo da
I want to match the entire string, ex. "doo da", but only highligh "da". If "da" appears else where, ex. asdf da, I don't want it to be highlighted.
 
Old 02-25-2005, 08:06 PM   #2
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Original Poster
Rep: Reputation: 32
Ok, got the second question I asked... You use parenthesis for sub expressions, then after the expression, use a number to indicate the "subexpresion" (expressions in parenthesis) to highlight. ex.
'("doo\\(da\\)" 1 font-lock-warning-face)
 
Old 02-25-2005, 09:04 PM   #3
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Original Poster
Rep: Reputation: 32
nvm, im stupid, a period is just \.
I was just matching it with a \\< infront, which matches the beginning of word, and a word can never start with a period, so it was an impossible expression.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax highlighting for php in emacs bm1 Linux - Software 2 04-15-2017 04:29 AM
Set mode within Emacs, still no syntax highlighting rose_bud4201 Linux - Software 4 07-19-2005 10:20 PM
Emacs, scheme, syntax highlighting, indenting jrdioko Linux - Software 0 07-16-2005 04:13 PM
emacs color-syntax highlighting with perl SerfurJ Linux - Software 2 09-22-2003 08:40 AM
JSP Syntax highlighting in EMACS glalu Programming 0 05-30-2002 12:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration