Emacs: highlighting "self" tweak

Sjoerd Mullender sjoerd at oratrix.nl
Thu Jul 8 04:47:57 EDT 1999


On Wed, Jul 7 1999 Harald Hanche-Olsen wrote:

> + Sjoerd Mullender <sjoerd at oratrix.nl>:
> 
> | You can use this piece of magic in your .emacs file (tested on XEmacs
> | 21.1):
> | 
> | (add-to-list 'after-load-alist
> | 	     (cons "python-mode"
> | 		   '((add-to-list (quote python-font-lock-keywords)
> | 				  (quote ("\\b\\(self\\)[ .,]?"
> | 					  1 font-lock-type-face))))))
> 
> which could be written more briefly as
> 
> (eval-after-load 
>  "python-mode"
>  '((add-to-list
>     'python-font-lock-keywords
>     '("\\b\\(self\\)[ .,]?" 1 font-lock-type-face))))

You learn something new every day!

But I think you have a couple of parens too many.  What about this:

(eval-after-load 
 "python-mode"
 '(add-to-list
    'python-font-lock-keywords
    '("\\b\\(self\\)[ .,]?" 1 font-lock-type-face)))

-- Sjoerd Mullender <sjoerd.mullender at oratrix.com>




More information about the Python-list mailing list