Path: news.rrz.uni-hamburg.de!news.dkrz.de!news.dfn.de!news.dfn.de!Germany.EU.net!EU.net!howland.reston.ans.net!xlink.net!nntp.gmd.de!borneo!veit
From: veit@borneo.gmd.de (Holger Veit)
Newsgroups: comp.lang.vhdl
Subject: VHDL-mode colored (emacs19)
Date: 9 Jun 1994 13:56:23 GMT
Organization: GMD - German National Research Center for Computer Science
Lines: 130
Distribution: world
Message-ID: <2t7727$h62@omega.gmd.de>
NNTP-Posting-Host: mururoa.gmd.de

The following might be interesting for GNU-Emacs users who use color highlighting
with the emacs file hilit19.el. This is an unofficial patch that adds the necessary 
regular expressions to allow highlighting and coloring of vhdl files.

I don't provide detailed instructions here how to get highlighting running
at all with emacs-19, read the f* manual. A good base to start is when you
succeeded in coloring C or C++ files already.

You need:
* emacs 19.?? of course.
* hilit19.el version 2.19. This should be already in the distribution of
  emacs 19.??. There is a new version named hilit319 which is entirely
  different in structure and does not work with the patch. You might
  ask archie for a hilit19.el file, I found a reference version this patch is
  based at ftp.th-darmstadt.de.
* Any vhdl-mode.el. It is irrelevant what it actually does, just for the feature
  of detecting '*.vhdl' or '*.vhd' files and entering a "vhdl-mode". Several
  versions exist, and some of them are occasionally posted to this newsgroup.
* Apply the patch to the hilit19.el file, take care for rejects, byte-compile-file
  it into an elc file, and try it out.

You might look for 'vhdl' in the patched file to find the coloring information
if you don't like my settings.
  
Note that there is NO WARRANTEE at all, that it works for you, and does not damage
anything (unlinkely, except the original hilit19.el file, perhaps), and
finally: I'm not an emacs guru, so don't ask me for "How do I install this"
or "can you help me to modify this or that".
However, if your newsreader clips long lines, and there are some of them in the 
part below, I can send you this file uuencoded.


Have fun !

---------------START OF PATCH------------
*** hilit19.el.old	Thu Jun  9 15:30:16 1994
--- hilit19.el	Thu Jun  9 15:29:45 1994
***************
*** 463,473 ****
      (define	ForestGreen-bold    green	       bold)
      (defun	blue-bold	    cyan-bold	       bold-italic)
      (decl	RoyalBlue	    cyan	       bold)
!     (type	nil		    yellow	       nil)
      (keyword	RoyalBlue	    cyan	       bold-italic)
      (label	red-underline	    orange-underlined  underline)
!     (string	grey40		    orange	       underline)
!     
      ;; some further faces for Ada
      (struct	  black-bold        white-bold	       bold)
      (glob-struct  magenta	    Plum1	       default-bold-underline)
--- 464,482 ----
      (define	ForestGreen-bold    green	       bold)
      (defun	blue-bold	    cyan-bold	       bold-italic)
      (decl	RoyalBlue	    cyan	       bold)
!     (type	RoyalBlue		    yellow	       nil)
      (keyword	RoyalBlue	    cyan	       bold-italic)
      (label	red-underline	    orange-underlined  underline)
!     (string	magenta		    orange	       underline)
! 
!     ;; something for VHDL
!     (vhdlkeyword RoyalBlue-underline cyan         bold-italic)
!     (vhdltype purple          brown             nil)
!     (vhdlenum purple          brown-bold        nil)
!     (vhdlattr RoyalBlue       cyan              bold-italic)
!     (vhdldefun	blue-bold-underline	    cyan-bold	       bold-italic)
!     (vhdldecl	RoyalBlue-underline	    cyan	       bold)
! 
      ;; some further faces for Ada
      (struct	  black-bold        white-bold	       bold)
      (glob-struct  magenta	    Plum1	       default-bold-underline)
***************
*** 1135,1148 ****
        ;; function decls are expected to have types on the previous line
        ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
        ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
!       ("^\\(template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl)
        ;; datatype -- black magic regular expression
!       ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\|class\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\s +\\*+)?\\|[ \n\t;()]\\)" nil type)
        ;; key words
        ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|delete\\|new\\)\\>[^_]"
