home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / help-lucid-emacs / text0125.txt < prev    next >
Encoding:
Text File  |  1993-07-14  |  1.4 KB  |  41 lines

  1.     I didn't notice any mention of the addition of perl mode to
  2. the font-lock code in the NEWS file, so I was sort of wondering why my
  3. perl font lock stuff wasn't working correctly anymore...until this
  4. morning.  It kind of looks like Jamie based the perl-font-lock-keywords
  5. in font-lock.el on an early version that I posted before I got
  6. it to work right.  This one looks much nicer:
  7.  
  8. (defconst perl-font-lock-keywords
  9.   (list
  10.    (cons
  11.      (concat "[ \n\t{]*\\("
  12.          (mapconcat 'identity
  13.             '("if" "until" "while" "elsif" "else" "unless" "for"
  14.               "foreach" "continue" "exit" "die" "last" "goto"
  15.               "next" "redo" "return" "local" "exec")
  16.             "\\|")
  17.          "\\)[ \n\t;(]")
  18.      1)
  19.    (mapconcat 'identity
  20.           '("#endif" "#else" "#ifdef" "#ifndef" "#if" "#include"
  21.         "#define" "#undef")
  22.           "\\|")
  23.    '("^[ \n\t]*sub[ \t]+\\([^ \t{]+\\)[ \n\t]*\\{" 1 font-lock-function-name-face)
  24.    '("[ \n\t{]*\\(eval\\)[ \n\t(;]" 1 font-lock-function-name-face)
  25.    '("\\(--- .* ---\\|=== .* ===\\)" 1 font-lock-doc-string-face)
  26.    )
  27.   "Additional expressions to highlight in Perl-mode.")
  28.  
  29.  
  30.     BTW, the last line is a carry-over from lightbrite to
  31. highlight that regexp in comment lines...which of course doesn't work
  32. in font-lock mode.  If there's a way to make that work, could someone
  33. let me know.  If not, Jamie should probably just take it out of the
  34. defs in font-lock.el.
  35.  
  36.  
  37. FYI,
  38. Michael
  39. lamour@mitre.org
  40.  
  41.