all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* help with minor mode for word highlighting
@ 2005-12-19 18:01 perldev
  0 siblings, 0 replies; 3+ messages in thread
From: perldev @ 2005-12-19 18:01 UTC (permalink / raw)


Greetings:

In the interest of time, I'm writing asking for a little help getting  
the ball rolling on this. I've spent 3 days poking around on the  
internet and trying various approaches--but have come up short. I'm  
trying to write a very simple minor-mode for highlighting some words  
under text-mode. Here are the specifics of what would be great to see  
example code of:

-- minor-mode skeleton to run alongside text-mode/paragraph-indent- 
minor-mode
-- an example of creating a custom font-lock face for this mode
-- an example of coloring a list of words using the custom face
-- an example of coloring based on a regex

That's it, really. No functions or specified indentation. I just want  
some special coloring on top of text-mode running paragraph-indent- 
minor-mode.

Any suggestions, examples of code, or tutorial links to help  
accomplish this would be *greatly* appreciated.

Thanks!

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

* Re: help with minor mode for word highlighting
       [not found] <mailman.19837.1135016930.20277.help-gnu-emacs@gnu.org>
@ 2005-12-21  0:42 ` gamename
  2006-01-04 22:35 ` kgold
  1 sibling, 0 replies; 3+ messages in thread
From: gamename @ 2005-12-21  0:42 UTC (permalink / raw)


Hi,

Have a look at this:
http://www.emacswiki.org/cgi-bin/wiki/AddBufferKeywords

It describes pretty much what you want.

-T

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

* Re: help with minor mode for word highlighting
       [not found] <mailman.19837.1135016930.20277.help-gnu-emacs@gnu.org>
  2005-12-21  0:42 ` help with minor mode for word highlighting gamename
@ 2006-01-04 22:35 ` kgold
  1 sibling, 0 replies; 3+ messages in thread
From: kgold @ 2006-01-04 22:35 UTC (permalink / raw)


"perldev@monkeybytes.org" <perldev@monkeybytes.org> writes:
> I'm  
> trying to write a very simple minor-mode for highlighting some words  
> under text-mode. Here are the specifics of what would be great to see  
> example code of:
> 
> -- minor-mode skeleton to run alongside text-mode/paragraph-indent- 
> minor-mode
> -- an example of creating a custom font-lock face for this mode
> -- an example of coloring a list of words using the custom face
> -- an example of coloring based on a regex
> 
> That's it, really. No functions or specified indentation. I just want  
> some special coloring on top of text-mode running paragraph-indent- 
> minor-mode.

This isn't a minor mode, but here's what I did for log4j files:

(defface font-lock-fatal-face
  '((((type tty) (class color)) (:foreground "red" ))
    (t ))
  "Font Lock mode face used to highlight fatal errors."
  :group 'font-lock-highlighting-faces)

(define-generic-mode 'log4j-mode
  '("#")
  '("DEBUG")
  '(
    ("INFO" . 'font-lock-constant-face)
    ("DEBUG" . 'font-lock-keyword-face)
    ("WARN" . 'font-lock-type-face)
    ("ERROR" . 'paren-face-mismatch)
    ("FATAL" . 'font-lock-fatal-face)
)
  '(".log4j\\'")
  nil
  "Major mode for editing log4j logs")


-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646

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

end of thread, other threads:[~2006-01-04 22:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.19837.1135016930.20277.help-gnu-emacs@gnu.org>
2005-12-21  0:42 ` help with minor mode for word highlighting gamename
2006-01-04 22:35 ` kgold
2005-12-19 18:01 perldev

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.