all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* symbols, operators highlighting (+, -, =, <, >, etc)
@ 2009-05-02  6:43 ex
  2009-05-02 10:58 ` Anselm Helbig
  0 siblings, 1 reply; 2+ messages in thread
From: ex @ 2009-05-02  6:43 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-02 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-02  6:43 symbols, operators highlighting (+, -, =, <, >, etc) ex
2009-05-02 10:58 ` Anselm Helbig

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.