!        1 keyword)))))
  
  (hilit-set-mode-patterns
   'perl-mode
   '(("\\s #.*$" nil comment)
     ("^#.*$" nil comment)
--- 1144,1172 ----
        ;; function decls are expected to have types on the previous line
        ("^\\(\\(\\w\\|[$_]\\)+::\\)?\\(\\w\\|[$_]\\)+\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
        ("^\\(\\(\\w\\|[$_]\\)+[ \t]*::[ \t]*\\)?\\(\\(\\w\\|[$_]\\)+\\|operator.*\\)\\s *\\(\\(\\w\\|[$_]\\)+\\s *((\\|(\\)[^)]*)+" nil defun)
!       ("^\\(friend\\|template\\|typedef\\|struct\\|union\\|class\\|enum\\|public\\|private\\|protected\\).*$" nil decl)
        ;; datatype -- black magic regular expression
!       ("[ \n\t({]\\(\\(const\\|register\\|volatile\\|unsigned\\|extern\\|static\\)\\s +\\)*\\(\\(\\w\\|[$_]\\)+_t\\|float\\|double\\|void\\|char\\|short\\|int\\|long\\|FILE\\|\\(\\(struct\\|union\\|enum\\|class\\)\\([ \t]+\\(\\w\\|[$_]\\)*\\)\\)\\)\\(\\(\\s +\\*+)\\|\\(\\*+\\s +\\)\\)?\\|[ \n\t;()]\\)" nil type)
        ;; key words
        ("[^_]\\<\\(return\\|goto\\|if\\|else\\|case\\|default\\|switch\\|break\\|continue\\|while\\|do\\|for\\|public\\|protected\\|private\\|delete\\|new\\)\\>[^_]"
!        1 keyword))))
! )
  
  (hilit-set-mode-patterns
+  'vhdl-mode
+  '(
+    ("\\('.?'\\|'''\\)" nil string)
+    (hilit-string-find ?' string)
+    ("^--.*$" nil comment)
+    ("\\s ?--.*$" nil comment)
+    ("\\b'\\(base\\|left\\|right\\|high\\|l\\|ascending\\|image\\|value\\|pos\\|val\\|succ\\|pred\\|leftof\\|rightof\\|range\\|reverse_range\\|length\\|delayed\\|stable\\|quiet\\|transaction\\|event\\|active\\|last_event\\|last_active\\|last_value\\|driving\\|driving_value\\|behavior\\|structure\\|simple_name\\|instance_name\\|path_name\\)\\b" nil vhdlattr)
+    ("\\b\\(boolean\\|character\\|bit\\|severity_level\\|integer\\|real\\|time\\|delay_length\\|natural\\|positive\\|string\\|bit_vector\\|file_open_kind\\|file_open_status\\)\\b" nil vhdltype)
+    ("\\b\\(true\\|false\\|nul\\|soh\\|[es]tx\\|eot\\|enq\\|ack\\|[bd]el\\|bs\\|ht\\|vt\\|[lf]f\\|cr\\|so\\|si\\|dle\\|dc[1-4]\\|nak\\|syn\\|etb\\|can\\|em\\|sub\\|esc\\|[fgru]sp\\|c12[89]\\|c1[345][0-9]\\|note\\|warning\\|error\\|failure\\|fs\\|ps\\|ns\\|us\\|ms\\|sec\\|min\\|hr\\|read_mode\\|write_mode\\|append_mode\\|open_ok\\|status_error\\|name_error\\|mode_error\\)\\b" nil vhdlenum)
+    ("\\b\\(use\\|package\\|body\\|library\\|configuration\\|entity\\|architecture\\)\\b" nil vhdldefun)
+    ("\\b\\(constant\\|variable\\|procedure\\|function\\|signal\\|type\\|subtype\\|file\\|group\\|component\\|block\\|process\\)\\b" nil vhdldecl)
+    ("\\b\\(abs\\|access\\|after\\|alias\\|all\\|and\\|array\\|assert\\|attribute\\|begin\\|buffer\\|bus\\|case\\|disconnect\\|downto\\|else\\|elsif\\|end\\|exit\\|for\\|generate\\|generic\\|guarded\\|if\\|impure\\|in\\|inertial\\|inout\\|is\\|label\\|linkage\\|literal\\|loop\\|map\\|mod\\|nand\\|new\\|next\\|nor\\|not\\|null\\|of\\|on\\|open\\|or\\|others\\|out\\|port\\|postponed\\|pure\\|range\\|record\\|register\\|reject\\|rem\\|report\\|return\\|rol\\|ror\\|select\\|severity\\|shared\\|sla\\|sll\\|sra

\\|srl\\|then\\|to\\|transport\\|unaffected\\|units\\|until\\|wait\\|when\\|while\\|with\\|xnor\\|xor\\)\\b" nil vhdlkeyword)) nil 'case-insensitive)
+ 
+ (hilit-set-mode-patterns
   'perl-mode
   '(("\\s #.*$" nil comment)
     ("^#.*$" nil comment)

------------------END OF PATCH-----------





-- 
         Dr. Holger Veit                   | INTERNET: Holger.Veit@gmd.de
|  |   / GMD-SET German National Research  | Phone: (+49) 2241 14 2448
|__|  /  Center for Computer Science       | Fax:   (+49) 2241 14 2342
|  | /   Schloss Birlinghoven              | Had a nightmare yesterday:
|  |/    53754 St. Augustin, Germany       | My system started up with
                                           | ... Booting vmunix.el ...


<div align="center"><br /><script type="text/javascript"><!--
google_ad_client = "pub-7293844627074885";
//468x60, Created at 07. 11. 25
google_ad_slot = "8619794253";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />&nbsp;</div>