aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReto Zimmermann2012-05-27 23:42:18 -0400
committerStefan Monnier2012-05-27 23:42:18 -0400
commitfda91268666fe6c082ee08c0c9519a248a3a3d1f (patch)
tree97d82bc4e01853c70ff3db1fda91a0d938461a9c
parent74d1f848fa6f197cd172aea14598a73a8ce72d3f (diff)
downloademacs-fda91268666fe6c082ee08c0c9519a248a3a3d1f.tar.gz
emacs-fda91268666fe6c082ee08c0c9519a248a3a3d1f.zip
* lisp/progmodes/vhdl-mode.el: Sync with upstream 3.33.28.
http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html#release-notes-3.33
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/progmodes/vhdl-mode.el1288
3 files changed, 892 insertions, 413 deletions
diff --git a/etc/NEWS b/etc/NEWS
index c5448c01e8a..479d2642162 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -95,6 +95,12 @@ character when doing minibuffer filename prompts.
95 95
96* Changes in Specialized Modes and Packages in Emacs 24.2 96* Changes in Specialized Modes and Packages in Emacs 24.2
97 97
98** VHDL-mode
99- Support for ghdl (free vhdl compiler). Now default.
100- Add/update support for VHDL-AMS packages.
101- Update to VHDL'02 standard.
102- Accept \r and \f as whitespace.
103
98** Diff mode 104** Diff mode
99 105
100Faces for changes now use the same diff color scheme as in modern VCSes 106Faces for changes now use the same diff color scheme as in modern VCSes
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a0c40e878e6..a9404dd2779 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-05-28 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/vhdl-mode.el: Sync with upstream 3.33.28.
4 http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html#release-notes-3.33
5
12012-05-27 Juanma Barranquero <lekktu@gmail.com> 62012-05-27 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * version.el (motif-version-string, gtk-version-string) 8 * version.el (motif-version-string, gtk-version-string)
@@ -14,9 +19,9 @@
14 19
152012-05-27 Eli Zaretskii <eliz@gnu.org> 202012-05-27 Eli Zaretskii <eliz@gnu.org>
16 21
17 * mail/sendmail.el (mail-yank-region): Recognize 22 * mail/sendmail.el (mail-yank-region):
18 rmail-yank-current-message in addition to insert-buffer. Fixes 23 Recognize rmail-yank-current-message in addition to insert-buffer.
19 mail-mode's "C-c C-r" that otherwise does nothing when invoked in 24 Fixes mail-mode's "C-c C-r" that otherwise does nothing when invoked in
20 a *mail* buffer created through rmail-start-mail with sendmail as 25 a *mail* buffer created through rmail-start-mail with sendmail as
21 mail-user-agent. 26 mail-user-agent.
22 27
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 9b7ee5d6aa0..dbf2cb26b83 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -13,10 +13,10 @@
13;; filed in the Emacs bug reporting system against this file, a copy 13;; filed in the Emacs bug reporting system against this file, a copy
14;; of the bug report be sent to the maintainer's email address. 14;; of the bug report be sent to the maintainer's email address.
15 15
16(defconst vhdl-version "3.33.6" 16(defconst vhdl-version "3.33.28"
17 "VHDL Mode version number.") 17 "VHDL Mode version number.")
18 18
19(defconst vhdl-time-stamp "2005-08-30" 19(defconst vhdl-time-stamp "2010-09-22"
20 "VHDL Mode time stamp for last update.") 20 "VHDL Mode time stamp for last update.")
21 21
22;; This file is part of GNU Emacs. 22;; This file is part of GNU Emacs.
@@ -72,13 +72,13 @@
72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73;; Emacs Versions 73;; Emacs Versions
74 74
75;; supported: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X 75;; supported: GNU Emacs 20.X/21.X/22.X,23.X, XEmacs 20.X/21.X
76;; tested on: GNU Emacs 20.4, XEmacs 21.1 (marginally) 76;; tested on: GNU Emacs 20.4/21.3/22.1,23.X, XEmacs 21.1 (marginally)
77 77
78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79;; Installation 79;; Installation
80 80
81;; Prerequisites: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X. 81;; Prerequisites: GNU Emacs 20.X/21.X/22.X/23.X, XEmacs 20.X/21.X.
82 82
83;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation 83;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation
84;; or into an arbitrary directory that is added to the load path by the 84;; or into an arbitrary directory that is added to the load path by the
@@ -93,7 +93,7 @@
93 93
94;; Add the following lines to the `site-start.el' file in the `site-lisp' 94;; Add the following lines to the `site-start.el' file in the `site-lisp'
95;; directory of your Emacs installation or to your Emacs start-up file `.emacs' 95;; directory of your Emacs installation or to your Emacs start-up file `.emacs'
96;; (not required in Emacs 20.X): 96;; (not required in Emacs 20 and higher):
97 97
98;; (autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t) 98;; (autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t)
99;; (setq auto-mode-alist (cons '("\\.vhdl?\\'" . vhdl-mode) auto-mode-alist)) 99;; (setq auto-mode-alist (cons '("\\.vhdl?\\'" . vhdl-mode) auto-mode-alist))
@@ -184,7 +184,7 @@ Examples:
184 \".*\" \"\" inserts empty string") 184 \".*\" \"\" inserts empty string")
185 185
186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
187;; User variables 187;; User variables (customization options)
188 188
189(defgroup vhdl nil 189(defgroup vhdl nil
190 "Customizations for VHDL Mode." 190 "Customizations for VHDL Mode."
@@ -210,6 +210,17 @@ Overrides local variable `indent-tabs-mode'."
210 210
211(defcustom vhdl-compiler-alist 211(defcustom vhdl-compiler-alist
212 '( 212 '(
213 ("ADVance MS" "vacom" "-work \\1" "make" "-f \\1"
214 nil "valib \\1; vamap \\2 \\1" "./" "work/" "Makefile" "adms"
215 ("\\s-\\([0-9]+\\):" 0 1 0) ("Compiling file \\(.+\\)" 1)
216 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif"
217 "PACK/\\1.vif" "BODY/\\1.vif" upcase))
218 ;; Aldec
219 ;; COMP96 ERROR COMP96_0078: "Unknown identifier "Addr_Bits"." "<filename>" 40 30
220 ("Aldec" "vcom" "-93 -work \\1" "make" "-f \\1"
221 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "aldec"
222 (".+?[ \t]+\\(?:ERROR\\)[^:]+:.+?\\(?:.+\"\\(.+?\\)\"[ \t]+\\([0-9]+\\)\\)" 1 2 0) ("" 0)
223 nil)
213 ;; Cadence Leapfrog: cv -file test.vhd 224 ;; Cadence Leapfrog: cv -file test.vhd
214 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared 225 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared
215 ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1" 226 ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1"
@@ -225,6 +236,12 @@ Overrides local variable `indent-tabs-mode'."
225 ("ncvhdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0) 236 ("ncvhdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0)
226 ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db" 237 ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db"
227 "\\1/package/pc.db" "\\1/body/pc.db" downcase)) 238 "\\1/package/pc.db" "\\1/body/pc.db" downcase))
239 ;; ghdl vhdl: ghdl test.vhd
240 ("GHDL" "ghdl" "-i --workdir=\\1 --ieee=synopsys -fexplicit " "make" "-f \\1"
241 nil "mkdir \\1" "./" "work/" "Makefile" "ghdl"
242 ("ghdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0)
243 ("\\1/entity" "\\2/\\1" "\\1/configuration"
244 "\\1/package" "\\1/body" downcase))
228 ;; Ikos Voyager: analyze test.vhd 245 ;; Ikos Voyager: analyze test.vhd
229 ;; analyze test.vhd 246 ;; analyze test.vhd
230 ;; E L4/C5: this library unit is inaccessible 247 ;; E L4/C5: this library unit is inaccessible
@@ -236,10 +253,11 @@ Overrides local variable `indent-tabs-mode'."
236 ;; ModelSim, Model Technology: vcom test.vhd 253 ;; ModelSim, Model Technology: vcom test.vhd
237 ;; ERROR: test.vhd(14): Unknown identifier: positiv 254 ;; ERROR: test.vhd(14): Unknown identifier: positiv
238 ;; WARNING[2]: test.vhd(85): Possible infinite loop 255 ;; WARNING[2]: test.vhd(85): Possible infinite loop
256 ;; ** Warning: [4] ../src/emacsvsim.vhd(43): An abstract ...
239 ;; ** Error: adder.vhd(190): Unknown identifier: ctl_numb 257 ;; ** Error: adder.vhd(190): Unknown identifier: ctl_numb
240 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1" 258 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1"
241 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim" 259 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim"
242 ("\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*: \\(.+\\)(\\([0-9]+\\)):" 2 3 0) ("" 0) 260 ("\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\[[0-9]+\]\\)? \\(.+\\)(\\([0-9]+\\)):" 3 4 0) ("" 0)
243 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" 261 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat"
244 "\\1/_primary.dat" "\\1/body.dat" downcase)) 262 "\\1/_primary.dat" "\\1/body.dat" downcase))
245 ;; ProVHDL, Synopsys LEDA: provhdl -w work -f test.vhd 263 ;; ProVHDL, Synopsys LEDA: provhdl -w work -f test.vhd
@@ -321,6 +339,12 @@ Overrides local variable `indent-tabs-mode'."
321 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0) 339 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0)
322 ("^ *Compiling \"\\(.+\\)\" " 1) 340 ("^ *Compiling \"\\(.+\\)\" " 1)
323 nil) 341 nil)
342 ;; Xilinx XST:
343 ;; ERROR:HDLParsers:164 - "test.vhd" Line 3. parse error
344 ("Xilinx XST" "xflow" "" "make" "-f \\1"
345 nil "mkdir \\1" "./" "work/" "Makefile" "xilinx"
346 ("^ERROR:HDLParsers:[0-9]+ - \"\\(.+\\)\" Line \\([0-9]+\\)\." 1 2 0) ("" 0)
347 nil)
324 ) 348 )
325 "List of available VHDL compilers and their properties. 349 "List of available VHDL compilers and their properties.
326Each list entry specifies the following items for a compiler: 350Each list entry specifies the following items for a compiler:
@@ -428,7 +452,7 @@ NOTE: Activate new error and file message regexps and reflect the new setting
428 (vhdl-custom-set variable value 'vhdl-update-mode-menu)) 452 (vhdl-custom-set variable value 'vhdl-update-mode-menu))
429 :group 'vhdl-compile) 453 :group 'vhdl-compile)
430 454
431(defcustom vhdl-compiler "ModelSim" 455(defcustom vhdl-compiler "GHDL"
432 "Specifies the VHDL compiler to be used for syntax analysis. 456 "Specifies the VHDL compiler to be used for syntax analysis.
433Select a compiler name from the ones defined in option `vhdl-compiler-alist'." 457Select a compiler name from the ones defined in option `vhdl-compiler-alist'."
434 :type (let ((alist vhdl-compiler-alist) list) 458 :type (let ((alist vhdl-compiler-alist) list)
@@ -450,6 +474,17 @@ NOTE: Activate the new setting by restarting Emacs."
450 :type 'boolean 474 :type 'boolean
451 :group 'vhdl-compile) 475 :group 'vhdl-compile)
452 476
477(defcustom vhdl-makefile-default-targets '("all" "clean" "library")
478 "List of default target names in Makefiles.
479Automatically generated Makefiles include three default targets to compile
480the entire design, clean the entire design and to create the design library.
481This option allows to change the names of these targets to avoid conflicts
482with other user Makefiles."
483 :type '(list (string :tag "Compile entire design")
484 (string :tag "Clean entire design ")
485 (string :tag "Create design library"))
486 :group 'vhdl-compile)
487
453(defcustom vhdl-makefile-generation-hook nil 488(defcustom vhdl-makefile-generation-hook nil
454 "Functions to run at the end of Makefile generation. 489 "Functions to run at the end of Makefile generation.
455Allows to insert user specific parts into a Makefile. 490Allows to insert user specific parts into a Makefile.
@@ -647,11 +682,11 @@ A project setup file can be obtained by exporting a project (see menu).
647 :group 'vhdl-port 682 :group 'vhdl-port
648 :group 'vhdl-compose) 683 :group 'vhdl-compose)
649 684
650(defcustom vhdl-standard '(87 nil) 685(defcustom vhdl-standard '(93 nil)
651 "VHDL standards used. 686 "VHDL standards used.
652Basic standard: 687Basic standard:
653 VHDL'87 : IEEE Std 1076-1987 688 VHDL'87 : IEEE Std 1076-1987
654 VHDL'93 : IEEE Std 1076-1993 689 VHDL'93/02 : IEEE Std 1076-1993/2002
655Additional standards: 690Additional standards:
656 VHDL-AMS : IEEE Std 1076.1 (analog-mixed-signal) 691 VHDL-AMS : IEEE Std 1076.1 (analog-mixed-signal)
657 Math packages: IEEE Std 1076.2 (`math_real', `math_complex') 692 Math packages: IEEE Std 1076.2 (`math_real', `math_complex')
@@ -660,7 +695,7 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
660 \"Activate Options\"." 695 \"Activate Options\"."
661 :type '(list (choice :tag "Basic standard" 696 :type '(list (choice :tag "Basic standard"
662 (const :tag "VHDL'87" 87) 697 (const :tag "VHDL'87" 87)
663 (const :tag "VHDL'93" 93)) 698 (const :tag "VHDL'93/02" 93))
664 (set :tag "Additional standards" :indent 2 699 (set :tag "Additional standards" :indent 2
665 (const :tag "VHDL-AMS" ams) 700 (const :tag "VHDL-AMS" ams)
666 (const :tag "Math packages" math))) 701 (const :tag "Math packages" math)))
@@ -730,6 +765,14 @@ This is done when expanded."
730 (const :tag "Always" always)) 765 (const :tag "Always" always))
731 :group 'vhdl-style) 766 :group 'vhdl-style)
732 767
768(defcustom vhdl-array-index-record-field-in-sensitivity-list t
769 "Non-nil means include array indices / record fields in sensitivity list.
770If a signal read in a process is a record field or pointed to by an array
771index, the record field or array index is included with the record name in
772the sensitivity list (e.g. \"in1(0)\", \"in2.f0\").
773Otherwise, only the record name is included (e.g. \"in1\", \"in2\")."
774 :type 'boolean
775 :group 'vhdl-style)
733 776
734(defgroup vhdl-naming nil 777(defgroup vhdl-naming nil
735 "Customizations for naming conventions." 778 "Customizations for naming conventions."
@@ -916,7 +959,8 @@ if the header needs to be version controlled.
916The following keywords for template generation are supported: 959The following keywords for template generation are supported:
917 <filename> : replaced by the name of the buffer 960 <filename> : replaced by the name of the buffer
918 <author> : replaced by the user name and email address 961 <author> : replaced by the user name and email address
919 \(`user-full-name', `mail-host-address', `user-mail-address') 962 \(`user-full-name',`mail-host-address', `user-mail-address')
963 <authorfull> : replaced by the user full name (`user-full-name')
920 <login> : replaced by user login name (`user-login-name') 964 <login> : replaced by user login name (`user-login-name')
921 <company> : replaced by contents of option `vhdl-company-name' 965 <company> : replaced by contents of option `vhdl-company-name'
922 <date> : replaced by the current date 966 <date> : replaced by the current date
@@ -999,11 +1043,12 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
999 "Customizations for sequential processes." 1043 "Customizations for sequential processes."
1000 :group 'vhdl-template) 1044 :group 'vhdl-template)
1001 1045
1002(defcustom vhdl-reset-kind 'async 1046(defcustom vhdl-reset-kind 'async
1003 "Specifies which kind of reset to use in sequential processes." 1047 "Specifies which kind of reset to use in sequential processes."
1004 :type '(choice (const :tag "None" none) 1048 :type '(choice (const :tag "None" none)
1005 (const :tag "Synchronous" sync) 1049 (const :tag "Synchronous" sync)
1006 (const :tag "Asynchronous" async)) 1050 (const :tag "Asynchronous" async)
1051 (const :tag "Query" query))
1007 :group 'vhdl-sequential-process) 1052 :group 'vhdl-sequential-process)
1008 1053
1009(defcustom vhdl-reset-active-high nil 1054(defcustom vhdl-reset-active-high nil
@@ -1563,22 +1608,25 @@ NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
1563 :group 'vhdl-highlight) 1608 :group 'vhdl-highlight)
1564 1609
1565(defcustom vhdl-special-syntax-alist 1610(defcustom vhdl-special-syntax-alist
1566 '(("generic/constant" "\\w+_[cg]" "Gold3" "BurlyWood1") 1611 '(("generic/constant" "\\<\\w+_[cg]\\>" "Gold3" "BurlyWood1" nil)
1567 ("type" "\\w+_t" "ForestGreen" "PaleGreen") 1612 ("type" "\\<\\w+_t\\>" "ForestGreen" "PaleGreen" nil)
1568 ("variable" "\\w+_v" "Grey50" "Grey80")) 1613 ("variable" "\\<\\w+_v\\>" "Grey50" "Grey80" nil))
1569 "List of special syntax to be highlighted. 1614 "List of special syntax to be highlighted.
1570If option `vhdl-highlight-special-words' is non-nil, words with the specified 1615If option `vhdl-highlight-special-words' is non-nil, words with the specified
1571syntax (as regular expression) are highlighted in the corresponding color. 1616syntax (as regular expression) are highlighted in the corresponding color.
1572 1617
1573 Name : string of words and spaces 1618 Name : string of words and spaces
1574 Regexp : regular expression describing word syntax 1619 Regexp : regular expression describing word syntax
1575 (e.g. \"\\\w+_c\" matches word with suffix \"_c\") 1620 (e.g. \"\\\\=\<\\\w+_c\\\\=\>\" matches word with suffix \"_c\")
1621 expression must start with \"\\\\=\<\" and end with \"\\\\=\>\"
1622 if only whole words should be matched (no substrings)
1576 Color (light): foreground color for light background 1623 Color (light): foreground color for light background
1577 (matching color examples: Gold3, Grey50, LimeGreen, Tomato, 1624 (matching color examples: Gold3, Grey50, LimeGreen, Tomato,
1578 LightSeaGreen, DodgerBlue, Gold, PaleVioletRed) 1625 LightSeaGreen, DodgerBlue, Gold, PaleVioletRed)
1579 Color (dark) : foreground color for dark background 1626 Color (dark) : foreground color for dark background
1580 (matching color examples: BurlyWood1, Grey80, Green, Coral, 1627 (matching color examples: BurlyWood1, Grey80, Green, Coral,
1581 AquaMarine2, LightSkyBlue1, Yellow, PaleVioletRed1) 1628 AquaMarine2, LightSkyBlue1, Yellow, PaleVioletRed1)
1629 In comments : If non-nil, words are also highlighted inside comments
1582 1630
1583Can be used for visual support of naming conventions, such as highlighting 1631Can be used for visual support of naming conventions, such as highlighting
1584different kinds of signals (e.g. \"Clk50\", \"Rst_n\") or objects (e.g. 1632different kinds of signals (e.g. \"Clk50\", \"Rst_n\") or objects (e.g.
@@ -1593,7 +1641,8 @@ NOTE: Activate a changed regexp in a VHDL buffer by re-fontifying it (menu
1593 (string :tag "Name ") 1641 (string :tag "Name ")
1594 (regexp :tag "Regexp " "\\w+_") 1642 (regexp :tag "Regexp " "\\w+_")
1595 (string :tag "Color (light)") 1643 (string :tag "Color (light)")
1596 (string :tag "Color (dark) "))) 1644 (string :tag "Color (dark) ")
1645 (boolean :tag "In comments ")))
1597 :set (lambda (variable value) 1646 :set (lambda (variable value)
1598 (vhdl-custom-set variable value 'vhdl-font-lock-init)) 1647 (vhdl-custom-set variable value 'vhdl-font-lock-init))
1599 :group 'vhdl-highlight) 1648 :group 'vhdl-highlight)
@@ -1794,6 +1843,14 @@ useful in large files where syntax-based indentation gets very slow."
1794 :type 'boolean 1843 :type 'boolean
1795 :group 'vhdl-misc) 1844 :group 'vhdl-misc)
1796 1845
1846(defcustom vhdl-indent-comment-like-next-code-line t
1847 "*Non-nil means comment lines are indented like the following code line.
1848Otherwise, comment lines are indented like the preceding code line.
1849Indenting comment lines like the following code line gives nicer indentation
1850when comments precede the code that they refer to."
1851 :type 'boolean
1852 :group 'vhdl-misc)
1853
1797(defcustom vhdl-word-completion-case-sensitive nil 1854(defcustom vhdl-word-completion-case-sensitive nil
1798 "Non-nil means word completion using `TAB' is case sensitive. 1855 "Non-nil means word completion using `TAB' is case sensitive.
1799That is, `TAB' completes words that start with the same letters and case. 1856That is, `TAB' completes words that start with the same letters and case.
@@ -1833,6 +1890,7 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
1833 (custom-add-to-group 'vhdl-related 'paren-showing 'custom-group)) 1890 (custom-add-to-group 'vhdl-related 'paren-showing 'custom-group))
1834(custom-add-to-group 'vhdl-related 'ps-print 'custom-group) 1891(custom-add-to-group 'vhdl-related 'ps-print 'custom-group)
1835(custom-add-to-group 'vhdl-related 'speedbar 'custom-group) 1892(custom-add-to-group 'vhdl-related 'speedbar 'custom-group)
1893(custom-add-to-group 'vhdl-related 'comment-style 'custom-variable)
1836(custom-add-to-group 'vhdl-related 'line-number-mode 'custom-variable) 1894(custom-add-to-group 'vhdl-related 'line-number-mode 'custom-variable)
1837(unless (featurep 'xemacs) 1895(unless (featurep 'xemacs)
1838 (custom-add-to-group 'vhdl-related 'transient-mark-mode 'custom-variable)) 1896 (custom-add-to-group 'vhdl-related 'transient-mark-mode 'custom-variable))
@@ -1841,6 +1899,15 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
1841(custom-add-to-group 'vhdl-related 'user-mail-address 'custom-variable) 1899(custom-add-to-group 'vhdl-related 'user-mail-address 'custom-variable)
1842 1900
1843;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1901;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1902;; Hidden user variables
1903
1904(defvar vhdl-compile-absolute-path nil
1905 "If non-nil, use absolute instead of relative path for compiled files.")
1906
1907(defvar vhdl-comment-display-line-char ?-
1908 "Character to use in comment display line.")
1909
1910;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1844;; Internal variables 1911;; Internal variables
1845 1912
1846(defvar vhdl-menu-max-size 20 1913(defvar vhdl-menu-max-size 20
@@ -3270,9 +3337,6 @@ STRING are replaced by `-' and substrings are converted to lower case."
3270 (list 3337 (list
3271 (append 3338 (append
3272 '("Package") 3339 '("Package")
3273 (when (vhdl-standard-p 'math)
3274 '(["math_complex" vhdl-template-package-math-complex t]
3275 ["math_real" vhdl-template-package-math-real t]))
3276 '(["numeric_bit" vhdl-template-package-numeric-bit t] 3340 '(["numeric_bit" vhdl-template-package-numeric-bit t]
3277 ["numeric_std" vhdl-template-package-numeric-std t] 3341 ["numeric_std" vhdl-template-package-numeric-std t]
3278 ["std_logic_1164" vhdl-template-package-std-logic-1164 t] 3342 ["std_logic_1164" vhdl-template-package-std-logic-1164 t]
@@ -3283,8 +3347,22 @@ STRING are replaced by `-' and substrings are converted to lower case."
3283 ["std_logic_unsigned" vhdl-template-package-std-logic-unsigned t] 3347 ["std_logic_unsigned" vhdl-template-package-std-logic-unsigned t]
3284 ["std_logic_misc" vhdl-template-package-std-logic-misc t] 3348 ["std_logic_misc" vhdl-template-package-std-logic-misc t]
3285 ["std_logic_textio" vhdl-template-package-std-logic-textio t] 3349 ["std_logic_textio" vhdl-template-package-std-logic-textio t]
3286 "--" 3350 "--")
3287 ["Insert Package..." vhdl-template-insert-package 3351 (when (vhdl-standard-p 'ams)
3352 '(["fundamental_constants" vhdl-template-package-fundamental-constants t]
3353 ["material_constants" vhdl-template-package-material-constants t]
3354 ["energy_systems" vhdl-template-package-energy-systems t]
3355 ["electrical_systems" vhdl-template-package-electrical-systems t]
3356 ["mechanical_systems" vhdl-template-package-mechanical-systems t]
3357 ["radiant_systems" vhdl-template-package-radiant-systems t]
3358 ["thermal_systems" vhdl-template-package-thermal-systems t]
3359 ["fluidic_systems" vhdl-template-package-fluidic-systems t]
3360 "--"))
3361 (when (vhdl-standard-p 'math)
3362 '(["math_complex" vhdl-template-package-math-complex t]
3363 ["math_real" vhdl-template-package-math-real t]
3364 "--"))
3365 '(["Insert Package..." vhdl-template-insert-package
3288 :keys "C-c C-i C-p"]))) 3366 :keys "C-c C-i C-p"])))
3289 '(("Directive" 3367 '(("Directive"
3290 ["translate_on" vhdl-template-directive-translate-on t] 3368 ["translate_on" vhdl-template-directive-translate-on t]
@@ -3417,6 +3495,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
3417 ["Buffer" vhdl-beautify-buffer t]) 3495 ["Buffer" vhdl-beautify-buffer t])
3418 ("Fix" 3496 ("Fix"
3419 ["Generic/Port Clause" vhdl-fix-clause t] 3497 ["Generic/Port Clause" vhdl-fix-clause t]
3498 ["Generic/Port Clause Buffer" vhdl-fix-clause t]
3420 "--" 3499 "--"
3421 ["Case Region" vhdl-fix-case-region (mark)] 3500 ["Case Region" vhdl-fix-case-region (mark)]
3422 ["Case Buffer" vhdl-fix-case-buffer t] 3501 ["Case Buffer" vhdl-fix-case-buffer t]
@@ -3449,11 +3528,13 @@ STRING are replaced by `-' and substrings are converted to lower case."
3449 ("Mode" 3528 ("Mode"
3450 ["Electric Mode" 3529 ["Electric Mode"
3451 (progn (customize-set-variable 'vhdl-electric-mode 3530 (progn (customize-set-variable 'vhdl-electric-mode
3452 (not vhdl-electric-mode))) 3531 (not vhdl-electric-mode))
3532 (vhdl-mode-line-update))
3453 :style toggle :selected vhdl-electric-mode :keys "C-c C-m C-e"] 3533 :style toggle :selected vhdl-electric-mode :keys "C-c C-m C-e"]
3454 ["Stutter Mode" 3534 ["Stutter Mode"
3455 (progn (customize-set-variable 'vhdl-stutter-mode 3535 (progn (customize-set-variable 'vhdl-stutter-mode
3456 (not vhdl-stutter-mode))) 3536 (not vhdl-stutter-mode))
3537 (vhdl-mode-line-update))
3457 :style toggle :selected vhdl-stutter-mode :keys "C-c C-m C-s"] 3538 :style toggle :selected vhdl-stutter-mode :keys "C-c C-m C-s"]
3458 ["Indent Tabs Mode" 3539 ["Indent Tabs Mode"
3459 (progn (customize-set-variable 'vhdl-indent-tabs-mode 3540 (progn (customize-set-variable 'vhdl-indent-tabs-mode
@@ -3515,6 +3596,8 @@ STRING are replaced by `-' and substrings are converted to lower case."
3515 (customize-set-variable 'vhdl-compile-use-local-error-regexp 3596 (customize-set-variable 'vhdl-compile-use-local-error-regexp
3516 (not vhdl-compile-use-local-error-regexp)) 3597 (not vhdl-compile-use-local-error-regexp))
3517 :style toggle :selected vhdl-compile-use-local-error-regexp] 3598 :style toggle :selected vhdl-compile-use-local-error-regexp]
3599 ["Makefile Default Targets..."
3600 (customize-option 'vhdl-makefile-default-targets) t]
3518 ["Makefile Generation Hook..." 3601 ["Makefile Generation Hook..."
3519 (customize-option 'vhdl-makefile-generation-hook) t] 3602 (customize-option 'vhdl-makefile-generation-hook) t]
3520 ["Default Library Name" (customize-option 'vhdl-default-library) t] 3603 ["Default Library Name" (customize-option 'vhdl-default-library) t]
@@ -3527,7 +3610,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
3527 (list '87 (cadr vhdl-standard))) 3610 (list '87 (cadr vhdl-standard)))
3528 (vhdl-activate-customizations)) 3611 (vhdl-activate-customizations))
3529 :style radio :selected (eq '87 (car vhdl-standard))] 3612 :style radio :selected (eq '87 (car vhdl-standard))]
3530 ["VHDL'93" 3613 ["VHDL'93/02"
3531 (progn (customize-set-variable 'vhdl-standard 3614 (progn (customize-set-variable 'vhdl-standard
3532 (list '93 (cadr vhdl-standard))) 3615 (list '93 (cadr vhdl-standard)))
3533 (vhdl-activate-customizations)) 3616 (vhdl-activate-customizations))
@@ -3580,6 +3663,10 @@ STRING are replaced by `-' and substrings are converted to lower case."
3580 ["Always" 3663 ["Always"
3581 (customize-set-variable 'vhdl-use-direct-instantiation 'always) 3664 (customize-set-variable 'vhdl-use-direct-instantiation 'always)
3582 :style radio :selected (eq 'always vhdl-use-direct-instantiation)]) 3665 :style radio :selected (eq 'always vhdl-use-direct-instantiation)])
3666 ["Include Array Index and Record Field in Sensitivity List"
3667 (customize-set-variable 'vhdl-array-index-record-field-in-sensitivity-list
3668 (not vhdl-array-index-record-field-in-sensitivity-list))
3669 :style toggle :selected vhdl-array-index-record-field-in-sensitivity-list]
3583 "--" 3670 "--"
3584 ["Customize Group..." (customize-group 'vhdl-style) t]) 3671 ["Customize Group..." (customize-group 'vhdl-style) t])
3585 ("Naming" 3672 ("Naming"
@@ -3676,7 +3763,10 @@ STRING are replaced by `-' and substrings are converted to lower case."
3676 :style radio :selected (eq 'sync vhdl-reset-kind)] 3763 :style radio :selected (eq 'sync vhdl-reset-kind)]
3677 ["Asynchronous" 3764 ["Asynchronous"
3678 (customize-set-variable 'vhdl-reset-kind 'async) 3765 (customize-set-variable 'vhdl-reset-kind 'async)
3679 :style radio :selected (eq 'async vhdl-reset-kind)]) 3766 :style radio :selected (eq 'async vhdl-reset-kind)]
3767 ["Query"
3768 (customize-set-variable 'vhdl-reset-kind 'query)
3769 :style radio :selected (eq 'query vhdl-reset-kind)])
3680 ["Reset is Active High" 3770 ["Reset is Active High"
3681 (customize-set-variable 'vhdl-reset-active-high 3771 (customize-set-variable 'vhdl-reset-active-high
3682 (not vhdl-reset-active-high)) 3772 (not vhdl-reset-active-high))
@@ -3966,6 +4056,10 @@ STRING are replaced by `-' and substrings are converted to lower case."
3966 (customize-set-variable 'vhdl-indent-syntax-based 4056 (customize-set-variable 'vhdl-indent-syntax-based
3967 (not vhdl-indent-syntax-based)) 4057 (not vhdl-indent-syntax-based))
3968 :style toggle :selected vhdl-indent-syntax-based] 4058 :style toggle :selected vhdl-indent-syntax-based]
4059 ["Indent Comments Like Next Code Line"
4060 (customize-set-variable 'vhdl-indent-comment-like-next-code-line
4061 (not vhdl-indent-comment-like-next-code-line))
4062 :style toggle :selected vhdl-indent-comment-like-next-code-line]
3969 ["Word Completion is Case Sensitive" 4063 ["Word Completion is Case Sensitive"
3970 (customize-set-variable 'vhdl-word-completion-case-sensitive 4064 (customize-set-variable 'vhdl-word-completion-case-sensitive
3971 (not vhdl-word-completion-case-sensitive)) 4065 (not vhdl-word-completion-case-sensitive))
@@ -4009,7 +4103,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
4009 "^\\s-*\\(\\(\\(impure\\|pure\\)\\s-+\\|\\)function\\|procedure\\)\\s-+\\(\"?\\(\\w\\|\\s_\\)+\"?\\)" 4103 "^\\s-*\\(\\(\\(impure\\|pure\\)\\s-+\\|\\)function\\|procedure\\)\\s-+\\(\"?\\(\\w\\|\\s_\\)+\"?\\)"
4010 4) 4104 4)
4011 ("Instance" 4105 ("Instance"
4012 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\s-*:\\(\\s-\\|\n\\)*\\(\\w\\|\\s_\\)+\\)\\(\\s-\\|\n\\)+\\(generic\\|port\\)\\s-+map\\>" 4106 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\s-*:\\(\\s-\\|\n\\)*\\(entity\\s-+\\(\\w\\|\\s_\\)+\\.\\)?\\(\\w\\|\\s_\\)+\\)\\(\\s-\\|\n\\)+\\(generic\\|port\\)\\s-+map\\>"
4013 1) 4107 1)
4014 ("Component" 4108 ("Component"
4015 "^\\s-*\\(component\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)" 4109 "^\\s-*\\(component\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)"
@@ -4193,8 +4287,10 @@ Usage:
4193 with a comment in between. 4287 with a comment in between.
4194 `--CR' comments out code on that line. Re-hitting CR comments 4288 `--CR' comments out code on that line. Re-hitting CR comments
4195 out following lines. 4289 out following lines.
4196 `C-c c' comments out a region if not commented out, 4290 `C-c C-c' comments out a region if not commented out,
4197 uncomments a region if already commented out. 4291 uncomments a region if already commented out. Option
4292 `comment-style' defines where the comment characters
4293 should be placed (beginning of line, indent, etc.).
4198 4294
4199 You are prompted for comments after object definitions (i.e. signals, 4295 You are prompted for comments after object definitions (i.e. signals,
4200 variables, constants, ports) and after subprogram and process 4296 variables, constants, ports) and after subprogram and process
@@ -4215,7 +4311,8 @@ Usage:
4215 `TAB' indents a line if at the beginning of the line. The amount of 4311 `TAB' indents a line if at the beginning of the line. The amount of
4216 indentation is specified by option `vhdl-basic-offset'. `C-c C-i C-l' 4312 indentation is specified by option `vhdl-basic-offset'. `C-c C-i C-l'
4217 always indents the current line (is bound to `TAB' if option 4313 always indents the current line (is bound to `TAB' if option
4218 `vhdl-intelligent-tab' is nil). 4314 `vhdl-intelligent-tab' is nil). If a region is active, `TAB' indents
4315 the entire region.
4219 4316
4220 Indentation can be done for a group of lines (`C-c C-i C-g'), a region 4317 Indentation can be done for a group of lines (`C-c C-i C-g'), a region
4221 \(`M-C-\\') or the entire buffer (menu). Argument and port lists are 4318 \(`M-C-\\') or the entire buffer (menu). Argument and port lists are
@@ -4229,6 +4326,10 @@ Usage:
4229 Syntax-based indentation can be very slow in large files. Option 4326 Syntax-based indentation can be very slow in large files. Option
4230 `vhdl-indent-syntax-based' allows to use faster but simpler indentation. 4327 `vhdl-indent-syntax-based' allows to use faster but simpler indentation.
4231 4328
4329 Option `vhdl-indent-comment-like-next-code-line' controls whether
4330 comment lines are indented like the preceding or like the following code
4331 line.
4332
4232 4333
4233 ALIGNMENT: 4334 ALIGNMENT:
4234 The alignment functions align operators, keywords, and inline comments 4335 The alignment functions align operators, keywords, and inline comments
@@ -4357,12 +4458,12 @@ Usage:
4357 4458
4358 4459
4359 STRUCTURAL COMPOSITION: 4460 STRUCTURAL COMPOSITION:
4360 Enables simple structural composition. `C-c C-c C-n' creates a skeleton 4461 Enables simple structural composition. `C-c C-m C-n' creates a skeleton
4361 for a new component. Subcomponents (i.e. component declaration and 4462 for a new component. Subcomponents (i.e. component declaration and
4362 instantiation) can be automatically placed from a previously read port 4463 instantiation) can be automatically placed from a previously read port
4363 \(`C-c C-c C-p') or directly from the hierarchy browser (`P'). Finally, 4464 \(`C-c C-m C-p') or directly from the hierarchy browser (`P'). Finally,
4364 all subcomponents can be automatically connected using internal signals 4465 all subcomponents can be automatically connected using internal signals
4365 and ports (`C-c C-c C-w') following these rules: 4466 and ports (`C-c C-m C-w') following these rules:
4366 - subcomponent actual ports with same name are considered to be 4467 - subcomponent actual ports with same name are considered to be
4367 connected by a signal (internal signal or port) 4468 connected by a signal (internal signal or port)
4368 - signals that are only inputs to subcomponents are considered as 4469 - signals that are only inputs to subcomponents are considered as
@@ -4383,25 +4484,25 @@ Usage:
4383 4484
4384 Component declarations can be placed in a components package (option 4485 Component declarations can be placed in a components package (option
4385 `vhdl-use-components-package') which can be automatically generated for 4486 `vhdl-use-components-package') which can be automatically generated for
4386 an entire directory or project (`C-c C-c M-p'). The VHDL'93 direct 4487 an entire directory or project (`C-c C-m M-p'). The VHDL'93 direct
4387 component instantiation is also supported (option 4488 component instantiation is also supported (option
4388 `vhdl-use-direct-instantiation'). 4489 `vhdl-use-direct-instantiation').
4389 4490
4390| Configuration declarations can automatically be generated either from 4491 Configuration declarations can automatically be generated either from
4391| the menu (`C-c C-c C-f') (for the architecture the cursor is in) or from 4492 the menu (`C-c C-m C-f') (for the architecture the cursor is in) or from
4392| the speedbar menu (for the architecture under the cursor). The 4493 the speedbar menu (for the architecture under the cursor). The
4393| configurations can optionally be hierarchical (i.e. include all 4494 configurations can optionally be hierarchical (i.e. include all
4394| component levels of a hierarchical design, option 4495 component levels of a hierarchical design, option
4395| `vhdl-compose-configuration-hierarchical') or include subconfigurations 4496 `vhdl-compose-configuration-hierarchical') or include subconfigurations
4396| (option `vhdl-compose-configuration-use-subconfiguration'). For 4497 (option `vhdl-compose-configuration-use-subconfiguration'). For
4397| subcomponents in hierarchical configurations, the most-recently-analyzed 4498 subcomponents in hierarchical configurations, the most-recently-analyzed
4398| (mra) architecture is selected. If another architecture is desired, it 4499 (mra) architecture is selected. If another architecture is desired, it
4399| can be marked as most-recently-analyzed (speedbar menu) before 4500 can be marked as most-recently-analyzed (speedbar menu) before
4400| generating the configuration. 4501 generating the configuration.
4401| 4502
4402| Note: Configurations of subcomponents (i.e. hierarchical configuration 4503 Note: Configurations of subcomponents (i.e. hierarchical configuration
4403| declarations) are currently not considered when displaying 4504 declarations) are currently not considered when displaying
4404| configurations in speedbar. 4505 configurations in speedbar.
4405 4506
4406 See the options group `vhdl-compose' for all relevant user options. 4507 See the options group `vhdl-compose' for all relevant user options.
4407 4508
@@ -4433,11 +4534,13 @@ Usage:
4433 4534
4434 The Makefile's default target \"all\" compiles the entire design, the 4535 The Makefile's default target \"all\" compiles the entire design, the
4435 target \"clean\" removes it and the target \"library\" creates the 4536 target \"clean\" removes it and the target \"library\" creates the
4436 library directory if not existent. The Makefile also includes a target 4537 library directory if not existent. These target names can be customized
4437 for each primary library unit which allows selective compilation of this 4538 by option `vhdl-makefile-default-targets'. The Makefile also includes a
4438 unit, its secondary units and its subhierarchy (example: compilation of 4539 target for each primary library unit which allows selective compilation
4439 a design specified by a configuration). User specific parts can be 4540 of this unit, its secondary units and its subhierarchy (example:
4440 inserted into a Makefile with option `vhdl-makefile-generation-hook'. 4541 compilation of a design specified by a configuration). User specific
4542 parts can be inserted into a Makefile with option
4543 `vhdl-makefile-generation-hook'.
4441 4544
4442 Limitations: 4545 Limitations:
4443 - Only library units and dependencies within the current library are 4546 - Only library units and dependencies within the current library are
@@ -4483,7 +4586,7 @@ Usage:
4483 4586
4484 VHDL STANDARDS: 4587 VHDL STANDARDS:
4485 The VHDL standards to be used are specified in option `vhdl-standard'. 4588 The VHDL standards to be used are specified in option `vhdl-standard'.
4486 Available standards are: VHDL'87/'93, VHDL-AMS, and Math Packages. 4589 Available standards are: VHDL'87/'93(02), VHDL-AMS, and Math Packages.
4487 4590
4488 4591
4489 KEYWORD CASE: 4592 KEYWORD CASE:
@@ -4559,6 +4662,9 @@ Usage:
4559 - Out parameters of procedures are considered to be read. 4662 - Out parameters of procedures are considered to be read.
4560 Use option `vhdl-entity-file-name' to specify the entity file name 4663 Use option `vhdl-entity-file-name' to specify the entity file name
4561 \(used to obtain the port names). 4664 \(used to obtain the port names).
4665 Use option `vhdl-array-index-record-field-in-sensitivity-list' to
4666 specify whether to include array indices and record fields in
4667 sensitivity lists.
4562 4668
4563 4669
4564 CODE FIXING: 4670 CODE FIXING:
@@ -4632,16 +4738,17 @@ releases. You are kindly invited to participate in beta testing. Subscribe
4632to above mailing lists by sending an email to <reto@gnu.org>. 4738to above mailing lists by sending an email to <reto@gnu.org>.
4633 4739
4634VHDL Mode is officially distributed at 4740VHDL Mode is officially distributed at
4635URL `http://opensource.ethz.ch/emacs/vhdl-mode.html' 4741http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html
4636where the latest version can be found. 4742where the latest version can be found.
4637 4743
4638 4744
4639Known problems: 4745Known problems:
4640--------------- 4746---------------
4641 4747
4642- Indentation bug in simultaneous if- and case-statements (VHDL-AMS).
4643- XEmacs: Incorrect start-up when automatically opening speedbar. 4748- XEmacs: Incorrect start-up when automatically opening speedbar.
4644- XEmacs: Indentation in XEmacs 21.4 (and higher). 4749- XEmacs: Indentation in XEmacs 21.4 (and higher).
4750- Indentation incorrect for new 'postponed' VHDL keyword.
4751- Indentation incorrect for 'protected body' construct.
4645 4752
4646 4753
4647 The VHDL Mode Authors 4754 The VHDL Mode Authors
@@ -4764,7 +4871,7 @@ Key bindings:
4764;;; Keywords and standardized words 4871;;; Keywords and standardized words
4765;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4872;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4766 4873
4767(defconst vhdl-93-keywords 4874(defconst vhdl-02-keywords
4768 '( 4875 '(
4769 "abs" "access" "after" "alias" "all" "and" "architecture" "array" 4876 "abs" "access" "after" "alias" "all" "and" "architecture" "array"
4770 "assert" "attribute" 4877 "assert" "attribute"
@@ -4779,7 +4886,7 @@ Key bindings:
4779 "map" "mod" 4886 "map" "mod"
4780 "nand" "new" "next" "nor" "not" "null" 4887 "nand" "new" "next" "nor" "not" "null"
4781 "of" "on" "open" "or" "others" "out" 4888 "of" "on" "open" "or" "others" "out"
4782 "package" "port" "postponed" "procedure" "process" "pure" 4889 "package" "port" "postponed" "procedure" "process" "protected" "pure"
4783 "range" "record" "register" "reject" "rem" "report" "return" 4890 "range" "record" "register" "reject" "rem" "report" "return"
4784 "rol" "ror" 4891 "rol" "ror"
4785 "select" "severity" "shared" "signal" "sla" "sll" "sra" "srl" "subtype" 4892 "select" "severity" "shared" "signal" "sla" "sll" "sra" "srl" "subtype"
@@ -4789,7 +4896,7 @@ Key bindings:
4789 "wait" "when" "while" "with" 4896 "wait" "when" "while" "with"
4790 "xnor" "xor" 4897 "xnor" "xor"
4791 ) 4898 )
4792 "List of VHDL'93 keywords.") 4899 "List of VHDL'02 keywords.")
4793 4900
4794(defconst vhdl-ams-keywords 4901(defconst vhdl-ams-keywords
4795 '( 4902 '(
@@ -4822,7 +4929,7 @@ Key bindings:
4822 ) 4929 )
4823 "List of Verilog keywords as candidate for additional reserved words.") 4930 "List of Verilog keywords as candidate for additional reserved words.")
4824 4931
4825(defconst vhdl-93-types 4932(defconst vhdl-02-types
4826 '( 4933 '(
4827 "boolean" "bit" "bit_vector" "character" "severity_level" "integer" 4934 "boolean" "bit" "bit_vector" "character" "severity_level" "integer"
4828 "real" "time" "natural" "positive" "string" "line" "text" "side" 4935 "real" "time" "natural" "positive" "string" "line" "text" "side"
@@ -4830,25 +4937,72 @@ Key bindings:
4830 "std_logic" "std_logic_vector" 4937 "std_logic" "std_logic_vector"
4831 "std_ulogic" "std_ulogic_vector" 4938 "std_ulogic" "std_ulogic_vector"
4832 ) 4939 )
4833 "List of VHDL'93 standardized types.") 4940 "List of VHDL'02 standardized types.")
4834 4941
4835(defconst vhdl-ams-types 4942(defconst vhdl-ams-types
4943 ;; standards: IEEE Std 1076.1-2007, IEEE Std 1076.1.1-2004
4836 '( 4944 '(
4945 ;; package `standard'
4837 "domain_type" "real_vector" 4946 "domain_type" "real_vector"
4838 ;; from `nature_pkg' package 4947 ;; package `energy_systems'
4839 "voltage" "current" "electrical" "position" "velocity" "force" 4948 "energy" "power" "periodicity" "real_across" "real_through" "unspecified"
4840 "mechanical_vf" "mechanical_pf" "rotvel" "torque" "rotational" 4949 "unspecified_vector" "energy_vector" "power_vector" "periodicity_vector"
4841 "pressure" "flowrate" "fluid" 4950 "real_across_vector" "real_through_vector"
4842 ) 4951 ;; package `electrical_systems'
4952 "voltage" "current" "charge" "resistance" "conductance" "capacitance"
4953 "mmf" "electric_flux" "electric_flux_density" "electric_field_strength"
4954 "magnetic_flux" "magnetic_flux_density" "magnetic_field_strength"
4955 "inductance" "reluctance" "electrical" "electrical_vector" "magnetic"
4956 "magnetic_vector" "voltage_vector" "current_vector" "mmf_vector"
4957 "magnetic_flux_vector" "charge_vector" "resistance_vector"
4958 "conductance_vector" "capacitance_vector" "electric_flux_vector"
4959 "electric_flux_density_vector" "electric_field_strength_vector"
4960 "magnetic_flux_density_vector" "magnetic_field_strength_vector"
4961 "inductance_vector" "reluctance_vector" "ground"
4962 ;; package `mechanical_systems'
4963 "displacement" "force" "velocity" "acceleration" "mass" "stiffness"
4964 "damping" "momentum" "angle" "torque" "angular_velocity"
4965 "angular_acceleration" "moment_inertia" "angular_momentum"
4966 "angular_stiffness" "angular_damping" "translational"
4967 "translational_vector" "translational_velocity"
4968 "translational_velocity_vector" "rotational" "rotational_vector"
4969 "rotational_velocity" "rotational_velocity_vector" "displacement_vector"
4970 "force_vector" "velocity_vector" "force_velocity_vector" "angle_vector"
4971 "torque_vector" "angular_velocity_vector" "torque_velocity_vector"
4972 "acceleration_vector" "mass_vector" "stiffness_vector" "damping_vector"
4973 "momentum_vector" "angular_acceleration_vector" "moment_inertia_vector"
4974 "angular_momentum_vector" "angular_stiffness_vector"
4975 "angular_damping_vector" "anchor" "translational_v_ref"
4976 "rotational_v_ref" "translational_v" "rotational_v"
4977 ;; package `radiant_systems'
4978 "illuminance" "luminous_flux" "luminous_intensity" "irradiance" "radiant"
4979 "radiant_vector" "luminous_intensity_vector" "luminous_flux_vector"
4980 "illuminance_vector" "irradiance_vector"
4981 ;; package `thermal_systems'
4982 "temperature" "heat_flow" "thermal_capacitance" "thermal_resistance"
4983 "thermal_conductance" "thermal" "thermal_vector" "temperature_vector"
4984 "heat_flow_vector" "thermal_capacitance_vector"
4985 "thermal_resistance_vector" "thermal_conductance_vector"
4986 ;; package `fluidic_systems'
4987 "pressure" "vflow_rate" "mass_flow_rate" "volume" "density" "viscosity"
4988 "fresistance" "fconductance" "fcapacitance" "inertance" "cfresistance"
4989 "cfcapacitance" "cfinertance" "cfconductance" "fluidic" "fluidic_vector"
4990 "compressible_fluidic" "compressible_fluidic_vector" "pressure_vector"
4991 "vflow_rate_vector" "mass_flow_rate_vector" "volume_vector"
4992 "density_vector" "viscosity_vector" "fresistance_vector"
4993 "fconductance_vector" "fcapacitance_vector" "inertance_vector"
4994 "cfresistance_vector" "cfconductance_vector" "cfcapacitance_vector"
4995 "cfinertance_vector"
4996 )
4843 "List of VHDL-AMS standardized types.") 4997 "List of VHDL-AMS standardized types.")
4844 4998
4845(defconst vhdl-math-types 4999(defconst vhdl-math-types
4846 '( 5000 '(
4847 "complex" "complex_polar" 5001 "complex" "complex_polar" "positive_real" "principal_value"
4848 ) 5002 )
4849 "List of Math Packages standardized types.") 5003 "List of Math Packages standardized types.")
4850 5004
4851(defconst vhdl-93-attributes 5005(defconst vhdl-02-attributes
4852 '( 5006 '(
4853 "base" "left" "right" "high" "low" "pos" "val" "succ" 5007 "base" "left" "right" "high" "low" "pos" "val" "succ"
4854 "pred" "leftof" "rightof" "range" "reverse_range" 5008 "pred" "leftof" "rightof" "range" "reverse_range"
@@ -4858,7 +5012,7 @@ Key bindings:
4858 "simple_name" "instance_name" "path_name" 5012 "simple_name" "instance_name" "path_name"
4859 "foreign" 5013 "foreign"
4860 ) 5014 )
4861 "List of VHDL'93 standardized attributes.") 5015 "List of VHDL'02 standardized attributes.")
4862 5016
4863(defconst vhdl-ams-attributes 5017(defconst vhdl-ams-attributes
4864 '( 5018 '(
@@ -4869,7 +5023,7 @@ Key bindings:
4869 ) 5023 )
4870 "List of VHDL-AMS standardized attributes.") 5024 "List of VHDL-AMS standardized attributes.")
4871 5025
4872(defconst vhdl-93-enum-values 5026(defconst vhdl-02-enum-values
4873 '( 5027 '(
4874 "true" "false" 5028 "true" "false"
4875 "note" "warning" "error" "failure" 5029 "note" "warning" "error" "failure"
@@ -4878,7 +5032,7 @@ Key bindings:
4878 "fs" "ps" "ns" "us" "ms" "sec" "min" "hr" 5032 "fs" "ps" "ns" "us" "ms" "sec" "min" "hr"
4879 "right" "left" 5033 "right" "left"
4880 ) 5034 )
4881 "List of VHDL'93 standardized enumeration values.") 5035 "List of VHDL'02 standardized enumeration values.")
4882 5036
4883(defconst vhdl-ams-enum-values 5037(defconst vhdl-ams-enum-values
4884 '( 5038 '(
@@ -4888,22 +5042,38 @@ Key bindings:
4888 ) 5042 )
4889 "List of VHDL-AMS standardized enumeration values.") 5043 "List of VHDL-AMS standardized enumeration values.")
4890 5044
5045(defconst vhdl-ams-constants
5046 ;; standard: IEEE Std 1076.1.1-2004
5047 '(
5048 ;; package `fundamental_constants'
5049 "phys_q" "phys_eps0" "phys_mu0" "phys_k" "phys_gravity" "phys_ctok"
5050 "phys_c" "phys_h" "phys_h_over_2_pi" "yocto" "zepto" "atto" "femto"
5051 "pico" "nano" "micro" "milli" "centi" "deci" "deka" "hecto" "kilo" "mega"
5052 "giga" "tera" "peta" "exa" "zetta" "yotta" "deca"
5053 ;; package `material_constants'
5054 "phys_eps_si" "phys_eps_sio2" "phys_e_si" "phys_e_sio2" "phys_e_poly"
5055 "phys_nu_si" "phys_nu_poly" "phys_rho_poly" "phys_rho_sio2"
5056 "ambient_temperature" "ambient_pressure" "ambient_illuminance"
5057 )
5058 "List of VHDL-AMS standardized constants.")
5059
4891(defconst vhdl-math-constants 5060(defconst vhdl-math-constants
5061 ;; standard: IEEE Std 1076.2-1996
4892 '( 5062 '(
4893 "math_e" "math_1_over_e" 5063 "math_1_over_e" "math_1_over_pi" "math_1_over_sqrt_2" "math_2_pi"
4894 "math_pi" "math_two_pi" "math_1_over_pi" 5064 "math_3_pi_over_2" "math_cbase_1" "math_cbase_j" "math_czero"
4895 "math_half_pi" "math_q_pi" "math_3_half_pi" 5065 "math_deg_to_rad" "math_e" "math_log10_of_e" "math_log2_of_e"
4896 "math_log_of_2" "math_log_of_10" "math_log2_of_e" "math_log10_of_e" 5066 "math_log_of_10" "math_log_of_2" "math_pi" "math_pi_over_2"
4897 "math_sqrt2" "math_sqrt1_2" "math_sqrt_pi" 5067 "math_pi_over_3" "math_pi_over_4" "math_rad_to_deg" "math_sqrt_2"
4898 "math_deg_to_rad" "math_rad_to_deg" 5068 "math_sqrt_pi"
4899 "cbase_1" "cbase_j" "czero"
4900 ) 5069 )
4901 "List of Math Packages standardized constants.") 5070 "List of Math Packages standardized constants.")
4902 5071
4903(defconst vhdl-93-functions 5072(defconst vhdl-02-functions
4904 '( 5073 '(
4905 "now" "resolved" "rising_edge" "falling_edge" 5074 "now" "resolved" "rising_edge" "falling_edge"
4906 "read" "readline" "write" "writeline" "endfile" 5075 "read" "readline" "hread" "oread" "write" "writeline" "hwrite" "owrite"
5076 "endfile"
4907 "resize" "is_X" "std_match" 5077 "resize" "is_X" "std_match"
4908 "shift_left" "shift_right" "rotate_left" "rotate_right" 5078 "shift_left" "shift_right" "rotate_left" "rotate_right"
4909 "to_unsigned" "to_signed" "to_integer" 5079 "to_unsigned" "to_signed" "to_integer"
@@ -4913,25 +5083,27 @@ Key bindings:
4913 "shl" "shr" "ext" "sxt" 5083 "shl" "shr" "ext" "sxt"
4914 "deallocate" 5084 "deallocate"
4915 ) 5085 )
4916 "List of VHDL'93 standardized functions.") 5086 "List of VHDL'02 standardized functions.")
4917 5087
4918(defconst vhdl-ams-functions 5088(defconst vhdl-ams-functions
4919 '( 5089 '(
5090 ;; package `standard'
4920 "frequency" 5091 "frequency"
4921 ) 5092 )
4922 "List of VHDL-AMS standardized functions.") 5093 "List of VHDL-AMS standardized functions.")
4923 5094
4924(defconst vhdl-math-functions 5095(defconst vhdl-math-functions
5096 ;; standard: IEEE Std 1076.2-1996
4925 '( 5097 '(
4926 "sign" "ceil" "floor" "round" "trunc" "fmax" "fmin" "uniform" 5098 "arccos" "arccosh" "arcsin" "arcsinh" "arctan" "arctanh" "arg"
4927 "sqrt" "cbrt" "exp" "log" 5099 "cbrt" "ceil" "cmplx" "complex_to_polar" "conj" "cos" "cosh" "exp"
4928 "sin" "cos" "tan" "arcsin" "arccos" "arctan" 5100 "floor" "get_principal_value" "log" "log10" "log2" "polar_to_complex"
4929 "sinh" "cosh" "tanh" "arcsinh" "arccosh" "arctanh" 5101 "realmax" "realmin" "round" "sign" "sin" "sinh" "sqrt"
4930 "cmplx" "complex_to_polar" "polar_to_complex" "arg" "conj" 5102 "tan" "tanh" "trunc" "uniform"
4931 ) 5103 )
4932 "List of Math Packages standardized functions.") 5104 "List of Math Packages standardized functions.")
4933 5105
4934(defconst vhdl-93-packages 5106(defconst vhdl-02-packages
4935 '( 5107 '(
4936 "std_logic_1164" "numeric_std" "numeric_bit" 5108 "std_logic_1164" "numeric_std" "numeric_bit"
4937 "standard" "textio" 5109 "standard" "textio"
@@ -4939,12 +5111,13 @@ Key bindings:
4939 "std_logic_misc" "std_logic_textio" 5111 "std_logic_misc" "std_logic_textio"
4940 "ieee" "std" "work" 5112 "ieee" "std" "work"
4941 ) 5113 )
4942 "List of VHDL'93 standardized packages and libraries.") 5114 "List of VHDL'02 standardized packages and libraries.")
4943 5115
4944(defconst vhdl-ams-packages 5116(defconst vhdl-ams-packages
4945 '( 5117 '(
4946 ;; from `nature_pkg' package 5118 "fundamental_constants" "material_constants" "energy_systems"
4947 "nature_pkg" 5119 "electrical_systems" "mechanical_systems" "radiant_systems"
5120 "thermal_systems" "fluidic_systems"
4948 ) 5121 )
4949 "List of VHDL-AMS standardized packages and libraries.") 5122 "List of VHDL-AMS standardized packages and libraries.")
4950 5123
@@ -4990,6 +5163,9 @@ Key bindings:
4990(defvar vhdl-enum-values-regexp nil 5163(defvar vhdl-enum-values-regexp nil
4991 "Regexp for VHDL standardized enumeration values.") 5164 "Regexp for VHDL standardized enumeration values.")
4992 5165
5166(defvar vhdl-constants-regexp nil
5167 "Regexp for VHDL standardized constants.")
5168
4993(defvar vhdl-functions-regexp nil 5169(defvar vhdl-functions-regexp nil
4994 "Regexp for VHDL standardized functions.") 5170 "Regexp for VHDL standardized functions.")
4995 5171
@@ -5002,29 +5178,50 @@ Key bindings:
5002(defvar vhdl-directive-keywords-regexp nil 5178(defvar vhdl-directive-keywords-regexp nil
5003 "Regexp for compiler directive keywords.") 5179 "Regexp for compiler directive keywords.")
5004 5180
5181(defun vhdl-upcase-list (condition list)
5182 "Upcase all elements in LIST based on CONDITION."
5183 (when condition
5184 (let ((tmp-list list))
5185 (while tmp-list
5186 (setcar tmp-list (upcase (car tmp-list)))
5187 (setq tmp-list (cdr tmp-list)))))
5188 list)
5189
5005(defun vhdl-words-init () 5190(defun vhdl-words-init ()
5006 "Initialize reserved words." 5191 "Initialize reserved words."
5007 (setq vhdl-keywords 5192 (setq vhdl-keywords
5008 (append vhdl-93-keywords 5193 (vhdl-upcase-list
5009 (when (vhdl-standard-p 'ams) vhdl-ams-keywords))) 5194 (and vhdl-highlight-case-sensitive vhdl-upper-case-keywords)
5195 (append vhdl-02-keywords
5196 (when (vhdl-standard-p 'ams) vhdl-ams-keywords))))
5010 (setq vhdl-types 5197 (setq vhdl-types
5011 (append vhdl-93-types 5198 (vhdl-upcase-list
5012 (when (vhdl-standard-p 'ams) vhdl-ams-types) 5199 (and vhdl-highlight-case-sensitive vhdl-upper-case-types)
5013 (when (vhdl-standard-p 'math) vhdl-math-types))) 5200 (append vhdl-02-types
5201 (when (vhdl-standard-p 'ams) vhdl-ams-types)
5202 (when (vhdl-standard-p 'math) vhdl-math-types))))
5014 (setq vhdl-attributes 5203 (setq vhdl-attributes
5015 (append vhdl-93-attributes 5204 (vhdl-upcase-list
5016 (when (vhdl-standard-p 'ams) vhdl-ams-attributes))) 5205 (and vhdl-highlight-case-sensitive vhdl-upper-case-attributes)
5206 (append vhdl-02-attributes
5207 (when (vhdl-standard-p 'ams) vhdl-ams-attributes))))
5017 (setq vhdl-enum-values 5208 (setq vhdl-enum-values
5018 (append vhdl-93-enum-values 5209 (vhdl-upcase-list
5019 (when (vhdl-standard-p 'ams) vhdl-ams-enum-values))) 5210 (and vhdl-highlight-case-sensitive vhdl-upper-case-enum-values)
5211 (append vhdl-02-enum-values
5212 (when (vhdl-standard-p 'ams) vhdl-ams-enum-values))))
5020 (setq vhdl-constants 5213 (setq vhdl-constants
5021 (append (when (vhdl-standard-p 'math) vhdl-math-constants))) 5214 (vhdl-upcase-list
5215 (and vhdl-highlight-case-sensitive vhdl-upper-case-constants)
5216 (append (when (vhdl-standard-p 'ams) vhdl-ams-constants)
5217 (when (vhdl-standard-p 'math) vhdl-math-constants)
5218 '(""))))
5022 (setq vhdl-functions 5219 (setq vhdl-functions
5023 (append vhdl-93-functions 5220 (append vhdl-02-functions
5024 (when (vhdl-standard-p 'ams) vhdl-ams-functions) 5221 (when (vhdl-standard-p 'ams) vhdl-ams-functions)
5025 (when (vhdl-standard-p 'math) vhdl-math-functions))) 5222 (when (vhdl-standard-p 'math) vhdl-math-functions)))
5026 (setq vhdl-packages 5223 (setq vhdl-packages
5027 (append vhdl-93-packages 5224 (append vhdl-02-packages
5028 (when (vhdl-standard-p 'ams) vhdl-ams-packages) 5225 (when (vhdl-standard-p 'ams) vhdl-ams-packages)
5029 (when (vhdl-standard-p 'math) vhdl-math-packages))) 5226 (when (vhdl-standard-p 'math) vhdl-math-packages)))
5030 (setq vhdl-reserved-words 5227 (setq vhdl-reserved-words
@@ -5039,6 +5236,8 @@ Key bindings:
5039 (concat "\\<\\(" (regexp-opt vhdl-attributes) "\\)\\>")) 5236 (concat "\\<\\(" (regexp-opt vhdl-attributes) "\\)\\>"))
5040 (setq vhdl-enum-values-regexp 5237 (setq vhdl-enum-values-regexp
5041 (concat "\\<\\(" (regexp-opt vhdl-enum-values) "\\)\\>")) 5238 (concat "\\<\\(" (regexp-opt vhdl-enum-values) "\\)\\>"))
5239 (setq vhdl-constants-regexp
5240 (concat "\\<\\(" (regexp-opt vhdl-constants) "\\)\\>"))
5042 (setq vhdl-functions-regexp 5241 (setq vhdl-functions-regexp
5043 (concat "\\<\\(" (regexp-opt vhdl-functions) "\\)\\>")) 5242 (concat "\\<\\(" (regexp-opt vhdl-functions) "\\)\\>"))
5044 (setq vhdl-packages-regexp 5243 (setq vhdl-packages-regexp
@@ -5090,7 +5289,7 @@ We cannot use just `word' syntax class since `_' cannot be in word
5090class. Putting underscore in word class breaks forward word movement 5289class. Putting underscore in word class breaks forward word movement
5091behavior that users are familiar with.") 5290behavior that users are familiar with.")
5092 5291
5093(defconst vhdl-case-header-key "case[( \t\n][^;=>]+[) \t\n]is" 5292(defconst vhdl-case-header-key "case[( \t\n\r\f][^;=>]+[) \t\n\r\f]is"
5094 "Regexp describing a case statement header key.") 5293 "Regexp describing a case statement header key.")
5095 5294
5096(defconst vhdl-label-key 5295(defconst vhdl-label-key
@@ -5318,6 +5517,17 @@ the offset is simply returned."
5318 "Check if point is in a string." 5517 "Check if point is in a string."
5319 (eq (vhdl-in-literal) 'string)) 5518 (eq (vhdl-in-literal) 'string))
5320 5519
5520(defun vhdl-in-quote-p ()
5521 "Check if point is in a quote ('x')."
5522 (or (and (> (point) (point-min))
5523 (< (1+ (point)) (point-max))
5524 (= (char-before (point)) ?\')
5525 (= (char-after (1+ (point))) ?\'))
5526 (and (> (1- (point)) (point-min))
5527 (< (point) (point-max))
5528 (= (char-before (1- (point))) ?\')
5529 (= (char-after (point)) ?\'))))
5530
5321(defun vhdl-in-literal () 5531(defun vhdl-in-literal ()
5322 "Determine if point is in a VHDL literal." 5532 "Determine if point is in a VHDL literal."
5323 (save-excursion 5533 (save-excursion
@@ -5328,6 +5538,12 @@ the offset is simply returned."
5328 ((vhdl-beginning-of-macro) 'pound) 5538 ((vhdl-beginning-of-macro) 'pound)
5329 (t nil))))) 5539 (t nil)))))
5330 5540
5541(defun vhdl-in-extended-identifier-p ()
5542 "Determine if point is inside extended identifier (delimited by '\')."
5543 (save-match-data
5544 (and (save-excursion (re-search-backward "\\\\" (vhdl-point 'bol) t))
5545 (save-excursion (re-search-forward "\\\\" (vhdl-point 'eol) t)))))
5546
5331(defun vhdl-forward-comment (&optional direction) 5547(defun vhdl-forward-comment (&optional direction)
5332 "Skip all comments (including whitespace). Skip backwards if DIRECTION is 5548 "Skip all comments (including whitespace). Skip backwards if DIRECTION is
5333negative, skip forward otherwise." 5549negative, skip forward otherwise."
@@ -5335,20 +5551,30 @@ negative, skip forward otherwise."
5335 (if (and direction (< direction 0)) 5551 (if (and direction (< direction 0))
5336 ;; skip backwards 5552 ;; skip backwards
5337 (progn 5553 (progn
5338 (skip-chars-backward " \t\n") 5554 (skip-chars-backward " \t\n\r\f")
5339 (while (re-search-backward "^[^\"-]*\\(\\(-?\"[^\"]*\"\\|-[^\"-]\\)[^\"-]*\\)*\\(--\\)" (vhdl-point 'bol) t) 5555 (while (re-search-backward "^[^\"-]*\\(\\(-?\"[^\"]*\"\\|-[^\"-]\\)[^\"-]*\\)*\\(--\\)" (vhdl-point 'bol) t)
5340 (goto-char (match-beginning 3)) 5556 (goto-char (match-beginning 3))
5341 (skip-chars-backward " \t\n"))) 5557 (skip-chars-backward " \t\n\r\f")))
5342 ;; skip forwards 5558 ;; skip forwards
5343 (skip-chars-forward " \t\n") 5559 (skip-chars-forward " \t\n\r\f")
5344 (while (looking-at "--.*") 5560 (while (looking-at "--.*")
5345 (goto-char (match-end 0)) 5561 (goto-char (match-end 0))
5346 (skip-chars-forward " \t\n")))) 5562 (skip-chars-forward " \t\n\r\f"))))
5347 5563
5348;; XEmacs hack: work around buggy `forward-comment' in XEmacs 21.4+ 5564;; XEmacs hack: work around buggy `forward-comment' in XEmacs 21.4+
5349(unless (and (featurep 'xemacs) (string< "21.2" emacs-version)) 5565(unless (and (featurep 'xemacs) (string< "21.2" emacs-version))
5350 (defalias 'vhdl-forward-comment 'forward-comment)) 5566 (defalias 'vhdl-forward-comment 'forward-comment))
5351 5567
5568(defun vhdl-back-to-indentation ()
5569 "Move point to the first non-whitespace character on this line."
5570 (interactive)
5571 (beginning-of-line 1)
5572 (skip-syntax-forward " " (vhdl-point 'eol)))
5573
5574;; XEmacs hack: work around old `back-to-indentation' in XEmacs
5575(when (featurep 'xemacs)
5576 (defalias 'back-to-indentation 'vhdl-back-to-indentation))
5577
5352;; This is the best we can do in Win-Emacs. 5578;; This is the best we can do in Win-Emacs.
5353(defun vhdl-win-il (&optional lim) 5579(defun vhdl-win-il (&optional lim)
5354 "Determine if point is in a VHDL literal." 5580 "Determine if point is in a VHDL literal."
@@ -5513,7 +5739,7 @@ that point, else nil."
5513 (and 5739 (and
5514 (save-excursion 5740 (save-excursion
5515 (forward-sexp) 5741 (forward-sexp)
5516 (skip-chars-forward " \t\n") 5742 (skip-chars-forward " \t\n\r\f")
5517 (not (looking-at "is\\b[^_]"))) 5743 (not (looking-at "is\\b[^_]")))
5518 (save-excursion 5744 (save-excursion
5519 (backward-sexp) 5745 (backward-sexp)
@@ -5553,12 +5779,12 @@ corresponding \"begin\" keyword, else return nil."
5553 "is")))) 5779 "is"))))
5554 5780
5555(defconst vhdl-begin-fwd-re 5781(defconst vhdl-begin-fwd-re
5556 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\|units\\|record\\|for\\)\\b\\([^_]\\|\\'\\)" 5782 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\(\\s-+body\\)?\\|units\\|use\\|record\\|protected\\(\\s-+body\\)?\\|for\\)\\b\\([^_]\\|\\'\\)"
5557 "A regular expression for searching forward that matches all known 5783 "A regular expression for searching forward that matches all known
5558\"begin\" keywords.") 5784\"begin\" keywords.")
5559 5785
5560(defconst vhdl-begin-bwd-re 5786(defconst vhdl-begin-bwd-re
5561 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\|units\\|record\\|for\\)\\b[^_]" 5787 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\(\\s-+body\\)?\\|units\\|use\\|record\\|protected\\(\\s-+body\\)?\\|for\\)\\b[^_]"
5562 "A regular expression for searching backward that matches all known 5788 "A regular expression for searching backward that matches all known
5563\"begin\" keywords.") 5789\"begin\" keywords.")
5564 5790
@@ -5591,21 +5817,21 @@ keyword."
5591 (and (/= (following-char) ?\;) 5817 (and (/= (following-char) ?\;)
5592 (not (looking-at "is\\|begin\\|process\\|procedural\\|block"))))) 5818 (not (looking-at "is\\|begin\\|process\\|procedural\\|block")))))
5593 t) 5819 t)
5594 ;; "begin", "then": 5820 ;; "begin", "then", "use":
5595 ((looking-at "be\\|t") 5821 ((looking-at "be\\|t\\|use")
5596 t) 5822 t)
5597 ;; "else": 5823 ;; "else":
5598 ((and (looking-at "e") 5824 ((and (looking-at "e")
5599 ;; make sure that the "else" isn't inside a 5825 ;; make sure that the "else" isn't inside a
5600 ;; conditional signal assignment. 5826 ;; conditional signal assignment.
5601 (save-excursion 5827 (save-excursion
5602 (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move) 5828 (vhdl-re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move)
5603 (or (eq (following-char) ?\;) 5829 (or (eq (following-char) ?\;)
5604 (eq (point) lim)))) 5830 (eq (point) lim))))
5605 t) 5831 t)
5606 ;; "block", "generate", "loop", "process", "procedural", 5832 ;; "block", "generate", "loop", "process", "procedural",
5607 ;; "units", "record": 5833 ;; "units", "record", "protected body":
5608 ((and (looking-at "bl\\|[glpur]") 5834 ((and (looking-at "block\\|generate\\|loop\\|process\\|procedural\\|protected\\(\\s-+body\\)?\\|units\\|record")
5609 (save-excursion 5835 (save-excursion
5610 (backward-sexp) 5836 (backward-sexp)
5611 (not (looking-at "end\\s-+\\w")))) 5837 (not (looking-at "end\\s-+\\w"))))
@@ -5633,7 +5859,7 @@ keyword."
5633 (cond 5859 (cond
5634 ((looking-at "is\\|block\\|generate\\|process\\|procedural") 5860 ((looking-at "is\\|block\\|generate\\|process\\|procedural")
5635 "begin") 5861 "begin")
5636 ((looking-at "then") 5862 ((looking-at "then\\|use")
5637 "<else>") 5863 "<else>")
5638 (t 5864 (t
5639 "end"))) 5865 "end")))
@@ -5648,6 +5874,9 @@ Assumes that the caller will make sure that we are not in the middle
5648of an identifier that just happens to contain a \"begin\" keyword." 5874of an identifier that just happens to contain a \"begin\" keyword."
5649 (save-excursion 5875 (save-excursion
5650 (and (looking-at vhdl-begin-fwd-re) 5876 (and (looking-at vhdl-begin-fwd-re)
5877 (or (not (looking-at "\\<use\\>"))
5878 (save-excursion (back-to-indentation)
5879 (looking-at "\\(\\w+\\s-*:\\s-*\\)?\\<\\(case\\|elsif\\|if\\)\\>")))
5651 (/= (preceding-char) ?_) 5880 (/= (preceding-char) ?_)
5652 (not (vhdl-in-literal)) 5881 (not (vhdl-in-literal))
5653 (vhdl-begin-p lim) 5882 (vhdl-begin-p lim)
@@ -5670,8 +5899,8 @@ of an identifier that just happens to contain a \"begin\" keyword."
5670 (vhdl-beginning-of-statement-1 lim) 5899 (vhdl-beginning-of-statement-1 lim)
5671 (vhdl-backward-skip-label lim) 5900 (vhdl-backward-skip-label lim)
5672 (vhdl-first-word (point))))))) 5901 (vhdl-first-word (point)))))))
5673 ;; "component", "units", "record": 5902 ;; "component", "units", "record", "protected body":
5674 ((looking-at "[cur]") 5903 ((looking-at "component\\|units\\|protected\\(\\s-+body\\)?\\|record")
5675 ;; The first end found will close the block 5904 ;; The first end found will close the block
5676 (vector "end" nil)) 5905 (vector "end" nil))
5677 ;; "block", "process", "procedural": 5906 ;; "block", "process", "procedural":
@@ -5683,8 +5912,8 @@ of an identifier that just happens to contain a \"begin\" keyword."
5683 (vhdl-backward-skip-label lim) 5912 (vhdl-backward-skip-label lim)
5684 (vhdl-first-word (point)))))) 5913 (vhdl-first-word (point))))))
5685 ;; "then": 5914 ;; "then":
5686 ((looking-at "t") 5915 ((looking-at "t\\|use")
5687 (vector "elsif\\|else\\|end\\s-+if" 5916 (vector "elsif\\|else\\|end\\s-+\\(if\\|use\\)"
5688 (and (vhdl-last-word (point)) 5917 (and (vhdl-last-word (point))
5689 (or (vhdl-first-word (point)) 5918 (or (vhdl-first-word (point))
5690 (save-excursion 5919 (save-excursion
@@ -5730,25 +5959,25 @@ of an identifier that just happens to contain an \"end\" keyword."
5730 (vhdl-end-p lim)) 5959 (vhdl-end-p lim))
5731 (if (looking-at "el") 5960 (if (looking-at "el")
5732 ;; "else", "elsif": 5961 ;; "else", "elsif":
5733 (vector "if\\|elsif" (vhdl-first-word (point)) "then" nil) 5962 (vector "if\\|elsif" (vhdl-first-word (point)) "then\\|use" nil)
5734 ;; "end ...": 5963 ;; "end ...":
5735 (setq pos (point)) 5964 (setq pos (point))
5736 (forward-sexp) 5965 (forward-sexp)
5737 (skip-chars-forward " \t\n") 5966 (skip-chars-forward " \t\n\r\f")
5738 (cond 5967 (cond
5739 ;; "end if": 5968 ;; "end if":
5740 ((looking-at "if\\b[^_]") 5969 ((looking-at "if\\b[^_]")
5741 (vector "else\\|elsif\\|if" 5970 (vector "else\\|elsif\\|if"
5742 (vhdl-first-word pos) 5971 (vhdl-first-word pos)
5743 "else\\|then" nil)) 5972 "else\\|then\\|use" nil))
5744 ;; "end component": 5973 ;; "end component":
5745 ((looking-at "component\\b[^_]") 5974 ((looking-at "component\\b[^_]")
5746 (vector (buffer-substring (match-beginning 1) 5975 (vector (buffer-substring (match-beginning 1)
5747 (match-end 1)) 5976 (match-end 1))
5748 (vhdl-first-word pos) 5977 (vhdl-first-word pos)
5749 nil nil)) 5978 nil nil))
5750 ;; "end units", "end record": 5979 ;; "end units", "end record", "end protected":
5751 ((looking-at "\\(units\\|record\\)\\b[^_]") 5980 ((looking-at "\\(units\\|record\\|protected\\(\\s-+body\\)?\\)\\b[^_]")
5752 (vector (buffer-substring (match-beginning 1) 5981 (vector (buffer-substring (match-beginning 1)
5753 (match-end 1)) 5982 (match-end 1))
5754 (vhdl-first-word pos) 5983 (vhdl-first-word pos)
@@ -5805,38 +6034,38 @@ of an identifier that just happens to contain an \"end\" keyword."
5805 (cond ((looking-at "block\\|process\\|procedural") 6034 (cond ((looking-at "block\\|process\\|procedural")
5806 (if (save-excursion 6035 (if (save-excursion
5807 (forward-sexp) 6036 (forward-sexp)
5808 (skip-chars-forward " \t\n") 6037 (skip-chars-forward " \t\n\r\f")
5809 (= (following-char) ?\()) 6038 (= (following-char) ?\())
5810 (forward-sexp 2) 6039 (forward-sexp 2)
5811 (forward-sexp)) 6040 (forward-sexp))
5812 (when (looking-at "[ \t\n]*is") 6041 (when (looking-at "[ \t\n\r\f]*is")
5813 (goto-char (match-end 0))) 6042 (goto-char (match-end 0)))
5814 (point)) 6043 (point))
5815 ((looking-at "component") 6044 ((looking-at "component")
5816 (forward-sexp 2) 6045 (forward-sexp 2)
5817 (when (looking-at "[ \t\n]*is") 6046 (when (looking-at "[ \t\n\r\f]*is")
5818 (goto-char (match-end 0))) 6047 (goto-char (match-end 0)))
5819 (point)) 6048 (point))
5820 ((looking-at "for") 6049 ((looking-at "for")
5821 (forward-sexp 2) 6050 (forward-sexp 2)
5822 (skip-chars-forward " \t\n") 6051 (skip-chars-forward " \t\n\r\f")
5823 (while (looking-at "[,:(]") 6052 (while (looking-at "[,:(]")
5824 (forward-sexp) 6053 (forward-sexp)
5825 (skip-chars-forward " \t\n")) 6054 (skip-chars-forward " \t\n\r\f"))
5826 (point)) 6055 (point))
5827 (t nil) 6056 (t nil)
5828 ))) 6057 )))
5829 6058
5830(defconst vhdl-trailer-re 6059(defconst vhdl-trailer-re
5831 "\\b\\(is\\|then\\|generate\\|loop\\|record\\)\\b[^_]") 6060 "\\b\\(is\\|then\\|generate\\|loop\\|record\\|protected\\(\\s-+body\\)?\\|use\\)\\b[^_]")
5832 6061
5833(defconst vhdl-statement-fwd-re 6062(defconst vhdl-statement-fwd-re
5834 "\\b\\(if\\|for\\|while\\)\\b\\([^_]\\|\\'\\)" 6063 "\\b\\(if\\|for\\|while\\|loop\\)\\b\\([^_]\\|\\'\\)"
5835 "A regular expression for searching forward that matches all known 6064 "A regular expression for searching forward that matches all known
5836\"statement\" keywords.") 6065\"statement\" keywords.")
5837 6066
5838(defconst vhdl-statement-bwd-re 6067(defconst vhdl-statement-bwd-re
5839 "\\b\\(if\\|for\\|while\\)\\b[^_]" 6068 "\\b\\(if\\|for\\|while\\|loop\\)\\b[^_]"
5840 "A regular expression for searching backward that matches all known 6069 "A regular expression for searching backward that matches all known
5841\"statement\" keywords.") 6070\"statement\" keywords.")
5842 6071
@@ -5852,7 +6081,7 @@ in the middle of an identifier that just happens to contain a
5852 ;; Make sure it's the start of a parameter specification. 6081 ;; Make sure it's the start of a parameter specification.
5853 (save-excursion 6082 (save-excursion
5854 (forward-sexp 2) 6083 (forward-sexp 2)
5855 (skip-chars-forward " \t\n") 6084 (skip-chars-forward " \t\n\r\f")
5856 (looking-at "in\\b[^_]")) 6085 (looking-at "in\\b[^_]"))
5857 ;; Make sure it's not an "end for". 6086 ;; Make sure it's not an "end for".
5858 (save-excursion 6087 (save-excursion
@@ -5871,7 +6100,7 @@ in the middle of an identifier that just happens to contain a
5871 t) 6100 t)
5872 )) 6101 ))
5873 6102
5874(defconst vhdl-case-alternative-re "when[( \t\n][^;=>]+=>" 6103(defconst vhdl-case-alternative-re "when[( \t\n\r\f][^;=>]+=>"
5875 "Regexp describing a case statement alternative key.") 6104 "Regexp describing a case statement alternative key.")
5876 6105
5877(defun vhdl-case-alternative-p (&optional lim) 6106(defun vhdl-case-alternative-p (&optional lim)
@@ -5908,6 +6137,9 @@ contain a \"when\" keyword."
5908 (cond 6137 (cond
5909 ;; "begin" keyword: 6138 ;; "begin" keyword:
5910 ((and (looking-at vhdl-begin-fwd-re) 6139 ((and (looking-at vhdl-begin-fwd-re)
6140 (or (not (looking-at "\\<use\\>"))
6141 (save-excursion (back-to-indentation)
6142 (looking-at "\\(\\w+\\s-*:\\s-*\\)?\\<\\(case\\|elsif\\|if\\)\\>")))
5911 (/= (preceding-char) ?_) 6143 (/= (preceding-char) ?_)
5912 (vhdl-begin-p lim)) 6144 (vhdl-begin-p lim))
5913 (setq foundp 'begin)) 6145 (setq foundp 'begin))
@@ -5931,7 +6163,7 @@ With COUNT, do it that many times."
5931 (save-excursion 6163 (save-excursion
5932 (while (> count 0) 6164 (while (> count 0)
5933 ;; skip whitespace 6165 ;; skip whitespace
5934 (skip-chars-forward " \t\n") 6166 (skip-chars-forward " \t\n\r\f")
5935 ;; Check for an unbalanced "end" keyword 6167 ;; Check for an unbalanced "end" keyword
5936 (if (and (looking-at vhdl-end-fwd-re) 6168 (if (and (looking-at vhdl-end-fwd-re)
5937 (/= (preceding-char) ?_) 6169 (/= (preceding-char) ?_)
@@ -6007,6 +6239,10 @@ searches."
6007 nil 6239 nil
6008 (backward-sexp) 6240 (backward-sexp)
6009 (if (and (looking-at vhdl-begin-fwd-re) 6241 (if (and (looking-at vhdl-begin-fwd-re)
6242 (or (not (looking-at "\\<use\\>"))
6243 (save-excursion
6244 (back-to-indentation)
6245 (looking-at "\\(\\w+\\s-*:\\s-*\\)?\\<\\(case\\|elsif\\|if\\)\\>")))
6010 (/= (preceding-char) ?_) 6246 (/= (preceding-char) ?_)
6011 (not (vhdl-in-literal)) 6247 (not (vhdl-in-literal))
6012 (vhdl-begin-p lim)) 6248 (vhdl-begin-p lim))
@@ -6278,7 +6514,7 @@ search, and an argument indicating an interactive call."
6278 (re-search-forward vhdl-e-o-s-re)) 6514 (re-search-forward vhdl-e-o-s-re))
6279 6515
6280(defconst vhdl-b-o-s-re 6516(defconst vhdl-b-o-s-re
6281 (concat ";\\|\(\\|\)\\|\\bwhen\\b[^_]\\|" 6517 (concat ";[^_]\\|\([^_]\\|\)[^_]\\|\\bwhen\\b[^_]\\|"
6282 vhdl-begin-bwd-re "\\|" vhdl-statement-bwd-re)) 6518 vhdl-begin-bwd-re "\\|" vhdl-statement-bwd-re))
6283 6519
6284(defun vhdl-beginning-of-statement-1 (&optional lim) 6520(defun vhdl-beginning-of-statement-1 (&optional lim)
@@ -6299,7 +6535,7 @@ statement if already at the beginning of one."
6299 (while (and (not donep) 6535 (while (and (not donep)
6300 (not (bobp)) 6536 (not (bobp))
6301 ;; look backwards for a statement boundary 6537 ;; look backwards for a statement boundary
6302 (re-search-backward vhdl-b-o-s-re lim 'move)) 6538 (progn (forward-char) (re-search-backward vhdl-b-o-s-re lim 'move)))
6303 (if (or (= (preceding-char) ?_) 6539 (if (or (= (preceding-char) ?_)
6304 (vhdl-in-literal)) 6540 (vhdl-in-literal))
6305 (backward-char) 6541 (backward-char)
@@ -6319,13 +6555,17 @@ statement if already at the beginning of one."
6319 (vhdl-forward-syntactic-ws here) 6555 (vhdl-forward-syntactic-ws here)
6320 (setq donep t)))) 6556 (setq donep t))))
6321 ;; If we are looking at a semicolon, then stop 6557 ;; If we are looking at a semicolon, then stop
6322 ((eq (following-char) ?\;) 6558 ((and (eq (following-char) ?\;) (not (vhdl-in-quote-p)))
6323 (progn 6559 (progn
6324 (forward-char) 6560 (forward-char)
6325 (vhdl-forward-syntactic-ws here) 6561 (vhdl-forward-syntactic-ws here)
6326 (setq donep t))) 6562 (setq donep t)))
6327 ;; If we are looking at a "begin", then stop 6563 ;; If we are looking at a "begin", then stop
6328 ((and (looking-at vhdl-begin-fwd-re) 6564 ((and (looking-at vhdl-begin-fwd-re)
6565 (or (not (looking-at "\\<use\\>"))
6566 (save-excursion
6567 (back-to-indentation)
6568 (looking-at "\\(\\w+\\s-*:\\s-*\\)?\\<\\(case\\|elsif\\|if\\)\\>")))
6329 (/= (preceding-char) ?_) 6569 (/= (preceding-char) ?_)
6330 (vhdl-begin-p nil)) 6570 (vhdl-begin-p nil))
6331 ;; If it's a leader "begin", then find the 6571 ;; If it's a leader "begin", then find the
@@ -6576,6 +6816,10 @@ is not moved."
6576 (setq begin-after-ip (and 6816 (setq begin-after-ip (and
6577 (not literal) 6817 (not literal)
6578 (looking-at vhdl-begin-fwd-re) 6818 (looking-at vhdl-begin-fwd-re)
6819 (or (not (looking-at "\\<use\\>"))
6820 (save-excursion
6821 (back-to-indentation)
6822 (looking-at "\\(\\w+\\s-*:\\s-*\\)?\\<\\(case\\|elsif\\|if\\)\\>")))
6579 (vhdl-begin-p))) 6823 (vhdl-begin-p)))
6580 (setq end-after-ip (and 6824 (setq end-after-ip (and
6581 (not literal) 6825 (not literal)
@@ -6624,7 +6868,8 @@ is not moved."
6624 ((progn 6868 ((progn
6625 (vhdl-backward-syntactic-ws lim) 6869 (vhdl-backward-syntactic-ws lim)
6626 (or (bobp) 6870 (or (bobp)
6627 (= (preceding-char) ?\;))) 6871 (and (= (preceding-char) ?\;)
6872 (not (vhdl-in-quote-p)))))
6628 (vhdl-add-syntax 'statement placeholder)) 6873 (vhdl-add-syntax 'statement placeholder))
6629 ;; CASE 2D: we are looking at a top-level statement-cont 6874 ;; CASE 2D: we are looking at a top-level statement-cont
6630 (t 6875 (t
@@ -6662,6 +6907,10 @@ is not moved."
6662 (save-excursion 6907 (save-excursion
6663 (vhdl-beginning-of-statement-1 containing-sexp) 6908 (vhdl-beginning-of-statement-1 containing-sexp)
6664 (skip-chars-backward " \t(") 6909 (skip-chars-backward " \t(")
6910 (while (and (= (preceding-char) ?\;)
6911 (not (vhdl-in-quote-p)))
6912 (vhdl-beginning-of-statement-1 containing-sexp)
6913 (skip-chars-backward " \t("))
6665 (<= (point) containing-sexp))) 6914 (<= (point) containing-sexp)))
6666 (goto-char containing-sexp) 6915 (goto-char containing-sexp)
6667 (vhdl-add-syntax 'arglist-cont-nonempty (vhdl-point 'boi))) 6916 (vhdl-add-syntax 'arglist-cont-nonempty (vhdl-point 'boi)))
@@ -6730,7 +6979,7 @@ is not moved."
6730 (save-excursion 6979 (save-excursion
6731 (goto-char new) 6980 (goto-char new)
6732 (eq new (progn (back-to-indentation) (point))))) 6981 (eq new (progn (back-to-indentation) (point)))))
6733 (setq placeholder new))) 6982 (setq placeholder new)))
6734 (vhdl-add-syntax 'statement-cont placeholder) 6983 (vhdl-add-syntax 'statement-cont placeholder)
6735 (if begin-after-ip 6984 (if begin-after-ip
6736 (vhdl-add-syntax 'block-open))) 6985 (vhdl-add-syntax 'block-open)))
@@ -6891,7 +7140,7 @@ only-lines."
6891 (let* ((relpos (cdr langelem)) 7140 (let* ((relpos (cdr langelem))
6892 (assignp (save-excursion 7141 (assignp (save-excursion
6893 (goto-char (vhdl-point 'boi)) 7142 (goto-char (vhdl-point 'boi))
6894 (and (re-search-forward "\\(<\\|:\\)=" 7143 (and (re-search-forward "\\(<\\|:\\|=\\)="
6895 (vhdl-point 'eol) t) 7144 (vhdl-point 'eol) t)
6896 (- (point) (vhdl-point 'boi))))) 7145 (- (point) (vhdl-point 'boi)))))
6897 (curcol (progn 7146 (curcol (progn
@@ -6900,7 +7149,7 @@ only-lines."
6900 foundp) 7149 foundp)
6901 (while (and (not foundp) 7150 (while (and (not foundp)
6902 (< (point) (vhdl-point 'eol))) 7151 (< (point) (vhdl-point 'eol)))
6903 (re-search-forward "\\(<\\|:\\)=\\|(" (vhdl-point 'eol) 'move) 7152 (re-search-forward "\\(<\\|:\\|=\\)=\\|(" (vhdl-point 'eol) 'move)
6904 (if (vhdl-in-literal) 7153 (if (vhdl-in-literal)
6905 (forward-char) 7154 (forward-char)
6906 (if (= (preceding-char) ?\() 7155 (if (= (preceding-char) ?\()
@@ -7001,7 +7250,8 @@ character is a space."
7001 (interactive) 7250 (interactive)
7002 (if (and (= (preceding-char) ? ) (vhdl-in-comment-p)) 7251 (if (and (= (preceding-char) ? ) (vhdl-in-comment-p))
7003 (indent-new-comment-line) 7252 (indent-new-comment-line)
7004 (when (and (>= (preceding-char) ?a) (<= (preceding-char) ?z)) 7253 (when (and (>= (preceding-char) ?a) (<= (preceding-char) ?z)
7254 (not (vhdl-in-comment-p)))
7005 (vhdl-fix-case-word -1)) 7255 (vhdl-fix-case-word -1))
7006 (newline-and-indent))) 7256 (newline-and-indent)))
7007 7257
@@ -7011,6 +7261,7 @@ indentation change."
7011 (interactive) 7261 (interactive)
7012 (let* ((syntax (and vhdl-indent-syntax-based (vhdl-get-syntactic-context))) 7262 (let* ((syntax (and vhdl-indent-syntax-based (vhdl-get-syntactic-context)))
7013 (pos (- (point-max) (point))) 7263 (pos (- (point-max) (point)))
7264 (is-comment nil)
7014 (indent 7265 (indent
7015 (if syntax 7266 (if syntax
7016 ;; indent syntax-based 7267 ;; indent syntax-based
@@ -7018,6 +7269,15 @@ indentation change."
7018 (>= (vhdl-get-offset (car syntax)) comment-column)) 7269 (>= (vhdl-get-offset (car syntax)) comment-column))
7019 ;; special case: comments at or right of comment-column 7270 ;; special case: comments at or right of comment-column
7020 (vhdl-get-offset (car syntax)) 7271 (vhdl-get-offset (car syntax))
7272 ;; align comments like following code line
7273 (when vhdl-indent-comment-like-next-code-line
7274 (save-excursion
7275 (while (eq (caar syntax) 'comment)
7276 (setq is-comment t)
7277 (beginning-of-line 2)
7278 (setq syntax (vhdl-get-syntactic-context)))))
7279 (when is-comment
7280 (setq syntax (cons (cons 'comment nil) syntax)))
7021 (apply '+ (mapcar 'vhdl-get-offset syntax))) 7281 (apply '+ (mapcar 'vhdl-get-offset syntax)))
7022 ;; indent like previous nonblank line 7282 ;; indent like previous nonblank line
7023 (save-excursion (beginning-of-line) 7283 (save-excursion (beginning-of-line)
@@ -7026,10 +7286,13 @@ indentation change."
7026 (shift-amt (- indent (current-indentation)))) 7286 (shift-amt (- indent (current-indentation))))
7027 (and vhdl-echo-syntactic-information-p 7287 (and vhdl-echo-syntactic-information-p
7028 (message "syntax: %s, indent= %d" syntax indent)) 7288 (message "syntax: %s, indent= %d" syntax indent))
7029 (unless (zerop shift-amt) 7289 (let ((has-formfeed
7030 (delete-region (vhdl-point 'bol) (vhdl-point 'boi)) 7290 (save-excursion (beginning-of-line) (looking-at "\\s-*\f"))))
7031 (beginning-of-line) 7291 (when (or (not (zerop shift-amt)) has-formfeed)
7032 (indent-to indent)) 7292 (delete-region (vhdl-point 'bol) (vhdl-point 'boi))
7293 (beginning-of-line)
7294 (when has-formfeed (insert "\f"))
7295 (indent-to indent)))
7033 (if (< (point) (vhdl-point 'boi)) 7296 (if (< (point) (vhdl-point 'boi))
7034 (back-to-indentation) 7297 (back-to-indentation)
7035 ;; If initial point was within line's indentation, position after 7298 ;; If initial point was within line's indentation, position after
@@ -7040,7 +7303,7 @@ indentation change."
7040 (vhdl-update-progress-info "Indenting" (vhdl-current-line)) 7303 (vhdl-update-progress-info "Indenting" (vhdl-current-line))
7041 shift-amt)) 7304 shift-amt))
7042 7305
7043(defun vhdl-indent-region (beg end column) 7306(defun vhdl-indent-region (beg end &optional column)
7044 "Indent region as VHDL code. 7307 "Indent region as VHDL code.
7045Adds progress reporting to `indent-region'." 7308Adds progress reporting to `indent-region'."
7046 (interactive "r\nP") 7309 (interactive "r\nP")
@@ -7055,7 +7318,7 @@ Adds progress reporting to `indent-region'."
7055 "Indent whole buffer as VHDL code. 7318 "Indent whole buffer as VHDL code.
7056Calls `indent-region' for whole buffer and adds progress reporting." 7319Calls `indent-region' for whole buffer and adds progress reporting."
7057 (interactive) 7320 (interactive)
7058 (vhdl-indent-region (point-min) (point-max) nil)) 7321 (vhdl-indent-region (point-min) (point-max)))
7059 7322
7060(defun vhdl-indent-group () 7323(defun vhdl-indent-group ()
7061 "Indent group of lines between empty lines." 7324 "Indent group of lines between empty lines."
@@ -7068,7 +7331,7 @@ Calls `indent-region' for whole buffer and adds progress reporting."
7068 (if (re-search-forward vhdl-align-group-separate nil t) 7331 (if (re-search-forward vhdl-align-group-separate nil t)
7069 (point-marker) 7332 (point-marker)
7070 (point-max-marker))))) 7333 (point-max-marker)))))
7071 (vhdl-indent-region beg end nil))) 7334 (vhdl-indent-region beg end)))
7072 7335
7073(defun vhdl-indent-sexp (&optional endpos) 7336(defun vhdl-indent-sexp (&optional endpos)
7074 "Indent each line of the list starting just after point. 7337 "Indent each line of the list starting just after point.
@@ -7131,21 +7394,23 @@ ENDPOS is encountered."
7131(defconst vhdl-align-alist 7394(defconst vhdl-align-alist
7132 '( 7395 '(
7133 ;; after some keywords 7396 ;; after some keywords
7134 (vhdl-mode "^\\s-*\\(constant\\|quantity\\|signal\\|subtype\\|terminal\\|type\\|variable\\)[ \t]" 7397 (vhdl-mode "^\\s-*\\(across\\|constant\\|quantity\\|signal\\|subtype\\|terminal\\|through\\|type\\|variable\\)[ \t]"
7135 "^\\s-*\\(constant\\|quantity\\|signal\\|subtype\\|terminal\\|type\\|variable\\)\\([ \t]+\\)" 2) 7398 "^\\s-*\\(across\\|constant\\|quantity\\|signal\\|subtype\\|terminal\\|through\\|type\\|variable\\)\\([ \t]+\\)" 2)
7136 ;; before ':' 7399 ;; before ':'
7137 (vhdl-mode ":[^=]" "\\([ \t]*\\):[^=]") 7400 (vhdl-mode ":[^=]" "\\([ \t]*\\):[^=]")
7138 ;; after direction specifications 7401 ;; after direction specifications
7139 (vhdl-mode ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\>" 7402 (vhdl-mode ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\>"
7140 ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\([ \t]+\\)" 2) 7403 ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\([ \t]+\\)" 2)
7141 ;; before "==", ":=", "=>", and "<=" 7404 ;; before "==", ":=", "=>", and "<="
7142 (vhdl-mode "[<:=]=" "\\([ \t]*\\)[<:=]=" 1) ; since "<= ... =>" can occur 7405 (vhdl-mode "[<:=]=" "\\([ \t]*\\)\\??[<:=]=" 1) ; since "<= ... =>" can occur
7143 (vhdl-mode "=>" "\\([ \t]*\\)=>" 1) 7406 (vhdl-mode "=>" "\\([ \t]*\\)=>" 1)
7144 (vhdl-mode "[<:=]=" "\\([ \t]*\\)[<:=]=" 1) ; since "=> ... <=" can occur 7407 (vhdl-mode "[<:=]=" "\\([ \t]*\\)\\??[<:=]=" 1) ; since "=> ... <=" can occur
7145 ;; before some keywords 7408 ;; before some keywords
7146 (vhdl-mode "[ \t]after\\>" "[^ \t]\\([ \t]+\\)after\\>" 1) 7409 (vhdl-mode "[ \t]after\\>" "[^ \t]\\([ \t]+\\)after\\>" 1)
7147 (vhdl-mode "[ \t]when\\>" "[^ \t]\\([ \t]+\\)when\\>" 1) 7410 (vhdl-mode "[ \t]when\\>" "[^ \t]\\([ \t]+\\)when\\>" 1)
7148 (vhdl-mode "[ \t]else\\>" "[^ \t]\\([ \t]+\\)else\\>" 1) 7411 (vhdl-mode "[ \t]else\\>" "[^ \t]\\([ \t]+\\)else\\>" 1)
7412 (vhdl-mode "[ \t]across\\>" "[^ \t]\\([ \t]+\\)across\\>" 1)
7413 (vhdl-mode "[ \t]through\\>" "[^ \t]\\([ \t]+\\)through\\>" 1)
7149 ;; before "=>" since "when/else ... =>" can occur 7414 ;; before "=>" since "when/else ... =>" can occur
7150 (vhdl-mode "=>" "\\([ \t]*\\)=>" 1) 7415 (vhdl-mode "=>" "\\([ \t]*\\)=>" 1)
7151 ) 7416 )
@@ -7195,7 +7460,7 @@ parentheses."
7195 (forward-list) 7460 (forward-list)
7196 (setq end (point)) 7461 (setq end (point))
7197 (goto-char (1+ beg)) 7462 (goto-char (1+ beg))
7198 (skip-chars-forward " \t\n") 7463 (skip-chars-forward " \t\n\r\f")
7199 (setq beg (point)))) 7464 (setq beg (point))))
7200 ;; run FUNCTION 7465 ;; run FUNCTION
7201 (if beg 7466 (if beg
@@ -7280,8 +7545,14 @@ the token in MATCH."
7280 bol (setq begin (progn (beginning-of-line) (point)))) 7545 bol (setq begin (progn (beginning-of-line) (point))))
7281 (while (< bol end) 7546 (while (< bol end)
7282 (save-excursion 7547 (save-excursion
7283 (when (and (re-search-forward match eol t) 7548 (when (and (vhdl-re-search-forward match eol t)
7284 (not (vhdl-in-literal))) 7549 (save-excursion
7550 (goto-char (match-beginning 0))
7551 (forward-char)
7552 (and (not (vhdl-in-literal))
7553 (not (vhdl-in-quote-p))
7554 (not (vhdl-in-extended-identifier-p))))
7555 (not (looking-at "\\s-*$")))
7285 (setq distance (- (match-beginning substr) bol)) 7556 (setq distance (- (match-beginning substr) bol))
7286 (when (> distance max) 7557 (when (> distance max)
7287 (setq max distance)))) 7558 (setq max distance))))
@@ -7295,8 +7566,16 @@ the token in MATCH."
7295 (goto-char (setq bol begin)) 7566 (goto-char (setq bol begin))
7296 (setq eol (point-at-eol)) 7567 (setq eol (point-at-eol))
7297 (while (> lines 0) 7568 (while (> lines 0)
7298 (when (and (re-search-forward match eol t) 7569 (when (and (vhdl-re-search-forward match eol t)
7299 (not (vhdl-in-literal))) 7570 (save-excursion
7571 (goto-char (match-beginning 0))
7572 (forward-char)
7573 (and (not (vhdl-in-literal))
7574 (not (vhdl-in-quote-p))
7575 (not (vhdl-in-extended-identifier-p))))
7576 (not (looking-at "\\s-*$"))
7577 (> (match-beginning 0) ; not if at boi
7578 (save-excursion (back-to-indentation) (point))))
7300 (setq width (- (match-end substr) (match-beginning substr))) 7579 (setq width (- (match-end substr) (match-beginning substr)))
7301 (setq distance (- (match-beginning substr) bol)) 7580 (setq distance (- (match-beginning substr) bol))
7302 (goto-char (match-beginning substr)) 7581 (goto-char (match-beginning substr))
@@ -7449,7 +7728,7 @@ the token in MATCH."
7449 ;; search for comment start positions and lengths 7728 ;; search for comment start positions and lengths
7450 (while (< (point) end) 7729 (while (< (point) end)
7451 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) 7730 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
7452 (looking-at "^\\(.*[^ \t\n-]+\\)\\s-*\\(--.*\\)$") 7731 (looking-at "^\\(.*[^ \t\n\r\f-]+\\)\\s-*\\(--.*\\)$")
7453 (not (save-excursion (goto-char (match-beginning 2)) 7732 (not (save-excursion (goto-char (match-beginning 2))
7454 (vhdl-in-literal)))) 7733 (vhdl-in-literal))))
7455 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing)) 7734 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing))
@@ -7474,7 +7753,7 @@ the token in MATCH."
7474 (while (< (point) end) 7753 (while (< (point) end)
7475 (setq cur-start nil) 7754 (setq cur-start nil)
7476 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) 7755 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
7477 (or (and (looking-at "^\\(.*[^ \t\n-]+\\)\\(\\s-*\\)\\(--.*\\)$") 7756 (or (and (looking-at "^\\(.*[^ \t\n\r\f-]+\\)\\(\\s-*\\)\\(--.*\\)$")
7478 (not (save-excursion 7757 (not (save-excursion
7479 (goto-char (match-beginning 3)) 7758 (goto-char (match-beginning 3))
7480 (vhdl-in-literal)))) 7759 (vhdl-in-literal))))
@@ -7582,32 +7861,35 @@ end of line, do nothing in comments and strings."
7582 (setq end (point-marker)) 7861 (setq end (point-marker))
7583 ;; have no space before and one space after `,' and ';' 7862 ;; have no space before and one space after `,' and ';'
7584 (goto-char beg) 7863 (goto-char beg)
7585 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\(\\s-*\\([,;]\\)\\)" end t) 7864 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\)\\|\\(\\s-*\\([,;]\\)\\)" end t)
7586 (if (match-string 1) 7865 (if (match-string 1)
7587 (goto-char (match-end 1)) 7866 (goto-char (match-end 1))
7588 (replace-match "\\3 " nil nil nil 3))) 7867 (replace-match "\\3 " nil nil nil 2)))
7589 ;; have no space after `(' 7868 ;; have no space after `('
7590 (goto-char beg) 7869 (goto-char beg)
7591 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\((\\)\\s-+" end t) 7870 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\)\\|\\((\\)\\s-+" end t)
7592 (if (match-string 1) 7871 (if (match-string 1)
7593 (goto-char (match-end 1)) 7872 (goto-char (match-end 1))
7594 (replace-match "\\2"))) 7873 (replace-match "\\2")))
7595 ;; have no space before `)' 7874 ;; have no space before `)'
7596 (goto-char beg) 7875 (goto-char beg)
7597 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|^\\s-+\\)\\|\\s-+\\()\\)" end t) 7876 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\|^\\s-+\\)\\|\\s-+\\()\\)" end t)
7598 (if (match-string 1) 7877 (if (match-string 1)
7599 (goto-char (match-end 1)) 7878 (goto-char (match-end 1))
7600 (replace-match "\\2"))) 7879 (replace-match "\\2")))
7601 ;; surround operator symbols by one space 7880 ;; surround operator symbols by one space
7602 (goto-char beg) 7881 (goto-char beg)
7603 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\(\\([^/:<>=]\\)\\(:\\|=\\|<\\|>\\|:=\\|<=\\|>=\\|=>\\|/=\\)\\([^=>]\\|$\\)\\)" end t) 7882 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|\\\\[^\\\n]*[\\\n]\\)\\|\\(\\([^/:<>=]\\)\\(:\\|\\??=\\|\\??<<\\|\\??>>\\|\\??<\\|\\??>\\|:=\\|\\??<=\\|\\??>=\\|=>\\|\\??/=\\|\\?\\?\\)\\([^=>]\\|$\\)\\)" end t)
7604 (if (match-string 1) 7883 (if (or (match-string 1)
7605 (goto-char (match-end 1)) 7884 (<= (match-beginning 0) ; not if at boi
7885 (save-excursion (back-to-indentation) (point))))
7886 (goto-char (match-end 0))
7606 (replace-match "\\3 \\4 \\5") 7887 (replace-match "\\3 \\4 \\5")
7607 (goto-char (match-end 2)))) 7888 (goto-char (match-end 2))))
7608 ;; eliminate multiple spaces and spaces at end of line 7889 ;; eliminate multiple spaces and spaces at end of line
7609 (goto-char beg) 7890 (goto-char beg)
7610 (while (or (and (looking-at "--.*\n") (re-search-forward "--.*\n" end t)) 7891 (while (or (and (looking-at "--.*\n") (re-search-forward "--.*\n" end t))
7892 (and (looking-at "--.*") (re-search-forward "--.*" end t))
7611 (and (looking-at "\"") (re-search-forward "\"[^\"\n]*[\"\n]" end t)) 7893 (and (looking-at "\"") (re-search-forward "\"[^\"\n]*[\"\n]" end t))
7612 (and (looking-at "\\s-+$") (re-search-forward "\\s-+$" end t) 7894 (and (looking-at "\\s-+$") (re-search-forward "\\s-+$" end t)
7613 (progn (replace-match "" nil nil) t)) 7895 (progn (replace-match "" nil nil) t))
@@ -7618,6 +7900,7 @@ end of line, do nothing in comments and strings."
7618 (progn (replace-match " " nil nil) t)) 7900 (progn (replace-match " " nil nil) t))
7619 (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t) 7901 (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t)
7620 (progn (replace-match " " nil nil) t)) 7902 (progn (replace-match " " nil nil) t))
7903 (and (looking-at "-") (re-search-forward "-" end t))
7621; (re-search-forward "[^ \t-]+" end t)))) 7904; (re-search-forward "[^ \t-]+" end t))))
7622 (re-search-forward "[^ \t\"-]+" end t)))) 7905 (re-search-forward "[^ \t\"-]+" end t))))
7623 (unless no-message (message "Fixing up whitespace...done"))) 7906 (unless no-message (message "Fixing up whitespace...done")))
@@ -7639,7 +7922,7 @@ case fixing to a region. Calls functions `vhdl-indent-buffer',
7639`vhdl-fix-case-buffer'." 7922`vhdl-fix-case-buffer'."
7640 (interactive "r") 7923 (interactive "r")
7641 (setq end (save-excursion (goto-char end) (point-marker))) 7924 (setq end (save-excursion (goto-char end) (point-marker)))
7642 (vhdl-indent-region beg end nil) 7925 (vhdl-indent-region beg end)
7643 (let ((vhdl-align-groups t)) 7926 (let ((vhdl-align-groups t))
7644 (vhdl-align-region beg end)) 7927 (vhdl-align-region beg end))
7645 (vhdl-fix-case-region beg end)) 7928 (vhdl-fix-case-region beg end))
@@ -7720,7 +8003,7 @@ buffer."
7720 (vhdl-prepare-search-2 8003 (vhdl-prepare-search-2
7721 (end-of-line) 8004 (end-of-line)
7722 ;; look whether in process 8005 ;; look whether in process
7723 (if (not (and (re-search-backward "^\\s-*\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(process\\|end\\s-+process\\)\\>" nil t) 8006 (if (not (and (re-search-backward "^\\s-*\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(process\\|end\\s-+process\\)\\>" nil t)
7724 (equal (upcase (match-string 2)) "PROCESS") 8007 (equal (upcase (match-string 2)) "PROCESS")
7725 (save-excursion (re-search-forward "^\\s-*end\\s-+process\\>" nil t)))) 8008 (save-excursion (re-search-forward "^\\s-*end\\s-+process\\>" nil t))))
7726 (error "ERROR: Not within a process") 8009 (error "ERROR: Not within a process")
@@ -7735,7 +8018,7 @@ buffer."
7735 (vhdl-prepare-search-2 8018 (vhdl-prepare-search-2
7736 (goto-char (point-min)) 8019 (goto-char (point-min))
7737 (message "Updating sensitivity lists...") 8020 (message "Updating sensitivity lists...")
7738 (while (re-search-forward "^\\s-*\\(\\w+[ \t\n]*:[ \t\n]*\\)?process\\>" nil t) 8021 (while (re-search-forward "^\\s-*\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?process\\>" nil t)
7739 (goto-char (match-beginning 0)) 8022 (goto-char (match-beginning 0))
7740 (condition-case nil (vhdl-update-sensitivity-list) (error ""))) 8023 (condition-case nil (vhdl-update-sensitivity-list) (error "")))
7741 (message "Updating sensitivity lists...done")))) 8024 (message "Updating sensitivity lists...done"))))
@@ -7744,9 +8027,13 @@ buffer."
7744 "Update sensitivity list." 8027 "Update sensitivity list."
7745 (let ((proc-beg (point)) 8028 (let ((proc-beg (point))
7746 (proc-end (re-search-forward "^\\s-*end\\s-+process\\>" nil t)) 8029 (proc-end (re-search-forward "^\\s-*end\\s-+process\\>" nil t))
7747 (proc-mid (re-search-backward "^\\s-*begin\\>" nil t)) 8030 (proc-mid (vhdl-re-search-backward
8031 "\\(\\(\\<begin\\>\\)\\|^\\s-*process\\>\\)" nil t))
7748 seq-region-list) 8032 seq-region-list)
7749 (cond 8033 (cond
8034 ;; error if 'begin' keyword missing
8035 ((not (match-string 2))
8036 (error "ERROR: No 'begin' keyword found"))
7750 ;; search for wait statement (no sensitivity list allowed) 8037 ;; search for wait statement (no sensitivity list allowed)
7751 ((progn (goto-char proc-mid) 8038 ((progn (goto-char proc-mid)
7752 (vhdl-re-search-forward "\\<wait\\>" proc-end t)) 8039 (vhdl-re-search-forward "\\<wait\\>" proc-end t))
@@ -7780,19 +8067,19 @@ buffer."
7780 ;; case expression 8067 ;; case expression
7781 ((re-search-forward "^\\s-*case\\>" proc-end t) 8068 ((re-search-forward "^\\s-*case\\>" proc-end t)
7782 (re-search-forward "\\<is\\>" proc-end t)) 8069 (re-search-forward "\\<is\\>" proc-end t))
7783 ;; parameter list of procedure call 8070 ;; parameter list of procedure call, array index
7784 ((and (re-search-forward "^\\s-*\\w+[ \t\n]*(" proc-end t) 8071 ((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t)
7785 (1- (point))) 8072 (1- (point)))
7786 (progn (backward-char) (forward-sexp) 8073 (progn (backward-char) (forward-sexp)
7787 (while (looking-at "(") (forward-sexp)) (point))))) 8074 (while (looking-at "(") (forward-sexp)) (point)))))
7788 name read-list sens-list signal-list 8075 name field read-list sens-list signal-list
7789 sens-beg sens-end beg end margin) 8076 sens-beg sens-end beg end margin)
7790 ;; scan for signals in old sensitivity list 8077 ;; scan for signals in old sensitivity list
7791 (goto-char proc-beg) 8078 (goto-char proc-beg)
7792 (re-search-forward "\\<process\\>" proc-mid t) 8079 (re-search-forward "\\<process\\>" proc-mid t)
7793 (if (not (looking-at "[ \t\n]*(")) 8080 (if (not (looking-at "[ \t\n\r\f]*("))
7794 (setq sens-beg (point)) 8081 (setq sens-beg (point))
7795 (setq sens-beg (re-search-forward "\\([ \t\n]*\\)([ \t\n]*" nil t)) 8082 (setq sens-beg (re-search-forward "\\([ \t\n\r\f]*\\)([ \t\n\r\f]*" nil t))
7796 (goto-char (match-end 1)) 8083 (goto-char (match-end 1))
7797 (forward-sexp) 8084 (forward-sexp)
7798 (setq sens-end (1- (point))) 8085 (setq sens-end (1- (point)))
@@ -7825,15 +8112,17 @@ buffer."
7825 (< (point) (caar tmp-list))) 8112 (< (point) (caar tmp-list)))
7826 (setq tmp-list (cdr tmp-list))) 8113 (setq tmp-list (cdr tmp-list)))
7827 (and tmp-list (< (point) (cdar tmp-list)))))) 8114 (and tmp-list (< (point) (cdar tmp-list))))))
7828 (while (vhdl-re-search-forward "[^'\"]\\<\\([a-zA-Z]\\w*\\)\\>[ \t\n]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t) 8115 (while (vhdl-re-search-forward "[^'\".]\\<\\([a-zA-Z]\\w*\\)\\(\\(\\.\\w+\\|[ \t\n\r\f]*([^)]*)\\)*\\)[ \t\n\r\f]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t)
7829 (setq name (match-string 1)) 8116 (setq name (match-string 1))
7830 (when (and (not (match-string 4)) ; not when formal parameter 8117 (when vhdl-array-index-record-field-in-sensitivity-list
7831 (not (and (match-string 3) ; not event attribute 8118 (setq field (match-string 2)))
7832 (not (member (downcase (match-string 3)) 8119 (when (and (not (match-string 6)) ; not when formal parameter
8120 (not (and (match-string 5) ; not event attribute
8121 (not (member (downcase (match-string 5))
7833 '("event" "last_event" "transaction"))))) 8122 '("event" "last_event" "transaction")))))
7834 (member (downcase name) signal-list)) 8123 (member (downcase name) signal-list))
7835 (unless (member-ignore-case name read-list) 8124 (unless (member-ignore-case (concat name field) read-list)
7836 (setq read-list (cons name read-list)))) 8125 (setq read-list (cons (concat name field) read-list))))
7837 (goto-char (match-end 1))))) 8126 (goto-char (match-end 1)))))
7838 (setq scan-regions-list (cdr scan-regions-list))) 8127 (setq scan-regions-list (cdr scan-regions-list)))
7839 ;; update sensitivity list 8128 ;; update sensitivity list
@@ -7879,17 +8168,17 @@ buffer."
7879 (goto-char (point-min)) 8168 (goto-char (point-min))
7880 (if (not (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t)) 8169 (if (not (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t))
7881 (error "ERROR: Entity \"%s\" not found:\n --> see option `vhdl-entity-file-name'" entity-name) 8170 (error "ERROR: Entity \"%s\" not found:\n --> see option `vhdl-entity-file-name'" entity-name)
7882 (when (setq beg (re-search-forward 8171 (when (setq beg (vhdl-re-search-forward
7883 "^\\s-*port[ \t\n]*(" 8172 "\\<port[ \t\n\r\f]*("
7884 (save-excursion 8173 (save-excursion
7885 (re-search-forward "^end\\>" nil t)) t)) 8174 (re-search-forward "^end\\>" nil t)) t))
7886 (setq end (save-excursion 8175 (setq end (save-excursion
7887 (backward-char) (forward-sexp) (point))) 8176 (backward-char) (forward-sexp) (point)))
7888 (vhdl-forward-syntactic-ws) 8177 (vhdl-forward-syntactic-ws)
7889 (while (< (point) end) 8178 (while (< (point) end)
7890 (when (looking-at "signal[ \t\n]+") 8179 (when (looking-at "signal[ \t\n\r\f]+")
7891 (goto-char (match-end 0))) 8180 (goto-char (match-end 0)))
7892 (while (looking-at "\\(\\w+\\)[ \t\n,]+") 8181 (while (looking-at "\\(\\w+\\)[ \t\n\r\f,]+")
7893 (setq signal-list 8182 (setq signal-list
7894 (cons (downcase (match-string 1)) signal-list)) 8183 (cons (downcase (match-string 1)) signal-list))
7895 (goto-char (match-end 0)) 8184 (goto-char (match-end 0))
@@ -7908,12 +8197,12 @@ buffer."
7908 (when (= 0 (nth 0 (parse-partial-sexp beg (point)))) 8197 (when (= 0 (nth 0 (parse-partial-sexp beg (point))))
7909 (if (match-string 2) 8198 (if (match-string 2)
7910 ;; scan signal name 8199 ;; scan signal name
7911 (while (looking-at "[ \t\n,]+\\(\\w+\\)") 8200 (while (looking-at "[ \t\n\r\f,]+\\(\\w+\\)")
7912 (setq signal-list 8201 (setq signal-list
7913 (cons (downcase (match-string 1)) signal-list)) 8202 (cons (downcase (match-string 1)) signal-list))
7914 (goto-char (match-end 0))) 8203 (goto-char (match-end 0)))
7915 ;; scan alias name, check is alias of (declared) signal 8204 ;; scan alias name, check is alias of (declared) signal
7916 (when (and (looking-at "[ \t\n]+\\(\\w+\\)[^;]*\\<is[ \t\n]+\\(\\w+\\)") 8205 (when (and (looking-at "[ \t\n\r\f]+\\(\\w+\\)[^;]*\\<is[ \t\n\r\f]+\\(\\w+\\)")
7917 (member (downcase (match-string 2)) signal-list)) 8206 (member (downcase (match-string 2)) signal-list))
7918 (setq signal-list 8207 (setq signal-list
7919 (cons (downcase (match-string 1)) signal-list)) 8208 (cons (downcase (match-string 1)) signal-list))
@@ -7950,6 +8239,18 @@ buffer."
7950;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 8239;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7951;; Generic/port clause fixing 8240;; Generic/port clause fixing
7952 8241
8242(defun vhdl-fix-clause-buffer ()
8243 "Fix all generic/port clauses in current buffer."
8244 (interactive)
8245 (save-excursion
8246 (vhdl-prepare-search-2
8247 (goto-char (point-min))
8248 (message "Fixing generic/port clauses...")
8249 (while (re-search-forward "^\\s-*\\(generic\\|port\\)[ \t\n\r\f]*(" nil t)
8250 (goto-char (match-end 0))
8251 (condition-case nil (vhdl-fix-clause) (error "")))
8252 (message "Fixing generic/port clauses...done"))))
8253
7953(defun vhdl-fix-clause () 8254(defun vhdl-fix-clause ()
7954 "Fix closing parenthesis within generic/port clause." 8255 "Fix closing parenthesis within generic/port clause."
7955 (interactive) 8256 (interactive)
@@ -7957,13 +8258,14 @@ buffer."
7957 (vhdl-prepare-search-2 8258 (vhdl-prepare-search-2
7958 (let ((pos (point)) 8259 (let ((pos (point))
7959 beg end) 8260 beg end)
7960 (if (not (re-search-backward "^\\s-*\\(generic\\|port\\)[ \t\n]*(" nil t)) 8261 (end-of-line)
8262 (if (not (re-search-backward "^\\s-*\\(generic\\|port\\)[ \t\n\r\f]*(" nil t))
7961 (error "ERROR: Not within a generic/port clause") 8263 (error "ERROR: Not within a generic/port clause")
7962 ;; search for end of clause 8264 ;; search for end of clause
7963 (goto-char (match-end 0)) 8265 (goto-char (match-end 0))
7964 (setq beg (1- (point))) 8266 (setq beg (1- (point)))
7965 (vhdl-forward-syntactic-ws) 8267 (vhdl-forward-syntactic-ws)
7966 (while (looking-at "\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*[ \t\n]*:[ \t\n]*\\w+[^;]*;") 8268 (while (looking-at "\\w+\\([ \t\n\r\f]*,[ \t\n\r\f]*\\w+\\)*[ \t\n\r\f]*:[ \t\n\r\f]*\\w+[^;]*;")
7967 (goto-char (1- (match-end 0))) 8269 (goto-char (1- (match-end 0)))
7968 (setq end (point-marker)) 8270 (setq end (point-marker))
7969 (forward-char) 8271 (forward-char)
@@ -8317,7 +8619,8 @@ is omitted or nil."
8317 (let ((margin (current-indentation)) 8619 (let ((margin (current-indentation))
8318 (start (point)) 8620 (start (point))
8319 label) 8621 label)
8320 (unless kind (setq kind (if (vhdl-sequential-statement-p) 'is 'use))) 8622 (unless kind (setq kind (if (or (vhdl-sequential-statement-p)
8623 (not (vhdl-standard-p 'ams))) 'is 'use)))
8321 (if (or (not (eq vhdl-optional-labels 'all)) (vhdl-standard-p '87)) 8624 (if (or (not (eq vhdl-optional-labels 'all)) (vhdl-standard-p '87))
8322 (vhdl-insert-keyword "CASE ") 8625 (vhdl-insert-keyword "CASE ")
8323 (vhdl-insert-keyword ": CASE ") 8626 (vhdl-insert-keyword ": CASE ")
@@ -8905,7 +9208,7 @@ otherwise."
8905 (vhdl-insert-keyword 9208 (vhdl-insert-keyword
8906 (concat " " (if (eq kind 'then) "THEN" "USE") "\n\n")) 9209 (concat " " (if (eq kind 'then) "THEN" "USE") "\n\n"))
8907 (indent-to margin) 9210 (indent-to margin)
8908 (vhdl-insert-keyword "END IF") 9211 (vhdl-insert-keyword (concat "END " (if (eq kind 'then) "IF" "USE")))
8909 (when label (insert " " label)) 9212 (when label (insert " " label))
8910 (insert ";") 9213 (insert ";")
8911 (forward-line -1) 9214 (forward-line -1)
@@ -9226,6 +9529,7 @@ otherwise."
9226 (interactive) 9529 (interactive)
9227 (let ((margin (current-indentation)) 9530 (let ((margin (current-indentation))
9228 (start (point)) 9531 (start (point))
9532 (reset-kind vhdl-reset-kind)
9229 label seq input-signals clock reset final-pos) 9533 label seq input-signals clock reset final-pos)
9230 (setq seq (if kind (eq kind 'seq) 9534 (setq seq (if kind (eq kind 'seq)
9231 (eq (vhdl-decision-query 9535 (eq (vhdl-decision-query
@@ -9248,7 +9552,13 @@ otherwise."
9248 (setq clock (or (and (not (equal "" vhdl-clock-name)) 9552 (setq clock (or (and (not (equal "" vhdl-clock-name))
9249 (progn (insert vhdl-clock-name) vhdl-clock-name)) 9553 (progn (insert vhdl-clock-name) vhdl-clock-name))
9250 (vhdl-template-field "clock name") "<clock>")) 9554 (vhdl-template-field "clock name") "<clock>"))
9251 (when (eq vhdl-reset-kind 'async) 9555 (when (eq reset-kind 'query)
9556 (setq reset-kind
9557 (if (eq (vhdl-decision-query
9558 "" "(a)synchronous or (s)ynchronous reset?" t) ?a)
9559 'async
9560 'sync)))
9561 (when (eq reset-kind 'async)
9252 (insert ", ") 9562 (insert ", ")
9253 (setq reset (or (and (not (equal "" vhdl-reset-name)) 9563 (setq reset (or (and (not (equal "" vhdl-reset-name))
9254 (progn (insert vhdl-reset-name) vhdl-reset-name)) 9564 (progn (insert vhdl-reset-name) vhdl-reset-name))
@@ -9257,7 +9567,7 @@ otherwise."
9257 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " IS")) 9567 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " IS"))
9258 (insert "\n") 9568 (insert "\n")
9259 (vhdl-template-begin-end "PROCESS" label margin) 9569 (vhdl-template-begin-end "PROCESS" label margin)
9260 (when seq (setq reset (vhdl-template-seq-process clock reset))) 9570 (when seq (setq reset (vhdl-template-seq-process clock reset reset-kind)))
9261 (when vhdl-prompt-for-comments 9571 (when vhdl-prompt-for-comments
9262 (setq final-pos (point-marker)) 9572 (setq final-pos (point-marker))
9263 (vhdl-prepare-search-2 9573 (vhdl-prepare-search-2
@@ -9589,13 +9899,13 @@ otherwise."
9589 (in-arglist (vhdl-in-argument-list-p))) 9899 (in-arglist (vhdl-in-argument-list-p)))
9590 (vhdl-prepare-search-2 9900 (vhdl-prepare-search-2
9591 (if (or (save-excursion 9901 (if (or (save-excursion
9592 (and (vhdl-re-search-backward 9902 (progn (vhdl-beginning-of-block)
9593 "\\<function\\|procedure\\|process\\|procedural\\|end\\>" 9903 (looking-at "\\s-*\\(\\w+\\s-*:\\s-*\\)?\\<\\(\\<function\\|procedure\\|process\\|procedural\\)\\>")))
9594 nil t)
9595 (not (progn (backward-word 1) (looking-at "\\<end\\>")))))
9596 (save-excursion (backward-word 1) (looking-at "\\<shared\\>"))) 9904 (save-excursion (backward-word 1) (looking-at "\\<shared\\>")))
9597 (vhdl-insert-keyword "VARIABLE ") 9905 (vhdl-insert-keyword "VARIABLE ")
9598 (vhdl-insert-keyword "SHARED VARIABLE "))) 9906 (if (vhdl-standard-p '87)
9907 (error "ERROR: Not within sequential block")
9908 (vhdl-insert-keyword "SHARED VARIABLE "))))
9599 (when (vhdl-template-field "names" nil t start (point)) 9909 (when (vhdl-template-field "names" nil t start (point))
9600 (insert " : ") 9910 (insert " : ")
9601 (when in-arglist (vhdl-template-field "[IN | OUT | INOUT]" " " t)) 9911 (when in-arglist (vhdl-template-field "[IN | OUT | INOUT]" " " t))
@@ -9692,14 +10002,16 @@ otherwise."
9692 (concat (if vhdl-clock-rising-edge "rising" "falling") 10002 (concat (if vhdl-clock-rising-edge "rising" "falling")
9693 " clock edge"))))) 10003 " clock edge")))))
9694 10004
9695(defun vhdl-template-seq-process (clock reset) 10005(defun vhdl-template-seq-process (clock reset reset-kind)
9696 "Insert a template for the body of a sequential process." 10006 "Insert a template for the body of a sequential process."
9697 (let ((margin (current-indentation)) 10007 (let ((margin (current-indentation))
9698 position) 10008 position)
9699 (vhdl-insert-keyword "IF ") 10009 (vhdl-insert-keyword "IF ")
9700 (when (eq vhdl-reset-kind 'async) 10010 (when vhdl-conditions-in-parenthesis (insert "("))
10011 (when (eq reset-kind 'async)
9701 (insert reset " = " 10012 (insert reset " = "
9702 (if vhdl-reset-active-high vhdl-one-string vhdl-zero-string)) 10013 (if vhdl-reset-active-high vhdl-one-string vhdl-zero-string))
10014 (when vhdl-conditions-in-parenthesis (insert ")"))
9703 (vhdl-insert-keyword " THEN") 10015 (vhdl-insert-keyword " THEN")
9704 (vhdl-comment-insert-inline 10016 (vhdl-comment-insert-inline
9705 (concat "asynchronous reset (active " 10017 (concat "asynchronous reset (active "
@@ -9707,7 +10019,8 @@ otherwise."
9707 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) 10019 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
9708 (setq position (point)) 10020 (setq position (point))
9709 (insert "\n") (indent-to margin) 10021 (insert "\n") (indent-to margin)
9710 (vhdl-insert-keyword "ELSIF ")) 10022 (vhdl-insert-keyword "ELSIF ")
10023 (when vhdl-conditions-in-parenthesis (insert "(")))
9711 (if (eq vhdl-clock-edge-condition 'function) 10024 (if (eq vhdl-clock-edge-condition 'function)
9712 (insert (if vhdl-clock-rising-edge "rising" "falling") 10025 (insert (if vhdl-clock-rising-edge "rising" "falling")
9713 "_edge(" clock ")") 10026 "_edge(" clock ")")
@@ -9715,17 +10028,20 @@ otherwise."
9715 (vhdl-insert-keyword " AND ") 10028 (vhdl-insert-keyword " AND ")
9716 (insert clock " = " 10029 (insert clock " = "
9717 (if vhdl-clock-rising-edge vhdl-one-string vhdl-zero-string))) 10030 (if vhdl-clock-rising-edge vhdl-one-string vhdl-zero-string)))
10031 (when vhdl-conditions-in-parenthesis (insert ")"))
9718 (vhdl-insert-keyword " THEN") 10032 (vhdl-insert-keyword " THEN")
9719 (vhdl-comment-insert-inline 10033 (vhdl-comment-insert-inline
9720 (concat (if vhdl-clock-rising-edge "rising" "falling") " clock edge")) 10034 (concat (if vhdl-clock-rising-edge "rising" "falling") " clock edge"))
9721 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) 10035 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
9722 (when (eq vhdl-reset-kind 'sync) 10036 (when (eq reset-kind 'sync)
9723 (vhdl-insert-keyword "IF ") 10037 (vhdl-insert-keyword "IF ")
10038 (when vhdl-conditions-in-parenthesis (insert "("))
9724 (setq reset (or (and (not (equal "" vhdl-reset-name)) 10039 (setq reset (or (and (not (equal "" vhdl-reset-name))
9725 (progn (insert vhdl-reset-name) vhdl-reset-name)) 10040 (progn (insert vhdl-reset-name) vhdl-reset-name))
9726 (vhdl-template-field "reset name") "<reset>")) 10041 (vhdl-template-field "reset name") "<reset>"))
9727 (insert " = " 10042 (insert " = "
9728 (if vhdl-reset-active-high vhdl-one-string vhdl-zero-string)) 10043 (if vhdl-reset-active-high vhdl-one-string vhdl-zero-string))
10044 (when vhdl-conditions-in-parenthesis (insert ")"))
9729 (vhdl-insert-keyword " THEN") 10045 (vhdl-insert-keyword " THEN")
9730 (vhdl-comment-insert-inline 10046 (vhdl-comment-insert-inline
9731 (concat "synchronous reset (active " 10047 (concat "synchronous reset (active "
@@ -9737,7 +10053,7 @@ otherwise."
9737 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset))) 10053 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset)))
9738 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) 10054 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
9739 (vhdl-insert-keyword "END IF;")) 10055 (vhdl-insert-keyword "END IF;"))
9740 (when (eq vhdl-reset-kind 'none) 10056 (when (eq reset-kind 'none)
9741 (setq position (point))) 10057 (setq position (point)))
9742 (insert "\n") (indent-to margin) 10058 (insert "\n") (indent-to margin)
9743 (vhdl-insert-keyword "END IF;") 10059 (vhdl-insert-keyword "END IF;")
@@ -9761,21 +10077,11 @@ specification, if not already there."
9761 (insert library ";") 10077 (insert library ";")
9762 (when package 10078 (when package
9763 (insert "\n") 10079 (insert "\n")
9764 (indent-to margin))) 10080 (indent-to margin))))
9765 (when package 10081 (when package
9766 (vhdl-insert-keyword "USE ") 10082 (vhdl-insert-keyword "USE ")
9767 (insert library "." package) 10083 (insert library "." package)
9768 (vhdl-insert-keyword ".ALL;"))))) 10084 (vhdl-insert-keyword ".ALL;"))))
9769
9770(defun vhdl-template-package-math-complex ()
9771 "Insert specification of `math_complex' package."
9772 (interactive)
9773 (vhdl-template-standard-package "ieee" "math_complex"))
9774
9775(defun vhdl-template-package-math-real ()
9776 "Insert specification of `math_real' package."
9777 (interactive)
9778 (vhdl-template-standard-package "ieee" "math_real"))
9779 10085
9780(defun vhdl-template-package-numeric-bit () 10086(defun vhdl-template-package-numeric-bit ()
9781 "Insert specification of `numeric_bit' package." 10087 "Insert specification of `numeric_bit' package."
@@ -9822,6 +10128,56 @@ specification, if not already there."
9822 (interactive) 10128 (interactive)
9823 (vhdl-template-standard-package "std" "textio")) 10129 (vhdl-template-standard-package "std" "textio"))
9824 10130
10131(defun vhdl-template-package-fundamental-constants ()
10132 "Insert specification of `fundamental_constants' package."
10133 (interactive)
10134 (vhdl-template-standard-package "ieee" "fundamental_constants"))
10135
10136(defun vhdl-template-package-material-constants ()
10137 "Insert specification of `material_constants' package."
10138 (interactive)
10139 (vhdl-template-standard-package "ieee" "material_constants"))
10140
10141(defun vhdl-template-package-energy-systems ()
10142 "Insert specification of `energy_systems' package."
10143 (interactive)
10144 (vhdl-template-standard-package "ieee" "energy_systems"))
10145
10146(defun vhdl-template-package-electrical-systems ()
10147 "Insert specification of `electrical_systems' package."
10148 (interactive)
10149 (vhdl-template-standard-package "ieee" "electrical_systems"))
10150
10151(defun vhdl-template-package-mechanical-systems ()
10152 "Insert specification of `mechanical_systems' package."
10153 (interactive)
10154 (vhdl-template-standard-package "ieee" "mechanical_systems"))
10155
10156(defun vhdl-template-package-radiant-systems ()
10157 "Insert specification of `radiant_systems' package."
10158 (interactive)
10159 (vhdl-template-standard-package "ieee" "radiant_systems"))
10160
10161(defun vhdl-template-package-thermal-systems ()
10162 "Insert specification of `thermal_systems' package."
10163 (interactive)
10164 (vhdl-template-standard-package "ieee" "thermal_systems"))
10165
10166(defun vhdl-template-package-fluidic-systems ()
10167 "Insert specification of `fluidic_systems' package."
10168 (interactive)
10169 (vhdl-template-standard-package "ieee" "fluidic_systems"))
10170
10171(defun vhdl-template-package-math-complex ()
10172 "Insert specification of `math_complex' package."
10173 (interactive)
10174 (vhdl-template-standard-package "ieee" "math_complex"))
10175
10176(defun vhdl-template-package-math-real ()
10177 "Insert specification of `math_real' package."
10178 (interactive)
10179 (vhdl-template-standard-package "ieee" "math_real"))
10180
9825(defun vhdl-template-directive (directive) 10181(defun vhdl-template-directive (directive)
9826 "Insert directive." 10182 "Insert directive."
9827 (unless (= (current-indentation) (current-column)) 10183 (unless (= (current-indentation) (current-column))
@@ -9900,6 +10256,9 @@ specification, if not already there."
9900 (insert (user-full-name)) 10256 (insert (user-full-name))
9901 (when user-mail-address (insert " <" user-mail-address ">"))) 10257 (when user-mail-address (insert " <" user-mail-address ">")))
9902 (goto-char beg) 10258 (goto-char beg)
10259 (while (search-forward "<authorfull>" end t)
10260 (replace-match (user-full-name) t t))
10261 (goto-char beg)
9903 (while (search-forward "<login>" end t) 10262 (while (search-forward "<login>" end t)
9904 (replace-match (user-login-name) t t)) 10263 (replace-match (user-login-name) t t))
9905 (goto-char beg) 10264 (goto-char beg)
@@ -9915,7 +10274,7 @@ specification, if not already there."
9915 (while (search-forward "<standard>" end t) 10274 (while (search-forward "<standard>" end t)
9916 (replace-match 10275 (replace-match
9917 (concat "VHDL" (cond ((vhdl-standard-p '87) "'87") 10276 (concat "VHDL" (cond ((vhdl-standard-p '87) "'87")
9918 ((vhdl-standard-p '93) "'93")) 10277 ((vhdl-standard-p '93) "'93/02"))
9919 (when (vhdl-standard-p 'ams) ", VHDL-AMS") 10278 (when (vhdl-standard-p 'ams) ", VHDL-AMS")
9920 (when (vhdl-standard-p 'math) ", Math Packages")) t t)) 10279 (when (vhdl-standard-p 'math) ", Math Packages")) t t))
9921 (goto-char beg) 10280 (goto-char beg)
@@ -10021,9 +10380,10 @@ If starting after end-comment-column, start a new line."
10021 "Displays one line of dashes." 10380 "Displays one line of dashes."
10022 (interactive) 10381 (interactive)
10023 (while (= (preceding-char) ?-) (delete-char -2)) 10382 (while (= (preceding-char) ?-) (delete-char -2))
10383 (insert "--")
10024 (let* ((col (current-column)) 10384 (let* ((col (current-column))
10025 (len (- end-comment-column col))) 10385 (len (- end-comment-column col)))
10026 (insert-char ?- len))) 10386 (insert-char vhdl-comment-display-line-char len)))
10027 10387
10028(defun vhdl-comment-append-inline () 10388(defun vhdl-comment-append-inline ()
10029 "Append empty inline comment to current line." 10389 "Append empty inline comment to current line."
@@ -10084,7 +10444,7 @@ If starting after end-comment-column, start a new line."
10084 (goto-char beg) 10444 (goto-char beg)
10085 (beginning-of-line) 10445 (beginning-of-line)
10086 (setq beg (point)) 10446 (setq beg (point))
10087 (if (looking-at comment-start) 10447 (if (looking-at (concat "\\s-*" comment-start))
10088 (comment-region beg end '(4)) 10448 (comment-region beg end '(4))
10089 (comment-region beg end)))) 10449 (comment-region beg end))))
10090 10450
@@ -10119,7 +10479,7 @@ If starting after end-comment-column, start a new line."
10119 (goto-char beg) 10479 (goto-char beg)
10120 (beginning-of-line) 10480 (beginning-of-line)
10121 (while (< (point) end) 10481 (while (< (point) end)
10122 (when (looking-at "^.*[^ \t\n-]+\\(\\s-*--.*\\)$") 10482 (when (looking-at "^.*[^ \t\n\r\f-]+\\(\\s-*--.*\\)$")
10123 (delete-region (match-beginning 1) (match-end 1))) 10483 (delete-region (match-beginning 1) (match-end 1)))
10124 (beginning-of-line 2)))) 10484 (beginning-of-line 2))))
10125 10485
@@ -10323,9 +10683,9 @@ if in comment and past end-comment-column."
10323 (self-insert-command count) 10683 (self-insert-command count)
10324 (cond ((>= (current-column) (+ 2 end-comment-column)) 10684 (cond ((>= (current-column) (+ 2 end-comment-column))
10325 (backward-char 1) 10685 (backward-char 1)
10326 (skip-chars-backward "^ \t\n") 10686 (skip-chars-backward "^ \t\n\r\f")
10327 (indent-new-comment-line) 10687 (indent-new-comment-line)
10328 (skip-chars-forward "^ \t\n") 10688 (skip-chars-forward "^ \t\n\r\f")
10329 (forward-char 1)) 10689 (forward-char 1))
10330 ((>= (current-column) end-comment-column) 10690 ((>= (current-column) end-comment-column)
10331 (indent-new-comment-line)) 10691 (indent-new-comment-line))
@@ -10369,7 +10729,9 @@ with double-quotes is to be inserted. DEFAULT specifies a default string."
10369 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-attributes 10729 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-attributes
10370 (concat "'" vhdl-attributes-regexp)) 10730 (concat "'" vhdl-attributes-regexp))
10371 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-enum-values 10731 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-enum-values
10372 vhdl-enum-values-regexp)) 10732 vhdl-enum-values-regexp)
10733 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-constants
10734 vhdl-constants-regexp))
10373 (when (or (not (equal string "")) (not optional)) 10735 (when (or (not (equal string "")) (not optional))
10374 (insert (or follow-string ""))) 10736 (insert (or follow-string "")))
10375 (if (equal string "") nil string))) 10737 (if (equal string "") nil string)))
@@ -10455,55 +10817,57 @@ else insert tab (used for word completion in VHDL minibuffer)."
10455(defun vhdl-beginning-of-block () 10817(defun vhdl-beginning-of-block ()
10456 "Move cursor to the beginning of the enclosing block." 10818 "Move cursor to the beginning of the enclosing block."
10457 (let (pos) 10819 (let (pos)
10458 (save-excursion 10820 (vhdl-prepare-search-2
10459 (beginning-of-line) 10821 (save-excursion
10460 ;; search backward for block beginning or end 10822 (beginning-of-line)
10461 (while (or (while (and (setq pos (re-search-backward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\|record\\|units\\)\\|\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(postponed[ \t\n]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\)\\)\\>" nil t)) 10823 ;; search backward for block beginning or end
10462 ;; not consider subprogram declarations 10824 (while (or (while (and (setq pos (re-search-backward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\(\\s-+body\\)?\\|type[ \t\n\r\f]+\\w+[ \t\n\r\f]+is[ \t\n\r\f]+\\(record\\|protected\\(\\s-+body\\)?\\)\\|units\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(postponed[ \t\n\r\f]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\|loop\\)\\)\\>" nil t))
10463 (or (and (match-string 5) 10825 ;; not consider subprogram declarations
10464 (save-match-data 10826 (or (and (match-string 5)
10465 (save-excursion 10827 (save-match-data
10466 (goto-char (match-end 5)) 10828 (save-excursion
10467 (forward-word 1) 10829 (goto-char (match-end 5))
10468 (vhdl-forward-syntactic-ws) 10830 (forward-word 1)
10469 (when (looking-at "(") 10831 (vhdl-forward-syntactic-ws)
10470 (forward-sexp)) 10832 (when (looking-at "(")
10471 (re-search-forward "\\<is\\>\\|\\(;\\)" nil t)) 10833 (forward-sexp))
10472 (match-string 1))) 10834 (re-search-forward "\\<is\\>\\|\\(;\\)" nil t))
10473 ;; not consider configuration specifications 10835 (match-string 1)))
10474 (and (match-string 6) 10836 ;; not consider configuration specifications
10475 (save-match-data 10837 (and (match-string 6)
10476 (save-excursion 10838 (save-match-data
10477 (vhdl-end-of-block) 10839 (save-excursion
10478 (beginning-of-line) 10840 (vhdl-end-of-block)
10479 (not (looking-at "^\\s-*end\\s-+\\(for\\|generate\\|loop\\)\\>")))))))) 10841 (beginning-of-line)
10480 (match-string 2)) 10842 (not (looking-at "^\\s-*end\\s-+\\(for\\|generate\\|loop\\)\\>"))))))))
10481 ;; skip subblock if block end found 10843 (match-string 2))
10482 (vhdl-beginning-of-block))) 10844 ;; skip subblock if block end found
10845 (vhdl-beginning-of-block))))
10483 (when pos (goto-char pos)))) 10846 (when pos (goto-char pos))))
10484 10847
10485(defun vhdl-end-of-block () 10848(defun vhdl-end-of-block ()
10486 "Move cursor to the end of the enclosing block." 10849 "Move cursor to the end of the enclosing block."
10487 (let (pos) 10850 (let (pos)
10488 (save-excursion 10851 (vhdl-prepare-search-2
10489 (end-of-line) 10852 (save-excursion
10490 ;; search forward for block beginning or end 10853 (end-of-line)
10491 (while (or (while (and (setq pos (re-search-forward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\|record\\|units\\)\\|\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(postponed[ \t\n]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\)\\)\\>" nil t)) 10854 ;; search forward for block beginning or end
10492 ;; not consider subprogram declarations 10855 (while (or (while (and (setq pos (re-search-forward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\(\\s-+body\\)?\\|type[ \t\n\r\f]+\\w+[ \t\n\r\f]+is[ \t\n\r\f]+\\(record\\|protected\\(\\s-+body\\)?\\)\\|units\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(postponed[ \t\n\r\f]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\|loop\\)\\)\\>" nil t))
10493 (or (and (match-string 5) 10856 ;; not consider subprogram declarations
10494 (save-match-data 10857 (or (and (match-string 5)
10495 (save-excursion (re-search-forward "\\<is\\>\\|\\(;\\)" nil t)) 10858 (save-match-data
10496 (match-string 1))) 10859 (save-excursion (re-search-forward "\\<is\\>\\|\\(;\\)" nil t))
10497 ;; not consider configuration specifications 10860 (match-string 1)))
10498 (and (match-string 6) 10861 ;; not consider configuration specifications
10499 (save-match-data 10862 (and (match-string 6)
10500 (save-excursion 10863 (save-match-data
10501 (vhdl-end-of-block) 10864 (save-excursion
10502 (beginning-of-line) 10865 (vhdl-end-of-block)
10503 (not (looking-at "^\\s-*end\\s-+\\(for\\|generate\\|loop\\)\\>")))))))) 10866 (beginning-of-line)
10504 (not (match-string 2))) 10867 (not (looking-at "^\\s-*end\\s-+\\(for\\|generate\\|loop\\)\\>"))))))))
10505 ;; skip subblock if block beginning found 10868 (not (match-string 2)))
10506 (vhdl-end-of-block))) 10869 ;; skip subblock if block beginning found
10870 (vhdl-end-of-block))))
10507 (when pos (goto-char pos)))) 10871 (when pos (goto-char pos))))
10508 10872
10509(defun vhdl-sequential-statement-p () 10873(defun vhdl-sequential-statement-p ()
@@ -10518,7 +10882,7 @@ else insert tab (used for word completion in VHDL minibuffer)."
10518 (< start (point))) 10882 (< start (point)))
10519 ;; ... a sequential block 10883 ;; ... a sequential block
10520 (progn (vhdl-beginning-of-block) 10884 (progn (vhdl-beginning-of-block)
10521 (looking-at "^\\s-*\\(\\(\\w+[ \t\n]+\\)?\\(function\\|procedure\\)\\|\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(\\w+[ \t\n]+\\)?\\(procedural\\|process\\)\\)\\>"))))))) 10885 (looking-at "^\\s-*\\(\\(\\w+[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(\\w+[ \t\n\r\f]+\\)?\\(procedural\\|process\\)\\)\\>")))))))
10522 10886
10523(defun vhdl-in-argument-list-p () 10887(defun vhdl-in-argument-list-p ()
10524 "Check if within an argument list." 10888 "Check if within an argument list."
@@ -10542,7 +10906,9 @@ but not if inside a comment or quote."
10542 (progn 10906 (progn
10543 (insert " ") 10907 (insert " ")
10544 (unexpand-abbrev) 10908 (unexpand-abbrev)
10545 (delete-char -1)) 10909 (backward-word 1)
10910 (vhdl-case-word 1)
10911 (delete-char 1))
10546 (if (not vhdl-electric-mode) 10912 (if (not vhdl-electric-mode)
10547 (progn 10913 (progn
10548 (insert " ") 10914 (insert " ")
@@ -10821,7 +11187,10 @@ but not if inside a comment or quote."
10821(defun vhdl-parse-string (string &optional optional) 11187(defun vhdl-parse-string (string &optional optional)
10822 "Check that the text following point matches the regexp in STRING." 11188 "Check that the text following point matches the regexp in STRING."
10823 (if (looking-at string) 11189 (if (looking-at string)
10824 (goto-char (match-end 0)) 11190 (progn (goto-char (match-end 0))
11191 (when (vhdl-in-literal)
11192 (end-of-line))
11193 (point))
10825 (unless optional 11194 (unless optional
10826 (throw 'parse (format "ERROR: Syntax error near line %s, expecting \"%s\"" 11195 (throw 'parse (format "ERROR: Syntax error near line %s, expecting \"%s\""
10827 (vhdl-current-line) string))) 11196 (vhdl-current-line) string)))
@@ -10919,7 +11288,9 @@ reflected in a subsequent paste operation."
10919 port-dir (car port-dir-car)) 11288 port-dir (car port-dir-car))
10920 (setcar port-dir-car 11289 (setcar port-dir-car
10921 (cond ((equal port-dir "in") "out") 11290 (cond ((equal port-dir "in") "out")
11291 ((equal port-dir "IN") "OUT")
10922 ((equal port-dir "out") "in") 11292 ((equal port-dir "out") "in")
11293 ((equal port-dir "OUT") "IN")
10923 (t port-dir))) 11294 (t port-dir)))
10924 (setq port-list (cdr port-list))) 11295 (setq port-list (cdr port-list)))
10925 (setq vhdl-port-reversed-direction (not vhdl-port-reversed-direction)) 11296 (setq vhdl-port-reversed-direction (not vhdl-port-reversed-direction))
@@ -10949,20 +11320,23 @@ reflected in a subsequent paste operation."
10949 (message "Reading port of %s \"%s\"..." decl-type name) 11320 (message "Reading port of %s \"%s\"..." decl-type name)
10950 (vhdl-forward-syntactic-ws) 11321 (vhdl-forward-syntactic-ws)
10951 ;; parse generic clause 11322 ;; parse generic clause
10952 (when (vhdl-parse-string "generic[ \t\n]*(" t) 11323 (when (vhdl-parse-string "generic[ \t\n\r\f]*(" t)
10953 ;; parse group comment and spacing 11324 ;; parse group comment and spacing
10954 (setq group-comment (vhdl-parse-group-comment)) 11325 (setq group-comment (vhdl-parse-group-comment))
10955 (setq end-of-list (vhdl-parse-string ")[ \t\n]*;[ \t\n]*" t)) 11326 (setq end-of-list (vhdl-parse-string ")[ \t\n\r\f]*;[ \t\n\r\f]*" t))
10956 (while (not end-of-list) 11327 (while (not end-of-list)
10957 ;; parse names (accept extended identifiers) 11328 ;; parse names (accept extended identifiers)
10958 (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*") 11329 (vhdl-parse-string "\\(\\\\[^\\]+\\\\\\|\\w+\\)[ \t\n\r\f]*")
10959 (setq names (list (match-string-no-properties 1))) 11330 (setq names (list (match-string-no-properties 1)))
10960 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\)[ \t\n]*" t) 11331 (while (vhdl-parse-string ",[ \t\n\r\f]*\\(\\\\[^\\]+\\\\\\|\\w+\\)[ \t\n\r\f]*" t)
10961 (setq names 11332 (setq names
10962 (append names (list (match-string-no-properties 1))))) 11333 (append names (list (match-string-no-properties 1)))))
10963 ;; parse type 11334 ;; parse type
10964 (vhdl-parse-string ":[ \t\n]*\\([^():;\n]+\\)") 11335 (vhdl-parse-string ":[ \t\n\r\f]*\\([^():;\n]+\\)")
10965 (setq type (match-string-no-properties 1)) 11336 (setq type (match-string-no-properties 1))
11337 (when (vhdl-in-comment-p) ; if stuck in comment
11338 (setq type (concat type (and (vhdl-parse-string ".*")
11339 (match-string-no-properties 0)))))
10966 (setq comment nil) 11340 (setq comment nil)
10967 (while (looking-at "(") 11341 (while (looking-at "(")
10968 (setq type 11342 (setq type
@@ -10980,7 +11354,7 @@ reflected in a subsequent paste operation."
10980 (setq type (substring type 0 (match-end 1))) 11354 (setq type (substring type 0 (match-end 1)))
10981 ;; parse initialization expression 11355 ;; parse initialization expression
10982 (setq init nil) 11356 (setq init nil)
10983 (when (vhdl-parse-string ":=[ \t\n]*" t) 11357 (when (vhdl-parse-string ":=[ \t\n\r\f]*" t)
10984 (vhdl-parse-string "\\([^();\n]*\\)") 11358 (vhdl-parse-string "\\([^();\n]*\\)")
10985 (setq init (match-string-no-properties 1)) 11359 (setq init (match-string-no-properties 1))
10986 (while (looking-at "(") 11360 (while (looking-at "(")
@@ -11014,28 +11388,31 @@ reflected in a subsequent paste operation."
11014 ;; parse group comment and spacing 11388 ;; parse group comment and spacing
11015 (setq group-comment (vhdl-parse-group-comment)))) 11389 (setq group-comment (vhdl-parse-group-comment))))
11016 ;; parse port clause 11390 ;; parse port clause
11017 (when (vhdl-parse-string "port[ \t\n]*(" t) 11391 (when (vhdl-parse-string "port[ \t\n\r\f]*(" t)
11018 ;; parse group comment and spacing 11392 ;; parse group comment and spacing
11019 (setq group-comment (vhdl-parse-group-comment)) 11393 (setq group-comment (vhdl-parse-group-comment))
11020 (setq end-of-list (vhdl-parse-string ")[ \t\n]*;[ \t\n]*" t)) 11394 (setq end-of-list (vhdl-parse-string ")[ \t\n\r\f]*;[ \t\n\r\f]*" t))
11021 (while (not end-of-list) 11395 (while (not end-of-list)
11022 ;; parse object 11396 ;; parse object
11023 (setq object 11397 (setq object
11024 (and (vhdl-parse-string "\\<\\(signal\\|quantity\\|terminal\\)\\>[ \t\n]*" t) 11398 (and (vhdl-parse-string "\\<\\(signal\\|quantity\\|terminal\\)\\>[ \t\n\r\f]*" t)
11025 (match-string-no-properties 1))) 11399 (match-string-no-properties 1)))
11026 ;; parse names (accept extended identifiers) 11400 ;; parse names (accept extended identifiers)
11027 (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*") 11401 (vhdl-parse-string "\\(\\\\[^\\]+\\\\\\|\\w+\\)[ \t\n\r\f]*")
11028 (setq names (list (match-string-no-properties 1))) 11402 (setq names (list (match-string-no-properties 1)))
11029 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*" t) 11403 (while (vhdl-parse-string ",[ \t\n\r\f]*\\(\\\\[^\\]+\\\\\\|\\w+\\)[ \t\n\r\f]*" t)
11030 (setq names (append names (list (match-string-no-properties 1))))) 11404 (setq names (append names (list (match-string-no-properties 1)))))
11031 ;; parse direction 11405 ;; parse direction
11032 (vhdl-parse-string ":[ \t\n]*") 11406 (vhdl-parse-string ":[ \t\n\r\f]*")
11033 (setq direct 11407 (setq direct
11034 (and (vhdl-parse-string "\\<\\(in\\|out\\|inout\\|buffer\\|linkage\\)\\>[ \t\n]+" t) 11408 (and (vhdl-parse-string "\\<\\(in\\|out\\|inout\\|buffer\\|linkage\\)\\>[ \t\n\r\f]+" t)
11035 (match-string-no-properties 1))) 11409 (match-string-no-properties 1)))
11036 ;; parse type 11410 ;; parse type
11037 (vhdl-parse-string "\\([^();\n]+\\)") 11411 (vhdl-parse-string "\\([^();\n]+\\)")
11038 (setq type (match-string-no-properties 1)) 11412 (setq type (match-string-no-properties 1))
11413 (when (vhdl-in-comment-p) ; if stuck in comment
11414 (setq type (concat type (and (vhdl-parse-string ".*")
11415 (match-string-no-properties 0)))))
11039 (setq comment nil) 11416 (setq comment nil)
11040 (while (looking-at "(") 11417 (while (looking-at "(")
11041 (setq type (concat type 11418 (setq type (concat type
@@ -11313,7 +11690,7 @@ reflected in a subsequent paste operation."
11313 (setq port-list (cdr port-list)) 11690 (setq port-list (cdr port-list))
11314 (insert (if port-list "," ");")) 11691 (insert (if port-list "," ");"))
11315 ;; paste comment 11692 ;; paste comment
11316 (when (or vhdl-include-direction-comments 11693 (when (or (and vhdl-include-direction-comments (nth 2 port))
11317 vhdl-include-type-comments 11694 vhdl-include-type-comments
11318 (and vhdl-include-port-comments (nth 4 port))) 11695 (and vhdl-include-port-comments (nth 4 port)))
11319 (vhdl-comment-insert-inline 11696 (vhdl-comment-insert-inline
@@ -11454,12 +11831,17 @@ reflected in a subsequent paste operation."
11454 ;; paste type 11831 ;; paste type
11455 (insert " : " (nth 3 port)) 11832 (insert " : " (nth 3 port))
11456 ;; paste initialization (inputs only) 11833 ;; paste initialization (inputs only)
11457 (when (and initialize (equal "IN" (upcase (nth 2 port)))) 11834 (when (and initialize (nth 2 port) (equal "IN" (upcase (nth 2 port))))
11458 (insert " := " (if (string-match "(.+)" (nth 3 port)) 11835 (insert " := "
11459 "(others => '0')" "'0'"))) 11836 (cond ((string-match "integer" (nth 3 port)) "0")
11837 ((string-match "natural" (nth 3 port)) "0")
11838 ((string-match "positive" (nth 3 port)) "0")
11839 ((string-match "real" (nth 3 port)) "0.0")
11840 ((string-match "(.+)" (nth 3 port)) "(others => '0')")
11841 (t "'0'"))))
11460 (insert ";") 11842 (insert ";")
11461 ;; paste comment 11843 ;; paste comment
11462 (when (or vhdl-include-direction-comments 11844 (when (or (and vhdl-include-direction-comments (nth 2 port))
11463 (and vhdl-include-port-comments (nth 4 port))) 11845 (and vhdl-include-port-comments (nth 4 port)))
11464 (vhdl-comment-insert-inline 11846 (vhdl-comment-insert-inline
11465 (concat 11847 (concat
@@ -11495,8 +11877,14 @@ reflected in a subsequent paste operation."
11495 (setq name (car (nth 0 port))) 11877 (setq name (car (nth 0 port)))
11496 (insert (vhdl-replace-string vhdl-actual-port-name name)) 11878 (insert (vhdl-replace-string vhdl-actual-port-name name))
11497 ;; paste initialization 11879 ;; paste initialization
11498 (insert " <= " (if (string-match "(.+)" (nth 3 port)) 11880 (insert " <= "
11499 "(others => '0')" "'0'") ";")) 11881 (cond ((string-match "integer" (nth 3 port)) "0")
11882 ((string-match "natural" (nth 3 port)) "0")
11883 ((string-match "positive" (nth 3 port)) "0")
11884 ((string-match "real" (nth 3 port)) "0.0")
11885 ((string-match "(.+)" (nth 3 port)) "(others => '0')")
11886 (t "'0'"))
11887 ";"))
11500 (setq port-list (cdr port-list)) 11888 (setq port-list (cdr port-list))
11501 (when (and port-list 11889 (when (and port-list
11502 (equal "IN" (upcase (nth 2 (car port-list))))) 11890 (equal "IN" (upcase (nth 2 (car port-list)))))
@@ -11609,7 +11997,9 @@ reflected in a subsequent paste operation."
11609 ;; paste custom declarations 11997 ;; paste custom declarations
11610 (unless (equal "" vhdl-testbench-declarations) 11998 (unless (equal "" vhdl-testbench-declarations)
11611 (insert "\n") 11999 (insert "\n")
11612 (vhdl-insert-string-or-file vhdl-testbench-declarations)) 12000 (setq position (point))
12001 (vhdl-insert-string-or-file vhdl-testbench-declarations)
12002 (vhdl-indent-region position (point)))
11613 (setq position (point)) 12003 (setq position (point))
11614 (insert "\n\n") 12004 (insert "\n\n")
11615 (vhdl-comment-display-line) (insert "\n") 12005 (vhdl-comment-display-line) (insert "\n")
@@ -11638,7 +12028,9 @@ reflected in a subsequent paste operation."
11638 ;; paste custom statements 12028 ;; paste custom statements
11639 (unless (equal "" vhdl-testbench-statements) 12029 (unless (equal "" vhdl-testbench-statements)
11640 (insert "\n") 12030 (insert "\n")
11641 (vhdl-insert-string-or-file vhdl-testbench-statements)) 12031 (setq position (point))
12032 (vhdl-insert-string-or-file vhdl-testbench-statements)
12033 (vhdl-indent-region position (point)))
11642 (insert "\n") 12034 (insert "\n")
11643 (indent-to vhdl-basic-offset) 12035 (indent-to vhdl-basic-offset)
11644 (unless (eq vhdl-testbench-create-files 'none) 12036 (unless (eq vhdl-testbench-create-files 'none)
@@ -11707,8 +12099,8 @@ reflected in a subsequent paste operation."
11707 ;; check if within function declaration 12099 ;; check if within function declaration
11708 (setq pos (point)) 12100 (setq pos (point))
11709 (end-of-line) 12101 (end-of-line)
11710 (when (looking-at "[ \t\n]*\\((\\|;\\|is\\>\\)") (goto-char (match-end 0))) 12102 (when (looking-at "[ \t\n\r\f]*\\((\\|;\\|is\\>\\)") (goto-char (match-end 0)))
11711 (unless (and (re-search-backward "^\\s-*\\(\\(procedure\\)\\|\\(\\(pure\\|impure\\)\\s-+\\)?function\\)\\s-+\\(\"?\\w+\"?\\)[ \t\n]*\\(\\((\\)\\|;\\|is\\>\\)" nil t) 12103 (unless (and (re-search-backward "^\\s-*\\(\\(procedure\\)\\|\\(\\(pure\\|impure\\)\\s-+\\)?function\\)\\s-+\\(\"?\\w+\"?\\)[ \t\n\r\f]*\\(\\((\\)\\|;\\|is\\>\\)" nil t)
11712 (goto-char (match-end 0)) 12104 (goto-char (match-end 0))
11713 (save-excursion (backward-char) 12105 (save-excursion (backward-char)
11714 (forward-sexp) 12106 (forward-sexp)
@@ -11721,21 +12113,21 @@ reflected in a subsequent paste operation."
11721 ;; parse parameter list 12113 ;; parse parameter list
11722 (setq group-comment (vhdl-parse-group-comment)) 12114 (setq group-comment (vhdl-parse-group-comment))
11723 (setq end-of-list (or end-of-list 12115 (setq end-of-list (or end-of-list
11724 (vhdl-parse-string ")[ \t\n]*\\(;\\|\\(is\\|return\\)\\>\\)" t))) 12116 (vhdl-parse-string ")[ \t\n\r\f]*\\(;\\|\\(is\\|return\\)\\>\\)" t)))
11725 (while (not end-of-list) 12117 (while (not end-of-list)
11726 ;; parse object 12118 ;; parse object
11727 (setq object 12119 (setq object
11728 (and (vhdl-parse-string "\\(constant\\|signal\\|variable\\|file\\|quantity\\|terminal\\)[ \t\n]*" t) 12120 (and (vhdl-parse-string "\\(constant\\|signal\\|variable\\|file\\|quantity\\|terminal\\)[ \t\n\r\f]*" t)
11729 (match-string-no-properties 1))) 12121 (match-string-no-properties 1)))
11730 ;; parse names (accept extended identifiers) 12122 ;; parse names (accept extended identifiers)
11731 (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*") 12123 (vhdl-parse-string "\\(\\\\[^\\]+\\\\\\|\\w+\\)[ \t\n\r\f]*")
11732 (setq names (list (match-string-no-properties 1))) 12124 (setq names (list (match-string-no-properties 1)))
11733 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*" t) 12125 (while (vhdl-parse-string ",[ \t\n\r\f]*\\(\\\\[^\\]+\\\\\\|\\w+\\)[ \t\n\r\f]*" t)
11734 (setq names (append names (list (match-string-no-properties 1))))) 12126 (setq names (append names (list (match-string-no-properties 1)))))
11735 ;; parse direction 12127 ;; parse direction
11736 (vhdl-parse-string ":[ \t\n]*") 12128 (vhdl-parse-string ":[ \t\n\r\f]*")
11737 (setq direct 12129 (setq direct
11738 (and (vhdl-parse-string "\\(in\\|out\\|inout\\|buffer\\|linkage\\)[ \t\n]+" t) 12130 (and (vhdl-parse-string "\\(in\\|out\\|inout\\|buffer\\|linkage\\)[ \t\n\r\f]+" t)
11739 (match-string-no-properties 1))) 12131 (match-string-no-properties 1)))
11740 ;; parse type 12132 ;; parse type
11741 (vhdl-parse-string "\\([^():;\n]+\\)") 12133 (vhdl-parse-string "\\([^():;\n]+\\)")
@@ -11757,7 +12149,7 @@ reflected in a subsequent paste operation."
11757 (setq type (substring type 0 (match-end 1))) 12149 (setq type (substring type 0 (match-end 1)))
11758 ;; parse initialization expression 12150 ;; parse initialization expression
11759 (setq init nil) 12151 (setq init nil)
11760 (when (vhdl-parse-string ":=[ \t\n]*" t) 12152 (when (vhdl-parse-string ":=[ \t\n\r\f]*" t)
11761 (vhdl-parse-string "\\([^();\n]*\\)") 12153 (vhdl-parse-string "\\([^();\n]*\\)")
11762 (setq init (match-string-no-properties 1)) 12154 (setq init (match-string-no-properties 1))
11763 (while (looking-at "(") 12155 (while (looking-at "(")
@@ -11787,7 +12179,7 @@ reflected in a subsequent paste operation."
11787 (vhdl-parse-string "\\(;\\|\\(is\\|\\(return\\)\\)\\>\\)\\s-*") 12179 (vhdl-parse-string "\\(;\\|\\(is\\|\\(return\\)\\)\\>\\)\\s-*")
11788 ;; parse return type 12180 ;; parse return type
11789 (when (match-string 3) 12181 (when (match-string 3)
11790 (vhdl-parse-string "[ \t\n]*\\(.+\\)[ \t\n]*\\(;\\|is\\>\\)\\s-*") 12182 (vhdl-parse-string "[ \t\n\r\f]*\\(.+\\)[ \t\n\r\f]*\\(;\\|is\\>\\)\\s-*")
11791 (setq return-type (match-string-no-properties 1)) 12183 (setq return-type (match-string-no-properties 1))
11792 (when (and return-type 12184 (when (and return-type
11793 (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" return-type)) 12185 (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" return-type))
@@ -12015,17 +12407,15 @@ expressions (e.g. for index ranges of types and signals)."
12015 (defalias 'he-list-beg 'vhdl-he-list-beg)) 12407 (defalias 'he-list-beg 'vhdl-he-list-beg))
12016 12408
12017;; function for expanding abbrevs and dabbrevs 12409;; function for expanding abbrevs and dabbrevs
12018(defun vhdl-expand-abbrev (arg)) 12410(defalias 'vhdl-expand-abbrev (make-hippie-expand-function
12019(fset 'vhdl-expand-abbrev (make-hippie-expand-function 12411 '(try-expand-dabbrev
12020 '(try-expand-dabbrev 12412 try-expand-dabbrev-all-buffers
12021 try-expand-dabbrev-all-buffers 12413 vhdl-try-expand-abbrev)))
12022 vhdl-try-expand-abbrev)))
12023 12414
12024;; function for expanding parenthesis 12415;; function for expanding parenthesis
12025(defun vhdl-expand-paren (arg)) 12416(defalias 'vhdl-expand-paren (make-hippie-expand-function
12026(fset 'vhdl-expand-paren (make-hippie-expand-function 12417 '(try-expand-list
12027 '(try-expand-list 12418 try-expand-list-all-buffers)))
12028 try-expand-list-all-buffers)))
12029 12419
12030;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12420;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12031;; Case fixing 12421;; Case fixing
@@ -12049,7 +12439,7 @@ depending on parameter UPPER-CASE."
12049 (< vhdl-progress-interval 12439 (< vhdl-progress-interval
12050 (- (nth 1 (current-time)) last-update))) 12440 (- (nth 1 (current-time)) last-update)))
12051 (message "Fixing case... (%2d%s)" 12441 (message "Fixing case... (%2d%s)"
12052 (+ (* count 25) (/ (* 25 (- (point) beg)) (- end beg))) 12442 (+ (* count 20) (/ (* 20 (- (point) beg)) (- end beg)))
12053 "%") 12443 "%")
12054 (setq last-update (nth 1 (current-time))))) 12444 (setq last-update (nth 1 (current-time)))))
12055 (goto-char end))))) 12445 (goto-char end)))))
@@ -12066,6 +12456,8 @@ options vhdl-upper-case-{keywords,types,attributes,enum-values}."
12066 beg end vhdl-upper-case-attributes (concat "'" vhdl-attributes-regexp) 2) 12456 beg end vhdl-upper-case-attributes (concat "'" vhdl-attributes-regexp) 2)
12067 (vhdl-fix-case-region-1 12457 (vhdl-fix-case-region-1
12068 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3) 12458 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3)
12459 (vhdl-fix-case-region-1
12460 beg end vhdl-upper-case-constants vhdl-constants-regexp 4)
12069 (when vhdl-progress-interval (message "Fixing case...done"))) 12461 (when vhdl-progress-interval (message "Fixing case...done")))
12070 12462
12071(defun vhdl-fix-case-buffer () 12463(defun vhdl-fix-case-buffer ()
@@ -12091,6 +12483,9 @@ options vhdl-upper-case-{keywords,types,attributes,enum-values}."
12091 (upcase-word 1)) 12483 (upcase-word 1))
12092 (when (and vhdl-upper-case-enum-values 12484 (when (and vhdl-upper-case-enum-values
12093 (looking-at vhdl-enum-values-regexp)) 12485 (looking-at vhdl-enum-values-regexp))
12486 (upcase-word 1))
12487 (when (and vhdl-upper-case-constants
12488 (looking-at vhdl-constants-regexp))
12094 (upcase-word 1))))) 12489 (upcase-word 1)))))
12095 12490
12096;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12491;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -12205,6 +12600,9 @@ it works within comments too."
12205 (interactive) 12600 (interactive)
12206 (let ((no-stats 0) 12601 (let ((no-stats 0)
12207 (no-code-lines 0) 12602 (no-code-lines 0)
12603 (no-empty-lines 0)
12604 (no-comm-lines 0)
12605 (no-comments 0)
12208 (no-lines (count-lines (point-min) (point-max)))) 12606 (no-lines (count-lines (point-min) (point-max))))
12209 (save-excursion 12607 (save-excursion
12210 ;; count statements 12608 ;; count statements
@@ -12218,15 +12616,40 @@ it works within comments too."
12218 (while (not (eobp)) 12616 (while (not (eobp))
12219 (unless (looking-at "^\\s-*\\(--.*\\)?$") 12617 (unless (looking-at "^\\s-*\\(--.*\\)?$")
12220 (setq no-code-lines (1+ no-code-lines))) 12618 (setq no-code-lines (1+ no-code-lines)))
12221 (beginning-of-line 2))) 12619 (beginning-of-line 2))
12620 ;; count empty lines
12621 (goto-char (point-min))
12622 (while (and (re-search-forward "^\\s-*$" nil t)
12623 (not (eq (point) (point-max))))
12624 (if (match-string 1)
12625 (goto-char (match-end 1))
12626 (setq no-empty-lines (1+ no-empty-lines))
12627 (unless (eq (point) (point-max))
12628 (forward-char))))
12629 ;; count comment-only lines
12630 (goto-char (point-min))
12631 (while (re-search-forward "^\\s-*--.*" nil t)
12632 (if (match-string 1)
12633 (goto-char (match-end 1))
12634 (setq no-comm-lines (1+ no-comm-lines))))
12635 ;; count comments
12636 (goto-char (point-min))
12637 (while (re-search-forward "--.*" nil t)
12638 (if (match-string 1)
12639 (goto-char (match-end 1))
12640 (setq no-comments (1+ no-comments)))))
12222 ;; print results 12641 ;; print results
12223 (message "\n\ 12642 (message "\n\
12224File statistics: \"%s\"\n\ 12643File statistics: \"%s\"\n\
12225---------------------\n\ 12644---------------------\n\
12226# statements : %5d\n\ 12645# statements : %5d\n\
12227# code lines : %5d\n\ 12646# code lines : %5d\n\
12228# total lines : %5d\n\ " 12647# empty lines : %5d\n\
12229 (buffer-file-name) no-stats no-code-lines no-lines) 12648# comment lines : %5d\n\
12649# comments : %5d\n\
12650# total lines : %5d\n\ "
12651 (buffer-file-name) no-stats no-code-lines no-empty-lines
12652 no-comm-lines no-comments no-lines)
12230 (unless vhdl-emacs-21 (vhdl-show-messages)))) 12653 (unless vhdl-emacs-21 (vhdl-show-messages))))
12231 12654
12232;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12655;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -12390,18 +12813,18 @@ File statistics: \"%s\"\n\
12390 (concat 12813 (concat
12391 "\\(^\\)\\s-*\\(" 12814 "\\(^\\)\\s-*\\("
12392 ;; generic/port clause 12815 ;; generic/port clause
12393 "\\(generic\\|port\\)[ \t\n]*(\\|" 12816 "\\(generic\\|port\\)[ \t\n\r\f]*(\\|"
12394 ;; component 12817 ;; component
12395 "component\\>\\|" 12818 "component\\>\\|"
12396 ;; component instantiation 12819 ;; component instantiation
12397 "\\(\\w\\|\\s_\\)+[ \t\n]*:[ \t\n]*" 12820 "\\(\\w\\|\\s_\\)+[ \t\n\r\f]*:[ \t\n\r\f]*"
12398 "\\(\\(component\\|configuration\\|entity\\)[ \t\n]+\\)?" 12821 "\\(\\(component\\|configuration\\|entity\\)[ \t\n\r\f]+\\)?"
12399 "\\(\\w\\|\\s_\\)+\\([ \t\n]*(\\(\\w\\|\\s_\\)+)\\)?[ \t\n]*" 12822 "\\(\\w\\|\\s_\\)+\\([ \t\n\r\f]*(\\(\\w\\|\\s_\\)+)\\)?[ \t\n\r\f]*"
12400 "\\(generic\\|port\\)[ \t\n]+map[ \t\n]*(\\|" 12823 "\\(generic\\|port\\)[ \t\n\r\f]+map[ \t\n\r\f]*(\\|"
12401 ;; subprogram 12824 ;; subprogram
12402 "\\(function\\|procedure\\)\\>\\|" 12825 "\\(function\\|procedure\\)\\>\\|"
12403 ;; process, block 12826 ;; process, block
12404 "\\(\\(\\w\\|\\s_\\)+[ \t\n]*:[ \t\n]*\\)?\\(process\\|block\\)\\>\\|" 12827 "\\(\\(\\w\\|\\s_\\)+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(process\\|block\\)\\>\\|"
12405 ;; configuration declaration 12828 ;; configuration declaration
12406 "configuration\\>" 12829 "configuration\\>"
12407 "\\)") 12830 "\\)")
@@ -12414,7 +12837,7 @@ File statistics: \"%s\"\n\
12414 (beginning-of-line) 12837 (beginning-of-line)
12415 (cond 12838 (cond
12416 ;; generic/port clause 12839 ;; generic/port clause
12417 ((looking-at "^\\s-*\\(generic\\|port\\)[ \t\n]*(") 12840 ((looking-at "^\\s-*\\(generic\\|port\\)[ \t\n\r\f]*(")
12418 (goto-char (match-end 0)) 12841 (goto-char (match-end 0))
12419 (backward-char) 12842 (backward-char)
12420 (forward-sexp)) 12843 (forward-sexp))
@@ -12424,16 +12847,16 @@ File statistics: \"%s\"\n\
12424 ;; component instantiation 12847 ;; component instantiation
12425 ((looking-at 12848 ((looking-at
12426 (concat 12849 (concat
12427 "^\\s-*\\w+\\s-*:[ \t\n]*" 12850 "^\\s-*\\w+\\s-*:[ \t\n\r\f]*"
12428 "\\(\\(component\\|configuration\\|entity\\)[ \t\n]+\\)?" 12851 "\\(\\(component\\|configuration\\|entity\\)[ \t\n\r\f]+\\)?"
12429 "\\w+\\(\\s-*(\\w+)\\)?[ \t\n]*" 12852 "\\w+\\(\\s-*(\\w+)\\)?[ \t\n\r\f]*"
12430 "\\(generic\\|port\\)\\s-+map[ \t\n]*(")) 12853 "\\(generic\\|port\\)\\s-+map[ \t\n\r\f]*("))
12431 (goto-char (match-end 0)) 12854 (goto-char (match-end 0))
12432 (backward-char) 12855 (backward-char)
12433 (forward-sexp) 12856 (forward-sexp)
12434 (setq pos (point)) 12857 (setq pos (point))
12435 (vhdl-forward-syntactic-ws) 12858 (vhdl-forward-syntactic-ws)
12436 (when (looking-at "port\\s-+map[ \t\n]*(") 12859 (when (looking-at "port\\s-+map[ \t\n\r\f]*(")
12437 (goto-char (match-end 0)) 12860 (goto-char (match-end 0))
12438 (backward-char) 12861 (backward-char)
12439 (forward-sexp) 12862 (forward-sexp)
@@ -12585,7 +13008,7 @@ This does highlighting of keywords and standard identifiers.")
12585 ;; highlight labels of common constructs 13008 ;; highlight labels of common constructs
12586 (list 13009 (list
12587 (concat 13010 (concat
12588 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n]*\\(\\(" 13011 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n\r\f]*\\(\\("
12589 "assert\\|block\\|case\\|exit\\|for\\|if\\|loop\\|next\\|null\\|" 13012 "assert\\|block\\|case\\|exit\\|for\\|if\\|loop\\|next\\|null\\|"
12590 "postponed\\|process\\|" 13013 "postponed\\|process\\|"
12591 (when (vhdl-standard-p 'ams) "procedural\\|") 13014 (when (vhdl-standard-p 'ams) "procedural\\|")
@@ -12596,14 +13019,14 @@ This does highlighting of keywords and standard identifiers.")
12596 ;; highlight label and component name of component instantiations 13019 ;; highlight label and component name of component instantiations
12597 (list 13020 (list
12598 (concat 13021 (concat
12599 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n]*\\(\\w+\\)" 13022 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n\r\f]*\\(\\w+\\)[ \t\n\r\f]*"
12600 "\\(\\s-*\\(--[^\n]*\\)?$\\|\\s-+\\(generic\\|port\\)\\s-+map\\>\\)") 13023 "\\(--[^\n]*[ \t\n\r\f]+\\)*\\(generic\\|port\\)\\s-+map\\>")
12601 '(1 font-lock-function-name-face) '(2 font-lock-function-name-face)) 13024 '(1 font-lock-function-name-face) '(2 font-lock-function-name-face))
12602 13025
12603 ;; highlight label and instantiated unit of component instantiations 13026 ;; highlight label and instantiated unit of component instantiations
12604 (list 13027 (list
12605 (concat 13028 (concat
12606 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n]*" 13029 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n\r\f]*"
12607 "\\(component\\|configuration\\|entity\\)\\s-+" 13030 "\\(component\\|configuration\\|entity\\)\\s-+"
12608 "\\(\\w+\\)\\(\\.\\(\\w+\\)\\)?\\(\\s-*(\\(\\w+\\))\\)?") 13031 "\\(\\w+\\)\\(\\.\\(\\w+\\)\\)?\\(\\s-*(\\(\\w+\\))\\)?")
12609 '(1 font-lock-function-name-face) '(3 font-lock-function-name-face) 13032 '(1 font-lock-function-name-face) '(3 font-lock-function-name-face)
@@ -12638,7 +13061,7 @@ This does highlighting of keywords and standard identifiers.")
12638 (list 13061 (list
12639 (concat 13062 (concat
12640 "^\\s-*for\\s-+\\(\\w+\\(,\\s-*\\w+\\)*\\)\\>\\s-*" 13063 "^\\s-*for\\s-+\\(\\w+\\(,\\s-*\\w+\\)*\\)\\>\\s-*"
12641 "\\(:[ \t\n]*\\(\\w+\\)\\|[^i \t]\\)") 13064 "\\(:[ \t\n\r\f]*\\(\\w+\\)\\|[^i \t]\\)")
12642 '(1 font-lock-function-name-face) '(4 font-lock-function-name-face nil t)) 13065 '(1 font-lock-function-name-face) '(4 font-lock-function-name-face nil t))
12643 13066
12644 ;; highlight names in library clauses 13067 ;; highlight names in library clauses
@@ -12662,8 +13085,8 @@ This does highlighting of keywords and standard identifiers.")
12662 ;; highlight type/nature name in (sub)type/(sub)nature declarations 13085 ;; highlight type/nature name in (sub)type/(sub)nature declarations
12663 (list 13086 (list
12664 (concat 13087 (concat
12665 "^\\s-*\\(sub\\)?\\(nature\\|type\\)\\s-+\\(\\w+\\)") 13088 "^\\s-*\\(\\(sub\\)?\\(nature\\|type\\)\\|end\\s-+\\(record\\|protected\\)\\)\\s-+\\(\\w+\\)")
12666 3 'font-lock-type-face) 13089 5 'font-lock-type-face)
12667 13090
12668 ;; highlight signal/variable/constant declaration names 13091 ;; highlight signal/variable/constant declaration names
12669 (list "\\(:[^=]\\)" 13092 (list "\\(:[^=]\\)"
@@ -12867,6 +13290,7 @@ This does background highlighting of translate-off regions.")
12867 (list vhdl-functions-regexp 1 'vhdl-font-lock-function-face) 13290 (list vhdl-functions-regexp 1 'vhdl-font-lock-function-face)
12868 (list vhdl-packages-regexp 1 'vhdl-font-lock-function-face) 13291 (list vhdl-packages-regexp 1 'vhdl-font-lock-function-face)
12869 (list vhdl-enum-values-regexp 1 'vhdl-font-lock-enumvalue-face) 13292 (list vhdl-enum-values-regexp 1 'vhdl-font-lock-enumvalue-face)
13293 (list vhdl-constants-regexp 1 'font-lock-constant-face)
12870 (list vhdl-keywords-regexp 1 'font-lock-keyword-face))) 13294 (list vhdl-keywords-regexp 1 'font-lock-keyword-face)))
12871 ;; highlight words with special syntax. 13295 ;; highlight words with special syntax.
12872 (setq vhdl-font-lock-keywords-3 13296 (setq vhdl-font-lock-keywords-3
@@ -12875,9 +13299,10 @@ This does background highlighting of translate-off regions.")
12875 (while syntax-alist 13299 (while syntax-alist
12876 (setq keywords 13300 (setq keywords
12877 (cons 13301 (cons
12878 (cons (concat "\\<\\(" (nth 1 (car syntax-alist)) "\\)\\>") 13302 (list (concat "\\(" (nth 1 (car syntax-alist)) "\\)") 1
12879 (vhdl-function-name 13303 (vhdl-function-name
12880 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face")) 13304 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face")
13305 (nth 4 (car syntax-alist)))
12881 keywords)) 13306 keywords))
12882 (setq syntax-alist (cdr syntax-alist))) 13307 (setq syntax-alist (cdr syntax-alist)))
12883 keywords)) 13308 keywords))
@@ -13066,7 +13491,7 @@ hierarchy otherwise.")
13066 (when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t) 13491 (when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t)
13067 (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t) 13492 (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t)
13068 (equal "USE" (upcase (match-string 1)))) 13493 (equal "USE" (upcase (match-string 1))))
13069 (when (looking-at "^[ \t]*use[ \t\n]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+") 13494 (when (looking-at "^[ \t]*use[ \t\n\r\f]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+")
13070 (setq lib-alist (cons (cons (match-string-no-properties 1) 13495 (setq lib-alist (cons (cons (match-string-no-properties 1)
13071 (vhdl-match-string-downcase 2)) 13496 (vhdl-match-string-downcase 2))
13072 lib-alist)))))) 13497 lib-alist))))))
@@ -13140,7 +13565,7 @@ hierarchy otherwise.")
13140 (setq big-files t)) 13565 (setq big-files t))
13141 ;; scan for entities 13566 ;; scan for entities
13142 (goto-char (point-min)) 13567 (goto-char (point-min))
13143 (while (re-search-forward "^[ \t]*entity[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) 13568 (while (re-search-forward "^[ \t]*entity[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
13144 (let* ((ent-name (match-string-no-properties 1)) 13569 (let* ((ent-name (match-string-no-properties 1))
13145 (ent-key (downcase ent-name)) 13570 (ent-key (downcase ent-name))
13146 (ent-entry (aget ent-alist ent-key t)) 13571 (ent-entry (aget ent-alist ent-key t))
@@ -13157,7 +13582,7 @@ hierarchy otherwise.")
13157 lib-alist))))) 13582 lib-alist)))))
13158 ;; scan for architectures 13583 ;; scan for architectures
13159 (goto-char (point-min)) 13584 (goto-char (point-min))
13160 (while (re-search-forward "^[ \t]*architecture[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) 13585 (while (re-search-forward "^[ \t]*architecture[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
13161 (let* ((arch-name (match-string-no-properties 1)) 13586 (let* ((arch-name (match-string-no-properties 1))
13162 (arch-key (downcase arch-name)) 13587 (arch-key (downcase arch-name))
13163 (ent-name (match-string-no-properties 2)) 13588 (ent-name (match-string-no-properties 2))
@@ -13183,7 +13608,7 @@ hierarchy otherwise.")
13183 arch-key (nth 5 ent-entry)))))) 13608 arch-key (nth 5 ent-entry))))))
13184 ;; scan for configurations 13609 ;; scan for configurations
13185 (goto-char (point-min)) 13610 (goto-char (point-min))
13186 (while (re-search-forward "^[ \t]*configuration[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) 13611 (while (re-search-forward "^[ \t]*configuration[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
13187 (let* ((conf-name (match-string-no-properties 1)) 13612 (let* ((conf-name (match-string-no-properties 1))
13188 (conf-key (downcase conf-name)) 13613 (conf-key (downcase conf-name))
13189 (conf-entry (aget conf-alist conf-key t)) 13614 (conf-entry (aget conf-alist conf-key t))
@@ -13195,7 +13620,7 @@ hierarchy otherwise.")
13195 arch-key comp-conf-list inst-key-list 13620 arch-key comp-conf-list inst-key-list
13196 inst-comp-key inst-ent-key inst-arch-key 13621 inst-comp-key inst-ent-key inst-arch-key
13197 inst-conf-key inst-lib-key) 13622 inst-conf-key inst-lib-key)
13198 (when (vhdl-re-search-forward "\\<for[ \t\n]+\\(\\w+\\)") 13623 (when (vhdl-re-search-forward "\\<for[ \t\n\r\f]+\\(\\w+\\)")
13199 (setq arch-key (vhdl-match-string-downcase 1))) 13624 (setq arch-key (vhdl-match-string-downcase 1)))
13200 (if conf-entry 13625 (if conf-entry
13201 (vhdl-warning-when-idle 13626 (vhdl-warning-when-idle
@@ -13204,13 +13629,13 @@ hierarchy otherwise.")
13204 (nth 2 conf-entry) file-name conf-line) 13629 (nth 2 conf-entry) file-name conf-line)
13205 (setq conf-list (cons conf-key conf-list)) 13630 (setq conf-list (cons conf-key conf-list))
13206 ;; scan for subconfigurations and subentities 13631 ;; scan for subconfigurations and subentities
13207 (while (re-search-forward "^[ \t]*for[ \t\n]+\\(\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*\\)[ \t\n]*:[ \t\n]*\\(\\w+\\)[ \t\n]+" end-of-unit t) 13632 (while (re-search-forward "^[ \t]*for[ \t\n\r\f]+\\(\\w+\\([ \t\n\r\f]*,[ \t\n\r\f]*\\w+\\)*\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\(\\w+\\)[ \t\n\r\f]+" end-of-unit t)
13208 (setq inst-comp-key (vhdl-match-string-downcase 3) 13633 (setq inst-comp-key (vhdl-match-string-downcase 3)
13209 inst-key-list (split-string 13634 inst-key-list (split-string
13210 (vhdl-match-string-downcase 1) 13635 (vhdl-match-string-downcase 1)
13211 "[ \t\n]*,[ \t\n]*")) 13636 "[ \t\n\r\f]*,[ \t\n\r\f]*"))
13212 (vhdl-forward-syntactic-ws) 13637 (vhdl-forward-syntactic-ws)
13213 (when (looking-at "use[ \t\n]+\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\w+\\)\\.\\(\\w+\\)[ \t\n]*\\((\\(\\w+\\))\\)?") 13638 (when (looking-at "use[ \t\n\r\f]+\\(\\(entity\\)\\|configuration\\)[ \t\n\r\f]+\\(\\w+\\)\\.\\(\\w+\\)[ \t\n\r\f]*\\((\\(\\w+\\))\\)?")
13214 (setq 13639 (setq
13215 inst-lib-key (vhdl-match-string-downcase 3) 13640 inst-lib-key (vhdl-match-string-downcase 3)
13216 inst-ent-key (and (match-string 2) 13641 inst-ent-key (and (match-string 2)
@@ -13232,7 +13657,7 @@ hierarchy otherwise.")
13232 arch-key comp-conf-list lib-alist))))) 13657 arch-key comp-conf-list lib-alist)))))
13233 ;; scan for packages 13658 ;; scan for packages
13234 (goto-char (point-min)) 13659 (goto-char (point-min))
13235 (while (re-search-forward "^[ \t]*package[ \t\n]+\\(body[ \t\n]+\\)?\\(\\w+\\)[ \t\n]+is\\>" nil t) 13660 (while (re-search-forward "^[ \t]*package[ \t\n\r\f]+\\(body[ \t\n\r\f]+\\)?\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
13236 (let* ((pack-name (match-string-no-properties 2)) 13661 (let* ((pack-name (match-string-no-properties 2))
13237 (pack-key (downcase pack-name)) 13662 (pack-key (downcase pack-name))
13238 (is-body (match-string-no-properties 1)) 13663 (is-body (match-string-no-properties 1))
@@ -13250,7 +13675,7 @@ hierarchy otherwise.")
13250 ;; scan for context clauses 13675 ;; scan for context clauses
13251 (setq lib-alist (vhdl-scan-context-clause)) 13676 (setq lib-alist (vhdl-scan-context-clause))
13252 ;; scan for component and subprogram declarations/bodies 13677 ;; scan for component and subprogram declarations/bodies
13253 (while (re-search-forward "^[ \t]*\\(component\\|function\\|procedure\\)[ \t\n]+\\(\\w+\\|\".*\"\\)" end-of-unit t) 13678 (while (re-search-forward "^[ \t]*\\(component\\|function\\|procedure\\)[ \t\n\r\f]+\\(\\w+\\|\".*\"\\)" end-of-unit t)
13254 (if (equal (upcase (match-string 1)) "COMPONENT") 13679 (if (equal (upcase (match-string 1)) "COMPONENT")
13255 (setq comp-name (match-string-no-properties 2) 13680 (setq comp-name (match-string-no-properties 2)
13256 comp-alist 13681 comp-alist
@@ -13286,7 +13711,7 @@ hierarchy otherwise.")
13286 (setq big-files t)) 13711 (setq big-files t))
13287 ;; scan for architectures 13712 ;; scan for architectures
13288 (goto-char (point-min)) 13713 (goto-char (point-min))
13289 (while (re-search-forward "^[ \t]*architecture[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) 13714 (while (re-search-forward "^[ \t]*architecture[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
13290 (let* ((ent-name (match-string-no-properties 2)) 13715 (let* ((ent-name (match-string-no-properties 2))
13291 (ent-key (downcase ent-name)) 13716 (ent-key (downcase ent-name))
13292 (arch-name (match-string-no-properties 1)) 13717 (arch-name (match-string-no-properties 1))
@@ -13300,12 +13725,12 @@ hierarchy otherwise.")
13300 inst-alist inst-path) 13725 inst-alist inst-path)
13301 ;; scan for contained instantiations 13726 ;; scan for contained instantiations
13302 (while (and (re-search-forward 13727 (while (and (re-search-forward
13303 (concat "^[ \t]*\\(\\w+\\)[ \t\n]*:[ \t\n]*\\(" 13728 (concat "^[ \t]*\\(\\w+\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\("
13304 "\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(generic\\|port\\)[ \t\n]+map\\>\\|" 13729 "\\(\\w+\\)[ \t\n\r\f]+\\(--[^\n]*\n[ \t\n\r\f]*\\)*\\(generic\\|port\\)[ \t\n\r\f]+map\\>\\|"
13305 "component[ \t\n]+\\(\\w+\\)\\|" 13730 "component[ \t\n\r\f]+\\(\\w+\\)\\|"
13306 "\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?\\|" 13731 "\\(\\(entity\\)\\|configuration\\)[ \t\n\r\f]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n\r\f]*(\\(\\w+\\))\\)?\\|"
13307 "\\(\\(for\\|if\\)\\>[^;:]+\\<generate\\>\\|block\\>\\)\\)\\|" 13732 "\\(\\(for\\|if\\)\\>[^;:]+\\<generate\\>\\|block\\>\\)\\)\\|"
13308 "\\(^[ \t]*end[ \t\n]+\\(generate\\|block\\)\\>\\)") end-of-unit t) 13733 "\\(^[ \t]*end[ \t\n\r\f]+\\(generate\\|block\\)\\>\\)") end-of-unit t)
13309 (or (not limit-hier-inst-no) 13734 (or (not limit-hier-inst-no)
13310 (<= (setq inst-no (1+ inst-no)) 13735 (<= (setq inst-no (1+ inst-no))
13311 limit-hier-inst-no))) 13736 limit-hier-inst-no)))
@@ -13349,8 +13774,8 @@ hierarchy otherwise.")
13349 ;; scan for contained configuration specifications 13774 ;; scan for contained configuration specifications
13350 (goto-char beg-of-unit) 13775 (goto-char beg-of-unit)
13351 (while (re-search-forward 13776 (while (re-search-forward
13352 (concat "^[ \t]*for[ \t\n]+\\(\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*\\)[ \t\n]*:[ \t\n]*\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*" 13777 (concat "^[ \t]*for[ \t\n\r\f]+\\(\\w+\\([ \t\n\r\f]*,[ \t\n\r\f]*\\w+\\)*\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\(\\w+\\)[ \t\n\r\f]+\\(--[^\n]*\n[ \t\n\r\f]*\\)*"
13353 "use[ \t\n]+\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?") end-of-unit t) 13778 "use[ \t\n\r\f]+\\(\\(entity\\)\\|configuration\\)[ \t\n\r\f]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n\r\f]*(\\(\\w+\\))\\)?") end-of-unit t)
13354 (let* ((inst-comp-name (match-string-no-properties 3)) 13779 (let* ((inst-comp-name (match-string-no-properties 3))
13355 (inst-ent-key 13780 (inst-ent-key
13356 (and (match-string 6) 13781 (and (match-string 6)
@@ -13362,7 +13787,7 @@ hierarchy otherwise.")
13362 (inst-lib-key (vhdl-match-string-downcase 8)) 13787 (inst-lib-key (vhdl-match-string-downcase 8))
13363 (inst-key-list 13788 (inst-key-list
13364 (split-string (vhdl-match-string-downcase 1) 13789 (split-string (vhdl-match-string-downcase 1)
13365 "[ \t\n]*,[ \t\n]*")) 13790 "[ \t\n\r\f]*,[ \t\n\r\f]*"))
13366 (tmp-inst-alist inst-alist) 13791 (tmp-inst-alist inst-alist)
13367 inst-entry) 13792 inst-entry)
13368 (while tmp-inst-alist 13793 (while tmp-inst-alist
@@ -15347,7 +15772,7 @@ expansion function)."
15347 (read-from-minibuffer "architecture name: " 15772 (read-from-minibuffer "architecture name: "
15348 nil vhdl-minibuffer-local-map) 15773 nil vhdl-minibuffer-local-map)
15349 (vhdl-replace-string vhdl-compose-architecture-name ent-name))) 15774 (vhdl-replace-string vhdl-compose-architecture-name ent-name)))
15350 ent-file-name arch-file-name ent-buffer arch-buffer project) 15775 ent-file-name arch-file-name ent-buffer arch-buffer project end-pos)
15351 (message "Creating component \"%s(%s)\"..." ent-name arch-name) 15776 (message "Creating component \"%s(%s)\"..." ent-name arch-name)
15352 ;; open entity file 15777 ;; open entity file
15353 (unless (eq vhdl-compose-create-files 'none) 15778 (unless (eq vhdl-compose-create-files 'none)
@@ -15364,6 +15789,7 @@ expansion function)."
15364 ;; insert header 15789 ;; insert header
15365 (if vhdl-compose-include-header 15790 (if vhdl-compose-include-header
15366 (progn (vhdl-template-header) 15791 (progn (vhdl-template-header)
15792 (setq end-pos (point))
15367 (goto-char (point-max))) 15793 (goto-char (point-max)))
15368 (vhdl-comment-display-line) (insert "\n\n")) 15794 (vhdl-comment-display-line) (insert "\n\n"))
15369 ;; insert library clause 15795 ;; insert library clause
@@ -15390,6 +15816,7 @@ expansion function)."
15390 ;; open architecture file 15816 ;; open architecture file
15391 (if (not (eq vhdl-compose-create-files 'separate)) 15817 (if (not (eq vhdl-compose-create-files 'separate))
15392 (insert "\n") 15818 (insert "\n")
15819 (goto-char (or end-pos (point-min)))
15393 (setq ent-buffer (current-buffer)) 15820 (setq ent-buffer (current-buffer))
15394 (setq arch-file-name 15821 (setq arch-file-name
15395 (concat (vhdl-replace-string vhdl-architecture-file-name 15822 (concat (vhdl-replace-string vhdl-architecture-file-name
@@ -15434,7 +15861,7 @@ expansion function)."
15434 (if (and vhdl-compose-include-header (not (equal vhdl-file-footer ""))) 15861 (if (and vhdl-compose-include-header (not (equal vhdl-file-footer "")))
15435 (vhdl-template-footer) 15862 (vhdl-template-footer)
15436 (vhdl-comment-display-line) (insert "\n")) 15863 (vhdl-comment-display-line) (insert "\n"))
15437 (goto-char (point-min)) 15864 (goto-char (or end-pos (point-min)))
15438 (setq arch-buffer (current-buffer)) 15865 (setq arch-buffer (current-buffer))
15439 (when ent-buffer (set-buffer ent-buffer) (save-buffer)) 15866 (when ent-buffer (set-buffer ent-buffer) (save-buffer))
15440 (set-buffer arch-buffer) (save-buffer) 15867 (set-buffer arch-buffer) (save-buffer)
@@ -15453,8 +15880,8 @@ component instantiation."
15453 (error "ERROR: No port has been read") 15880 (error "ERROR: No port has been read")
15454 (save-excursion 15881 (save-excursion
15455 (vhdl-prepare-search-2 15882 (vhdl-prepare-search-2
15456 (unless (or (re-search-backward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) 15883 (unless (or (re-search-backward "^architecture[ \t\n\r\f]+\\w+[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
15457 (re-search-forward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)) 15884 (re-search-forward "^architecture[ \t\n\r\f]+\\w+[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t))
15458 (error "ERROR: No architecture found")) 15885 (error "ERROR: No architecture found"))
15459 (let* ((ent-name (match-string 1)) 15886 (let* ((ent-name (match-string 1))
15460 (ent-file-name 15887 (ent-file-name
@@ -15471,13 +15898,13 @@ component instantiation."
15471 (car vhdl-port-list) "\\>") nil t))) 15898 (car vhdl-port-list) "\\>") nil t)))
15472 (re-search-forward "^begin\\>" nil) 15899 (re-search-forward "^begin\\>" nil)
15473 (beginning-of-line) 15900 (beginning-of-line)
15474 (skip-chars-backward " \t\n") 15901 (skip-chars-backward " \t\n\r\f")
15475 (insert "\n\n") (indent-to vhdl-basic-offset) 15902 (insert "\n\n") (indent-to vhdl-basic-offset)
15476 (vhdl-port-paste-component t)) 15903 (vhdl-port-paste-component t))
15477 ;; place component instantiation 15904 ;; place component instantiation
15478 (re-search-forward "^end\\>" nil) 15905 (re-search-forward "^end\\>" nil)
15479 (beginning-of-line) 15906 (beginning-of-line)
15480 (skip-chars-backward " \t\n") 15907 (skip-chars-backward " \t\n\r\f")
15481 (insert "\n\n") (indent-to vhdl-basic-offset) 15908 (insert "\n\n") (indent-to vhdl-basic-offset)
15482 (vhdl-port-paste-instance nil t t) 15909 (vhdl-port-paste-instance nil t t)
15483 ;; place use clause for used packages 15910 ;; place use clause for used packages
@@ -15486,7 +15913,7 @@ component instantiation."
15486 (when (file-exists-p ent-file-name) 15913 (when (file-exists-p ent-file-name)
15487 (find-file ent-file-name)) 15914 (find-file ent-file-name))
15488 (goto-char (point-min)) 15915 (goto-char (point-min))
15489 (unless (re-search-forward (concat "^entity[ \t\n]+" ent-name "[ \t\n]+is\\>") nil t) 15916 (unless (re-search-forward (concat "^entity[ \t\n\r\f]+" ent-name "[ \t\n\r\f]+is\\>") nil t)
15490 (error "ERROR: Entity not found: \"%s\"" ent-name)) 15917 (error "ERROR: Entity not found: \"%s\"" ent-name))
15491 (goto-char (match-beginning 0)) 15918 (goto-char (match-beginning 0))
15492 (if (and (save-excursion 15919 (if (and (save-excursion
@@ -15505,8 +15932,8 @@ component instantiation."
15505 (interactive) 15932 (interactive)
15506 (save-excursion 15933 (save-excursion
15507 (vhdl-prepare-search-2 15934 (vhdl-prepare-search-2
15508 (unless (or (re-search-backward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t) 15935 (unless (or (re-search-backward "^architecture[ \t\n\r\f]+\\w+[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t)
15509 (re-search-forward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)) 15936 (re-search-forward "^architecture[ \t\n\r\f]+\\w+[ \t\n\r\f]+of[ \t\n\r\f]+\\(\\w+\\)[ \t\n\r\f]+is\\>" nil t))
15510 (error "ERROR: No architecture found")) 15937 (error "ERROR: No architecture found"))
15511 (let* ((ent-name (match-string 1)) 15938 (let* ((ent-name (match-string 1))
15512 (ent-file-name 15939 (ent-file-name
@@ -15532,11 +15959,11 @@ component instantiation."
15532 ;; process all instances 15959 ;; process all instances
15533 (goto-char arch-stat-pos) 15960 (goto-char arch-stat-pos)
15534 (while (re-search-forward 15961 (while (re-search-forward
15535 (concat "^[ \t]*\\(\\w+\\)[ \t\n]*:[ \t\n]*\\(" 15962 (concat "^[ \t]*\\(\\w+\\)[ \t\n\r\f]*:[ \t\n\r\f]*\\("
15536 "\\(component[ \t\n]+\\)?\\(\\w+\\)" 15963 "\\(component[ \t\n\r\f]+\\)?\\(\\w+\\)"
15537 "[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(\\(generic\\)\\|port\\)[ \t\n]+map\\|" 15964 "[ \t\n\r\f]+\\(--[^\n]*\n[ \t\n\r\f]*\\)*\\(\\(generic\\)\\|port\\)[ \t\n\r\f]+map\\|"
15538 "\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?" 15965 "\\(\\(entity\\)\\|configuration\\)[ \t\n\r\f]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n\r\f]*(\\(\\w+\\))\\)?"
15539 "[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(\\(generic\\)\\|port\\)[ \t\n]+map\\)[ \t\n]*(") arch-end-pos t) 15966 "[ \t\n\r\f]+\\(--[^\n]*\n[ \t\n\r\f]*\\)*\\(\\(generic\\)\\|port\\)[ \t\n\r\f]+map\\)[ \t\n\r\f]*(") arch-end-pos t)
15540 (setq inst-name (match-string-no-properties 1) 15967 (setq inst-name (match-string-no-properties 1)
15541 comp-name (match-string-no-properties 4) 15968 comp-name (match-string-no-properties 4)
15542 comp-ent-name (match-string-no-properties 12) 15969 comp-ent-name (match-string-no-properties 12)
@@ -15548,7 +15975,7 @@ component instantiation."
15548 (when vhdl-use-components-package pack-file-name) t 15975 (when vhdl-use-components-package pack-file-name) t
15549 (save-excursion 15976 (save-excursion
15550 (goto-char (point-min)) 15977 (goto-char (point-min))
15551 (unless (re-search-forward (concat "^\\s-*component[ \t\n]+" comp-name "\\>") nil t) 15978 (unless (re-search-forward (concat "^\\s-*component[ \t\n\r\f]+" comp-name "\\>") nil t)
15552 (error "ERROR: Component declaration not found: \"%s\"" comp-name)) 15979 (error "ERROR: Component declaration not found: \"%s\"" comp-name))
15553 (vhdl-port-copy))) 15980 (vhdl-port-copy)))
15554 ;; ... from entity declaration (direct instantiation) 15981 ;; ... from entity declaration (direct instantiation)
@@ -15559,7 +15986,7 @@ component instantiation."
15559 comp-ent-file-name t 15986 comp-ent-file-name t
15560 (save-excursion 15987 (save-excursion
15561 (goto-char (point-min)) 15988 (goto-char (point-min))
15562 (unless (re-search-forward (concat "^\\s-*entity[ \t\n]+" comp-ent-name "\\>") nil t) 15989 (unless (re-search-forward (concat "^\\s-*entity[ \t\n\r\f]+" comp-ent-name "\\>") nil t)
15563 (error "ERROR: Entity declaration not found: \"%s\"" comp-ent-name)) 15990 (error "ERROR: Entity declaration not found: \"%s\"" comp-ent-name))
15564 (vhdl-port-copy)))) 15991 (vhdl-port-copy))))
15565 (vhdl-port-flatten t) 15992 (vhdl-port-flatten t)
@@ -15571,7 +15998,7 @@ component instantiation."
15571 (when has-generic 15998 (when has-generic
15572 ;; process all constants in generic map 15999 ;; process all constants in generic map
15573 (vhdl-forward-syntactic-ws) 16000 (vhdl-forward-syntactic-ws)
15574 (while (vhdl-parse-string "\\(\\(\\w+\\)[ \t\n]*=>[ \t\n]*\\)?\\(\\w+\\),?" t) 16001 (while (vhdl-parse-string "\\(\\(\\w+\\)[ \t\n\r\f]*=>[ \t\n\r\f]*\\)?\\(\\w+\\),?" t)
15575 (setq constant-name (match-string-no-properties 3)) 16002 (setq constant-name (match-string-no-properties 3))
15576 (setq constant-entry 16003 (setq constant-entry
15577 (cons constant-name 16004 (cons constant-name
@@ -15589,10 +16016,10 @@ component instantiation."
15589 (unless (match-string 1) 16016 (unless (match-string 1)
15590 (setq generic-alist (cdr generic-alist))) 16017 (setq generic-alist (cdr generic-alist)))
15591 (vhdl-forward-syntactic-ws)) 16018 (vhdl-forward-syntactic-ws))
15592 (vhdl-re-search-forward "\\<port\\s-+map[ \t\n]*(" nil t)) 16019 (vhdl-re-search-forward "\\<port\\s-+map[ \t\n\r\f]*(" nil t))
15593 ;; process all signals in port map 16020 ;; process all signals in port map
15594 (vhdl-forward-syntactic-ws) 16021 (vhdl-forward-syntactic-ws)
15595 (while (vhdl-parse-string "\\(\\(\\w+\\)[ \t\n]*=>[ \t\n]*\\)?\\(\\w+\\),?" t) 16022 (while (vhdl-parse-string "\\(\\(\\w+\\)[ \t\n\r\f]*=>[ \t\n\r\f]*\\)?\\(\\w+\\),?" t)
15596 (setq signal-name (match-string-no-properties 3)) 16023 (setq signal-name (match-string-no-properties 3))
15597 (setq signal-entry (cons signal-name 16024 (setq signal-entry (cons signal-name
15598 (if (match-string 1) 16025 (if (match-string 1)
@@ -15638,7 +16065,7 @@ component instantiation."
15638 ;; prepare signal insertion 16065 ;; prepare signal insertion
15639 (vhdl-goto-marker arch-decl-pos) 16066 (vhdl-goto-marker arch-decl-pos)
15640 (forward-line 1) 16067 (forward-line 1)
15641 (re-search-forward "^\\s-*-- Internal signal declarations[ \t\n]*-*\n" arch-stat-pos t) 16068 (re-search-forward "^\\s-*-- Internal signal declarations[ \t\n\r\f]*-*\n" arch-stat-pos t)
15642 (setq signal-pos (point-marker)) 16069 (setq signal-pos (point-marker))
15643 (while (progn (vhdl-forward-syntactic-ws) 16070 (while (progn (vhdl-forward-syntactic-ws)
15644 (looking-at "signal\\>")) 16071 (looking-at "signal\\>"))
@@ -15649,10 +16076,10 @@ component instantiation."
15649 (when (file-exists-p ent-file-name) 16076 (when (file-exists-p ent-file-name)
15650 (find-file ent-file-name)) 16077 (find-file ent-file-name))
15651 (goto-char (point-min)) 16078 (goto-char (point-min))
15652 (unless (re-search-forward (concat "^entity[ \t\n]+" ent-name "[ \t\n]+is\\>") nil t) 16079 (unless (re-search-forward (concat "^entity[ \t\n\r\f]+" ent-name "[ \t\n\r\f]+is\\>") nil t)
15653 (error "ERROR: Entity not found: \"%s\"" ent-name)) 16080 (error "ERROR: Entity not found: \"%s\"" ent-name))
15654 ;; prepare generic clause insertion 16081 ;; prepare generic clause insertion
15655 (unless (and (re-search-forward "\\(^\\s-*generic[ \t\n]*(\\)\\|^end\\>" nil t) 16082 (unless (and (re-search-forward "\\(^\\s-*generic[ \t\n\r\f]*(\\)\\|^end\\>" nil t)
15656 (match-string 1)) 16083 (match-string 1))
15657 (goto-char (match-beginning 0)) 16084 (goto-char (match-beginning 0))
15658 (indent-to vhdl-basic-offset) 16085 (indent-to vhdl-basic-offset)
@@ -15670,7 +16097,7 @@ component instantiation."
15670 (setq generic-beg-pos (point-marker) generic-pos (point-marker) 16097 (setq generic-beg-pos (point-marker) generic-pos (point-marker)
15671 generic-inst-pos (point-marker) generic-end-pos (point-marker)) 16098 generic-inst-pos (point-marker) generic-end-pos (point-marker))
15672 ;; prepare port clause insertion 16099 ;; prepare port clause insertion
15673 (unless (and (re-search-forward "\\(^\\s-*port[ \t\n]*(\\)\\|^end\\>" nil t) 16100 (unless (and (re-search-forward "\\(^\\s-*port[ \t\n\r\f]*(\\)\\|^end\\>" nil t)
15674 (match-string 1)) 16101 (match-string 1))
15675 (goto-char (match-beginning 0)) 16102 (goto-char (match-beginning 0))
15676 (indent-to vhdl-basic-offset) 16103 (indent-to vhdl-basic-offset)
@@ -15894,7 +16321,8 @@ current project/directory."
15894 (message "Generating components package \"%s\"...done\n File created: \"%s\"" 16321 (message "Generating components package \"%s\"...done\n File created: \"%s\""
15895 pack-name pack-file-name))) 16322 pack-name pack-file-name)))
15896 16323
15897(defun vhdl-compose-configuration-architecture (ent-name arch-name inst-alist 16324(defun vhdl-compose-configuration-architecture (ent-name arch-name ent-alist
16325 conf-alist inst-alist
15898 &optional insert-conf) 16326 &optional insert-conf)
15899 "Generate block configuration for architecture." 16327 "Generate block configuration for architecture."
15900 (let ((margin (current-indentation)) 16328 (let ((margin (current-indentation))
@@ -15970,7 +16398,7 @@ current project/directory."
15970 (nth 3 ent-entry)) 16398 (nth 3 ent-entry))
15971 (indent-to (+ margin vhdl-basic-offset)) 16399 (indent-to (+ margin vhdl-basic-offset))
15972 (vhdl-compose-configuration-architecture 16400 (vhdl-compose-configuration-architecture
15973 (nth 0 ent-entry) arch-name 16401 (nth 0 ent-entry) arch-name ent-alist conf-alist
15974 (nth 3 (aget (nth 3 ent-entry) (downcase arch-name) t)))))) 16402 (nth 3 (aget (nth 3 ent-entry) (downcase arch-name) t))))))
15975 ;; insert component configuration end 16403 ;; insert component configuration end
15976 (indent-to margin) 16404 (indent-to margin)
@@ -16052,7 +16480,8 @@ current project/directory."
16052 (vhdl-insert-keyword " IS\n") 16480 (vhdl-insert-keyword " IS\n")
16053 (indent-to vhdl-basic-offset) 16481 (indent-to vhdl-basic-offset)
16054 ;; insert block configuration (for architecture) 16482 ;; insert block configuration (for architecture)
16055 (vhdl-compose-configuration-architecture ent-name arch-name inst-alist t) 16483 (vhdl-compose-configuration-architecture
16484 ent-name arch-name ent-alist conf-alist inst-alist t)
16056 (vhdl-insert-keyword "END ") (insert conf-name ";") 16485 (vhdl-insert-keyword "END ") (insert conf-name ";")
16057 (when conf-file-name 16486 (when conf-file-name
16058 ;; insert footer and save 16487 ;; insert footer and save
@@ -16072,6 +16501,9 @@ current project/directory."
16072;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 16501;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16073;; (using `compile.el') 16502;; (using `compile.el')
16074 16503
16504(defvar vhdl-compile-post-command ""
16505 "String appended to compile command after file name.")
16506
16075(defun vhdl-makefile-name () 16507(defun vhdl-makefile-name ()
16076 "Return the Makefile name of the current project or the current compiler if 16508 "Return the Makefile name of the current project or the current compiler if
16077no project is defined." 16509no project is defined."
@@ -16226,9 +16658,11 @@ do not print any file names."
16226 (compiler (or (aget vhdl-compiler-alist vhdl-compiler nil) 16658 (compiler (or (aget vhdl-compiler-alist vhdl-compiler nil)
16227 (error "ERROR: No such compiler: \"%s\"" vhdl-compiler))) 16659 (error "ERROR: No such compiler: \"%s\"" vhdl-compiler)))
16228 (command (nth 0 compiler)) 16660 (command (nth 0 compiler))
16229 (file-name (buffer-file-name))
16230 (options (vhdl-get-compile-options project compiler file-name))
16231 (default-directory (vhdl-compile-directory)) 16661 (default-directory (vhdl-compile-directory))
16662 (file-name (if vhdl-compile-absolute-path
16663 (buffer-file-name)
16664 (file-relative-name (buffer-file-name))))
16665 (options (vhdl-get-compile-options project compiler file-name))
16232 compilation-process-setup-function) 16666 compilation-process-setup-function)
16233 (unless (file-directory-p default-directory) 16667 (unless (file-directory-p default-directory)
16234 (error "ERROR: Compile directory does not exist: \"%s\"" default-directory)) 16668 (error "ERROR: Compile directory does not exist: \"%s\"" default-directory))
@@ -16236,14 +16670,18 @@ do not print any file names."
16236 (when (string-match " " file-name) 16670 (when (string-match " " file-name)
16237 (setq file-name (concat "\"" file-name "\""))) 16671 (setq file-name (concat "\"" file-name "\"")))
16238 ;; print out file name if compiler does not 16672 ;; print out file name if compiler does not
16239 (setq vhdl-compile-file-name (buffer-file-name)) 16673 (setq vhdl-compile-file-name (if vhdl-compile-absolute-path
16674 (buffer-file-name)
16675 (file-relative-name (buffer-file-name))))
16240 (when (and (= 0 (nth 1 (nth 10 compiler))) 16676 (when (and (= 0 (nth 1 (nth 10 compiler)))
16241 (= 0 (nth 1 (nth 11 compiler)))) 16677 (= 0 (nth 1 (nth 11 compiler))))
16242 (setq compilation-process-setup-function 'vhdl-compile-print-file-name)) 16678 (setq compilation-process-setup-function 'vhdl-compile-print-file-name))
16243 ;; run compilation 16679 ;; run compilation
16244 (if options 16680 (if options
16245 (when command 16681 (when command
16246 (compile (concat command " " options " " file-name))) 16682 (compile (concat command " " options " " file-name
16683 (unless (equal vhdl-compile-post-command "")
16684 (concat " " vhdl-compile-post-command)))))
16247 (vhdl-warning "Your project settings tell me not to compile this file")))) 16685 (vhdl-warning "Your project settings tell me not to compile this file"))))
16248 16686
16249(defvar vhdl-make-target "all" 16687(defvar vhdl-make-target "all"
@@ -16551,6 +16989,8 @@ specified by a target."
16551 (insert "\n\n# Define compilation command and options\n" 16989 (insert "\n\n# Define compilation command and options\n"
16552 "\nCOMPILE = " (nth 0 compiler) 16990 "\nCOMPILE = " (nth 0 compiler)
16553 "\nOPTIONS = " (vhdl-get-compile-options project compiler nil) 16991 "\nOPTIONS = " (vhdl-get-compile-options project compiler nil)
16992 (if (equal vhdl-compile-post-command "") ""
16993 (concat "\nPOST-COMPILE = " vhdl-compile-post-command))
16554 "\n") 16994 "\n")
16555 ;; insert library paths 16995 ;; insert library paths
16556 (setq library-directory 16996 (setq library-directory
@@ -16580,16 +17020,16 @@ specified by a target."
16580 (setq unit-list tmp-list) 17020 (setq unit-list tmp-list)
16581 ;; insert `make all' rule 17021 ;; insert `make all' rule
16582 (insert "\n\n\n# Rule for compiling entire design\n" 17022 (insert "\n\n\n# Rule for compiling entire design\n"
16583 "\nall :" 17023 "\n" (nth 0 vhdl-makefile-default-targets) " :"
16584 " \\\n\t\tlibrary" 17024 " \\\n\t\t" (nth 2 vhdl-makefile-default-targets)
16585 " \\\n\t\t$(ALL_UNITS)\n") 17025 " \\\n\t\t$(ALL_UNITS)\n")
16586 ;; insert `make clean' rule 17026 ;; insert `make clean' rule
16587 (insert "\n\n# Rule for cleaning entire design\n" 17027 (insert "\n\n# Rule for cleaning entire design\n"
16588 "\nclean : " 17028 "\n" (nth 1 vhdl-makefile-default-targets) " : "
16589 "\n\t-rm -f $(ALL_UNITS)\n") 17029 "\n\t-rm -f $(ALL_UNITS)\n")
16590 ;; insert `make library' rule 17030 ;; insert `make library' rule
16591 (insert "\n\n# Rule for creating library directory\n" 17031 (insert "\n\n# Rule for creating library directory\n"
16592 "\nlibrary :" 17032 "\n" (nth 2 vhdl-makefile-default-targets) " :"
16593 " \\\n\t\t$(LIBRARY-" work-library ")\n" 17033 " \\\n\t\t$(LIBRARY-" work-library ")\n"
16594 "\n$(LIBRARY-" work-library ") :" 17034 "\n$(LIBRARY-" work-library ") :"
16595 "\n\t" 17035 "\n\t"
@@ -16597,6 +17037,11 @@ specified by a target."
16597 (cons "\\(.*\\)\n\\(.*\\)" (nth 5 compiler)) 17037 (cons "\\(.*\\)\n\\(.*\\)" (nth 5 compiler))
16598 (concat "$(LIBRARY-" work-library ")\n" (vhdl-work-library))) 17038 (concat "$(LIBRARY-" work-library ")\n" (vhdl-work-library)))
16599 "\n") 17039 "\n")
17040 ;; insert '.PHONY' declaration
17041 (insert "\n\n.PHONY : "
17042 (nth 0 vhdl-makefile-default-targets) " "
17043 (nth 1 vhdl-makefile-default-targets) " "
17044 (nth 2 vhdl-makefile-default-targets) "\n")
16600 ;; insert rule for each library unit 17045 ;; insert rule for each library unit
16601 (insert "\n\n# Rules for compiling single library units and their subhierarchy\n") 17046 (insert "\n\n# Rules for compiling single library units and their subhierarchy\n")
16602 (while prim-list 17047 (while prim-list
@@ -16611,7 +17056,7 @@ specified by a target."
16611 (unless (equal unit-key unit-name) 17056 (unless (equal unit-key unit-name)
16612 (insert " \\\n" unit-name)) 17057 (insert " \\\n" unit-name))
16613 (insert " :" 17058 (insert " :"
16614 " \\\n\t\tlibrary" 17059 " \\\n\t\t" (nth 2 vhdl-makefile-default-targets)
16615 " \\\n\t\t$(UNIT-" work-library "-" unit-key ")") 17060 " \\\n\t\t$(UNIT-" work-library "-" unit-key ")")
16616 (while second-list 17061 (while second-list
16617 (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")") 17062 (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")")
@@ -16653,7 +17098,9 @@ specified by a target."
16653 (if options 17098 (if options
16654 (insert "\n\t$(COMPILE) " 17099 (insert "\n\t$(COMPILE) "
16655 (if (eq options 'default) "$(OPTIONS)" options) " " 17100 (if (eq options 'default) "$(OPTIONS)" options) " "
16656 (nth 0 rule) "\n") 17101 (nth 0 rule)
17102 (if (equal vhdl-compile-post-command "") ""
17103 " $(POST-COMPILE)") "\n")
16657 (setq tmp-list target-list) 17104 (setq tmp-list target-list)
16658 (while target-list 17105 (while target-list
16659 (insert "\n\t@touch $(UNIT-" work-library "-" (car target-list) ")" 17106 (insert "\n\t@touch $(UNIT-" work-library "-" (car target-list) ")"
@@ -16712,6 +17159,7 @@ specified by a target."
16712 'vhdl-compiler-alist 17159 'vhdl-compiler-alist
16713 'vhdl-compiler 17160 'vhdl-compiler
16714 'vhdl-compile-use-local-error-regexp 17161 'vhdl-compile-use-local-error-regexp
17162 'vhdl-makefile-default-targets
16715 'vhdl-makefile-generation-hook 17163 'vhdl-makefile-generation-hook
16716 'vhdl-default-library 17164 'vhdl-default-library
16717 'vhdl-standard 17165 'vhdl-standard
@@ -16722,6 +17170,7 @@ specified by a target."
16722 'vhdl-upper-case-enum-values 17170 'vhdl-upper-case-enum-values
16723 'vhdl-upper-case-constants 17171 'vhdl-upper-case-constants
16724 'vhdl-use-direct-instantiation 17172 'vhdl-use-direct-instantiation
17173 'vhdl-array-index-record-field-in-sensitivity-list
16725 'vhdl-compose-configuration-name 17174 'vhdl-compose-configuration-name
16726 'vhdl-entity-file-name 17175 'vhdl-entity-file-name
16727 'vhdl-architecture-file-name 17176 'vhdl-architecture-file-name
@@ -16812,6 +17261,7 @@ specified by a target."
16812 'vhdl-print-customize-faces 17261 'vhdl-print-customize-faces
16813 'vhdl-intelligent-tab 17262 'vhdl-intelligent-tab
16814 'vhdl-indent-syntax-based 17263 'vhdl-indent-syntax-based
17264 'vhdl-indent-comment-like-next-code-line
16815 'vhdl-word-completion-case-sensitive 17265 'vhdl-word-completion-case-sensitive
16816 'vhdl-word-completion-in-minibuffer 17266 'vhdl-word-completion-in-minibuffer
16817 'vhdl-underscore-is-part-of-word 17267 'vhdl-underscore-is-part-of-word
@@ -16851,6 +17301,17 @@ CONFIGURATION DECLARATION GENERATION:
16851 (See documentation (`C-c C-h') in section on STRUCTURAL COMPOSITION.) 17301 (See documentation (`C-c C-h') in section on STRUCTURAL COMPOSITION.)
16852 17302
16853 17303
17304Key Bindings
17305------------
17306
17307For Emacs compliance the following key bindings have been changed:
17308
17309- `C-c c' -> `C-c C-c' `vhdl-comment-uncomment-region'
17310- `C-c f' -> `C-c C-i C-f' `vhdl-fontify-buffer'
17311- `C-c s' -> `C-c C-i C-s' `vhdl-statistics-buffer'
17312- `C-c C-c ...' -> `C-c C-m ...' `vhdl-compose-...'
17313
17314
16854User Options 17315User Options
16855------------ 17316------------
16856 17317
@@ -16864,6 +17325,12 @@ User Options
16864 Specify whether hierarchical configurations should be created. 17325 Specify whether hierarchical configurations should be created.
16865`vhdl-compose-configuration-use-subconfiguration': (new) 17326`vhdl-compose-configuration-use-subconfiguration': (new)
16866 Specify whether subconfigurations should be used inside configurations. 17327 Specify whether subconfigurations should be used inside configurations.
17328`vhdl-makefile-default-targets': (new)
17329 Customize names of Makefile default targets.
17330`vhdl-indent-comment-like-next-code-line': (new)
17331 Specify whether comment lines are indented like following code line.
17332`vhdl-array-index-record-field-in-sensitivity-list': (new)
17333 Specify whether to include array indices / record fields in sensitivity list.
16867") 17334")
16868 17335
16869 17336
@@ -16872,19 +17339,20 @@ User Options
16872Reserved words in VHDL 17339Reserved words in VHDL
16873---------------------- 17340----------------------
16874 17341
16875VHDL'93 (IEEE Std 1076-1993): 17342VHDL'93/02 (IEEE Std 1076-1993/2002):
16876 `vhdl-93-keywords' : keywords 17343 `vhdl-02-keywords' : keywords
16877 `vhdl-93-types' : standardized types 17344 `vhdl-02-types' : standardized types
16878 `vhdl-93-attributes' : standardized attributes 17345 `vhdl-02-attributes' : standardized attributes
16879 `vhdl-93-enum-values' : standardized enumeration values 17346 `vhdl-02-enum-values' : standardized enumeration values
16880 `vhdl-93-functions' : standardized functions 17347 `vhdl-02-functions' : standardized functions
16881 `vhdl-93-packages' : standardized packages and libraries 17348 `vhdl-02-packages' : standardized packages and libraries
16882 17349
16883VHDL-AMS (IEEE Std 1076.1): 17350VHDL-AMS (IEEE Std 1076.1 / 1076.1.1):
16884 `vhdl-ams-keywords' : keywords 17351 `vhdl-ams-keywords' : keywords
16885 `vhdl-ams-types' : standardized types 17352 `vhdl-ams-types' : standardized types
16886 `vhdl-ams-attributes' : standardized attributes 17353 `vhdl-ams-attributes' : standardized attributes
16887 `vhdl-ams-enum-values' : standardized enumeration values 17354 `vhdl-ams-enum-values' : standardized enumeration values
17355 `vhdl-ams-constants' : standardized constants
16888 `vhdl-ams-functions' : standardized functions 17356 `vhdl-ams-functions' : standardized functions
16889 17357
16890Math Packages (IEEE Std 1076.2): 17358Math Packages (IEEE Std 1076.2):