<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Evan Klitzke wrote:
<blockquote cite="mid:1239253749.5924.8.camel@localhost.localdomain"
 type="cite">
  <pre wrap="">I know, this is an emacs question and not a fedora question per se. But
I've asked my question on the emacs help news group without a response,
and I know there are some emacs users lurking around these parts, so I
thought I'd try here :-)

My question is stated previously at:
<a class="moz-txt-link-freetext" href="http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/785fb0e6542eda80/1ad000e4fa700e1e">http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/785fb0e6542eda80/1ad000e4fa700e1e</a>

Basically, emacs uses a big complex regular expression to figure out
what words to highlight in different modes. There seems to be a command
font-lock-remove-keyword that can be used to safely edit the regular
expression and remove a keyword from it; but the documentation is pretty
vague, and the source code for the function is way over my head.

Thanks for any help!

  </pre>
</blockquote>
The elisp function that you should try is font-lock-remove-keywords as
you mentioned.  The Emacs help for this function shows the syntax as:<br>
    (font-lock-remove-keywords   mode   keywords)<br>
<br>
I have not used this function, though I have used its counterpart
font-lock-add-keywords.  Try the following and see if it does what you
want:<br>
<br>
    ;;; Define a list of keywords to be removed from the list of Python
keywords<br>
    ;;; note: your list may consist of just one keyword or multiple<br>
    (defconst my-python-non-keywords                                  
    ;; constant name<br>
       '("\\bself\\b" "\\bTrue\\b" "\\bFalse\\b")                     
       ;; constant value<br>
       "My list of Python Keywords that I do not highlighted")  ;;
constant description/comment<br>
<br>
    ;;; Remove Keywords from Python font-lock-keywords-alist<br>
    (font-lock-remove-keywords   'python-mode   my-python-non-keywords)<br>
<br>
You may have to play around with the list of keywords.  I am not sure
what the regular expression should look like.  It may be that you only
need the keywords without the extra regular expressions to remove them;
I have only added keywords so I am not sure about this point.  In other
words, if "\\bself\\b" does not work, try "self" next.  If neither of
them work, then you are going to have to experiment and/or seek more
help in the forums.<br>
<br>
The example that I used above, "\\bTEXT\\b", works for C++ keywords. 
The "\\b" causes the regular expression to select TEXT when it is a
word and ignore it when it part of another word like "anyTEXT".<br>
<br>
You do not need to do the two step code that I wrote.  You can replace
the my-python-non-keywords variable/constant name with the actual value
'("\\bself\\b").  I prefer creating the constant first because then I
can list the constant to verify that the list is actual what I think it
is using the command:<br>
     Control-H   v   my-python-non-keywords<br>
<br>
I used a constant in my original C++ keyword code.  You can use a
constant or a variable.  <br>
    (defvar name value comment)<br>
The only difference is that if you use a variable you can change the
value.<br>
<br>
When I tried something similar, many years ago, I actually created a
complete list of C++ keywords used by the compiler that I was using
then and replaced the entire list:<br>
    (font-lock-add-keywords 'c++-mode my-c++-keywords nil)<br>
<br>
The last argument is set to nil to replace or t to append.  I no longer
recommend the complete replacement of the keyword list since you must
remain active to keep the list up to date.  But it is an option that
can be used when all else fails.<br>
<br>
Good luck and let us know when you are successful.<br>
<br>
<div class="moz-signature">-- <br>
<div>  Steven F. LeBrun<br>
<p>
Quote: <em>"The objection to fairy stories is that they tell children
there are dragons. But children have always known there are dragons.
Fairy stories tell children that dragons can be killed."</em><br>
     -- G.K. Chesterton</p>
</div>
</div>
</body>
</html>