Mercurial > emacs
annotate lisp/progmodes/vhdl-mode.el @ 44443:9e6f2afa9f19
(sgml-comment-indent-new-line): New fun.
(sgml-mode): Use it for comment-line-break-function.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 08 Apr 2002 21:32:05 +0000 |
parents | 048fa049ccba |
children | 93c6c36e6a0d |
rev | line source |
---|---|
20665 | 1 ;;; vhdl-mode.el --- major mode for editing VHDL code |
2 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3 ;; Copyright (C) 1992,93,94,95,96,97,98,99 Free Software Foundation, Inc. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5 ;; Authors: Reto Zimmermann <mailto:Reto.Zimmermann@iaeth.ch> |
20665 | 6 ;; <http://www.iis.ee.ethz.ch/~zimmi/> |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7 ;; Rodney J. Whitby <mailto:rwhitby@geocities.com> |
20665 | 8 ;; <http://www.geocities.com/SiliconValley/Park/8287/> |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9 ;; Maintainer: VHDL Mode Maintainers <vhdl-mode@geocities.com> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10 ;; <http://www.geocities.com/SiliconValley/Peaks/8287/> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
11 ;; Version: 3.29 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
12 ;; Keywords: languages vhdl |
20665 | 13 |
14 ;; This file is part of GNU Emacs. | |
15 | |
16 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
17 ;; it under the terms of the GNU General Public License as published by | |
18 ;; the Free Software Foundation; either version 2, or (at your option) | |
19 ;; any later version. | |
20 | |
21 ;; GNU Emacs is distributed in the hope that it will be useful, | |
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
24 ;; GNU General Public License for more details. | |
25 | |
26 ;; You should have received a copy of the GNU General Public License | |
27 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
28 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
29 ;; Boston, MA 02111-1307, USA. | |
30 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 32 ;;; Commentary: |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
33 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 34 |
35 ;; This package provides an Emacs major mode for editing VHDL code. | |
36 ;; It includes the following features: | |
37 | |
38 ;; - Highlighting of VHDL syntax | |
39 ;; - Indentation based on versatile syntax analysis | |
40 ;; - Template insertion (electrification) for most VHDL constructs | |
41 ;; - Insertion of customizable VHDL file headers | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
42 ;; - Insertion of user-specified models |
20665 | 43 ;; - Word completion (dynamic abbreviations) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
44 ;; - Comprehensive menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
45 ;; - File browser (using Speedbar or index/sources menu) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
46 ;; - Design hierarchy browser (using Speedbar) |
20665 | 47 ;; - Source file compilation (syntax analysis) |
48 ;; - Postscript printing with fontification | |
49 ;; - Lower and upper case keywords | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
50 ;; - Hiding code of design units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
51 ;; - Code beautification |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
52 ;; - Port translation and test bench generation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
53 ;; - VHDL'87/'93 and VHDL-AMS supported |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
54 ;; - Fully customizable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
55 ;; - Works under GNU Emacs (Unix and Windows NT/95) and XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
56 ;; (GNU Emacs is preferred due to higher robustness and functionality) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
57 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
58 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 59 ;; Usage |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
60 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
61 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
62 ;; see below (comment in `vhdl-mode' function) or type `C-c C-h' in Emacs. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
63 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
64 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 65 ;; Emacs Versions |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
66 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
67 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
68 ;; supported: Emacs 20.X (Unix and Windows NT/95), XEmacs 20.X |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
69 ;; tested on: Emacs 20.3, XEmacs 20.4 (marginally) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
70 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
71 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 72 ;; Acknowledgements |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 74 |
75 ;; Electrification ideas by Bob Pack <rlpst@cislabs.pitt.edu> | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
76 ;; and Steve Grout. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
77 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
78 ;; Fontification approach suggested by Ken Wood <ken@eda.com.au>. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
79 ;; Ideas about alignment from John Wiegley <johnw@borland.com>. |
20665 | 80 |
81 ;; Many thanks to all the users who sent me bug reports and enhancement | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
82 ;; requests. Colin Marquardt, will you never stop asking for new features :-? |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
83 ;; Thanks to Dan Nicolaescu for reviewing the code and for his valuable hints. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
84 ;; Thanks to Ulf Klaperski for the indentation speedup hint. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
85 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
86 ;; Special thanks go to Wolfgang Fichtner and the crew from the Integrated |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
87 ;; Systems Laboratory, Swiss Federal Institute of Technology Zurich, for |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
88 ;; giving me the opportunity to develop this code. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
89 ;; This work has been funded in part by MICROSWISS, a Microelectronics Program |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
90 ;; of the Swiss Government. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
91 |
20665 | 92 |
93 ;;; Code: | |
94 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
95 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
96 ;;; Variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
97 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
98 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
99 ;; help function |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
100 (defun vhdl-custom-set (variable value &rest functions) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
101 "Set variables as in `custom-set-default' and call FUNCTIONS afterwards." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
102 (if (fboundp 'custom-set-default) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
103 (custom-set-default variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
104 (set-default variable value)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
105 (while functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
106 (when (fboundp (car functions)) (funcall (car functions))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
107 (setq functions (cdr functions)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
108 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
109 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
110 ;; User variables |
20665 | 111 |
112 (defgroup vhdl nil | |
113 "Customizations for VHDL Mode." | |
114 :prefix "vhdl-" | |
21651
86fcccceba7b
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
21466
diff
changeset
|
115 :group 'languages |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
116 :version "20.4" ; comment out for XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
117 ) |
20665 | 118 |
119 (defgroup vhdl-mode nil | |
120 "Customizations for modes." | |
121 :group 'vhdl) | |
122 | |
123 (defcustom vhdl-electric-mode t | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
124 "*Non-nil enables electrification (automatic template generation). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
125 If nil, template generators can still be invoked through key bindings and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
126 menu. Is indicated in the modeline by `/e' after the mode name and can be |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
127 toggled by `\\[vhdl-electric-mode]'." |
20665 | 128 :type 'boolean |
129 :group 'vhdl-mode) | |
130 | |
131 (defcustom vhdl-stutter-mode t | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
132 "*Non-nil enables stuttering. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
133 Is indicated in the modeline by `/s' after the mode name and can be toggled |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
134 by `\\[vhdl-stutter-mode]'." |
20665 | 135 :type 'boolean |
136 :group 'vhdl-mode) | |
137 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
138 (defcustom vhdl-indent-tabs-mode nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
139 "*Non-nil means indentation can insert tabs. |
20665 | 140 Overrides local variable `indent-tabs-mode'." |
141 :type 'boolean | |
142 :group 'vhdl-mode) | |
143 | |
144 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
145 (defgroup vhdl-project nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
146 "Customizations for projects." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
147 :group 'vhdl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
148 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
149 (defcustom vhdl-project-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
150 '(("example 1" "Project with individual source files" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
151 ("~/example1/vhdl/system.vhd" "~/example1/vhdl/component_*.vhd") "\ |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
152 ------------------------------------------------------------------------------- |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
153 -- This is a multi-line project description |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
154 -- that can be used as a project dependent part of the file header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
155 ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
156 ("example 2" "Project where source files are located in two directories" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
157 ("$EXAMPLE2/vhdl/components/" "$EXAMPLE2/vhdl/system/") "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
158 ("example 3" "Project where source files are located in some directory trees" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
159 ("-r ~/example3/*/vhdl/") "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
160 "*List of projects and their properties. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
161 Name : name of project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
162 Title : title of project (one-line string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
163 Sources : a) source files : path + \"/\" + file name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
164 b) directory : path + \"/\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
165 c) directory tree: \"-r \" + path + \"/\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
166 Description: description of project (multi-line string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
167 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
168 Project name and description are used to insert into the file header (see |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
169 variable `vhdl-file-header'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
170 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
171 Path and file name can contain wildcards `*' and `?'. Environment variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
172 \(e.g. \"$EXAMPLE2\") are resolved. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
173 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
174 The hierarchy browser shows the hierarchy of the design units found in |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
175 `Sources'. If no directories or files are specified, the current directory is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
176 shown. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
177 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
178 NOTE: Reflect the new setting in the choice list of variable `vhdl-project' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
179 by restarting Emacs." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
180 :type '(repeat (list :tag "Project" :indent 2 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
181 (string :tag "Name ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
182 (string :tag "Title") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
183 (repeat :tag "Sources" :indent 4 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
184 (string :format "%v")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
185 (string :tag "Description: (type `C-j' for newline)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
186 :format "%t\n%v"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
187 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
188 (vhdl-custom-set variable value 'vhdl-update-mode-menu)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
189 :group 'vhdl-project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
190 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
191 (defcustom vhdl-project "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
192 "*Specifies the default for the current project. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
193 Select a project name from the ones defined in variable `vhdl-project-alist'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
194 Is used to determine the project title and description to be inserted in file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
195 headers and the source files/directories to be scanned in the hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
196 browser. The current project can also be changed temporarily in the menu." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
197 :type (let ((project-alist vhdl-project-alist) choice-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
198 (while project-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
199 (setq choice-list (cons (list 'const (car (car project-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
200 choice-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
201 (setq project-alist (cdr project-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
202 (append '(choice (const :tag "None" "") (const :tag "--")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
203 (nreverse choice-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
204 :group 'vhdl-project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
205 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
206 |
20665 | 207 (defgroup vhdl-compile nil |
208 "Customizations for compilation." | |
209 :group 'vhdl) | |
210 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
211 (defcustom vhdl-compiler-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
212 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
213 ;; Cadence Design Systems: cv -file test.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
214 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
215 ("Cadence" "cv -file" "" "" "./" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
216 ("duluth: \\*E,[0-9]+ (\\(.+\\),\\([0-9]+\\)):" 1 2) ("" 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
217 ;; Ikos Voyager: analyze test.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
218 ;; analyze sdrctl.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
219 ;; E L4/C5: this library unit is inaccessible |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
220 ("Ikos" "analyze" "" "" "./" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
221 ("E L\\([0-9]+\\)/C[0-9]+:" 0 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
222 ("^analyze +\\(.+ +\\)*\\(.+\\)$" 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
223 ;; ModelSim, Model Technology: vcom test.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
224 ;; ERROR: test.vhd(14): Unknown identifier: positiv |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
225 ;; WARNING[2]: test.vhd(85): Possible infinite loop |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
226 ("ModelSim" "vcom" "" "vmake > Makefile" "./" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
227 ("\\(ERROR\\|WARNING\\)[^:]*: \\(.+\\)(\\([0-9]+\\)):" 2 3) ("" 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
228 ;; QuickHDL, Mentor Graphics: qvhcom test.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
229 ;; ERROR: test.vhd(24): near "dnd": expecting: END |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
230 ;; WARNING[4]: test.vhd(30): A space is required between ... |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
231 ("QuickHDL" "qvhcom" "" "qhmake >! Makefile" "./" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
232 ("\\(ERROR\\|WARNING\\)[^:]*: \\(.+\\)(\\([0-9]+\\)):" 2 3) ("" 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
233 ;; Synopsys, VHDL Analyzer: vhdlan test.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
234 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
235 ("Synopsys" "vhdlan" "" "" "./" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
236 ("\\*\\*Error: vhdlan,[0-9]+ \\(.+\\)(\\([0-9]+\\)):" 1 2) ("" 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
237 ;; Vantage: analyze -libfile vsslib.ini -src test.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
238 ;; Compiling "pcu.vhd" line 1... |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
239 ;; **Error: LINE 499 *** No aggregate value is valid in this context. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
240 ("Vantage" "analyze -libfile vsslib.ini -src" "" "" "./" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
241 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
242 ("^ *Compiling \"\\(.+\\)\" " 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
243 ;; Viewlogic: analyze -libfile vsslib.ini -src test.vhd |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
244 ;; Compiling "pcu.vhd" line 1... |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
245 ;; **Error: LINE 499 *** No aggregate value is valid in this context. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
246 ("Viewlogic" "analyze -libfile vsslib.ini -src" "" "" "./" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
247 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
248 ("^ *Compiling \"\\(.+\\)\" " 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
249 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
250 "*List of available VHDL compilers and their properties. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
251 Each list entry specifies the following items for a compiler: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
252 Compiler: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
253 Compiler Name : name used in variable `vhdl-compiler' to choose compiler |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
254 Compile Command : command including options used for syntax analysis |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
255 Make Command : command including options used instead of `make' (default) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
256 Generate Makefile: command to generate a Makefile (used by `make' command) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
257 From Directory : directory where compilation is run (must end with '/') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
258 Error Message: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
259 Regexp : regular expression to match error messages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
260 File Subexp Index: index of subexpression that matches the file name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
261 Line Subexp Index: index of subexpression that matches the line number |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
262 File Message: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
263 Regexp : regular expression to match a file name message |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
264 File Subexp Index: index of subexpression that matches the file name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
265 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
266 See also variable `vhdl-compiler-options' to add options to the compile |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
267 command. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
268 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
269 Some compilers do not include the file name in the error message, but print |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
270 out a file name message in advance. In this case, set \"File Subexp Index\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
271 to 0 and fill out the \"File Message\" entries. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
272 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
273 A compiler is selected for syntax analysis (`\\[vhdl-compile]') by |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
274 assigning its name to variable `vhdl-compiler'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
275 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
276 NOTE: Reflect the new setting in the choice list of variable `vhdl-compiler' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
277 by restarting Emacs." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
278 :type '(repeat (list :tag "Compiler" :indent 2 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
279 (string :tag "Compiler Name ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
280 (string :tag "Compile Command ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
281 (string :tag "Make Command ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
282 (string :tag "Generate Makefile") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
283 (string :tag "From Directory " "./") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
284 (list :tag "Error Message" :indent 4 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
285 (regexp :tag "Regexp ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
286 (integer :tag "File Subexp Index") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
287 (integer :tag "Line Subexp Index")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
288 (list :tag "File Message" :indent 4 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
289 (regexp :tag "Regexp ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
290 (integer :tag "File Subexp Index")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
291 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
292 (vhdl-custom-set variable value 'vhdl-update-mode-menu)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
293 :group 'vhdl-compile) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
294 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
295 (defcustom vhdl-compiler "ModelSim" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
296 "*Specifies the VHDL compiler to be used for syntax analysis. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
297 Select a compiler name from the ones defined in variable `vhdl-compiler-alist'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
298 :type (let ((compiler-alist vhdl-compiler-alist) choice-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
299 (while compiler-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
300 (setq choice-list (cons (list 'const (car (car compiler-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
301 choice-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
302 (setq compiler-alist (cdr compiler-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
303 (append '(choice) (nreverse choice-list))) |
20665 | 304 :group 'vhdl-compile) |
305 | |
306 (defcustom vhdl-compiler-options "" | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
307 "*Options to be added to the compile command." |
20665 | 308 :type 'string |
309 :group 'vhdl-compile) | |
310 | |
311 | |
312 (defgroup vhdl-style nil | |
313 "Customizations for code styles." | |
314 :group 'vhdl) | |
315 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
316 (defcustom vhdl-standard '(87 nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
317 "*VHDL standards used. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
318 Basic standard: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
319 VHDL'87 : IEEE Std 1076-1987 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
320 VHDL'93 : IEEE Std 1076-1993 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
321 Additional standards: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
322 VHDL-AMS : IEEE Std 1076.1 (analog-mixed-signal) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
323 Math Packages: IEEE Std 1076.2 (`math_real', `math_complex') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
324 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
325 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
326 \"Activate New Customizations\"." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
327 :type '(list (choice :tag "Basic standard" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
328 (const :tag "VHDL'87" 87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
329 (const :tag "VHDL'93" 93)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
330 (set :tag "Additional standards" :indent 2 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
331 (const :tag "VHDL-AMS" ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
332 (const :tag "Math Packages" math))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
333 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
334 (vhdl-custom-set variable value |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
335 'vhdl-template-map-init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
336 'vhdl-mode-abbrev-table-init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
337 'vhdl-template-construct-alist-init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
338 'vhdl-template-package-alist-init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
339 'vhdl-update-mode-menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
340 'vhdl-words-init 'vhdl-font-lock-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
341 :group 'vhdl-style) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
342 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
343 (defcustom vhdl-basic-offset 2 |
20665 | 344 "*Amount of basic offset used for indentation. |
345 This value is used by + and - symbols in `vhdl-offsets-alist'." | |
346 :type 'integer | |
347 :group 'vhdl-style) | |
348 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
349 (defcustom vhdl-upper-case-keywords nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
350 "*Non-nil means convert keywords to upper case. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
351 This is done when typed or expanded or by the fix case functions." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
352 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
353 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
354 (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
20665 | 355 :group 'vhdl-style) |
356 | |
357 (defcustom vhdl-upper-case-types nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
358 "*Non-nil means convert standardized types to upper case. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
359 This is done when expanded or by the fix case functions." |
20665 | 360 :type 'boolean |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
361 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
362 (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
363 :group 'vhdl-style) |
20665 | 364 |
365 (defcustom vhdl-upper-case-attributes nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
366 "*Non-nil means convert standardized attributes to upper case. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
367 This is done when expanded or by the fix case functions." |
20665 | 368 :type 'boolean |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
369 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
370 (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
371 :group 'vhdl-style) |
20665 | 372 |
373 (defcustom vhdl-upper-case-enum-values nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
374 "*Non-nil means convert standardized enumeration values to upper case. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
375 This is done when expanded or by the fix case functions." |
20665 | 376 :type 'boolean |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
377 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
378 (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
379 :group 'vhdl-style) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
380 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
381 (defcustom vhdl-upper-case-constants t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
382 "*Non-nil means convert standardized constants to upper case. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
383 This is done when expanded." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
384 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
385 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
386 (vhdl-custom-set variable value 'vhdl-abbrev-list-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
387 :group 'vhdl-style) |
20665 | 388 |
389 | |
390 (defgroup vhdl-electric nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
391 "Customizations for electrification." |
20665 | 392 :group 'vhdl) |
393 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
394 (defcustom vhdl-electric-keywords '(vhdl user) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
395 "*Type of keywords for which electrification is enabled. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
396 VHDL keywords: invoke built-in templates |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
397 User keywords: invoke user models (see variable `vhdl-model-alist')" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
398 :type '(set (const :tag "VHDL keywords" vhdl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
399 (const :tag "User keywords" user)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
400 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
401 (vhdl-custom-set variable value 'vhdl-mode-abbrev-table-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
402 :group 'vhdl-electric) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
403 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
404 (defcustom vhdl-optional-labels 'process |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
405 "*Constructs for which labels are to be queried. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
406 Template generators prompt for optional labels for: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
407 None : no constructs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
408 Processes only: processes only (also procedurals in VHDL-AMS) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
409 All constructs: all constructs with optional labels and keyword END" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
410 :type '(choice (const :tag "None" none) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
411 (const :tag "Processes only" process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
412 (const :tag "All constructs" all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
413 :group 'vhdl-electric) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
414 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
415 (defcustom vhdl-insert-empty-lines 'unit |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
416 "*Specifies whether to insert empty lines in some templates. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
417 This improves readability of code. Empty lines are inserted in: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
418 None : no constructs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
419 Design units only: entities, architectures, configurations, packages only |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
420 All constructs : also all constructs with BEGIN...END parts |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
421 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
422 Replaces variable `vhdl-additional-empty-lines'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
423 :type '(choice (const :tag "None" none) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
424 (const :tag "Design units only" unit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
425 (const :tag "All constructs" all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
426 :group 'vhdl-electric) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
427 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
428 (defcustom vhdl-argument-list-indent nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
429 "*Non-nil means indent argument lists relative to opening parenthesis. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
430 That is, argument, association, and port lists start on the same line as the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
431 opening parenthesis and subsequent lines are indented accordingly. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
432 Otherwise, lists start on a new line and are indented as normal code." |
20665 | 433 :type 'boolean |
434 :group 'vhdl-electric) | |
435 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
436 (defcustom vhdl-association-list-with-formals t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
437 "*Non-nil means write association lists with formal parameters. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
438 In templates, you are prompted for formal and actual parameters. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
439 If nil, only a list of actual parameters is entered." |
20665 | 440 :type 'boolean |
441 :group 'vhdl-electric) | |
442 | |
443 (defcustom vhdl-conditions-in-parenthesis nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
444 "*Non-nil means place parenthesis around condition expressions." |
20665 | 445 :type 'boolean |
446 :group 'vhdl-electric) | |
447 | |
448 (defcustom vhdl-zero-string "'0'" | |
449 "*String to use for a logic zero." | |
450 :type 'string | |
451 :group 'vhdl-electric) | |
452 | |
453 (defcustom vhdl-one-string "'1'" | |
454 "*String to use for a logic one." | |
455 :type 'string | |
456 :group 'vhdl-electric) | |
457 | |
458 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
459 (defgroup vhdl-header nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
460 "Customizations for file header." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
461 :group 'vhdl-electric) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
462 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
463 (defcustom vhdl-file-header "\ |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
464 ------------------------------------------------------------------------------- |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
465 -- Title : <title string> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
466 -- Project : <project> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
467 ------------------------------------------------------------------------------- |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
468 -- File : <filename> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
469 -- Author : <author> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
470 -- Company : <company> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
471 -- Last update: <date> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
472 -- Platform : <platform> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
473 <projectdesc>------------------------------------------------------------------------------- |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
474 -- Description: <cursor> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
475 ------------------------------------------------------------------------------- |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
476 -- Revisions : |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
477 -- Date Version Author Description |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
478 -- <date> 1.0 <login>\tCreated |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
479 ------------------------------------------------------------------------------- |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
480 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
481 " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
482 "*String or file to insert as file header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
483 If the string specifies an existing file name, the contents of the file is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
484 inserted, otherwise the string itself is inserted as file header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
485 Type `C-j' for newlines. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
486 If the header contains RCS keywords, they may be written as <RCS>Keyword<RCS> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
487 if the header needs to be version controlled. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
488 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
489 The following keywords for template generation are supported: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
490 <filename> : replaced by the name of the buffer |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
491 <author> : replaced by the user name and email address (customize |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
492 `mail-host-address' or `user-mail-address' if required) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
493 <login> : replaced by user login name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
494 <company> : replaced by contents of variable `vhdl-company-name' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
495 <date> : replaced by the current date |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
496 <project> : replaced by title of current project (`vhdl-project') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
497 <projectdesc>: replaced by description of current project (`vhdl-project') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
498 <platform> : replaced by contents of variable `vhdl-platform-spec' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
499 <... string> : replaced by a queried string (... is the prompt word) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
500 <cursor> : final cursor position |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
501 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
502 The (multi-line) project description <projectdesc> can be used as a project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
503 dependent part of the file header and can also contain the above keywords." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
504 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
505 :group 'vhdl-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
506 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
507 (defcustom vhdl-file-footer "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
508 "*String or file to insert as file footer. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
509 If the string specifies an existing file name, the contents of the file is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
510 inserted, otherwise the string itself is inserted as file footer (i.e. at |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
511 the end of the file). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
512 Type `C-j' for newlines." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
513 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
514 :group 'vhdl-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
515 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
516 (defcustom vhdl-company-name "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
517 "*Name of company to insert in file header." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
518 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
519 :group 'vhdl-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
520 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
521 (defcustom vhdl-platform-spec "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
522 "*Specification of VHDL platform to insert in file header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
523 The platform specification should contain names and versions of the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
524 simulation and synthesis tools used." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
525 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
526 :group 'vhdl-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
527 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
528 (defcustom vhdl-date-format "%Y/%m/%d" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
529 "*Specifies the date format to use in the header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
530 This string is passed as argument to the command `format-time-string'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
531 For more information on format strings, see the documentation for the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
532 `format-time-string' command (C-h f `format-time-string')." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
533 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
534 :group 'vhdl-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
535 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
536 (defcustom vhdl-modify-date-prefix-string "-- Last update: " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
537 "*Prefix string of modification date in VHDL file header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
538 If actualization of the modification date is called (menu, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
539 `\\[vhdl-template-modify]'), this string is searched and the rest |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
540 of the line replaced by the current date." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
541 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
542 :group 'vhdl-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
543 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
544 (defcustom vhdl-modify-date-on-saving t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
545 "*Non-nil means update the modification date when the buffer is saved. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
546 Calls function `\\[vhdl-template-modify]'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
547 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
548 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
549 \"Activate New Customizations\"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
550 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
551 :group 'vhdl-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
552 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
553 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
554 (defgroup vhdl-sequential-process nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
555 "Customizations for sequential processes." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
556 :group 'vhdl-electric) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
557 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
558 (defcustom vhdl-reset-kind 'async |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
559 "*Specifies which kind of reset to use in sequential processes." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
560 :type '(choice (const :tag "None" none) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
561 (const :tag "Synchronous" sync) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
562 (const :tag "Asynchronous" async)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
563 :group 'vhdl-sequential-process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
564 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
565 (defcustom vhdl-reset-active-high nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
566 "*Non-nil means reset in sequential processes is active high. |
42205 | 567 nil means active low." |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
568 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
569 :group 'vhdl-sequential-process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
570 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
571 (defcustom vhdl-clock-rising-edge t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
572 "*Non-nil means rising edge of clock triggers sequential processes. |
42205 | 573 nil means falling edge." |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
574 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
575 :group 'vhdl-sequential-process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
576 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
577 (defcustom vhdl-clock-edge-condition 'standard |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
578 "*Syntax of the clock edge condition. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
579 Standard: \"clk'event and clk = '1'\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
580 Function: \"rising_edge(clk)\"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
581 :type '(choice (const :tag "Standard" standard) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
582 (const :tag "Function" function)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
583 :group 'vhdl-sequential-process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
584 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
585 (defcustom vhdl-clock-name "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
586 "*Name of clock signal to use in templates." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
587 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
588 :group 'vhdl-sequential-process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
589 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
590 (defcustom vhdl-reset-name "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
591 "*Name of reset signal to use in templates." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
592 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
593 :group 'vhdl-sequential-process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
594 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
595 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
596 (defgroup vhdl-model nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
597 "Customizations for user models." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
598 :group 'vhdl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
599 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
600 (defcustom vhdl-model-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
601 '(("example model" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
602 "<label> : process (<clock>, <reset>) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
603 begin -- process <label> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
604 if <reset> = '0' then -- asynchronous reset (active low) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
605 <cursor> |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
606 elsif <clock>'event and <clock> = '1' then -- rising clock edge |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
607 if <enable> = '1' then -- synchronous load |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
608 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
609 end if; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
610 end if; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
611 end process <label>;" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
612 "e" "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
613 "*List of user models. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
614 VHDL models (templates) can be specified by the user in this list. They can be |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
615 invoked from the menu, through key bindings (`C-c C-m ...'), or by keyword |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
616 electrification (i.e. overriding existing or creating new keywords, see |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
617 variable `vhdl-electric-keywords'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
618 Name : name of model (string of words and spaces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
619 String : string or name of file to be inserted as model (newline: `C-j') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
620 Key Binding: key binding to invoke model, added to prefix `C-c C-m' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
621 (must be in double-quotes, examples: \"i\", \"\\C-p\", \"\\M-s\") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
622 Keyword : keyword to invoke model |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
623 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
624 The models can contain prompts to be queried. A prompt is of the form \"<...>\". |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
625 A prompt that appears several times is queried once and replaced throughout |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
626 the model. Special prompts are: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
627 <clock> : name specified in `vhdl-clock-name' (if not empty) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
628 <reset> : name specified in `vhdl-reset-name' (if not empty) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
629 <cursor>: final cursor position |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
630 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
631 If the string specifies an existing file name, the contents of the file is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
632 inserted, otherwise the string itself is inserted. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
633 The code within the models should be correctly indented. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
634 Type `C-j' for newlines. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
635 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
636 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
637 \"Activate New Customizations\"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
638 :type '(repeat (list :tag "Model" :indent 2 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
639 (string :tag "Name ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
640 (string :tag "String : (type `C-j' for newline)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
641 :format "%t\n%v") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
642 (sexp :tag "Key Binding" x) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
643 (string :tag "Keyword "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
644 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
645 (vhdl-custom-set variable value |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
646 'vhdl-model-map-init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
647 'vhdl-model-defun |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
648 'vhdl-mode-abbrev-table-init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
649 'vhdl-update-mode-menu)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
650 :group 'vhdl-model) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
651 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
652 (defgroup vhdl-port nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
653 "Customizations for port transformation functions." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
654 :group 'vhdl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
655 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
656 (defcustom vhdl-include-port-comments nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
657 "*Non-nil means include port comments when a port is pasted." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
658 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
659 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
660 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
661 (defcustom vhdl-include-direction-comments nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
662 "*Non-nil means include signal direction in instantiations as comments." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
663 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
664 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
665 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
666 (defconst vhdl-name-doc-string " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
667 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
668 FROM REGEXP is a regular expression matching the formal port name: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
669 `.*' matches the entire name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
670 `\\(...\\)' matches a substring |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
671 TO STRING specifies the string to be inserted as actual port name: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
672 `\\&' means substitute original matched text |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
673 `\\N' means substitute what matched the Nth `\\(...\\)' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
674 Examples: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
675 `.*' `\\&' leaves name as it is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
676 `.*' `\\&_i' attaches `_i' to original name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
677 `\\(.*\\)_[io]$' `\\1' strips off `_i' or `_o' from original name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
678 `.*' `' leaves name empty") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
679 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
680 (defcustom vhdl-actual-port-name '(".*" . "\\&_i") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
681 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
682 "*Specifies how actual port names are obtained from formal port names. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
683 In a component instantiation, an actual port name can be obtained by |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
684 modifying the formal port name (e.g. attaching or stripping off a substring)." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
685 vhdl-name-doc-string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
686 :type '(cons (regexp :tag "From Regexp") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
687 (string :tag "To String ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
688 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
689 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
690 (defcustom vhdl-instance-name '(".*" . "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
691 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
692 "*Specifies how an instance name is obtained. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
693 The instance name can be obtained by modifying the name of the component to be |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
694 instantiated (e.g. attaching or stripping off a substring). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
695 If TO STRING is empty, the instance name is queried." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
696 vhdl-name-doc-string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
697 :type '(cons (regexp :tag "From Regexp") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
698 (string :tag "To String ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
699 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
700 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
701 (defcustom vhdl-testbench-entity-name '(".*" . "\\&_tb") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
702 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
703 "*Specifies how the test bench entity name is obtained. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
704 The entity name of a test bench can be obtained by modifying the name of |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
705 the component to be tested (e.g. attaching or stripping off a substring)." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
706 vhdl-name-doc-string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
707 :type '(cons (regexp :tag "From Regexp") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
708 (string :tag "To String ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
709 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
710 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
711 (defcustom vhdl-testbench-architecture-name '(".*" . "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
712 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
713 "*Specifies how the test bench architecture name is obtained. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
714 The test bench architecture name can be obtained by modifying the name of |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
715 the component to be tested (e.g. attaching or stripping off a substring). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
716 If TO STRING is empty, the architecture name is queried." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
717 vhdl-name-doc-string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
718 :type '(cons (regexp :tag "From Regexp") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
719 (string :tag "To String ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
720 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
721 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
722 (defcustom vhdl-testbench-dut-name '(".*" . "DUT") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
723 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
724 "*Specifies how a DUT instance name is obtained. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
725 The design-under-test instance name (i.e. the component instantiated in the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
726 test bench) can be obtained by modifying the component name (e.g. attaching |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
727 or stripping off a substring)." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
728 vhdl-name-doc-string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
729 :type '(cons (regexp :tag "From Regexp") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
730 (string :tag "To String ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
731 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
732 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
733 (defcustom vhdl-testbench-entity-header "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
734 "*String or file to be inserted as test bench entity header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
735 If the string specifies an existing file name, the contents of the file is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
736 inserted, otherwise the string itself is inserted at the beginning of the test |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
737 bench entity template. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
738 Type `C-j' for newlines." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
739 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
740 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
741 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
742 (defcustom vhdl-testbench-architecture-header "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
743 "*String or file to be inserted as test bench architecture header. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
744 If the string specifies an existing file name, the contents of the file is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
745 inserted, otherwise the string itself is inserted at the beginning of the test |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
746 bench architecture template, if a separate file is created for the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
747 architecture. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
748 Type `C-j' for newlines." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
749 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
750 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
751 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
752 (defcustom vhdl-testbench-declarations "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
753 "*String or file to be inserted in the test bench declarative part. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
754 If the string specifies an existing file name, the contents of the file is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
755 inserted, otherwise the string itself is inserted in the test bench |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
756 architecture before the BEGIN keyword. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
757 Type `C-j' for newlines." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
758 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
759 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
760 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
761 (defcustom vhdl-testbench-statements "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
762 "*String or file to be inserted in the test bench statement part. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
763 If the string specifies an existing file name, the contents of the file is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
764 inserted, otherwise the string itself is inserted in the test bench |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
765 architecture before the END keyword. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
766 Type `C-j' for newlines." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
767 :type 'string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
768 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
769 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
770 (defcustom vhdl-testbench-initialize-signals nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
771 "*Non-nil means initialize signals with `0' when declared in test bench." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
772 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
773 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
774 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
775 (defcustom vhdl-testbench-create-files 'single |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
776 "*Specifies whether new files should be created for the test bench. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
777 Test bench entity and architecture are inserted: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
778 None : in current buffer |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
779 Single file : in new single file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
780 Separate files: in two separate files |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
781 Note that the files have the same name as the contained design unit." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
782 :type '(choice (const :tag "None" none) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
783 (const :tag "Single file" single) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
784 (const :tag "Separate files" separate)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
785 :group 'vhdl-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
786 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
787 |
20665 | 788 (defgroup vhdl-comment nil |
789 "Customizations for comments." | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
790 :group 'vhdl) |
20665 | 791 |
792 (defcustom vhdl-self-insert-comments t | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
793 "*Non-nil means various templates automatically insert help comments." |
20665 | 794 :type 'boolean |
795 :group 'vhdl-comment) | |
796 | |
797 (defcustom vhdl-prompt-for-comments t | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
798 "*Non-nil means various templates prompt for user definable comments." |
20665 | 799 :type 'boolean |
800 :group 'vhdl-comment) | |
801 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
802 (defcustom vhdl-inline-comment-column 40 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
803 "*Column to indent inline comments to. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
804 Overrides local variable `comment-column'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
805 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
806 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
807 \"Activate New Customizations\"" |
20665 | 808 :type 'integer |
809 :group 'vhdl-comment) | |
810 | |
811 (defcustom vhdl-end-comment-column 79 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
812 "*End of comment column. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
813 Comments that exceed this column number are wrapped. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
814 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
815 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
816 \"Activate New Customizations\"" |
20665 | 817 :type 'integer |
818 :group 'vhdl-comment) | |
819 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
820 (defvar end-comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
821 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
822 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
823 (defgroup vhdl-align nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
824 "Customizations for alignment." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
825 :group 'vhdl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
826 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
827 (defcustom vhdl-auto-align t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
828 "*Non-nil means align some templates automatically after generation." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
829 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
830 :group 'vhdl-align) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
831 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
832 (defcustom vhdl-align-groups t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
833 "*Non-nil means align groups of code lines separately. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
834 A group of code lines is a region of lines with no empty lines inbetween." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
835 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
836 :group 'vhdl-align) |
20665 | 837 |
838 | |
839 (defgroup vhdl-highlight nil | |
840 "Customizations for highlighting." | |
841 :group 'vhdl) | |
842 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
843 (defcustom vhdl-highlight-keywords t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
844 "*Non-nil means highlight VHDL keywords and other standardized words. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
845 The following faces are used: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
846 `font-lock-keyword-face' : keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
847 `font-lock-type-face' : standardized types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
848 `vhdl-font-lock-attribute-face' : standardized attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
849 `vhdl-font-lock-enumvalue-face' : standardized enumeration values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
850 `vhdl-font-lock-function-face' : standardized function and package names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
851 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
852 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
853 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
854 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
855 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
856 (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
857 :group 'vhdl-highlight) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
858 |
20665 | 859 (defcustom vhdl-highlight-names t |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
860 "*Non-nil means highlight declaration names and construct labels. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
861 The following faces are used: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
862 `font-lock-function-name-face' : names in declarations of units, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
863 subprograms, components, as well as labels of VHDL constructs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
864 `font-lock-type-face' : names in type/nature declarations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
865 `vhdl-font-lock-attribute-face' : names in attribute declarations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
866 `font-lock-variable-name-face' : names in declarations of signals, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
867 variables, constants, subprogram parameters, generics, and ports |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
868 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
869 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
870 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
20665 | 871 :type 'boolean |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
872 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
873 (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
20665 | 874 :group 'vhdl-highlight) |
875 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
876 (defcustom vhdl-highlight-special-words nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
877 "*Non-nil means highlight words with special syntax. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
878 The words with syntax and color specified in variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
879 `vhdl-special-syntax-alist' are highlighted accordingly. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
880 Can be used for visual support of naming conventions. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
881 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
882 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
883 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
20665 | 884 :type 'boolean |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
885 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
886 (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
887 :group 'vhdl-highlight) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
888 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
889 (defcustom vhdl-highlight-forbidden-words nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
890 "*Non-nil means highlight forbidden words. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
891 The reserved words specified in variable `vhdl-forbidden-words' or having the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
892 syntax specified in variable `vhdl-forbidden-syntax' are highlighted in a |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
893 warning color (face `vhdl-font-lock-reserved-words-face') to indicate not to |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
894 use them. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
895 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
896 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
897 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
898 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
899 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
900 (vhdl-custom-set variable value |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
901 'vhdl-words-init 'vhdl-font-lock-init)) |
20665 | 902 :group 'vhdl-highlight) |
903 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
904 (defcustom vhdl-highlight-verilog-keywords nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
905 "*Non-nil means highlight Verilog keywords as reserved words. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
906 Verilog keywords are highlighted in a warning color (face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
907 `vhdl-font-lock-reserved-words-face') to indicate not to use them. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
908 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
909 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
910 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
20665 | 911 :type 'boolean |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
912 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
913 (vhdl-custom-set variable value |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
914 'vhdl-words-init 'vhdl-font-lock-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
915 :group 'vhdl-highlight) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
916 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
917 (defcustom vhdl-highlight-translate-off nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
918 "*Non-nil means background-highlight code excluded from translation. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
919 That is, all code between \"-- pragma translate_off\" and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
920 \"-- pragma translate_on\" is highlighted using a different background color |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
921 \(face `vhdl-font-lock-translate-off-face'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
922 Note: this might slow down on-the-fly fontification (and thus editing). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
923 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
924 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
925 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
926 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
927 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
928 (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
20665 | 929 :group 'vhdl-highlight) |
930 | |
931 (defcustom vhdl-highlight-case-sensitive nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
932 "*Non-nil means consider case for highlighting. |
20665 | 933 Possible trade-off: |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
934 non-nil also upper-case VHDL words are highlighted, but case of words with |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
935 special syntax is not considered |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
936 nil only lower-case VHDL words are highlighted, but case of words with |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
937 special syntax is considered |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
938 Overrides local variable `font-lock-keywords-case-fold-search'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
939 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
940 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
941 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
20665 | 942 :type 'boolean |
943 :group 'vhdl-highlight) | |
944 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
945 (defcustom vhdl-special-syntax-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
946 "*List of special syntax to be highlighted. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
947 If variable `vhdl-highlight-special-words' is non-nil, words with the specified |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
948 syntax (as regular expression) are highlighted in the corresponding color. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
949 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
950 Name : string of words and spaces |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
951 Regexp : regular expression describing word syntax |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
952 (e.g. \"\\\w+_c\" matches word with suffix \"_c\") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
953 Color (light): foreground color for light background |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
954 (matching color examples: Gold3, Grey50, LimeGreen, Tomato, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
955 LightSeaGreen, DodgerBlue, Gold, PaleVioletRed) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
956 Color (dark) : foreground color for dark background |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
957 (matching color examples: BurlyWood1, Grey80, Green, Coral, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
958 AquaMarine2, LightSkyBlue1, Yellow, PaleVioletRed1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
959 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
960 Can be used for visual support of naming conventions, such as highlighting |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
961 different kinds of signals (e.g. \"Clk_c\", \"Rst_r\") or objects (e.g. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
962 \"Signal_s\", \"Variable_v\", \"Constant_c\") by distinguishing them using |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
963 name suffices. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
964 For each entry, a new face is generated with the specified colors and name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
965 \"vhdl-font-lock-\" + name + \"-face\". |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
966 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
967 NOTE: Activate a changed regexp in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
968 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
969 All other changes require restarting Emacs." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
970 :type '(repeat (list :tag "Face" :indent 2 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
971 (string :tag "Name ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
972 (regexp :tag "Regexp " "\\w+_") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
973 (string :tag "Color (light)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
974 (string :tag "Color (dark) "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
975 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
976 (vhdl-custom-set variable value 'vhdl-font-lock-init)) |
20665 | 977 :group 'vhdl-highlight) |
978 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
979 (defcustom vhdl-forbidden-words '() |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
980 "*List of forbidden words to be highlighted. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
981 If variable `vhdl-highlight-forbidden-words' is non-nil, these reserved |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
982 words are highlighted in a warning color to indicate not to use them. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
983 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
984 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
985 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
986 :type '(repeat (string :format "%v")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
987 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
988 (vhdl-custom-set variable value |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
989 'vhdl-words-init 'vhdl-font-lock-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
990 :group 'vhdl-highlight) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
991 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
992 (defcustom vhdl-forbidden-syntax "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
993 "*Syntax of forbidden words to be highlighted. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
994 If variable `vhdl-highlight-forbidden-words' is non-nil, words with this |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
995 syntax are highlighted in a warning color to indicate not to use them. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
996 Can be used to highlight too long identifiers (e.g. \"\\w\\w\\w\\w\\w\\w\\w\\w\\w\\w+\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
997 highlights identifiers with 10 or more characters). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
998 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
999 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1000 entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
20665 | 1001 :type 'regexp |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1002 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1003 (vhdl-custom-set variable value |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1004 'vhdl-words-init 'vhdl-font-lock-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1005 :group 'vhdl-highlight) |
20665 | 1006 |
1007 | |
1008 (defgroup vhdl-menu nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1009 "Customizations for speedbar and menues." |
20665 | 1010 :group 'vhdl) |
1011 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1012 (defcustom vhdl-speedbar nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1013 "*Non-nil means open the speedbar automatically at startup. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1014 Alternatively, the speedbar can be opened from the VHDL menu." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1015 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1016 :group 'vhdl-menu) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1017 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1018 (defcustom vhdl-speedbar-show-hierarchy nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1019 "*Non-nil means open the speedbar as hierarchy browser at startup. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1020 Otherwise, the speedbar is opened as normal file browser." |
20665 | 1021 :type 'boolean |
1022 :group 'vhdl-menu) | |
1023 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1024 (defcustom vhdl-speedbar-hierarchy-indent 1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1025 "*Amount of indentation in hierarchy display of subcomponent." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1026 :type 'integer |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1027 :group 'vhdl-menu) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1028 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1029 (defcustom vhdl-index-menu nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1030 "*Non-nil means add an index menu for a source file when loading. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1031 Alternatively, the speedbar can be used. Note that the index menu scans a file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1032 when it is opened, while speedbar only scans the file upon request. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1033 Does not work under XEmacs." |
20665 | 1034 :type 'boolean |
1035 :group 'vhdl-menu) | |
1036 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1037 (defcustom vhdl-source-file-menu nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1038 "*Non-nil means add a menu of all source files in current directory. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1039 Alternatively, the speedbar can be used." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1040 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1041 :group 'vhdl-menu) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1042 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1043 (defcustom vhdl-hideshow-menu nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1044 "*Non-nil means add hideshow menu and functionality. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1045 Hideshow allows hiding code of VHDL design units. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1046 Does not work under XEmacs. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1047 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1048 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1049 \"Activate New Customizations\"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1050 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1051 :group 'vhdl-menu) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1052 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1053 (defcustom vhdl-hide-all-init nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1054 "*Non-nil means hide all design units initially after a file is loaded." |
20665 | 1055 :type 'boolean |
1056 :group 'vhdl-menu) | |
1057 | |
1058 | |
1059 (defgroup vhdl-print nil | |
1060 "Customizations for printing." | |
1061 :group 'vhdl) | |
1062 | |
1063 (defcustom vhdl-print-two-column t | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1064 "*Non-nil means print code in two columns and landscape format. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1065 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1066 NOTE: Activate the new setting by restarting Emacs. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1067 Overrides `ps-print' settings locally." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1068 :type 'boolean |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1069 :group 'vhdl-print) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1070 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1071 (defcustom vhdl-print-customize-faces t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1072 "*Non-nil means use an optimized set of faces for postscript printing. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1073 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1074 NOTE: Activate the new setting by restarting Emacs. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1075 Overrides `ps-print' settings locally." |
20665 | 1076 :type 'boolean |
1077 :group 'vhdl-print) | |
1078 | |
1079 | |
1080 (defgroup vhdl-misc nil | |
1081 "Miscellaneous customizations." | |
1082 :group 'vhdl) | |
1083 | |
1084 (defcustom vhdl-intelligent-tab t | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1085 "*Non-nil means `TAB' does indentation, word completion and tab insertion. |
20665 | 1086 That is, if preceeding character is part of a word then complete word, |
1087 else if not at beginning of line then insert tab, | |
1088 else if last command was a `TAB' or `RET' then dedent one step, | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1089 else indent current line (i.e. `TAB' is bound to `vhdl-electric-tab'). |
20665 | 1090 If nil, TAB always indents current line (i.e. `TAB' is bound to |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1091 `vhdl-indent-line'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1092 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1093 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1094 \"Activate New Customizations\"" |
20665 | 1095 :type 'boolean |
1096 :group 'vhdl-misc) | |
1097 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1098 (defcustom vhdl-word-completion-case-sensitive nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1099 "*Non-nil means word completion using `TAB' is case sensitive. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1100 That is, `TAB' completes words that start with the same letters and case. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1101 Otherwise, case is ignored." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1102 :type 'boolean |
20665 | 1103 :group 'vhdl-misc) |
1104 | |
1105 (defcustom vhdl-word-completion-in-minibuffer t | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1106 "*Non-nil enables word completion in minibuffer (for template prompts). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1107 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1108 NOTE: Activate the new setting by restarting Emacs." |
20665 | 1109 :type 'boolean |
1110 :group 'vhdl-misc) | |
1111 | |
1112 (defcustom vhdl-underscore-is-part-of-word nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1113 "*Non-nil means consider the underscore character `_' as part of word. |
20665 | 1114 An identifier containing underscores is then treated as a single word in |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1115 select and move operations. All parts of an identifier separated by underscore |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1116 are treated as single words otherwise. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1117 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1118 NOTE: Activate the new setting in a VHDL buffer using the menu entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1119 \"Activate New Customizations\"" |
20665 | 1120 :type 'boolean |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1121 :set (lambda (variable value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1122 (vhdl-custom-set variable value 'vhdl-mode-syntax-table-init)) |
20665 | 1123 :group 'vhdl-misc) |
1124 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1125 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1126 (defgroup vhdl-related nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1127 "Related general customizations." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1128 :group 'vhdl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1129 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1130 ;; add related general customizations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1131 (custom-add-to-group 'vhdl-related 'line-number-mode 'custom-variable) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1132 (if (string-match "XEmacs" emacs-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1133 (custom-add-to-group 'vhdl-related 'paren-mode 'custom-variable) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1134 (custom-add-to-group 'vhdl-related 'paren-showing 'custom-group)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1135 (unless (string-match "XEmacs" emacs-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1136 (custom-add-to-group 'vhdl-related 'transient-mark-mode 'custom-variable)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1137 (custom-add-to-group 'vhdl-related 'ps-print 'custom-group) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1138 (custom-add-to-group 'vhdl-related 'mail-host-address 'custom-variable) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1139 (custom-add-to-group 'vhdl-related 'user-mail-address 'custom-variable) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1140 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1142 ;; Internal variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1143 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1144 (defconst vhdl-version "3.29" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1145 "VHDL Mode version number.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1146 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1147 (defvar vhdl-progress-interval 1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1148 "*Interval used to update progress status during long operations. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1149 If a number, percentage complete gets updated after each interval of |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1150 that many seconds. To inhibit all messages, set this variable to nil.") |
20665 | 1151 |
1152 (defvar vhdl-inhibit-startup-warnings-p nil | |
1153 "*If non-nil, inhibits start up compatibility warnings.") | |
1154 | |
1155 (defvar vhdl-strict-syntax-p nil | |
1156 "*If non-nil, all syntactic symbols must be found in `vhdl-offsets-alist'. | |
1157 If the syntactic symbol for a particular line does not match a symbol | |
1158 in the offsets alist, an error is generated, otherwise no error is | |
1159 reported and the syntactic symbol is ignored.") | |
1160 | |
1161 (defvar vhdl-echo-syntactic-information-p nil | |
1162 "*If non-nil, syntactic info is echoed when the line is indented.") | |
1163 | |
1164 (defconst vhdl-offsets-alist-default | |
1165 '((string . -1000) | |
1166 (block-open . 0) | |
1167 (block-close . 0) | |
1168 (statement . 0) | |
1169 (statement-cont . vhdl-lineup-statement-cont) | |
1170 (statement-block-intro . +) | |
1171 (statement-case-intro . +) | |
1172 (case-alternative . +) | |
1173 (comment . vhdl-lineup-comment) | |
1174 (arglist-intro . +) | |
1175 (arglist-cont . 0) | |
1176 (arglist-cont-nonempty . vhdl-lineup-arglist) | |
1177 (arglist-close . vhdl-lineup-arglist) | |
1178 (entity . 0) | |
1179 (configuration . 0) | |
1180 (package . 0) | |
1181 (architecture . 0) | |
1182 (package-body . 0) | |
1183 ) | |
1184 "Default settings for offsets of syntactic elements. | |
1185 Do not change this constant! See the variable `vhdl-offsets-alist' for | |
1186 more information.") | |
1187 | |
1188 (defvar vhdl-offsets-alist (copy-alist vhdl-offsets-alist-default) | |
1189 "*Association list of syntactic element symbols and indentation offsets. | |
1190 As described below, each cons cell in this list has the form: | |
1191 | |
1192 (SYNTACTIC-SYMBOL . OFFSET) | |
1193 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1194 When a line is indented, `vhdl-mode' first determines the syntactic |
20665 | 1195 context of the line by generating a list of symbols called syntactic |
1196 elements. This list can contain more than one syntactic element and | |
1197 the global variable `vhdl-syntactic-context' contains the context list | |
1198 for the line being indented. Each element in this list is actually a | |
1199 cons cell of the syntactic symbol and a buffer position. This buffer | |
1200 position is call the relative indent point for the line. Some | |
1201 syntactic symbols may not have a relative indent point associated with | |
1202 them. | |
1203 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1204 After the syntactic context list for a line is generated, `vhdl-mode' |
20665 | 1205 calculates the absolute indentation for the line by looking at each |
1206 syntactic element in the list. First, it compares the syntactic | |
1207 element against the SYNTACTIC-SYMBOL's in `vhdl-offsets-alist'. When it | |
1208 finds a match, it adds the OFFSET to the column of the relative indent | |
1209 point. The sum of this calculation for each element in the syntactic | |
1210 list is the absolute offset for line being indented. | |
1211 | |
1212 If the syntactic element does not match any in the `vhdl-offsets-alist', | |
1213 an error is generated if `vhdl-strict-syntax-p' is non-nil, otherwise | |
1214 the element is ignored. | |
1215 | |
1216 Actually, OFFSET can be an integer, a function, a variable, or one of | |
1217 the following symbols: `+', `-', `++', or `--'. These latter | |
1218 designate positive or negative multiples of `vhdl-basic-offset', | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1219 respectively: *1, *-1, *2, and *-2. If OFFSET is a function, it is |
20665 | 1220 called with a single argument containing the cons of the syntactic |
1221 element symbol and the relative indent point. The function should | |
1222 return an integer offset. | |
1223 | |
1224 Here is the current list of valid syntactic element symbols: | |
1225 | |
1226 string -- inside multi-line string | |
1227 block-open -- statement block open | |
1228 block-close -- statement block close | |
1229 statement -- a VHDL statement | |
1230 statement-cont -- a continuation of a VHDL statement | |
1231 statement-block-intro -- the first line in a new statement block | |
1232 statement-case-intro -- the first line in a case alternative block | |
1233 case-alternative -- a case statement alternative clause | |
1234 comment -- a line containing only a comment | |
1235 arglist-intro -- the first line in an argument list | |
1236 arglist-cont -- subsequent argument list lines when no | |
1237 arguments follow on the same line as the | |
1238 the arglist opening paren | |
1239 arglist-cont-nonempty -- subsequent argument list lines when at | |
1240 least one argument follows on the same | |
1241 line as the arglist opening paren | |
1242 arglist-close -- the solo close paren of an argument list | |
1243 entity -- inside an entity declaration | |
1244 configuration -- inside a configuration declaration | |
1245 package -- inside a package declaration | |
1246 architecture -- inside an architecture body | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1247 package-body -- inside a package body") |
20665 | 1248 |
1249 (defvar vhdl-comment-only-line-offset 0 | |
1250 "*Extra offset for line which contains only the start of a comment. | |
1251 Can contain an integer or a cons cell of the form: | |
1252 | |
1253 (NON-ANCHORED-OFFSET . ANCHORED-OFFSET) | |
1254 | |
1255 Where NON-ANCHORED-OFFSET is the amount of offset given to | |
1256 non-column-zero anchored comment-only lines, and ANCHORED-OFFSET is | |
1257 the amount of offset to give column-zero anchored comment-only lines. | |
1258 Just an integer as value is equivalent to (<val> . 0)") | |
1259 | |
1260 (defvar vhdl-special-indent-hook nil | |
1261 "*Hook for user defined special indentation adjustments. | |
1262 This hook gets called after a line is indented by the mode.") | |
1263 | |
1264 (defvar vhdl-style-alist | |
1265 '(("IEEE" | |
1266 (vhdl-basic-offset . 4) | |
1267 (vhdl-offsets-alist . ()) | |
1268 ) | |
1269 ) | |
1270 "Styles of Indentation. | |
1271 Elements of this alist are of the form: | |
1272 | |
1273 (STYLE-STRING (VARIABLE . VALUE) [(VARIABLE . VALUE) ...]) | |
1274 | |
1275 where STYLE-STRING is a short descriptive string used to select a | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1276 style, VARIABLE is any `vhdl-mode' variable, and VALUE is the intended |
20665 | 1277 value for that variable when using the selected style. |
1278 | |
1279 There is one special case when VARIABLE is `vhdl-offsets-alist'. In this | |
1280 case, the VALUE is a list containing elements of the form: | |
1281 | |
1282 (SYNTACTIC-SYMBOL . VALUE) | |
1283 | |
1284 as described in `vhdl-offsets-alist'. These are passed directly to | |
1285 `vhdl-set-offset' so there is no need to set every syntactic symbol in | |
1286 your style, only those that are different from the default.") | |
1287 | |
1288 ;; dynamically append the default value of most variables | |
1289 (or (assoc "Default" vhdl-style-alist) | |
1290 (let* ((varlist '(vhdl-inhibit-startup-warnings-p | |
1291 vhdl-strict-syntax-p | |
1292 vhdl-echo-syntactic-information-p | |
1293 vhdl-basic-offset | |
1294 vhdl-offsets-alist | |
1295 vhdl-comment-only-line-offset)) | |
1296 (default (cons "Default" | |
1297 (mapcar | |
1298 (function | |
1299 (lambda (var) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1300 (cons var (symbol-value var)))) |
20665 | 1301 varlist)))) |
1302 (setq vhdl-style-alist (cons default vhdl-style-alist)))) | |
1303 | |
1304 (defvar vhdl-mode-hook nil | |
1305 "*Hook called by `vhdl-mode'.") | |
1306 | |
1307 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1308 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1309 ;; Compatibility |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1310 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1311 (defvar vhdl-startup-warnings nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1312 "Warnings to tell the user during start up.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1313 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1314 (defun vhdl-print-warnings () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1315 "Print out messages in variable `vhdl-startup-warnings'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1316 (let ((warnings vhdl-startup-warnings)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1317 (while warnings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1318 (message (concat "WARNING: " (car warnings))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1319 (setq warnings (cdr warnings)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1320 (when (> (length vhdl-startup-warnings) 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1321 (message "WARNING: See warning messages in *Messages* buffer."))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1322 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1323 (defun vhdl-add-warning (string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1324 "Add STRING to warning list `vhdl-startup-warnings'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1325 (setq vhdl-startup-warnings (cons string vhdl-startup-warnings))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1326 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1327 ;; Perform compatibility checks. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1328 (when (not (stringp vhdl-compiler)) ; changed format of `vhdl-compiler' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1329 (setq vhdl-compiler "ModelSim") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1330 (vhdl-add-warning "Variable `vhdl-compiler' has changed format; customize again")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1331 (when (not (listp vhdl-standard)) ; changed format of `vhdl-standard' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1332 (setq vhdl-standard '(87 nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1333 (vhdl-add-warning "Variable `vhdl-standard' has changed format; customize again")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1334 (when (= (length (car vhdl-model-alist)) 3) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1335 (let ((old-alist vhdl-model-alist) ; changed format of `vhdl-model-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1336 new-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1337 (while old-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1338 (setq new-alist (cons (append (car old-alist) '("")) new-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1339 (setq old-alist (cdr old-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1340 (setq vhdl-model-alist (nreverse new-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1341 (when (= (length (car vhdl-project-alist)) 3) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1342 (let ((old-alist vhdl-project-alist) ; changed format of `vhdl-project-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1343 new-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1344 (while old-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1345 (setq new-alist (cons (append (car old-alist) '("")) new-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1346 (setq old-alist (cdr old-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1347 (setq vhdl-project-alist (nreverse new-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1348 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1349 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1350 ;; Help functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1351 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1352 (defsubst vhdl-standard-p (standard) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1353 "Check if STANDARD is specified as used standard." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1354 (or (eq standard (car vhdl-standard)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1355 (memq standard (cadr vhdl-standard)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1356 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1357 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1358 ;; Required packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1359 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1360 (require 'assoc) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1361 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1362 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1363 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1364 ;;; Emacs variant handling |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1365 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 1366 |
1367 ;; active regions | |
1368 | |
1369 (defun vhdl-keep-region-active () | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1370 "Do whatever is necessary to keep the region active in XEmacs. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1371 Ignore byte-compiler warnings you might see." |
20665 | 1372 (and (boundp 'zmacs-region-stays) |
1373 (setq zmacs-region-stays t))) | |
1374 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1375 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1376 ;; XEmacs hacks |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1377 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1378 (unless (fboundp 'wildcard-to-regexp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1379 (defun wildcard-to-regexp (wildcard) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1380 "Simplified version of `wildcard-to-regexp' from Emacs' `files.el'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1381 (let* ((i (string-match "[*?]" wildcard)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1382 (result (substring wildcard 0 i)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1383 (len (length wildcard))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1384 (when i |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1385 (while (< i len) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1386 (let ((ch (aref wildcard i))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1387 (setq result (concat result |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1388 (cond ((eq ch ?*) "[^\000]*") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1389 ((eq ch ??) "[^\000]") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1390 (t (char-to-string ch))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1391 (setq i (1+ i))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1392 (concat "\\`" result "\\'")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1393 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1394 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1395 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1396 ;;; Bindings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1397 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1398 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1399 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 1400 ;; Key bindings |
1401 | |
1402 (defvar vhdl-template-map () | |
1403 "Keymap for VHDL templates.") | |
1404 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1405 (defun vhdl-template-map-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1406 "Initialize `vhdl-template-map'." |
20665 | 1407 (setq vhdl-template-map (make-sparse-keymap)) |
1408 ;; key bindings for VHDL templates | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1409 (define-key vhdl-template-map "al" 'vhdl-template-alias) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1410 (define-key vhdl-template-map "ar" 'vhdl-template-architecture) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1411 (define-key vhdl-template-map "at" 'vhdl-template-assert) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1412 (define-key vhdl-template-map "ad" 'vhdl-template-attribute-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1413 (define-key vhdl-template-map "as" 'vhdl-template-attribute-spec) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1414 (define-key vhdl-template-map "bl" 'vhdl-template-block) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1415 (define-key vhdl-template-map "ca" 'vhdl-template-case-is) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1416 (define-key vhdl-template-map "cd" 'vhdl-template-component-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1417 (define-key vhdl-template-map "ci" 'vhdl-template-component-inst) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1418 (define-key vhdl-template-map "cs" 'vhdl-template-conditional-signal-asst) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1419 (define-key vhdl-template-map "Cb" 'vhdl-template-block-configuration) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1420 (define-key vhdl-template-map "Cc" 'vhdl-template-component-conf) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1421 (define-key vhdl-template-map "Cd" 'vhdl-template-configuration-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1422 (define-key vhdl-template-map "Cs" 'vhdl-template-configuration-spec) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1423 (define-key vhdl-template-map "co" 'vhdl-template-constant) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1424 (define-key vhdl-template-map "di" 'vhdl-template-disconnect) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1425 (define-key vhdl-template-map "el" 'vhdl-template-else) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1426 (define-key vhdl-template-map "ei" 'vhdl-template-elsif) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1427 (define-key vhdl-template-map "en" 'vhdl-template-entity) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1428 (define-key vhdl-template-map "ex" 'vhdl-template-exit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1429 (define-key vhdl-template-map "fi" 'vhdl-template-file) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1430 (define-key vhdl-template-map "fg" 'vhdl-template-for-generate) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1431 (define-key vhdl-template-map "fl" 'vhdl-template-for-loop) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1432 (define-key vhdl-template-map "\C-f" 'vhdl-template-footer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1433 (define-key vhdl-template-map "fb" 'vhdl-template-function-body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1434 (define-key vhdl-template-map "fd" 'vhdl-template-function-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1435 (define-key vhdl-template-map "ge" 'vhdl-template-generic) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1436 (define-key vhdl-template-map "gd" 'vhdl-template-group-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1437 (define-key vhdl-template-map "gt" 'vhdl-template-group-template) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1438 (define-key vhdl-template-map "\C-h" 'vhdl-template-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1439 (define-key vhdl-template-map "ig" 'vhdl-template-if-generate) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1440 (define-key vhdl-template-map "it" 'vhdl-template-if-then) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1441 (define-key vhdl-template-map "li" 'vhdl-template-library) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1442 (define-key vhdl-template-map "lo" 'vhdl-template-bare-loop) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1443 (define-key vhdl-template-map "\C-m" 'vhdl-template-modify) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1444 (define-key vhdl-template-map "\C-t" 'vhdl-template-insert-date) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1445 (define-key vhdl-template-map "ma" 'vhdl-template-map) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1446 (define-key vhdl-template-map "ne" 'vhdl-template-next) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1447 (define-key vhdl-template-map "ot" 'vhdl-template-others) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1448 (define-key vhdl-template-map "Pd" 'vhdl-template-package-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1449 (define-key vhdl-template-map "Pb" 'vhdl-template-package-body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1450 (define-key vhdl-template-map "(" 'vhdl-template-paired-parens) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1451 (define-key vhdl-template-map "po" 'vhdl-template-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1452 (define-key vhdl-template-map "pb" 'vhdl-template-procedure-body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1453 (define-key vhdl-template-map "pd" 'vhdl-template-procedure-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1454 (define-key vhdl-template-map "pc" 'vhdl-template-process-comb) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1455 (define-key vhdl-template-map "ps" 'vhdl-template-process-seq) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1456 (define-key vhdl-template-map "rp" 'vhdl-template-report) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1457 (define-key vhdl-template-map "rt" 'vhdl-template-return) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1458 (define-key vhdl-template-map "ss" 'vhdl-template-selected-signal-asst) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1459 (define-key vhdl-template-map "si" 'vhdl-template-signal) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1460 (define-key vhdl-template-map "su" 'vhdl-template-subtype) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1461 (define-key vhdl-template-map "ty" 'vhdl-template-type) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1462 (define-key vhdl-template-map "us" 'vhdl-template-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1463 (define-key vhdl-template-map "va" 'vhdl-template-variable) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1464 (define-key vhdl-template-map "wa" 'vhdl-template-wait) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1465 (define-key vhdl-template-map "wl" 'vhdl-template-while-loop) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1466 (define-key vhdl-template-map "wi" 'vhdl-template-with) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1467 (define-key vhdl-template-map "wc" 'vhdl-template-clocked-wait) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1468 (define-key vhdl-template-map "\C-pb" 'vhdl-template-package-numeric-bit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1469 (define-key vhdl-template-map "\C-pn" 'vhdl-template-package-numeric-std) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1470 (define-key vhdl-template-map "\C-ps" 'vhdl-template-package-std-logic-1164) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1471 (define-key vhdl-template-map "\C-pA" 'vhdl-template-package-std-logic-arith) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1472 (define-key vhdl-template-map "\C-pM" 'vhdl-template-package-std-logic-misc) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1473 (define-key vhdl-template-map "\C-pS" 'vhdl-template-package-std-logic-signed) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1474 (define-key vhdl-template-map "\C-pT" 'vhdl-template-package-std-logic-textio) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1475 (define-key vhdl-template-map "\C-pU" 'vhdl-template-package-std-logic-unsigned) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1476 (define-key vhdl-template-map "\C-pt" 'vhdl-template-package-textio) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1477 (define-key vhdl-template-map "\C-dn" 'vhdl-template-directive-translate-on) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1478 (define-key vhdl-template-map "\C-df" 'vhdl-template-directive-translate-off) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1479 (define-key vhdl-template-map "\C-dN" 'vhdl-template-directive-synthesis-on) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1480 (define-key vhdl-template-map "\C-dF" 'vhdl-template-directive-synthesis-off) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1481 (define-key vhdl-template-map "\C-q" 'vhdl-template-search-prompt) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1482 (when (vhdl-standard-p 'ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1483 (define-key vhdl-template-map "br" 'vhdl-template-break) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1484 (define-key vhdl-template-map "cu" 'vhdl-template-case-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1485 (define-key vhdl-template-map "iu" 'vhdl-template-if-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1486 (define-key vhdl-template-map "lm" 'vhdl-template-limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1487 (define-key vhdl-template-map "na" 'vhdl-template-nature) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1488 (define-key vhdl-template-map "pa" 'vhdl-template-procedural) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1489 (define-key vhdl-template-map "qf" 'vhdl-template-quantity-free) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1490 (define-key vhdl-template-map "qb" 'vhdl-template-quantity-branch) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1491 (define-key vhdl-template-map "qs" 'vhdl-template-quantity-source) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1492 (define-key vhdl-template-map "sn" 'vhdl-template-subnature) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1493 (define-key vhdl-template-map "te" 'vhdl-template-terminal) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1494 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1495 (when (vhdl-standard-p 'math) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1496 (define-key vhdl-template-map "\C-pc" 'vhdl-template-package-math-complex) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1497 (define-key vhdl-template-map "\C-pr" 'vhdl-template-package-math-real) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1498 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1499 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1500 ;; initialize template map for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1501 (vhdl-template-map-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1502 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1503 (defun vhdl-function-name (prefix string &optional postfix) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1504 "Generate a Lisp function name. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1505 PREFIX, STRING and optional POSTFIX are concatenated by '-' and spaces in |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1506 STRING are replaced by `-' and substrings are converted to lower case." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1507 (let ((name prefix)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1508 (while (string-match "\\(\\w+\\)\\s-*\\(.*\\)" string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1509 (setq name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1510 (concat name "-" (downcase (substring string 0 (match-end 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1511 (setq string (substring string (match-beginning 2)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1512 (when postfix (setq name (concat name "-" postfix))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1513 (intern name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1514 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1515 (defvar vhdl-model-map () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1516 "Keymap for VHDL models.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1517 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1518 (defun vhdl-model-map-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1519 "Initialize `vhdl-model-map'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1520 (setq vhdl-model-map (make-sparse-keymap)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1521 ;; key bindings for VHDL models |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1522 (let ((model-alist vhdl-model-alist) model) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1523 (while model-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1524 (setq model (car model-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1525 (define-key vhdl-model-map (nth 2 model) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1526 (vhdl-function-name "vhdl-model" (nth 0 model))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1527 (setq model-alist (cdr model-alist))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1528 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1529 ;; initialize user model map for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1530 (vhdl-model-map-init) |
20665 | 1531 |
1532 (defvar vhdl-mode-map () | |
1533 "Keymap for VHDL Mode.") | |
1534 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1535 (defun vhdl-mode-map-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1536 "Initialize `vhdl-mode-map'." |
20665 | 1537 (setq vhdl-mode-map (make-sparse-keymap)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1538 ;; template key bindings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1539 (define-key vhdl-mode-map "\C-c\C-t" vhdl-template-map) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1540 ;; model key bindings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1541 (define-key vhdl-mode-map "\C-c\C-m" vhdl-model-map) |
20665 | 1542 ;; standard key bindings |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1543 (define-key vhdl-mode-map "\M-a" 'vhdl-beginning-of-statement) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1544 (define-key vhdl-mode-map "\M-e" 'vhdl-end-of-statement) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1545 (define-key vhdl-mode-map "\M-\C-f" 'vhdl-forward-sexp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1546 (define-key vhdl-mode-map "\M-\C-b" 'vhdl-backward-sexp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1547 (define-key vhdl-mode-map "\M-\C-u" 'vhdl-backward-up-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1548 (define-key vhdl-mode-map "\M-\C-a" 'vhdl-beginning-of-defun) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1549 (define-key vhdl-mode-map "\M-\C-e" 'vhdl-end-of-defun) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1550 (define-key vhdl-mode-map "\M-\C-h" 'vhdl-mark-defun) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1551 (define-key vhdl-mode-map "\M-\C-q" 'vhdl-indent-sexp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1552 ;; backspace/delete key bindings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1553 (define-key vhdl-mode-map [backspace] 'backward-delete-char-untabify) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1554 (define-key vhdl-mode-map [delete] 'delete-char) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1555 (unless (string-match "XEmacs" emacs-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1556 (define-key vhdl-mode-map [M-delete] 'kill-word)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1557 ;; mode specific key bindings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1558 (define-key vhdl-mode-map "\C-c\C-e" 'vhdl-electric-mode) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1559 (define-key vhdl-mode-map "\C-c\C-s" 'vhdl-stutter-mode) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1560 (define-key vhdl-mode-map "\C-c\C-k" 'vhdl-compile) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1561 (define-key vhdl-mode-map "\C-c\M-\C-k" 'vhdl-make) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1562 (define-key vhdl-mode-map "\C-c\C-p\C-w" 'vhdl-port-copy) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1563 (define-key vhdl-mode-map "\C-c\C-p\M-w" 'vhdl-port-copy) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1564 (define-key vhdl-mode-map "\C-c\C-p\C-e" 'vhdl-port-paste-entity) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1565 (define-key vhdl-mode-map "\C-c\C-p\C-c" 'vhdl-port-paste-component) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1566 (define-key vhdl-mode-map "\C-c\C-p\C-i" 'vhdl-port-paste-instance) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1567 (define-key vhdl-mode-map "\C-c\C-p\C-s" 'vhdl-port-paste-signals) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1568 (define-key vhdl-mode-map "\C-c\C-p\M-c" 'vhdl-port-paste-constants) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1569 (if (string-match "XEmacs" emacs-version) ; `... C-g' not allowed in XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1570 (define-key vhdl-mode-map "\C-c\C-p\M-g" 'vhdl-port-paste-generic-map) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1571 (define-key vhdl-mode-map "\C-c\C-p\C-g" 'vhdl-port-paste-generic-map)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1572 (define-key vhdl-mode-map "\C-c\C-p\C-t" 'vhdl-port-paste-testbench) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1573 (define-key vhdl-mode-map "\C-c\C-p\C-f" 'vhdl-port-flatten) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1574 (define-key vhdl-mode-map "\C-c\C-c" 'vhdl-comment-uncomment-region) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1575 (define-key vhdl-mode-map "\C-c-" 'vhdl-comment-append-inline) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1576 (define-key vhdl-mode-map "\C-c\M--" 'vhdl-comment-display-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1577 (define-key vhdl-mode-map "\C-c\M-\C-i" 'vhdl-indent-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1578 (define-key vhdl-mode-map "\M-\C-\\" 'vhdl-indent-region) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1579 (define-key vhdl-mode-map "\C-c\C-a" 'vhdl-align-group) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1580 (define-key vhdl-mode-map "\C-c\C-r\C-a" 'vhdl-align-noindent-region) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1581 (define-key vhdl-mode-map "\C-c\M-\C-a" 'vhdl-align-inline-comment-group) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1582 (define-key vhdl-mode-map "\C-c\C-r\M-\C-a" 'vhdl-align-inline-comment-region) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1583 (define-key vhdl-mode-map "\C-c\C-w" 'vhdl-fixup-whitespace-region) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1584 (define-key vhdl-mode-map "\C-c\C-l\C-w" 'vhdl-line-kill) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1585 (define-key vhdl-mode-map "\C-c\C-l\M-w" 'vhdl-line-copy) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1586 (define-key vhdl-mode-map "\C-c\C-l\C-y" 'vhdl-line-yank) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1587 (define-key vhdl-mode-map "\C-c\C-l\t" 'vhdl-line-expand) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1588 (define-key vhdl-mode-map "\C-c\C-l\C-n" 'vhdl-line-transpose-next) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1589 (define-key vhdl-mode-map "\C-c\C-l\C-p" 'vhdl-line-transpose-previous) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1590 (define-key vhdl-mode-map "\C-c\C-l\C-o" 'vhdl-line-open) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1591 (define-key vhdl-mode-map "\C-c\C-l\C-g" 'goto-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1592 (define-key vhdl-mode-map "\C-c\C-l\C-c" 'vhdl-comment-uncomment-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1593 (define-key vhdl-mode-map "\C-c\C-r\C-u" 'vhdl-fix-case-region) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1594 (define-key vhdl-mode-map "\C-c\C-u" 'vhdl-fix-case-buffer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1595 (define-key vhdl-mode-map "\C-c\C-f" 'vhdl-fontify-buffer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1596 (define-key vhdl-mode-map "\C-c\C-x" 'vhdl-show-syntactic-information) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1597 (define-key vhdl-mode-map "\C-c\C-h" 'vhdl-doc-mode) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1598 (define-key vhdl-mode-map "\C-c\C-v" 'vhdl-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1599 (define-key vhdl-mode-map "\C-c\C-r\C-b" 'vhdl-beautify-region) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1600 (define-key vhdl-mode-map "\C-c\C-b" 'vhdl-beautify-buffer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1601 (define-key vhdl-mode-map "\M-\t" 'tab-to-tab-stop) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1602 ;; insert commands bindings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1603 (define-key vhdl-mode-map "\C-c\C-i\C-c" 'vhdl-template-insert-construct) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1604 (define-key vhdl-mode-map "\C-c\C-i\C-p" 'vhdl-template-insert-package) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1605 (define-key vhdl-mode-map "\C-c\C-i\C-d" 'vhdl-template-insert-directive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1606 (define-key vhdl-mode-map "\C-c\C-i\C-m" 'vhdl-model-insert) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1607 ;; electric key bindings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1608 (define-key vhdl-mode-map " " 'vhdl-electric-space) |
20665 | 1609 (if vhdl-intelligent-tab |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1610 (define-key vhdl-mode-map "\t" 'vhdl-electric-tab) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1611 (define-key vhdl-mode-map "\t" 'vhdl-indent-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1612 (define-key vhdl-mode-map "\r" 'vhdl-electric-return) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1613 (define-key vhdl-mode-map "-" 'vhdl-electric-dash) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1614 (define-key vhdl-mode-map "[" 'vhdl-electric-open-bracket) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1615 (define-key vhdl-mode-map "]" 'vhdl-electric-close-bracket) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1616 (define-key vhdl-mode-map "'" 'vhdl-electric-quote) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1617 (define-key vhdl-mode-map ";" 'vhdl-electric-semicolon) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1618 (define-key vhdl-mode-map "," 'vhdl-electric-comma) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1619 (define-key vhdl-mode-map "." 'vhdl-electric-period) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1620 (when (vhdl-standard-p 'ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1621 (define-key vhdl-mode-map "=" 'vhdl-electric-equal))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1622 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1623 ;; initialize mode map for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1624 (vhdl-mode-map-init) |
20665 | 1625 |
1626 ;; define special minibuffer keymap for enabling word completion in minibuffer | |
1627 ;; (useful in template generator prompts) | |
1628 (defvar vhdl-minibuffer-local-map (copy-keymap minibuffer-local-map) | |
1629 "Keymap for minibuffer used in VHDL Mode.") | |
1630 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1631 (when vhdl-word-completion-in-minibuffer |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1632 (define-key vhdl-minibuffer-local-map "\t" 'vhdl-minibuffer-tab)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1633 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1634 ;; set up electric character functions to work with |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1635 ;; `delete-selection-mode' (Emacs) and `pending-delete-mode' (XEmacs) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1636 (mapcar |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1637 (function |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1638 (lambda (sym) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1639 (put sym 'delete-selection t) ; for `delete-selection-mode' (Emacs) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1640 (put sym 'pending-delete t))) ; for `pending-delete-mode' (XEmacs) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1641 '(vhdl-electric-space |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1642 vhdl-electric-tab |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1643 vhdl-electric-return |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1644 vhdl-electric-dash |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1645 vhdl-electric-open-bracket |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1646 vhdl-electric-close-bracket |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1647 vhdl-electric-quote |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1648 vhdl-electric-semicolon |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1649 vhdl-electric-comma |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1650 vhdl-electric-period |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1651 vhdl-electric-equal)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1652 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1653 ;; syntax table |
20665 | 1654 (defvar vhdl-mode-syntax-table nil |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1655 "Syntax table used in `vhdl-mode' buffers.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1656 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1657 (defun vhdl-mode-syntax-table-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1658 "Initialize `vhdl-mode-syntax-table'." |
20665 | 1659 (setq vhdl-mode-syntax-table (make-syntax-table)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1660 ;; define punctuation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1661 (modify-syntax-entry ?\# "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1662 (modify-syntax-entry ?\$ "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1663 (modify-syntax-entry ?\% "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1664 (modify-syntax-entry ?\& "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1665 (modify-syntax-entry ?\' "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1666 (modify-syntax-entry ?\* "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1667 (modify-syntax-entry ?\+ "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1668 (modify-syntax-entry ?\. "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1669 (modify-syntax-entry ?\/ "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1670 (modify-syntax-entry ?\: "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1671 (modify-syntax-entry ?\; "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1672 (modify-syntax-entry ?\< "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1673 (modify-syntax-entry ?\= "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1674 (modify-syntax-entry ?\> "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1675 (modify-syntax-entry ?\\ "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1676 (modify-syntax-entry ?\| "." vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1677 ;; define string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1678 (modify-syntax-entry ?\" "\"" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1679 ;; define underscore |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1680 (when vhdl-underscore-is-part-of-word |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1681 (modify-syntax-entry ?_ "w" vhdl-mode-syntax-table)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1682 ;; a single hyphen is punctuation, but a double hyphen starts a comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1683 (modify-syntax-entry ?\- ". 12" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1684 ;; and \n and \^M end a comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1685 (modify-syntax-entry ?\n ">" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1686 (modify-syntax-entry ?\^M ">" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1687 ;; define parentheses to match |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1688 (modify-syntax-entry ?\( "()" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1689 (modify-syntax-entry ?\) ")(" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1690 (modify-syntax-entry ?\[ "(]" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1691 (modify-syntax-entry ?\] ")[" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1692 (modify-syntax-entry ?\{ "(}" vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1693 (modify-syntax-entry ?\} "){" vhdl-mode-syntax-table)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1694 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1695 ;; initialize syntax table for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1696 (vhdl-mode-syntax-table-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1697 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1698 (defmacro vhdl-ext-syntax-table (&rest body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1699 "Execute BODY with syntax table that includes `_' in word class." |
26464 | 1700 `(let (result) |
1701 (modify-syntax-entry ?_ "w" vhdl-mode-syntax-table) | |
1702 (setq result (progn ,@body)) | |
1703 (when (not vhdl-underscore-is-part-of-word) | |
1704 (modify-syntax-entry ?_ "_" vhdl-mode-syntax-table)) | |
1705 result)) | |
20665 | 1706 |
1707 (defvar vhdl-syntactic-context nil | |
1708 "Buffer local variable containing syntactic analysis list.") | |
1709 (make-variable-buffer-local 'vhdl-syntactic-context) | |
1710 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1711 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 1712 ;; Abbrev hook bindings |
1713 | |
1714 (defvar vhdl-mode-abbrev-table nil | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1715 "Abbrev table to use in `vhdl-mode' buffers.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1716 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1717 (defun vhdl-mode-abbrev-table-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1718 "Initialize `vhdl-mode-abbrev-table'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1719 (when vhdl-mode-abbrev-table (clear-abbrev-table vhdl-mode-abbrev-table)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1720 (define-abbrev-table 'vhdl-mode-abbrev-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1721 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1722 (when (memq 'vhdl vhdl-electric-keywords) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1723 ;; VHDL'93 keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1724 '( |
42441
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1725 ("--" "" vhdl-template-display-comment-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1726 ("abs" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1727 ("access" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1728 ("after" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1729 ("alias" "" vhdl-template-alias-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1730 ("all" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1731 ("and" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1732 ("arch" "" vhdl-template-architecture-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1733 ("architecture" "" vhdl-template-architecture-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1734 ("array" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1735 ("assert" "" vhdl-template-assert-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1736 ("attr" "" vhdl-template-attribute-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1737 ("attribute" "" vhdl-template-attribute-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1738 ("begin" "" vhdl-template-default-indent-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1739 ("block" "" vhdl-template-block-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1740 ("body" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1741 ("buffer" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1742 ("bus" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1743 ("case" "" vhdl-template-case-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1744 ("comp" "" vhdl-template-component-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1745 ("component" "" vhdl-template-component-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1746 ("cond" "" vhdl-template-conditional-signal-asst-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1747 ("conditional" "" vhdl-template-conditional-signal-asst-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1748 ("conf" "" vhdl-template-configuration-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1749 ("configuration" "" vhdl-template-configuration-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1750 ("cons" "" vhdl-template-constant-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1751 ("constant" "" vhdl-template-constant-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1752 ("disconnect" "" vhdl-template-disconnect-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1753 ("downto" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1754 ("else" "" vhdl-template-else-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1755 ("elseif" "" vhdl-template-elsif-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1756 ("elsif" "" vhdl-template-elsif-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1757 ("end" "" vhdl-template-default-indent-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1758 ("entity" "" vhdl-template-entity-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1759 ("exit" "" vhdl-template-exit-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1760 ("file" "" vhdl-template-file-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1761 ("for" "" vhdl-template-for-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1762 ("func" "" vhdl-template-function-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1763 ("function" "" vhdl-template-function-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1764 ("generic" "" vhdl-template-generic-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1765 ("group" "" vhdl-template-group-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1766 ("guarded" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1767 ("if" "" vhdl-template-if-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1768 ("impure" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1769 ("in" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1770 ("inertial" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1771 ("inout" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1772 ("inst" "" vhdl-template-instance-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1773 ("instance" "" vhdl-template-instance-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1774 ("is" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1775 ("label" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1776 ("library" "" vhdl-template-library-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1777 ("linkage" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1778 ("literal" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1779 ("loop" "" vhdl-template-bare-loop-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1780 ("map" "" vhdl-template-map-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1781 ("mod" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1782 ("nand" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1783 ("new" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1784 ("next" "" vhdl-template-next-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1785 ("nor" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1786 ("not" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1787 ("null" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1788 ("of" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1789 ("on" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1790 ("open" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1791 ("or" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1792 ("others" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1793 ("out" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1794 ("pack" "" vhdl-template-package-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1795 ("package" "" vhdl-template-package-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1796 ("port" "" vhdl-template-port-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1797 ("postponed" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1798 ("procedure" "" vhdl-template-procedure-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1799 ("process" "" vhdl-template-process-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1800 ("pure" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1801 ("range" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1802 ("record" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1803 ("register" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1804 ("reject" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1805 ("rem" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1806 ("report" "" vhdl-template-report-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1807 ("return" "" vhdl-template-return-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1808 ("rol" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1809 ("ror" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1810 ("select" "" vhdl-template-selected-signal-asst-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1811 ("severity" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1812 ("shared" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1813 ("sig" "" vhdl-template-signal-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1814 ("signal" "" vhdl-template-signal-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1815 ("sla" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1816 ("sll" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1817 ("sra" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1818 ("srl" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1819 ("subtype" "" vhdl-template-subtype-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1820 ("then" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1821 ("to" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1822 ("transport" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1823 ("type" "" vhdl-template-type-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1824 ("unaffected" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1825 ("units" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1826 ("until" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1827 ("use" "" vhdl-template-use-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1828 ("var" "" vhdl-template-variable-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1829 ("variable" "" vhdl-template-variable-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1830 ("wait" "" vhdl-template-wait-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1831 ("when" "" vhdl-template-when-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1832 ("while" "" vhdl-template-while-loop-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1833 ("with" "" vhdl-template-with-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1834 ("xnor" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1835 ("xor" "" vhdl-template-default-hook 0 t) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1836 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1837 ;; VHDL-AMS keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1838 (when (and (memq 'vhdl vhdl-electric-keywords) (vhdl-standard-p 'ams)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1839 '( |
42441
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1840 ("across" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1841 ("break" "" vhdl-template-break-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1842 ("limit" "" vhdl-template-limit-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1843 ("nature" "" vhdl-template-nature-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1844 ("noise" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1845 ("procedural" "" vhdl-template-procedural-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1846 ("quantity" "" vhdl-template-quantity-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1847 ("reference" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1848 ("spectrum" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1849 ("subnature" "" vhdl-template-subnature-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1850 ("terminal" "" vhdl-template-terminal-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1851 ("through" "" vhdl-template-default-hook 0 t) |
3bd37559f5f7
(vhdl-mode-abbrev-table-init): Mark all the predefined abbrevs as "system"
Pavel Janík <Pavel@Janik.cz>
parents:
42205
diff
changeset
|
1852 ("tolerance" "" vhdl-template-default-hook 0 t) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1853 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1854 ;; user model keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1855 (when (memq 'user vhdl-electric-keywords) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1856 (let ((alist vhdl-model-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1857 abbrev-list keyword) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1858 (while alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1859 (setq keyword (nth 3 (car alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1860 (unless (equal keyword "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1861 (setq abbrev-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1862 (cons (list keyword "" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1863 (vhdl-function-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1864 "vhdl-model" (nth 0 (car alist)) "hook") 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1865 abbrev-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1866 (setq alist (cdr alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1867 abbrev-list))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1868 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1869 ;; initialize abbrev table for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1870 (vhdl-mode-abbrev-table-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1871 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1872 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1873 ;; Template completion lists |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1874 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1875 (defvar vhdl-template-construct-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1876 "List of built-in construct templates.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1877 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1878 (defun vhdl-template-construct-alist-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1879 "Initialize `vhdl-template-construct-alist'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1880 (setq |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1881 vhdl-template-construct-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1882 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1883 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1884 ("alias declaration" vhdl-template-alias) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1885 ("architecture body" vhdl-template-architecture) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1886 ("assertion" vhdl-template-assert) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1887 ("attribute declaration" vhdl-template-attribute-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1888 ("attribute specification" vhdl-template-attribute-spec) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1889 ("block configuration" vhdl-template-block-configuration) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1890 ("block statement" vhdl-template-block) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1891 ("case statement" vhdl-template-case-is) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1892 ("component configuration" vhdl-template-component-conf) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1893 ("component declaration" vhdl-template-component-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1894 ("component instantiation statement" vhdl-template-component-inst) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1895 ("conditional signal assignment" vhdl-template-conditional-signal-asst) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1896 ("configuration declaration" vhdl-template-configuration-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1897 ("configuration specification" vhdl-template-configuration-spec) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1898 ("constant declaration" vhdl-template-constant) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1899 ("disconnection specification" vhdl-template-disconnect) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1900 ("entity declaration" vhdl-template-entity) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1901 ("exit statement" vhdl-template-exit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1902 ("file declaration" vhdl-template-file) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1903 ("generate statement" vhdl-template-generate) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1904 ("generic clause" vhdl-template-generic) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1905 ("group declaration" vhdl-template-group-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1906 ("group template declaration" vhdl-template-group-template) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1907 ("if statement" vhdl-template-if-then) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1908 ("library clause" vhdl-template-library) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1909 ("loop statement" vhdl-template-loop) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1910 ("next statement" vhdl-template-next) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1911 ("package declaration" vhdl-template-package-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1912 ("package body" vhdl-template-package-body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1913 ("port clause" vhdl-template-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1914 ("process statement" vhdl-template-process) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1915 ("report statement" vhdl-template-report) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1916 ("return statement" vhdl-template-return) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1917 ("selected signal assignment" vhdl-template-selected-signal-asst) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1918 ("signal declaration" vhdl-template-signal) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1919 ("subprogram declaration" vhdl-template-subprogram-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1920 ("subprogram body" vhdl-template-subprogram-body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1921 ("subtype declaration" vhdl-template-subtype) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1922 ("type declaration" vhdl-template-type) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1923 ("use clause" vhdl-template-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1924 ("variable declaration" vhdl-template-variable) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1925 ("wait statement" vhdl-template-wait) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1926 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1927 (when (vhdl-standard-p 'ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1928 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1929 ("break statement" vhdl-template-break) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1930 ("nature declaration" vhdl-template-nature) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1931 ("quantity declaration" vhdl-template-quantity) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1932 ("simultaneous case statement" vhdl-template-case-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1933 ("simultaneous if statement" vhdl-template-if-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1934 ("simultaneous procedural statement" vhdl-template-procedural) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1935 ("step limit specification" vhdl-template-limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1936 ("subnature declaration" vhdl-template-subnature) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1937 ("terminal declaration" vhdl-template-terminal) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1938 ))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1939 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1940 ;; initialize for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1941 (vhdl-template-construct-alist-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1942 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1943 (defvar vhdl-template-package-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1944 "List of built-in package templates.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1945 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1946 (defun vhdl-template-package-alist-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1947 "Initialize `vhdl-template-package-alist'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1948 (setq |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1949 vhdl-template-package-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1950 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1951 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1952 ("numeric_bit" vhdl-template-package-numeric-bit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1953 ("numeric_std" vhdl-template-package-numeric-std) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1954 ("std_logic_1164" vhdl-template-package-std-logic-1164) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1955 ("std_logic_arith" vhdl-template-package-std-logic-arith) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1956 ("std_logic_misc" vhdl-template-package-std-logic-misc) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1957 ("std_logic_signed" vhdl-template-package-std-logic-signed) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1958 ("std_logic_textio" vhdl-template-package-std-logic-textio) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1959 ("std_logic_unsigned" vhdl-template-package-std-logic-unsigned) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1960 ("textio" vhdl-template-package-textio) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1961 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1962 (when (vhdl-standard-p 'math) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1963 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1964 ("math_complex" vhdl-template-package-math-complex) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1965 ("math_real" vhdl-template-package-math-real) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1966 ))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1967 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1968 ;; initialize for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1969 (vhdl-template-package-alist-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1970 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1971 (defvar vhdl-template-directive-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1972 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1973 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1974 ("translate_on" vhdl-template-directive-translate-on) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1975 ("translate_off" vhdl-template-directive-translate-off) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1976 ("synthesis_on" vhdl-template-directive-synthesis-on) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1977 ("synthesis_off" vhdl-template-directive-synthesis-off) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1978 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1979 "List of built-in directive templates.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1980 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1981 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1982 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1983 ;;; Menues |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1984 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1985 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1986 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 1987 ;; VHDL menu (using `easy-menu.el') |
1988 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1989 (defun vhdl-customize () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1990 "Call the customize function with `vhdl' as argument." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1991 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1992 (customize-browse 'vhdl)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1993 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1994 (defun vhdl-create-customize-menu () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1995 "Create a full customization menu for VHDL, insert it into the menu." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1996 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1997 (if (fboundp 'customize-menu-create) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1998 (easy-menu-change |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
1999 '("VHDL") "Customize" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2000 `(["Browse VHDL Group..." vhdl-customize t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2001 ,(customize-menu-create 'vhdl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2002 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2003 ["Activate New Customizations" vhdl-activate-customizations t])) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2004 (error "Cannot expand menu (outdated version of cus-edit.el)"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2005 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2006 (defun vhdl-create-mode-menu () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2007 "Create VHDL Mode menu." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2008 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2009 "VHDL" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2010 '("Mode" |
20665 | 2011 ["Electric" vhdl-electric-mode :style toggle :selected vhdl-electric-mode] |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2012 ["Stutter" vhdl-stutter-mode :style toggle :selected vhdl-stutter-mode] |
20665 | 2013 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2014 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2015 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2016 '("Project" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2017 ["None" (vhdl-project-switch "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2018 :style radio :selected (equal vhdl-project "")] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2019 "--" |
20665 | 2020 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2021 ;; add menu entries for defined projects |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2022 (let ((project-alist vhdl-project-alist) menu-alist name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2023 (while project-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2024 (setq name (car (car project-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2025 (setq menu-alist (cons (vector name (list 'vhdl-project-switch name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2026 :style 'radio :selected |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2027 (list 'equal 'vhdl-project name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2028 menu-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2029 (setq project-alist (cdr project-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2030 (setq menu-alist (cons '["Add Project..." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2031 (customize-variable 'vhdl-project-alist) t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2032 (cons "--" menu-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2033 (nreverse menu-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2034 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2035 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2036 "Compile" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2037 ["Compile Buffer" vhdl-compile t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2038 ["Stop Compilation" kill-compilation t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2039 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2040 ["Make" vhdl-make t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2041 ["Generate Makefile" vhdl-generate-makefile t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2042 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2043 ["Next Error" next-error t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2044 ["Previous Error" previous-error t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2045 ["First Error" first-error t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2046 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2047 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2048 '("Compiler") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2049 ;; add menu entries for defined compilers |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2050 (let ((comp-alist vhdl-compiler-alist) menu-alist name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2051 (while comp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2052 (setq name (car (car comp-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2053 (setq menu-alist (cons (vector name (list 'setq 'vhdl-compiler name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2054 :style 'radio :selected |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2055 (list 'equal 'vhdl-compiler name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2056 menu-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2057 (setq comp-alist (cdr comp-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2058 (setq menu-alist (cons '["Add Compiler..." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2059 (customize-variable 'vhdl-compiler-alist) t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2060 (cons "--" menu-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2061 (nreverse menu-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2062 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2063 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2064 '("Template" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2065 ("VHDL Construct 1" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2066 ["Alias" vhdl-template-alias t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2067 ["Architecture" vhdl-template-architecture t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2068 ["Assert" vhdl-template-assert t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2069 ["Attribute (Decl)" vhdl-template-attribute-decl t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2070 ["Attribute (Spec)" vhdl-template-attribute-spec t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2071 ["Block" vhdl-template-block t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2072 ["Case" vhdl-template-case-is t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2073 ["Component (Decl)" vhdl-template-component-decl t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2074 ["(Component) Instance" vhdl-template-component-inst t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2075 ["Conditional (Signal Asst)" vhdl-template-conditional-signal-asst t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2076 ["Configuration (Block)"vhdl-template-block-configuration t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2077 ["Configuration (Comp)" vhdl-template-component-conf t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2078 ["Configuration (Decl)" vhdl-template-configuration-decl t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2079 ["Configuration (Spec)" vhdl-template-configuration-spec t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2080 ["Constant" vhdl-template-constant t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2081 ["Disconnect" vhdl-template-disconnect t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2082 ["Else" vhdl-template-else t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2083 ["Elsif" vhdl-template-elsif t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2084 ["Entity" vhdl-template-entity t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2085 ["Exit" vhdl-template-exit t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2086 ["File" vhdl-template-file t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2087 ["For (Generate)" vhdl-template-for-generate t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2088 ["For (Loop)" vhdl-template-for-loop t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2089 ["Function (Body)" vhdl-template-function-body t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2090 ["Function (Decl)" vhdl-template-function-decl t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2091 ["Generic" vhdl-template-generic t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2092 ["Group (Decl)" vhdl-template-group-decl t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2093 ["Group (Template)" vhdl-template-group-template t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2094 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2095 ("VHDL Construct 2" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2096 ["If (Generate)" vhdl-template-if-generate t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2097 ["If (Then)" vhdl-template-if-then t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2098 ["Library" vhdl-template-library t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2099 ["Loop" vhdl-template-bare-loop t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2100 ["Map" vhdl-template-map t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2101 ["Next" vhdl-template-next t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2102 ["(Others)" vhdl-template-others t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2103 ["Package (Decl)" vhdl-template-package-decl t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2104 ["Package (Body)" vhdl-template-package-body t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2105 ["Port" vhdl-template-port t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2106 ["Procedure (Body)" vhdl-template-procedure-body t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2107 ["Procedure (Decl)" vhdl-template-procedure-decl t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2108 ["Process (Comb)" vhdl-template-process-comb t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2109 ["Process (Seq)" vhdl-template-process-seq t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2110 ["Report" vhdl-template-report t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2111 ["Return" vhdl-template-return t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2112 ["Select" vhdl-template-selected-signal-asst t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2113 ["Signal" vhdl-template-signal t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2114 ["Subtype" vhdl-template-subtype t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2115 ["Type" vhdl-template-type t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2116 ["Use" vhdl-template-use t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2117 ["Variable" vhdl-template-variable t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2118 ["Wait" vhdl-template-wait t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2119 ["(Clocked Wait)" vhdl-template-clocked-wait t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2120 ["When" vhdl-template-when t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2121 ["While (Loop)" vhdl-template-while-loop t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2122 ["With" vhdl-template-with t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2123 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2124 (when (vhdl-standard-p 'ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2125 '(("VHDL-AMS Construct" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2126 ["Break" vhdl-template-break t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2127 ["Case (Use)" vhdl-template-case-use t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2128 ["If (Use)" vhdl-template-if-use t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2129 ["Limit" vhdl-template-limit t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2130 ["Nature" vhdl-template-nature t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2131 ["Procedural" vhdl-template-procedural t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2132 ["Quantity (Free)" vhdl-template-quantity-free t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2133 ["Quantity (Branch)" vhdl-template-quantity-branch t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2134 ["Quantity (Source)" vhdl-template-quantity-source t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2135 ["Subnature" vhdl-template-subnature t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2136 ["Terminal" vhdl-template-terminal t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2137 ))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2138 '(["Insert Construct" vhdl-template-insert-construct |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2139 :keys "C-c C-i C-c"] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2140 "--") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2141 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2142 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2143 '("Package") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2144 (when (vhdl-standard-p 'math) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2145 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2146 ["math_complex" vhdl-template-package-math-complex t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2147 ["math_real" vhdl-template-package-math-real t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2148 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2149 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2150 ["numeric_bit" vhdl-template-package-numeric-bit t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2151 ["numeric_std" vhdl-template-package-numeric-std t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2152 ["std_logic_1164" vhdl-template-package-std-logic-1164 t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2153 ["textio" vhdl-template-package-textio t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2154 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2155 ["std_logic_arith" vhdl-template-package-std-logic-arith t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2156 ["std_logic_signed" vhdl-template-package-std-logic-signed t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2157 ["std_logic_unsigned" vhdl-template-package-std-logic-unsigned t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2158 ["std_logic_misc" vhdl-template-package-std-logic-misc t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2159 ["std_logic_textio" vhdl-template-package-std-logic-textio t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2160 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2161 ["Insert Package" vhdl-template-insert-package |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2162 :keys "C-c C-i C-p"] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2163 ))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2164 '(("Directive" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2165 ["translate_on" vhdl-template-directive-translate-on t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2166 ["translate_off" vhdl-template-directive-translate-off t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2167 ["synthesis_on" vhdl-template-directive-synthesis-on t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2168 ["synthesis_off" vhdl-template-directive-synthesis-off t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2169 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2170 ["Insert Directive" vhdl-template-insert-directive |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2171 :keys "C-c C-i C-d"] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2172 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2173 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2174 ["Insert Header" vhdl-template-header :keys "C-c C-t C-h"] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2175 ["Insert Footer" vhdl-template-footer t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2176 ["Insert Date" vhdl-template-insert-date t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2177 ["Modify Date" vhdl-template-modify :keys "C-c C-t C-m"] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2178 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2179 ["Query Next Prompt" vhdl-template-search-prompt t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2180 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2181 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2182 '("Model") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2183 ;; add menu entries for defined models |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2184 (let ((model-alist vhdl-model-alist) menu-alist model) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2185 (while model-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2186 (setq model (car model-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2187 (setq menu-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2188 (cons (vector |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2189 (nth 0 model) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2190 (vhdl-function-name "vhdl-model" (nth 0 model)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2191 :keys (concat "C-c C-m " (key-description (nth 2 model)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2192 menu-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2193 (setq model-alist (cdr model-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2194 (setq menu-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2195 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2196 (nreverse menu-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2197 '("--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2198 ["Insert Model" vhdl-model-insert :keys "C-c C-i C-m"] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2199 ["Add Model..." (customize-variable 'vhdl-model-alist) t]))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2200 menu-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2201 '("Port" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2202 ["Copy" vhdl-port-copy t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2203 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2204 ["Paste As Entity" vhdl-port-paste-entity vhdl-port-list] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2205 ["Paste As Component" vhdl-port-paste-component vhdl-port-list] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2206 ["Paste As Instance" vhdl-port-paste-instance |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2207 :keys "C-c C-p C-i" :active vhdl-port-list] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2208 ["Paste As Signals" vhdl-port-paste-signals vhdl-port-list] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2209 ["Paste As Constants" vhdl-port-paste-constants vhdl-port-list] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2210 ["Paste As Generic Map" vhdl-port-paste-generic-map vhdl-port-list] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2211 ["Paste As Test Bench" vhdl-port-paste-testbench vhdl-port-list] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2212 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2213 ["Flatten" vhdl-port-flatten vhdl-port-list] |
20665 | 2214 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2215 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2216 '("Comment" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2217 ["(Un)Comment Out Region" vhdl-comment-uncomment-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2218 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2219 ["Insert Inline Comment" vhdl-comment-append-inline t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2220 ["Insert Horizontal Line" vhdl-comment-display-line t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2221 ["Insert Display Comment" vhdl-comment-display t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2222 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2223 ["Fill Comment" fill-paragraph t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2224 ["Fill Comment Region" fill-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2225 ["Kill Comment Region" vhdl-comment-kill-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2226 ["Kill Inline Comment Region" vhdl-comment-kill-inline-region (mark)] |
20665 | 2227 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2228 '("Line" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2229 ["Kill" vhdl-line-kill t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2230 ["Copy" vhdl-line-copy t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2231 ["Yank" vhdl-line-yank t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2232 ["Expand" vhdl-line-expand t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2233 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2234 ["Transpose Next" vhdl-line-transpose-next t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2235 ["Transpose Prev" vhdl-line-transpose-previous t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2236 ["Open" vhdl-line-open t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2237 ["Join" delete-indentation t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2238 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2239 ["Goto" goto-line t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2240 ["(Un)Comment Out" vhdl-comment-uncomment-line t] |
20665 | 2241 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2242 '("Move" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2243 ["Forward Statement" vhdl-end-of-statement t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2244 ["Backward Statement" vhdl-beginning-of-statement t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2245 ["Forward Expression" vhdl-forward-sexp t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2246 ["Backward Expression" vhdl-backward-sexp t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2247 ["Forward Function" vhdl-end-of-defun t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2248 ["Backward Function" vhdl-beginning-of-defun t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2249 ["Mark Function" vhdl-mark-defun t] |
20665 | 2250 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2251 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2252 '("Indent" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2253 ["Line" vhdl-indent-line t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2254 ["Region" vhdl-indent-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2255 ["Buffer" vhdl-indent-buffer t] |
20665 | 2256 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2257 '("Align" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2258 ["Group" vhdl-align-group t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2259 ["Region" vhdl-align-noindent-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2260 ["Buffer" vhdl-align-noindent-buffer t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2261 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2262 ["Inline Comment Group" vhdl-align-inline-comment-group t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2263 ["Inline Comment Region" vhdl-align-inline-comment-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2264 ["Inline Comment Buffer" vhdl-align-inline-comment-buffer t] |
20665 | 2265 "--" |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2266 ["Fixup Whitespace Region" vhdl-fixup-whitespace-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2267 ["Fixup Whitespace Buffer" vhdl-fixup-whitespace-buffer t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2268 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2269 '("Fix Case" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2270 ["Region" vhdl-fix-case-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2271 ["Buffer" vhdl-fix-case-buffer t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2272 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2273 '("Beautify" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2274 ["Beautify Region" vhdl-beautify-region (mark)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2275 ["Beautify Buffer" vhdl-beautify-buffer t] |
20665 | 2276 ) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2277 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2278 ["Fontify Buffer" vhdl-fontify-buffer t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2279 ["Syntactic Info" vhdl-show-syntactic-information t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2280 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2281 '("Documentation" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2282 ["VHDL Mode" vhdl-doc-mode :keys "C-c C-h"] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2283 ["Reserved Words" (vhdl-doc-variable 'vhdl-doc-keywords) t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2284 ["Coding Style" (vhdl-doc-variable 'vhdl-doc-coding-style) t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2285 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2286 ["Version" vhdl-version t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2287 ["Bug Report..." vhdl-submit-bug-report t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2288 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2289 '("Speedbar" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2290 ["Open/Close" vhdl-speedbar t] |
20665 | 2291 "--" |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2292 ["Show Hierarchy" vhdl-speedbar-toggle-hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2293 :style toggle |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2294 :selected |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2295 (and (boundp 'speedbar-initial-expansion-list-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2296 (equal speedbar-initial-expansion-list-name "vhdl hierarchy")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2297 :active (and (boundp 'speedbar-frame) speedbar-frame)] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2298 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2299 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2300 '("Customize" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2301 ["Browse VHDL Group..." vhdl-customize t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2302 ["Build Customize Menu" vhdl-create-customize-menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2303 (fboundp 'customize-menu-create)] |
20665 | 2304 "--" |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2305 ["Activate New Customizations" vhdl-activate-customizations t]) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2306 )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2307 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2308 (defvar vhdl-mode-menu-list (vhdl-create-mode-menu) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2309 "VHDL Mode menu.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2310 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2311 (defun vhdl-update-mode-menu () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2312 "Update VHDL mode menu." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2313 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2314 (easy-menu-remove vhdl-mode-menu-list) ; for XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2315 (setq vhdl-mode-menu-list (vhdl-create-mode-menu)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2316 (easy-menu-add vhdl-mode-menu-list) ; for XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2317 (easy-menu-define vhdl-mode-menu vhdl-mode-map |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2318 "Menu keymap for VHDL Mode." vhdl-mode-menu-list)) |
20665 | 2319 |
2320 (require 'easymenu) | |
2321 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2322 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2323 ;; Index menu (using `imenu.el'), also used for speedbar (using `speedbar.el') |
20665 | 2324 |
2325 (defvar vhdl-imenu-generic-expression | |
2326 '( | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2327 ("Subprogram" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2328 "^\\s-*\\(\\(\\(impure\\|pure\\)\\s-+\\|\\)function\\|procedure\\)\\s-+\\(\"?\\(\\w\\|\\s_\\)+\"?\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2329 4) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2330 ("Instance" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2331 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\s-*:\\(\\s-\\|\n\\)*\\(\\w\\|\\s_\\)+\\)\\(\\s-\\|\n\\)+\\(generic\\|port\\)\\s-+map\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2332 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2333 ("Component" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2334 "^\\s-*\\(component\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2335 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2336 ("Procedural" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2337 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\)\\s-*:\\(\\s-\\|\n\\)*\\(procedural\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2338 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2339 ("Process" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2340 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\)\\s-*:\\(\\s-\\|\n\\)*\\(\\(postponed\\s-+\\|\\)process\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2341 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2342 ("Block" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2343 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\)\\s-*:\\(\\s-\\|\n\\)*\\(block\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2344 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2345 ("Package" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2346 "^\\s-*\\(package\\( body\\|\\)\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2347 3) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2348 ("Configuration" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2349 "^\\s-*\\(configuration\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\s-+of\\s-+\\(\\w\\|\\s_\\)+\\)" |
20665 | 2350 2) |
2351 ("Architecture" | |
2352 "^\\s-*\\(architecture\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\s-+of\\s-+\\(\\w\\|\\s_\\)+\\)" | |
2353 2) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2354 ("Entity" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2355 "^\\s-*\\(entity\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)" |
20665 | 2356 2) |
2357 ) | |
2358 "Imenu generic expression for VHDL Mode. See `imenu-generic-expression'.") | |
2359 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2360 (defun vhdl-index-menu-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2361 "Initialize index menu." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2362 (set (make-local-variable 'imenu-case-fold-search) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2363 (set (make-local-variable 'imenu-generic-expression) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2364 vhdl-imenu-generic-expression) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2365 (when (and vhdl-index-menu (not (string-match "XEmacs" emacs-version))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2366 (if (or (not (boundp 'font-lock-maximum-size)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2367 (> font-lock-maximum-size (buffer-size))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2368 (imenu-add-to-menubar "Index") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2369 (message "Scanning buffer for index...buffer too big")))) |
20665 | 2370 |
2371 ;; ############################################################################ | |
2372 ;; Source file menu (using `easy-menu.el') | |
2373 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2374 (defvar vhdl-sources-menu nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2375 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2376 (defun vhdl-directory-files (directory &optional full match) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2377 "Call `directory-files' if DIRECTORY exists, otherwise generate error |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2378 message." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2379 (if (file-directory-p directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2380 (directory-files directory full match) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2381 (message "No such directory: \"%s\"" directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2382 nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2383 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2384 (defun vhdl-get-source-files (&optional full directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2385 "Get list of VHDL source files in DIRECTORY or current directory." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2386 (let ((mode-alist auto-mode-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2387 filename-regexp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2388 ;; create regular expressions for matching file names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2389 (setq filename-regexp ".*\\(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2390 (while mode-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2391 (when (eq (cdr (car mode-alist)) 'vhdl-mode) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2392 (setq filename-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2393 (concat filename-regexp (car (car mode-alist)) "\\|"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2394 (setq mode-alist (cdr mode-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2395 (setq filename-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2396 (concat (substring filename-regexp 0 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2397 (string-match "\\\\|$" filename-regexp)) "\\)")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2398 ;; find files |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2399 (nreverse (vhdl-directory-files |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2400 (or directory default-directory) full filename-regexp)))) |
20665 | 2401 |
2402 (defun vhdl-add-source-files-menu () | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2403 "Scan directory for all VHDL source files and generate menu. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2404 The directory of the current source file is scanned." |
20665 | 2405 (interactive) |
2406 (message "Scanning directory for source files ...") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2407 (let ((newmap (current-local-map)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2408 (mode-alist auto-mode-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2409 (file-list (vhdl-get-source-files)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2410 menu-list found) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2411 ;; Create list for menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2412 (setq found nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2413 (while file-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2414 (setq found t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2415 (setq menu-list (cons (vector (car file-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2416 (list 'find-file (car file-list)) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2417 menu-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2418 (setq file-list (cdr file-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2419 (setq menu-list (vhdl-menu-split menu-list 25)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2420 (when found (setq menu-list (cons "--" menu-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2421 (setq menu-list (cons ["*Rescan*" vhdl-add-source-files-menu t] menu-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2422 (setq menu-list (cons "Sources" menu-list)) |
20665 | 2423 ;; Create menu |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2424 (easy-menu-add menu-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2425 (easy-menu-define vhdl-sources-menu newmap |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2426 "VHDL source files menu" menu-list)) |
20665 | 2427 (message "")) |
2428 | |
2429 (defun vhdl-menu-split (list n) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2430 "Split menu LIST into several submenues, if number of elements > N." |
20665 | 2431 (if (> (length list) n) |
2432 (let ((remain list) | |
2433 (result '()) | |
2434 (sublist '()) | |
2435 (menuno 1) | |
2436 (i 0)) | |
2437 (while remain | |
2438 (setq sublist (cons (car remain) sublist)) | |
2439 (setq remain (cdr remain)) | |
2440 (setq i (+ i 1)) | |
2441 (if (= i n) | |
2442 (progn | |
2443 (setq result (cons (cons (format "Sources %s" menuno) | |
2444 (nreverse sublist)) result)) | |
2445 (setq i 0) | |
2446 (setq menuno (+ menuno 1)) | |
2447 (setq sublist '())))) | |
2448 (and sublist | |
2449 (setq result (cons (cons (format "Sources %s" menuno) | |
2450 (nreverse sublist)) result))) | |
2451 (nreverse result)) | |
2452 list)) | |
2453 | |
2454 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2455 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2456 ;;; VHDL Mode definition |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2457 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2458 ;; performs all buffer local initializations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2459 |
21446
830023d4cec6
*** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents:
20665
diff
changeset
|
2460 ;;;###autoload |
20665 | 2461 (defun vhdl-mode () |
2462 "Major mode for editing VHDL code. | |
2463 | |
2464 Usage: | |
2465 ------ | |
2466 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2467 - TEMPLATE INSERTION (electrification): After typing a VHDL keyword and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2468 entering `\\[vhdl-electric-space]', you are prompted for arguments while a template is generated |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2469 for that VHDL construct. Typing `\\[vhdl-electric-return]' or `\\[keyboard-quit]' at the first (mandatory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2470 prompt aborts the current template generation. Optional arguments are |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2471 indicated by square brackets and removed if the queried string is left empty. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2472 Prompts for mandatory arguments remain in the code if the queried string is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2473 left empty. They can be queried again by `\\[vhdl-template-search-prompt]'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2474 Typing `\\[just-one-space]' after a keyword inserts a space without calling the template |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2475 generator. Automatic template generation (i.e. electrification) can be |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2476 disabled (enabled) by typing `\\[vhdl-electric-mode]' or by setting custom variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2477 `vhdl-electric-mode' (see CUSTOMIZATION). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2478 Enabled electrification is indicated by `/e' in the modeline. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2479 Template generators can be invoked from the VHDL menu, by key bindings, by |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2480 typing `C-c C-i C-c' and choosing a construct, or by typing the keyword (i.e. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2481 first word of menu entry not in parenthesis) and `\\[vhdl-electric-space]'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2482 The following abbreviations can also be used: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2483 arch, attr, cond, conf, comp, cons, func, inst, pack, sig, var. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2484 Template styles can be customized in customization group `vhdl-electric' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2485 \(see CUSTOMIZATION). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2486 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2487 - HEADER INSERTION: A file header can be inserted by `\\[vhdl-template-header]'. A |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2488 file footer (template at the end of the file) can be inserted by |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2489 `\\[vhdl-template-footer]'. See customization group `vhdl-header'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2490 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2491 - STUTTERING: Double striking of some keys inserts cumbersome VHDL syntax |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2492 elements. Stuttering can be disabled (enabled) by typing `\\[vhdl-stutter-mode]' or by |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2493 variable `vhdl-stutter-mode'. Enabled stuttering is indicated by `/s' in |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2494 the modeline. The stuttering keys and their effects are: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2495 ;; --> \" : \" [ --> ( -- --> comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2496 ;;; --> \" := \" [[ --> [ --CR --> comment-out code |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2497 .. --> \" => \" ] --> ) --- --> horizontal line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2498 ,, --> \" <= \" ]] --> ] ---- --> display comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2499 == --> \" == \" '' --> \\\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2500 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2501 - WORD COMPLETION: Typing `\\[vhdl-electric-tab]' after a (not completed) word looks for a VHDL |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2502 keyword or a word in the buffer that starts alike, inserts it and adjusts |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2503 case. Re-typing `\\[vhdl-electric-tab]' toggles through alternative word completions. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2504 This also works in the minibuffer (i.e. in template generator prompts). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2505 Typing `\\[vhdl-electric-tab]' after `(' looks for and inserts complete parenthesized |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2506 expressions (e.g. for array index ranges). All keywords as well as standard |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2507 types and subprograms of VHDL have predefined abbreviations (e.g. type \"std\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2508 and `\\[vhdl-electric-tab]' will toggle through all standard types beginning with \"std\"). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2509 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2510 Typing `\\[vhdl-electric-tab]' after a non-word character indents the line if at the beginning |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2511 of a line (i.e. no preceding non-blank characters),and inserts a tabulator |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2512 stop otherwise. `\\[tab-to-tab-stop]' always inserts a tabulator stop. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2513 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2514 - COMMENTS: |
20665 | 2515 `--' puts a single comment. |
2516 `---' draws a horizontal line for separating code segments. | |
2517 `----' inserts a display comment, i.e. two horizontal lines with a | |
2518 comment in between. | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2519 `--CR' comments out code on that line. Re-hitting CR comments out |
20665 | 2520 following lines. |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2521 `\\[vhdl-comment-uncomment-region]' comments out a region if not commented out, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2522 uncomments a region if already commented out. |
20665 | 2523 |
2524 You are prompted for comments after object definitions (i.e. signals, | |
2525 variables, constants, ports) and after subprogram and process specifications | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2526 if variable `vhdl-prompt-for-comments' is non-nil. Comments are |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2527 automatically inserted as additional labels (e.g. after begin statements) and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2528 as help comments if `vhdl-self-insert-comments' is non-nil. |
20665 | 2529 Inline comments (i.e. comments after a piece of code on the same line) are |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2530 indented at least to `vhdl-inline-comment-column'. Comments go at maximum to |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2531 `vhdl-end-comment-column'. `\\[vhdl-electric-return]' after a space in a comment will open a |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2532 new comment line. Typing beyond `vhdl-end-comment-column' in a comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2533 automatically opens a new comment line. `\\[fill-paragraph]' re-fills |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2534 multi-line comments. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2535 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2536 - INDENTATION: `\\[vhdl-electric-tab]' indents a line if at the beginning of the line. |
20665 | 2537 The amount of indentation is specified by variable `vhdl-basic-offset'. |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2538 `\\[vhdl-indent-line]' always indents the current line (is bound to `TAB' if variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2539 `vhdl-intelligent-tab' is nil). Indentation can be done for an entire region |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2540 \(`\\[vhdl-indent-region]') or buffer (menu). Argument and port lists are indented normally |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2541 \(nil) or relative to the opening parenthesis (non-nil) according to variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2542 `vhdl-argument-list-indent'. If variable `vhdl-indent-tabs-mode' is nil, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2543 spaces are used instead of tabs. `\\[tabify]' and `\\[untabify]' allow |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2544 to convert spaces to tabs and vice versa. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2545 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2546 - ALIGNMENT: The alignment functions align operators, keywords, and inline |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2547 comment to beautify argument lists, port maps, etc. `\\[vhdl-align-group]' aligns a group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2548 of consecutive lines separated by blank lines. `\\[vhdl-align-noindent-region]' aligns an |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2549 entire region. If variable `vhdl-align-groups' is non-nil, groups of code |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2550 lines separated by empty lines are aligned individually. `\\[vhdl-align-inline-comment-group]' aligns |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2551 inline comments for a group of lines, and `\\[vhdl-align-inline-comment-region]' for a region. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2552 Some templates are automatically aligned after generation if custom variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2553 `vhdl-auto-align' is non-nil. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2554 `\\[vhdl-fixup-whitespace-region]' fixes up whitespace in a region. That is, operator symbols |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2555 are surrounded by one space, and multiple spaces are eliminated. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2556 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2557 - PORT TRANSLATION: Generic and port clauses from entity or component |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2558 declarations can be copied (`\\[vhdl-port-copy]') and pasted as entity and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2559 component declarations, as component instantiations and corresponding |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2560 internal constants and signals, as a generic map with constants as actual |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2561 parameters, and as a test bench (menu). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2562 A clause with several generic/port names on the same line can be flattened |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2563 (`\\[vhdl-port-flatten]') so that only one name per line exists. Names for actual |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2564 ports, instances, test benches, and design-under-test instances can be |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2565 derived from existing names according to variables `vhdl-...-name'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2566 Variables `vhdl-testbench-...' allow the insertion of additional templates |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2567 into a test bench. New files are created for the test bench entity and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2568 architecture according to variable `vhdl-testbench-create-files'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2569 See customization group `vhdl-port'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2570 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2571 - TEST BENCH GENERATION: See PORT TRANSLATION. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2572 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2573 - KEY BINDINGS: Key bindings (`C-c ...') exist for most commands (see in |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2574 menu). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2575 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2576 - VHDL MENU: All commands can be invoked from the VHDL menu. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2577 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2578 - FILE BROWSER: The speedbar allows browsing of directories and file contents. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2579 It can be accessed from the VHDL menu and is automatically opened if |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2580 variable `vhdl-speedbar' is non-nil. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2581 In speedbar, open files and directories with `mouse-2' on the name and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2582 browse/rescan their contents with `mouse-2'/`S-mouse-2' on the `+'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2583 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2584 - DESIGN HIERARCHY BROWSER: The speedbar can also be used for browsing the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2585 hierarchy of design units contained in the source files of the current |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2586 directory or in the source files/directories specified for a project (see |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2587 variable `vhdl-project-alist'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2588 The speedbar can be switched between file and hierarchy browsing mode in the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2589 VHDL menu or by typing `f' and `h' in speedbar. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2590 In speedbar, open design units with `mouse-2' on the name and browse their |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2591 hierarchy with `mouse-2' on the `+'. The hierarchy can be rescanned and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2592 ports directly be copied from entities by using the speedbar menu. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2593 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2594 - PROJECTS: Projects can be defined in variable `vhdl-project-alist' and a |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2595 current project be selected using variable `vhdl-project' (permanently) or |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2596 from the menu (temporarily). For each project, a title string (for the file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2597 headers) and source files/directories (for the hierarchy browser) can be |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2598 specified. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2599 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2600 - SPECIAL MENUES: As an alternative to the speedbar, an index menu can |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2601 be added (set variable `vhdl-index-menu' to non-nil) or made accessible |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2602 as a mouse menu (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2603 your start-up file) for browsing the file contents. Also, a source file menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2604 can be added (set variable `vhdl-source-file-menu' to non-nil) for browsing |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2605 the current directory for VHDL source files. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2606 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2607 - SOURCE FILE COMPILATION: The syntax of the current buffer can be analyzed |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2608 by calling a VHDL compiler (menu, `\\[vhdl-compile]'). The compiler to be used is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2609 specified by variable `vhdl-compiler'. The available compilers are listed |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2610 in variable `vhdl-compiler-alist' including all required compilation command, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2611 destination directory, and error message syntax information. New compilers |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2612 can be added. Additional compile command options can be set in variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2613 `vhdl-compiler-options'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2614 An entire hierarchy of source files can be compiled by the `make' command |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2615 \(menu, `\\[vhdl-make]'). This only works if an appropriate Makefile exists. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2616 The make command itself as well as a command to generate a Makefile can also |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2617 be specified in variable `vhdl-compiler-alist'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2618 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2619 - VHDL STANDARDS: The VHDL standards to be used are specified in variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2620 `vhdl-standard'. Available standards are: VHDL'87/'93, VHDL-AMS, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2621 Math Packages. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2622 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2623 - KEYWORD CASE: Lower and upper case for keywords and standardized types, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2624 attributes, and enumeration values is supported. If the variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2625 `vhdl-upper-case-keywords' is set to non-nil, keywords can be typed in lower |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2626 case and are converted into upper case automatically (not for types, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2627 attributes, and enumeration values). The case of keywords, types, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2628 attributes,and enumeration values can be fixed for an entire region (menu) |
20665 | 2629 or buffer (`\\[vhdl-fix-case-buffer]') according to the variables |
2630 `vhdl-upper-case-{keywords,types,attributes,enum-values}'. | |
2631 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2632 - HIGHLIGHTING (fontification): Keywords and standardized types, attributes, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2633 enumeration values, and function names (controlled by variable |
20665 | 2634 `vhdl-highlight-keywords'), as well as comments, strings, and template |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2635 prompts are highlighted using different colors. Unit, subprogram, signal, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2636 variable, constant, parameter and generic/port names in declarations as well |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2637 as labels are highlighted if variable `vhdl-highlight-names' is non-nil. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2638 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2639 Additional reserved words or words with a forbidden syntax (e.g. words that |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2640 should be avoided) can be specified in variable `vhdl-forbidden-words' or |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2641 `vhdl-forbidden-syntax' and be highlighted in a warning color (variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2642 `vhdl-highlight-forbidden-words'). Verilog keywords are highlighted as |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2643 forbidden words if variable `vhdl-highlight-verilog-keywords' is non-nil. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2644 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2645 Words with special syntax can be highlighted by specifying their syntax and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2646 color in variable `vhdl-special-syntax-alist' and by setting variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2647 `vhdl-highlight-special-words' to non-nil. This allows to establish some |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2648 naming conventions (e.g. to distinguish different kinds of signals or other |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2649 objects by using name suffices) and to support them visually. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2650 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2651 Variable `vhdl-highlight-case-sensitive' can be set to non-nil in order to |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2652 support case-sensitive highlighting. However, keywords are then only |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2653 highlighted if written in lower case. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2654 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2655 Code between \"translate_off\" and \"translate_on\" pragmas is highlighted |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2656 using a different background color if variable `vhdl-highlight-translate-off' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2657 is non-nil. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2658 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2659 All colors can be customized by command `\\[customize-face]'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2660 For highlighting of matching parenthesis, see customization group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2661 `paren-showing' (`\\[customize-group]'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2662 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2663 - USER MODELS: VHDL models (templates) can be specified by the user and made |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2664 accessible in the menu, through key bindings (`C-c C-m ...'), or by keyword |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2665 electrification. See custom variable `vhdl-model-alist'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2666 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2667 - HIDE/SHOW: The code of entire VHDL design units can be hidden using the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2668 `Hide/Show' menu or by pressing `S-mouse-2' within the code (variable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2669 `vhdl-hideshow-menu'). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2670 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2671 - PRINTING: Postscript printing with different faces (an optimized set of |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2672 faces is used if `vhdl-print-customize-faces' is non-nil) or colors |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2673 \(if `ps-print-color-p' is non-nil) is possible using the standard Emacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2674 postscript printing commands. Variable `vhdl-print-two-column' defines |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2675 appropriate default settings for nice landscape two-column printing. The |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2676 paper format can be set by variable `ps-paper-type'. Do not forget to |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2677 switch `ps-print-color-p' to nil for printing on black-and-white printers. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2678 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2679 - CUSTOMIZATION: All variables can easily be customized using the `Customize' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2680 menu entry or `\\[customize-option]' (`\\[customize-group]' for groups). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2681 Some customizations only take effect after some action (read the NOTE in |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2682 the variable documentation). Customization can also be done globally (i.e. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2683 site-wide, read the INSTALL file). |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2684 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2685 - FILE EXTENSIONS: As default, files with extensions \".vhd\" and \".vhdl\" are |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2686 automatically recognized as VHDL source files. To add an extension \".xxx\", |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2687 add the following line to your Emacs start-up file (`.emacs'): |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2688 \(setq auto-mode-alist (cons '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2689 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2690 - HINTS: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2691 - Type `\\[keyboard-quit] \\[keyboard-quit]' to interrupt long operations or if Emacs hangs. |
20665 | 2692 |
2693 | |
2694 Maintenance: | |
2695 ------------ | |
2696 | |
2697 To submit a bug report, enter `\\[vhdl-submit-bug-report]' within VHDL Mode. | |
2698 Add a description of the problem and include a reproducible test case. | |
2699 | |
2700 Questions and enhancement requests can be sent to <vhdl-mode@geocities.com>. | |
2701 | |
2702 The `vhdl-mode-announce' mailing list informs about new VHDL Mode releases. | |
2703 The `vhdl-mode-victims' mailing list informs about new VHDL Mode beta releases. | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2704 You are kindly invited to participate in beta testing. Subscribe to above |
20665 | 2705 mailing lists by sending an email to <vhdl-mode@geocities.com>. |
2706 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2707 VHDL Mode is officially distributed on the Emacs VHDL Mode Home Page |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2708 <http://www.geocities.com/SiliconValley/Peaks/8287>, where the latest |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2709 version and release notes can be found. |
20665 | 2710 |
2711 | |
2712 Bugs and Limitations: | |
2713 --------------------- | |
2714 | |
2715 - Re-indenting large regions or expressions can be slow. | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2716 - Indentation bug in simultaneous if- and case-statements (VHDL-AMS). |
20665 | 2717 - Hideshow does not work under XEmacs. |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2718 - Index menu and file tagging in speedbar do not work under XEmacs. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2719 - Parsing compilation error messages for Ikos and Viewlogic VHDL compilers |
20665 | 2720 does not work under XEmacs. |
2721 | |
2722 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2723 The VHDL Mode Maintainers |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2724 Reto Zimmermann and Rod Whitby |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2725 |
20665 | 2726 Key bindings: |
2727 ------------- | |
2728 | |
2729 \\{vhdl-mode-map}" | |
2730 (interactive) | |
2731 (kill-all-local-variables) | |
2732 (setq major-mode 'vhdl-mode) | |
2733 (setq mode-name "VHDL") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2734 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2735 ;; set maps and tables |
20665 | 2736 (use-local-map vhdl-mode-map) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2737 (set-syntax-table vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2738 (setq local-abbrev-table vhdl-mode-abbrev-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2739 |
20665 | 2740 ;; set local variable values |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2741 (set (make-local-variable 'paragraph-start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2742 "\\s-*\\(--+\\s-*$\\|[^ -]\\|$\\)") |
20665 | 2743 (set (make-local-variable 'paragraph-separate) paragraph-start) |
2744 (set (make-local-variable 'paragraph-ignore-fill-prefix) t) | |
2745 (set (make-local-variable 'require-final-newline) t) | |
2746 (set (make-local-variable 'parse-sexp-ignore-comments) t) | |
2747 (set (make-local-variable 'indent-line-function) 'vhdl-indent-line) | |
2748 (set (make-local-variable 'comment-start) "--") | |
2749 (set (make-local-variable 'comment-end) "") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2750 (set (make-local-variable 'comment-column) vhdl-inline-comment-column) |
20665 | 2751 (set (make-local-variable 'end-comment-column) vhdl-end-comment-column) |
2752 (set (make-local-variable 'comment-start-skip) "--+\\s-*") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2753 (set (make-local-variable 'comment-multi-line) nil) |
20665 | 2754 (set (make-local-variable 'indent-tabs-mode) vhdl-indent-tabs-mode) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2755 (set (make-local-variable 'hippie-expand-only-buffers) '(vhdl-mode)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2756 (set (make-local-variable 'hippie-expand-verbose) nil) |
20665 | 2757 |
2758 ;; setup the comment indent variable in a Emacs version portable way | |
2759 ;; ignore any byte compiler warnings you might get here | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2760 (when (boundp 'comment-indent-function) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2761 (make-local-variable 'comment-indent-function) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2762 (setq comment-indent-function 'vhdl-comment-indent)) |
20665 | 2763 |
2764 ;; initialize font locking | |
2765 (require 'font-lock) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2766 (set (make-local-variable 'font-lock-defaults) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2767 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2768 'vhdl-font-lock-keywords nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2769 (not vhdl-highlight-case-sensitive) '((?\_ . "w")) 'beginning-of-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2770 '(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2771 (set (make-local-variable 'font-lock-support-mode) 'lazy-lock-mode) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2772 (set (make-local-variable 'lazy-lock-defer-contextually) nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2773 (set (make-local-variable 'lazy-lock-defer-on-the-fly) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2774 ; (set (make-local-variable 'lazy-lock-defer-time) 0.1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2775 (set (make-local-variable 'lazy-lock-defer-on-scrolling) t) |
20665 | 2776 (turn-on-font-lock) |
2777 | |
2778 ;; variables for source file compilation | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2779 (require 'compile) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2780 (set (make-local-variable 'compilation-error-regexp-alist) nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2781 (set (make-local-variable 'compilation-file-regexp-alist) nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2782 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2783 ;; add index menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2784 (vhdl-index-menu-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2785 ;; add source file menu |
20665 | 2786 (if vhdl-source-file-menu (vhdl-add-source-files-menu)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2787 ;; add VHDL menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2788 (easy-menu-add vhdl-mode-menu-list) ; for XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2789 (easy-menu-define vhdl-mode-menu vhdl-mode-map |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2790 "Menu keymap for VHDL Mode." vhdl-mode-menu-list) |
20665 | 2791 ;; initialize hideshow and add menu |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2792 (make-local-variable 'hs-minor-mode-hook) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2793 (vhdl-hideshow-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2794 (run-hooks 'menu-bar-update-hook) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2795 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2796 ;; add speedbar |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2797 (when (fboundp 'speedbar) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2798 (condition-case () ; due to bug in `speedbar-el' v0.7.2a |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2799 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2800 (when (and vhdl-speedbar (not (and (boundp 'speedbar-frame) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2801 (frame-live-p speedbar-frame)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2802 (speedbar-frame-mode 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2803 (select-frame speedbar-attached-frame))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2804 (error (vhdl-add-warning "Before using Speedbar, install included `speedbar.el' patch")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2805 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2806 ;; miscellaneous |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2807 (vhdl-ps-print-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2808 (vhdl-modify-date-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2809 (vhdl-mode-line-update) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2810 (message "VHDL Mode %s. Type C-c C-h for documentation." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2811 vhdl-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2812 (vhdl-print-warnings) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2813 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2814 ;; run hooks |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2815 (run-hooks 'vhdl-mode-hook)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2816 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2817 (defun vhdl-activate-customizations () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2818 "Activate all customizations on local variables." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2819 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2820 (vhdl-mode-map-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2821 (use-local-map vhdl-mode-map) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2822 (set-syntax-table vhdl-mode-syntax-table) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2823 (setq comment-column vhdl-inline-comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2824 (setq end-comment-column vhdl-end-comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2825 (vhdl-modify-date-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2826 (vhdl-update-mode-menu) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2827 (vhdl-hideshow-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2828 (run-hooks 'menu-bar-update-hook) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2829 (vhdl-mode-line-update)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2830 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2831 (defun vhdl-modify-date-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2832 "Add/remove hook for modifying date when buffer is saved." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2833 (if vhdl-modify-date-on-saving |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2834 (add-hook 'local-write-file-hooks 'vhdl-template-modify-noerror) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2835 (remove-hook 'local-write-file-hooks 'vhdl-template-modify-noerror))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2836 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2837 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2838 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2839 ;;; Documentation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2840 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2841 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2842 (defvar vhdl-doc-keywords nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2843 "Reserved words in VHDL: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2844 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2845 VHDL'93 (IEEE Std 1076-1993): |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2846 `vhdl-93-keywords' : keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2847 `vhdl-93-types' : standardized types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2848 `vhdl-93-attributes' : standardized attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2849 `vhdl-93-enum-values' : standardized enumeration values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2850 `vhdl-93-functions' : standardized functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2851 `vhdl-93-packages' : standardized packages and libraries |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2852 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2853 VHDL-AMS (IEEE Std 1076.1): |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2854 `vhdl-ams-keywords' : keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2855 `vhdl-ams-types' : standardized types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2856 `vhdl-ams-attributes' : standardized attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2857 `vhdl-ams-enum-values' : standardized enumeration values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2858 `vhdl-ams-functions' : standardized functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2859 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2860 Math Packages (IEEE Std 1076.2): |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2861 `vhdl-math-types' : standardized types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2862 `vhdl-math-constants' : standardized constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2863 `vhdl-math-functions' : standardized functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2864 `vhdl-math-packages' : standardized packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2865 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2866 Forbidden words: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2867 `vhdl-verilog-keywords' : Verilog reserved words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2868 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2869 NOTE: click `mouse-2' on variable names above (not in XEmacs).") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2870 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2871 (defvar vhdl-doc-coding-style nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2872 "For VHDL coding style and naming convention guidelines, see the following |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2873 references: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2874 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2875 \[1] Ben Cohen. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2876 \"VHDL Coding Styles and Methodologies\". |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2877 Kluwer Academic Publishers, 1999. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2878 http://members.aol.com/vhdlcohen/vhdl/ |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2879 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2880 \[2] Michael Keating and Pierre Bricaud. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2881 \"Reuse Methodology Manual\". |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2882 Kluwer Academic Publishers, 1998. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2883 http://www.synopsys.com/products/reuse/rmm.html |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2884 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2885 \[3] European Space Agency. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2886 \"VHDL Modelling Guidelines\". |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2887 ftp://ftp.estec.esa.nl/pub/vhdl/doc/ModelGuide.{pdf,ps} |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2888 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2889 Use variables `vhdl-highlight-special-words' and `vhdl-special-syntax-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2890 to visually support naming conventions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2891 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2892 (defun vhdl-doc-variable (variable) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2893 "Display VARIABLE's documentation in *Help* buffer." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2894 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2895 (with-output-to-temp-buffer "*Help*" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2896 (princ (documentation-property variable 'variable-documentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2897 (unless (string-match "XEmacs" emacs-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2898 (help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2899 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2900 (set-buffer standard-output) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2901 (help-mode)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2902 (print-help-return-message))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2903 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2904 (defun vhdl-doc-mode () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2905 "Display VHDL mode documentation in *Help* buffer." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2906 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2907 (with-output-to-temp-buffer "*Help*" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2908 (princ mode-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2909 (princ " mode:\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2910 (princ (documentation 'vhdl-mode)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2911 (unless (string-match "XEmacs" emacs-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2912 (help-setup-xref (list #'vhdl-doc-mode) (interactive-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2913 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2914 (set-buffer standard-output) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2915 (help-mode)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2916 (print-help-return-message))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2917 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2918 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2919 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2920 ;;; Keywords and standardized words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2921 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2922 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2923 (defconst vhdl-93-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2924 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2925 "abs" "access" "after" "alias" "all" "and" "architecture" "array" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2926 "assert" "attribute" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2927 "begin" "block" "body" "buffer" "bus" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2928 "case" "component" "configuration" "constant" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2929 "disconnect" "downto" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2930 "else" "elsif" "end" "entity" "exit" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2931 "file" "for" "function" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2932 "generate" "generic" "group" "guarded" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2933 "if" "impure" "in" "inertial" "inout" "is" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2934 "label" "library" "linkage" "literal" "loop" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2935 "map" "mod" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2936 "nand" "new" "next" "nor" "not" "null" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2937 "of" "on" "open" "or" "others" "out" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2938 "package" "port" "postponed" "procedure" "process" "pure" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2939 "range" "record" "register" "reject" "rem" "report" "return" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2940 "rol" "ror" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2941 "select" "severity" "shared" "signal" "sla" "sll" "sra" "srl" "subtype" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2942 "then" "to" "transport" "type" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2943 "unaffected" "units" "until" "use" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2944 "variable" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2945 "wait" "when" "while" "with" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2946 "xnor" "xor" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2947 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2948 "List of VHDL'93 keywords.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2949 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2950 (defconst vhdl-ams-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2951 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2952 "across" "break" "limit" "nature" "noise" "procedural" "quantity" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2953 "reference" "spectrum" "subnature" "terminal" "through" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2954 "tolerance" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2955 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2956 "List of VHDL-AMS keywords.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2957 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2958 (defconst vhdl-verilog-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2959 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2960 "`define" "`else" "`endif" "`ifdef" "`include" "`timescale" "`undef" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2961 "always" "and" "assign" "begin" "buf" "bufif0" "bufif1" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2962 "case" "casex" "casez" "cmos" "deassign" "default" "defparam" "disable" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2963 "edge" "else" "end" "endattribute" "endcase" "endfunction" "endmodule" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2964 "endprimitive" "endspecify" "endtable" "endtask" "event" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2965 "for" "force" "forever" "fork" "function" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2966 "highz0" "highz1" "if" "initial" "inout" "input" "integer" "join" "large" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2967 "macromodule" "makefile" "medium" "module" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2968 "nand" "negedge" "nmos" "nor" "not" "notif0" "notif1" "or" "output" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2969 "parameter" "pmos" "posedge" "primitive" "pull0" "pull1" "pulldown" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2970 "pullup" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2971 "rcmos" "real" "realtime" "reg" "release" "repeat" "rnmos" "rpmos" "rtran" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2972 "rtranif0" "rtranif1" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2973 "scalared" "signed" "small" "specify" "specparam" "strength" "strong0" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2974 "strong1" "supply" "supply0" "supply1" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2975 "table" "task" "time" "tran" "tranif0" "tranif1" "tri" "tri0" "tri1" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2976 "triand" "trior" "trireg" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2977 "vectored" "wait" "wand" "weak0" "weak1" "while" "wire" "wor" "xnor" "xor" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2978 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2979 "List of Verilog keywords as candidate for additional reserved words.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2980 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2981 (defconst vhdl-93-types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2982 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2983 "boolean" "bit" "bit_vector" "character" "severity_level" "integer" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2984 "real" "time" "natural" "positive" "string" "line" "text" "side" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2985 "unsigned" "signed" "delay_length" "file_open_kind" "file_open_status" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2986 "std_logic" "std_logic_vector" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2987 "std_ulogic" "std_ulogic_vector" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2988 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2989 "List of VHDL'93 standardized types.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2990 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2991 (defconst vhdl-ams-types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2992 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2993 "domain_type" "real_vector" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2994 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2995 "List of VHDL-AMS standardized types.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2996 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2997 (defconst vhdl-math-types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2998 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
2999 "complex" "complex_polar" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3000 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3001 "List of Math Packages standardized types.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3002 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3003 (defconst vhdl-93-attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3004 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3005 "base" "left" "right" "high" "low" "pos" "val" "succ" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3006 "pred" "leftof" "rightof" "range" "reverse_range" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3007 "length" "delayed" "stable" "quiet" "transaction" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3008 "event" "active" "last_event" "last_active" "last_value" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3009 "driving" "driving_value" "ascending" "value" "image" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3010 "simple_name" "instance_name" "path_name" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3011 "foreign" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3012 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3013 "List of VHDL'93 standardized attributes.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3014 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3015 (defconst vhdl-ams-attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3016 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3017 "across" "through" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3018 "reference" "contribution" "tolerance" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3019 "dot" "integ" "delayed" "above" "zoh" "ltf" "ztf" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3020 "ramp" "slew" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3021 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3022 "List of VHDL-AMS standardized attributes.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3023 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3024 (defconst vhdl-93-enum-values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3025 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3026 "true" "false" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3027 "note" "warning" "error" "failure" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3028 "read_mode" "write_mode" "append_mode" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3029 "open_ok" "status_error" "name_error" "mode_error" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3030 "fs" "ps" "ns" "us" "ms" "sec" "min" "hr" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3031 "right" "left" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3032 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3033 "List of VHDL'93 standardized enumeration values.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3034 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3035 (defconst vhdl-ams-enum-values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3036 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3037 "quiescent_domain" "time_domain" "frequency_domain" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3038 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3039 "List of VHDL-AMS standardized enumeration values.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3040 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3041 (defconst vhdl-math-constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3042 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3043 "math_e" "math_1_over_e" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3044 "math_pi" "math_two_pi" "math_1_over_pi" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3045 "math_half_pi" "math_q_pi" "math_3_half_pi" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3046 "math_log_of_2" "math_log_of_10" "math_log2_of_e" "math_log10_of_e" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3047 "math_sqrt2" "math_sqrt1_2" "math_sqrt_pi" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3048 "math_deg_to_rad" "math_rad_to_deg" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3049 "cbase_1" "cbase_j" "czero" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3050 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3051 "List of Math Packages standardized constants.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3052 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3053 (defconst vhdl-93-functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3054 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3055 "now" "resolved" "rising_edge" "falling_edge" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3056 "read" "readline" "write" "writeline" "endfile" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3057 "resize" "is_X" "std_match" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3058 "shift_left" "shift_right" "rotate_left" "rotate_right" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3059 "to_unsigned" "to_signed" "to_integer" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3060 "to_stdLogicVector" "to_stdULogic" "to_stdULogicVector" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3061 "to_bit" "to_bitVector" "to_X01" "to_X01Z" "to_UX01" "to_01" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3062 "conv_unsigned" "conv_signed" "conv_integer" "conv_std_logic_vector" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3063 "shl" "shr" "ext" "sxt" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3064 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3065 "List of VHDL'93 standardized functions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3066 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3067 (defconst vhdl-ams-functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3068 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3069 "frequency" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3070 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3071 "List of VHDL-AMS standardized functions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3072 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3073 (defconst vhdl-math-functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3074 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3075 "sign" "ceil" "floor" "round" "trunc" "fmax" "fmin" "uniform" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3076 "sqrt" "cbrt" "exp" "log" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3077 "sin" "cos" "tan" "arcsin" "arccos" "arctan" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3078 "sinh" "cosh" "tanh" "arcsinh" "arccosh" "arctanh" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3079 "cmplx" "complex_to_polar" "polar_to_complex" "arg" "conj" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3080 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3081 "List of Math Packages standardized functions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3082 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3083 (defconst vhdl-93-packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3084 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3085 "std_logic_1164" "numeric_std" "numeric_bit" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3086 "standard" "textio" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3087 "std_logic_arith" "std_logic_signed" "std_logic_unsigned" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3088 "std_logic_misc" "std_logic_textio" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3089 "ieee" "std" "work" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3090 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3091 "List of VHDL'93 standardized packages and libraries.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3092 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3093 (defconst vhdl-math-packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3094 '( |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3095 "math_real" "math_complex" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3096 ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3097 "List of Math Packages standardized packages and libraries.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3098 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3099 (defvar vhdl-keywords nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3100 "List of VHDL keywords.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3101 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3102 (defvar vhdl-types nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3103 "List of VHDL standardized types.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3104 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3105 (defvar vhdl-attributes nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3106 "List of VHDL standardized attributes.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3107 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3108 (defvar vhdl-enum-values nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3109 "List of VHDL standardized enumeration values.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3110 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3111 (defvar vhdl-constants nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3112 "List of VHDL standardized constants.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3113 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3114 (defvar vhdl-functions nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3115 "List of VHDL standardized functions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3116 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3117 (defvar vhdl-packages nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3118 "List of VHDL standardized packages and libraries.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3119 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3120 (defvar vhdl-reserved-words nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3121 "List of additional reserved words.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3122 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3123 (defvar vhdl-keywords-regexp nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3124 "Regexp for VHDL keywords.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3125 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3126 (defvar vhdl-types-regexp nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3127 "Regexp for VHDL standardized types.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3128 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3129 (defvar vhdl-attributes-regexp nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3130 "Regexp for VHDL standardized attributes.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3131 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3132 (defvar vhdl-enum-values-regexp nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3133 "Regexp for VHDL standardized enumeration values.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3134 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3135 (defvar vhdl-functions-regexp nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3136 "Regexp for VHDL standardized functions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3137 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3138 (defvar vhdl-packages-regexp nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3139 "Regexp for VHDL standardized packages and libraries.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3140 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3141 (defvar vhdl-reserved-words-regexp nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3142 "Regexp for additional reserved words.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3143 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3144 (defun vhdl-words-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3145 "Initialize reserved words." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3146 (setq vhdl-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3147 (append vhdl-93-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3148 (when (vhdl-standard-p 'ams) vhdl-ams-keywords))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3149 (setq vhdl-types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3150 (append vhdl-93-types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3151 (when (vhdl-standard-p 'ams) vhdl-ams-types) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3152 (when (vhdl-standard-p 'math) vhdl-math-types))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3153 (setq vhdl-attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3154 (append vhdl-93-attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3155 (when (vhdl-standard-p 'ams) vhdl-ams-attributes))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3156 (setq vhdl-enum-values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3157 (append vhdl-93-enum-values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3158 (when (vhdl-standard-p 'ams) vhdl-ams-enum-values))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3159 (setq vhdl-constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3160 (append (when (vhdl-standard-p 'math) vhdl-math-constants))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3161 (setq vhdl-functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3162 (append vhdl-93-functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3163 (when (vhdl-standard-p 'ams) vhdl-ams-functions) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3164 (when (vhdl-standard-p 'math) vhdl-math-functions))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3165 (setq vhdl-packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3166 (append vhdl-93-packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3167 (when (vhdl-standard-p 'math) vhdl-math-packages))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3168 (setq vhdl-reserved-words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3169 (append (when vhdl-highlight-forbidden-words vhdl-forbidden-words) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3170 (when vhdl-highlight-verilog-keywords vhdl-verilog-keywords) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3171 '(""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3172 (setq vhdl-keywords-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3173 (concat "\\<\\(" (regexp-opt vhdl-keywords) "\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3174 (setq vhdl-types-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3175 (concat "\\<\\(" (regexp-opt vhdl-types) "\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3176 (setq vhdl-attributes-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3177 (concat "\\<\\(" (regexp-opt vhdl-attributes) "\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3178 (setq vhdl-enum-values-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3179 (concat "\\<\\(" (regexp-opt vhdl-enum-values) "\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3180 (setq vhdl-functions-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3181 (concat "\\<\\(" (regexp-opt vhdl-functions) "\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3182 (setq vhdl-packages-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3183 (concat "\\<\\(" (regexp-opt vhdl-packages) "\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3184 (setq vhdl-reserved-words-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3185 (concat "\\<\\(" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3186 (unless (equal vhdl-forbidden-syntax "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3187 (concat vhdl-forbidden-syntax "\\|")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3188 (regexp-opt vhdl-reserved-words) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3189 "\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3190 (vhdl-abbrev-list-init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3191 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3192 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3193 ;; Words to expand |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3194 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3195 (defvar vhdl-abbrev-list nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3196 "Predefined abbreviations for VHDL.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3197 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3198 (defun vhdl-abbrev-list-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3199 (setq vhdl-abbrev-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3200 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3201 (list vhdl-upper-case-keywords) vhdl-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3202 (list vhdl-upper-case-types) vhdl-types |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3203 (list vhdl-upper-case-attributes) vhdl-attributes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3204 (list vhdl-upper-case-enum-values) vhdl-enum-values |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3205 (list vhdl-upper-case-constants) vhdl-constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3206 (list nil) vhdl-functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3207 (list nil) vhdl-packages))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3208 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3209 ;; initialize reserved words for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3210 (vhdl-words-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3211 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3212 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3213 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3214 ;;; Syntax analysis and indentation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3215 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3216 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3217 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 3218 ;; Syntax analysis |
3219 | |
3220 ;; constant regular expressions for looking at various constructs | |
3221 | |
3222 (defconst vhdl-symbol-key "\\(\\w\\|\\s_\\)+" | |
3223 "Regexp describing a VHDL symbol. | |
3224 We cannot use just `word' syntax class since `_' cannot be in word | |
3225 class. Putting underscore in word class breaks forward word movement | |
3226 behavior that users are familiar with.") | |
3227 | |
3228 (defconst vhdl-case-header-key "case[( \t\n][^;=>]+[) \t\n]is" | |
3229 "Regexp describing a case statement header key.") | |
3230 | |
3231 (defconst vhdl-label-key | |
3232 (concat "\\(" vhdl-symbol-key "\\s-*:\\)[^=]") | |
3233 "Regexp describing a VHDL label.") | |
3234 | |
3235 ;; Macro definitions: | |
3236 | |
3237 (defmacro vhdl-point (position) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3238 "Return the value of point at certain commonly referenced POSITIONs. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3239 POSITION can be one of the following symbols: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3240 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3241 bol -- beginning of line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3242 eol -- end of line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3243 bod -- beginning of defun |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3244 boi -- back to indentation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3245 eoi -- last whitespace on line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3246 ionl -- indentation of next line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3247 iopl -- indentation of previous line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3248 bonl -- beginning of next line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3249 bopl -- beginning of previous line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3250 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3251 This function does not modify point or mark." |
20665 | 3252 (or (and (eq 'quote (car-safe position)) |
3253 (null (cdr (cdr position)))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3254 (error "Bad buffer position requested: %s" position)) |
20665 | 3255 (setq position (nth 1 position)) |
26464 | 3256 `(let ((here (point))) |
3257 ,@(cond | |
3258 ((eq position 'bol) '((beginning-of-line))) | |
3259 ((eq position 'eol) '((end-of-line))) | |
3260 ((eq position 'bod) '((save-match-data | |
3261 (vhdl-beginning-of-defun)))) | |
3262 ((eq position 'boi) '((back-to-indentation))) | |
3263 ((eq position 'eoi) '((end-of-line)(skip-chars-backward " \t"))) | |
3264 ((eq position 'bonl) '((forward-line 1))) | |
3265 ((eq position 'bopl) '((forward-line -1))) | |
3266 ((eq position 'iopl) | |
3267 '((forward-line -1) | |
3268 (back-to-indentation))) | |
3269 ((eq position 'ionl) | |
3270 '((forward-line 1) | |
3271 (back-to-indentation))) | |
3272 (t (error "Unknown buffer position requested: %s" position)) | |
3273 ) | |
3274 (prog1 | |
3275 (point) | |
3276 (goto-char here)) | |
3277 ;; workaround for an Emacs18 bug -- blech! Well, at least it | |
3278 ;; doesn't hurt for v19 | |
3279 ,@nil | |
3280 )) | |
20665 | 3281 |
3282 (defmacro vhdl-safe (&rest body) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3283 "Safely execute BODY, return nil if an error occurred." |
26464 | 3284 `(condition-case nil |
3285 (progn ,@body) | |
3286 (error nil))) | |
20665 | 3287 |
3288 (defmacro vhdl-add-syntax (symbol &optional relpos) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3289 "A simple macro to append the syntax in SYMBOL to the syntax list. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3290 Try to increase performance by using this macro." |
26464 | 3291 `(setq vhdl-syntactic-context |
3292 (cons (cons ,symbol ,relpos) vhdl-syntactic-context))) | |
20665 | 3293 |
3294 (defmacro vhdl-has-syntax (symbol) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3295 "A simple macro to return check the syntax list. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3296 Try to increase performance by using this macro." |
26464 | 3297 `(assoc ,symbol vhdl-syntactic-context)) |
20665 | 3298 |
3299 ;; Syntactic element offset manipulation: | |
3300 | |
3301 (defun vhdl-read-offset (langelem) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3302 "Read new offset value for LANGELEM from minibuffer. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3303 Return a legal value only." |
20665 | 3304 (let ((oldoff (format "%s" (cdr-safe (assq langelem vhdl-offsets-alist)))) |
3305 (errmsg "Offset must be int, func, var, or one of +, -, ++, --: ") | |
3306 (prompt "Offset: ") | |
3307 offset input interned) | |
3308 (while (not offset) | |
3309 (setq input (read-string prompt oldoff) | |
3310 offset (cond ((string-equal "+" input) '+) | |
3311 ((string-equal "-" input) '-) | |
3312 ((string-equal "++" input) '++) | |
3313 ((string-equal "--" input) '--) | |
3314 ((string-match "^-?[0-9]+$" input) | |
3315 (string-to-int input)) | |
3316 ((fboundp (setq interned (intern input))) | |
3317 interned) | |
3318 ((boundp interned) interned) | |
3319 ;; error, but don't signal one, keep trying | |
3320 ;; to read an input value | |
3321 (t (ding) | |
3322 (setq prompt errmsg) | |
3323 nil)))) | |
3324 offset)) | |
3325 | |
3326 (defun vhdl-set-offset (symbol offset &optional add-p) | |
3327 "Change the value of a syntactic element symbol in `vhdl-offsets-alist'. | |
3328 SYMBOL is the syntactic element symbol to change and OFFSET is the new | |
3329 offset for that syntactic element. Optional ADD says to add SYMBOL to | |
3330 `vhdl-offsets-alist' if it doesn't already appear there." | |
3331 (interactive | |
3332 (let* ((langelem | |
3333 (intern (completing-read | |
3334 (concat "Syntactic symbol to change" | |
3335 (if current-prefix-arg " or add" "") | |
3336 ": ") | |
3337 (mapcar | |
3338 (function | |
3339 (lambda (langelem) | |
3340 (cons (format "%s" (car langelem)) nil))) | |
3341 vhdl-offsets-alist) | |
3342 nil (not current-prefix-arg) | |
3343 ;; initial contents tries to be the last element | |
3344 ;; on the syntactic analysis list for the current | |
3345 ;; line | |
3346 (let* ((syntax (vhdl-get-syntactic-context)) | |
3347 (len (length syntax)) | |
3348 (ic (format "%s" (car (nth (1- len) syntax))))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3349 ic) |
20665 | 3350 ))) |
3351 (offset (vhdl-read-offset langelem))) | |
3352 (list langelem offset current-prefix-arg))) | |
3353 ;; sanity check offset | |
3354 (or (eq offset '+) | |
3355 (eq offset '-) | |
3356 (eq offset '++) | |
3357 (eq offset '--) | |
3358 (integerp offset) | |
3359 (fboundp offset) | |
3360 (boundp offset) | |
3361 (error "Offset must be int, func, var, or one of +, -, ++, --: %s" | |
3362 offset)) | |
3363 (let ((entry (assq symbol vhdl-offsets-alist))) | |
3364 (if entry | |
3365 (setcdr entry offset) | |
3366 (if add-p | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3367 (setq vhdl-offsets-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3368 (cons (cons symbol offset) vhdl-offsets-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3369 (error "%s is not a valid syntactic symbol" symbol)))) |
20665 | 3370 (vhdl-keep-region-active)) |
3371 | |
3372 (defun vhdl-set-style (style &optional local) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3373 "Set `vhdl-mode' variables to use one of several different indentation styles. |
20665 | 3374 STYLE is a string representing the desired style and optional LOCAL is |
3375 a flag which, if non-nil, means to make the style variables being | |
3376 changed buffer local, instead of the default, which is to set the | |
3377 global variables. Interactively, the flag comes from the prefix | |
3378 argument. The styles are chosen from the `vhdl-style-alist' variable." | |
3379 (interactive (list (completing-read "Use which VHDL indentation style? " | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3380 vhdl-style-alist nil t) |
20665 | 3381 current-prefix-arg)) |
3382 (let ((vars (cdr (assoc style vhdl-style-alist)))) | |
3383 (or vars | |
3384 (error "Invalid VHDL indentation style `%s'" style)) | |
3385 ;; set all the variables | |
3386 (mapcar | |
3387 (function | |
3388 (lambda (varentry) | |
3389 (let ((var (car varentry)) | |
3390 (val (cdr varentry))) | |
3391 (and local | |
3392 (make-local-variable var)) | |
3393 ;; special case for vhdl-offsets-alist | |
3394 (if (not (eq var 'vhdl-offsets-alist)) | |
3395 (set var val) | |
3396 ;; reset vhdl-offsets-alist to the default value first | |
3397 (setq vhdl-offsets-alist (copy-alist vhdl-offsets-alist-default)) | |
3398 ;; now set the langelems that are different | |
3399 (mapcar | |
3400 (function | |
3401 (lambda (langentry) | |
3402 (let ((langelem (car langentry)) | |
3403 (offset (cdr langentry))) | |
3404 (vhdl-set-offset langelem offset) | |
3405 ))) | |
3406 val)) | |
3407 ))) | |
3408 vars)) | |
3409 (vhdl-keep-region-active)) | |
3410 | |
3411 (defun vhdl-get-offset (langelem) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3412 "Get offset from LANGELEM which is a cons cell of the form: |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3413 \(SYMBOL . RELPOS). The symbol is matched against |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3414 vhdl-offsets-alist and the offset found there is either returned, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3415 or added to the indentation at RELPOS. If RELPOS is nil, then |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3416 the offset is simply returned." |
20665 | 3417 (let* ((symbol (car langelem)) |
3418 (relpos (cdr langelem)) | |
3419 (match (assq symbol vhdl-offsets-alist)) | |
3420 (offset (cdr-safe match))) | |
3421 ;; offset can be a number, a function, a variable, or one of the | |
3422 ;; symbols + or - | |
3423 (cond | |
3424 ((not match) | |
3425 (if vhdl-strict-syntax-p | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3426 (error "Don't know how to indent a %s" symbol) |
20665 | 3427 (setq offset 0 |
3428 relpos 0))) | |
3429 ((eq offset '+) (setq offset vhdl-basic-offset)) | |
3430 ((eq offset '-) (setq offset (- vhdl-basic-offset))) | |
3431 ((eq offset '++) (setq offset (* 2 vhdl-basic-offset))) | |
3432 ((eq offset '--) (setq offset (* 2 (- vhdl-basic-offset)))) | |
3433 ((and (not (numberp offset)) | |
3434 (fboundp offset)) | |
3435 (setq offset (funcall offset langelem))) | |
3436 ((not (numberp offset)) | |
3437 (setq offset (eval offset))) | |
3438 ) | |
3439 (+ (if (and relpos | |
3440 (< relpos (vhdl-point 'bol))) | |
3441 (save-excursion | |
3442 (goto-char relpos) | |
3443 (current-column)) | |
3444 0) | |
3445 offset))) | |
3446 | |
3447 ;; Syntactic support functions: | |
3448 | |
3449 ;; Returns `comment' if in a comment, `string' if in a string literal, | |
3450 ;; or nil if not in a literal at all. Optional LIM is used as the | |
3451 ;; backward limit of the search. If omitted, or nil, (point-min) is | |
3452 ;; used. | |
3453 | |
3454 (defun vhdl-in-literal (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3455 "Determine if point is in a VHDL literal." |
20665 | 3456 (save-excursion |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3457 (let ((state (parse-partial-sexp (vhdl-point 'bol) (point)))) |
20665 | 3458 (cond |
3459 ((nth 3 state) 'string) | |
3460 ((nth 4 state) 'comment) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3461 (t nil))))) |
20665 | 3462 |
3463 ;; This is the best we can do in Win-Emacs. | |
3464 (defun vhdl-win-il (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3465 "Determine if point is in a VHDL literal." |
20665 | 3466 (save-excursion |
3467 (let* ((here (point)) | |
3468 (state nil) | |
3469 (match nil) | |
3470 (lim (or lim (vhdl-point 'bod)))) | |
3471 (goto-char lim ) | |
3472 (while (< (point) here) | |
3473 (setq match | |
3474 (and (re-search-forward "--\\|[\"']" | |
3475 here 'move) | |
3476 (buffer-substring (match-beginning 0) (match-end 0)))) | |
3477 (setq state | |
3478 (cond | |
3479 ;; no match | |
3480 ((null match) nil) | |
3481 ;; looking at the opening of a VHDL style comment | |
3482 ((string= "--" match) | |
3483 (if (<= here (progn (end-of-line) (point))) 'comment)) | |
3484 ;; looking at the opening of a double quote string | |
3485 ((string= "\"" match) | |
3486 (if (not (save-restriction | |
3487 ;; this seems to be necessary since the | |
3488 ;; re-search-forward will not work without it | |
3489 (narrow-to-region (point) here) | |
3490 (re-search-forward | |
3491 ;; this regexp matches a double quote | |
3492 ;; which is preceded by an even number | |
3493 ;; of backslashes, including zero | |
3494 "\\([^\\]\\|^\\)\\(\\\\\\\\\\)*\"" here 'move))) | |
3495 'string)) | |
3496 ;; looking at the opening of a single quote string | |
3497 ((string= "'" match) | |
3498 (if (not (save-restriction | |
3499 ;; see comments from above | |
3500 (narrow-to-region (point) here) | |
3501 (re-search-forward | |
3502 ;; this matches a single quote which is | |
3503 ;; preceded by zero or two backslashes. | |
3504 "\\([^\\]\\|^\\)\\(\\\\\\\\\\)?'" | |
3505 here 'move))) | |
3506 'string)) | |
3507 (t nil))) | |
3508 ) ; end-while | |
3509 state))) | |
3510 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3511 (and (string-match "Win-Emacs" emacs-version) |
20665 | 3512 (fset 'vhdl-in-literal 'vhdl-win-il)) |
3513 | |
3514 ;; Skipping of "syntactic whitespace". Syntactic whitespace is | |
3515 ;; defined as lexical whitespace or comments. Search no farther back | |
3516 ;; or forward than optional LIM. If LIM is omitted, (point-min) is | |
3517 ;; used for backward skipping, (point-max) is used for forward | |
3518 ;; skipping. | |
3519 | |
3520 (defun vhdl-forward-syntactic-ws (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3521 "Forward skip of syntactic whitespace." |
20665 | 3522 (save-restriction |
3523 (let* ((lim (or lim (point-max))) | |
3524 (here lim) | |
3525 (hugenum (point-max))) | |
3526 (narrow-to-region lim (point)) | |
3527 (while (/= here (point)) | |
3528 (setq here (point)) | |
3529 (forward-comment hugenum)) | |
3530 ))) | |
3531 | |
3532 ;; This is the best we can do in Win-Emacs. | |
3533 (defun vhdl-win-fsws (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3534 "Forward skip syntactic whitespace for Win-Emacs." |
20665 | 3535 (let ((lim (or lim (point-max))) |
3536 stop) | |
3537 (while (not stop) | |
3538 (skip-chars-forward " \t\n\r\f" lim) | |
3539 (cond | |
3540 ;; vhdl comment | |
3541 ((looking-at "--") (end-of-line)) | |
3542 ;; none of the above | |
3543 (t (setq stop t)) | |
3544 )))) | |
3545 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3546 (and (string-match "Win-Emacs" emacs-version) |
20665 | 3547 (fset 'vhdl-forward-syntactic-ws 'vhdl-win-fsws)) |
3548 | |
3549 (defun vhdl-backward-syntactic-ws (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3550 "Backward skip over syntactic whitespace." |
20665 | 3551 (save-restriction |
3552 (let* ((lim (or lim (point-min))) | |
3553 (here lim) | |
3554 (hugenum (- (point-max)))) | |
3555 (if (< lim (point)) | |
3556 (progn | |
3557 (narrow-to-region lim (point)) | |
3558 (while (/= here (point)) | |
3559 (setq here (point)) | |
3560 (forward-comment hugenum) | |
3561 ))) | |
3562 ))) | |
3563 | |
3564 ;; This is the best we can do in Win-Emacs. | |
3565 (defun vhdl-win-bsws (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3566 "Backward skip syntactic whitespace for Win-Emacs." |
20665 | 3567 (let ((lim (or lim (vhdl-point 'bod))) |
3568 stop) | |
3569 (while (not stop) | |
3570 (skip-chars-backward " \t\n\r\f" lim) | |
3571 (cond | |
3572 ;; vhdl comment | |
3573 ((eq (vhdl-in-literal lim) 'comment) | |
3574 (skip-chars-backward "^-" lim) | |
3575 (skip-chars-backward "-" lim) | |
3576 (while (not (or (and (= (following-char) ?-) | |
3577 (= (char-after (1+ (point))) ?-)) | |
3578 (<= (point) lim))) | |
3579 (skip-chars-backward "^-" lim) | |
3580 (skip-chars-backward "-" lim))) | |
3581 ;; none of the above | |
3582 (t (setq stop t)) | |
3583 )))) | |
3584 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3585 (and (string-match "Win-Emacs" emacs-version) |
20665 | 3586 (fset 'vhdl-backward-syntactic-ws 'vhdl-win-bsws)) |
3587 | |
3588 ;; Functions to help finding the correct indentation column: | |
3589 | |
3590 (defun vhdl-first-word (point) | |
3591 "If the keyword at POINT is at boi, then return (current-column) at | |
3592 that point, else nil." | |
3593 (save-excursion | |
3594 (and (goto-char point) | |
3595 (eq (point) (vhdl-point 'boi)) | |
3596 (current-column)))) | |
3597 | |
3598 (defun vhdl-last-word (point) | |
3599 "If the keyword at POINT is at eoi, then return (current-column) at | |
3600 that point, else nil." | |
3601 (save-excursion | |
3602 (and (goto-char point) | |
3603 (save-excursion (or (eq (progn (forward-sexp) (point)) | |
3604 (vhdl-point 'eoi)) | |
3605 (looking-at "\\s-*\\(--\\)?"))) | |
3606 (current-column)))) | |
3607 | |
3608 ;; Core syntactic evaluation functions: | |
3609 | |
3610 (defconst vhdl-libunit-re | |
3611 "\\b\\(architecture\\|configuration\\|entity\\|package\\)\\b[^_]") | |
3612 | |
3613 (defun vhdl-libunit-p () | |
3614 (and | |
3615 (save-excursion | |
3616 (forward-sexp) | |
3617 (skip-chars-forward " \t\n") | |
3618 (not (looking-at "is\\b[^_]"))) | |
3619 (save-excursion | |
3620 (backward-sexp) | |
3621 (and (not (looking-at "use\\b[^_]")) | |
3622 (progn | |
3623 (forward-sexp) | |
3624 (vhdl-forward-syntactic-ws) | |
3625 (/= (following-char) ?:)))) | |
3626 )) | |
3627 | |
3628 (defconst vhdl-defun-re | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3629 "\\b\\(architecture\\|block\\|configuration\\|entity\\|package\\|process\\|procedural\\|procedure\\|function\\)\\b[^_]") |
20665 | 3630 |
3631 (defun vhdl-defun-p () | |
3632 (save-excursion | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3633 (if (looking-at "block\\|process\\|procedural") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3634 ;; "block", "process", "procedural": |
20665 | 3635 (save-excursion |
3636 (backward-sexp) | |
3637 (not (looking-at "end\\s-+\\w"))) | |
3638 ;; "architecture", "configuration", "entity", | |
3639 ;; "package", "procedure", "function": | |
3640 t))) | |
3641 | |
3642 (defun vhdl-corresponding-defun () | |
3643 "If the word at the current position corresponds to a \"defun\" | |
3644 keyword, then return a string that can be used to find the | |
3645 corresponding \"begin\" keyword, else return nil." | |
3646 (save-excursion | |
3647 (and (looking-at vhdl-defun-re) | |
3648 (vhdl-defun-p) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3649 (if (looking-at "block\\|process\\|procedural") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3650 ;; "block", "process". "procedural: |
20665 | 3651 (buffer-substring (match-beginning 0) (match-end 0)) |
3652 ;; "architecture", "configuration", "entity", "package", | |
3653 ;; "procedure", "function": | |
3654 "is")))) | |
3655 | |
3656 (defconst vhdl-begin-fwd-re | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3657 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\|units\\|record\\|for\\)\\b\\([^_]\\|\\'\\)" |
20665 | 3658 "A regular expression for searching forward that matches all known |
3659 \"begin\" keywords.") | |
3660 | |
3661 (defconst vhdl-begin-bwd-re | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3662 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\|units\\|record\\|for\\)\\b[^_]" |
20665 | 3663 "A regular expression for searching backward that matches all known |
3664 \"begin\" keywords.") | |
3665 | |
3666 (defun vhdl-begin-p (&optional lim) | |
3667 "Return t if we are looking at a real \"begin\" keyword. | |
3668 Assumes that the caller will make sure that we are looking at | |
3669 vhdl-begin-fwd-re, and are not inside a literal, and that we are not in | |
3670 the middle of an identifier that just happens to contain a \"begin\" | |
3671 keyword." | |
3672 (cond | |
3673 ;; "[architecture|case|configuration|entity|package| | |
3674 ;; procedure|function] ... is": | |
3675 ((and (looking-at "i") | |
3676 (save-excursion | |
3677 ;; Skip backward over first sexp (needed to skip over a | |
3678 ;; procedure interface list, and is harmless in other | |
3679 ;; situations). Note that we need "return" in the | |
3680 ;; following search list so that we don't run into | |
3681 ;; semicolons in the function interface list. | |
3682 (backward-sexp) | |
3683 (let (foundp) | |
3684 (while (and (not foundp) | |
3685 (re-search-backward | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3686 ";\\|\\b\\(architecture\\|case\\|configuration\\|entity\\|package\\|procedure\\|return\\|is\\|begin\\|process\\|procedural\\|block\\)\\b[^_]" |
20665 | 3687 lim 'move)) |
3688 (if (or (= (preceding-char) ?_) | |
3689 (vhdl-in-literal lim)) | |
3690 (backward-char) | |
3691 (setq foundp t)))) | |
3692 (and (/= (following-char) ?\;) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3693 (not (looking-at "is\\|begin\\|process\\|procedural\\|block"))))) |
20665 | 3694 t) |
3695 ;; "begin", "then": | |
3696 ((looking-at "be\\|t") | |
3697 t) | |
3698 ;; "else": | |
3699 ((and (looking-at "e") | |
3700 ;; make sure that the "else" isn't inside a | |
3701 ;; conditional signal assignment. | |
3702 (save-excursion | |
3703 (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move) | |
3704 (or (eq (following-char) ?\;) | |
3705 (eq (point) lim)))) | |
3706 t) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3707 ;; "block", "generate", "loop", "process", "procedural", |
20665 | 3708 ;; "units", "record": |
3709 ((and (looking-at "bl\\|[glpur]") | |
3710 (save-excursion | |
3711 (backward-sexp) | |
3712 (not (looking-at "end\\s-+\\w")))) | |
3713 t) | |
3714 ;; "component": | |
3715 ((and (looking-at "c") | |
3716 (save-excursion | |
3717 (backward-sexp) | |
3718 (not (looking-at "end\\s-+\\w"))) | |
3719 ;; look out for the dreaded entity class in an attribute | |
3720 (save-excursion | |
3721 (vhdl-backward-syntactic-ws lim) | |
3722 (/= (preceding-char) ?:))) | |
3723 t) | |
3724 ;; "for" (inside configuration declaration): | |
3725 ((and (looking-at "f") | |
3726 (save-excursion | |
3727 (backward-sexp) | |
3728 (not (looking-at "end\\s-+\\w"))) | |
3729 (vhdl-has-syntax 'configuration)) | |
3730 t) | |
3731 )) | |
3732 | |
3733 (defun vhdl-corresponding-mid (&optional lim) | |
3734 (cond | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3735 ((looking-at "is\\|block\\|generate\\|process\\|procedural") |
20665 | 3736 "begin") |
3737 ((looking-at "then") | |
3738 "<else>") | |
3739 (t | |
3740 "end"))) | |
3741 | |
3742 (defun vhdl-corresponding-end (&optional lim) | |
3743 "If the word at the current position corresponds to a \"begin\" | |
3744 keyword, then return a vector containing enough information to find | |
3745 the corresponding \"end\" keyword, else return nil. The keyword to | |
3746 search forward for is aref 0. The column in which the keyword must | |
3747 appear is aref 1 or nil if any column is suitable. | |
3748 Assumes that the caller will make sure that we are not in the middle | |
3749 of an identifier that just happens to contain a \"begin\" keyword." | |
3750 (save-excursion | |
3751 (and (looking-at vhdl-begin-fwd-re) | |
3752 (/= (preceding-char) ?_) | |
3753 (not (vhdl-in-literal lim)) | |
3754 (vhdl-begin-p lim) | |
3755 (cond | |
3756 ;; "is", "generate", "loop": | |
3757 ((looking-at "[igl]") | |
3758 (vector "end" | |
3759 (and (vhdl-last-word (point)) | |
3760 (or (vhdl-first-word (point)) | |
3761 (save-excursion | |
3762 (vhdl-beginning-of-statement-1 lim) | |
3763 (vhdl-backward-skip-label lim) | |
3764 (vhdl-first-word (point))))))) | |
3765 ;; "begin", "else", "for": | |
3766 ((looking-at "be\\|[ef]") | |
3767 (vector "end" | |
3768 (and (vhdl-last-word (point)) | |
3769 (or (vhdl-first-word (point)) | |
3770 (save-excursion | |
3771 (vhdl-beginning-of-statement-1 lim) | |
3772 (vhdl-backward-skip-label lim) | |
3773 (vhdl-first-word (point))))))) | |
3774 ;; "component", "units", "record": | |
3775 ((looking-at "[cur]") | |
3776 ;; The first end found will close the block | |
3777 (vector "end" nil)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3778 ;; "block", "process", "procedural": |
20665 | 3779 ((looking-at "bl\\|p") |
3780 (vector "end" | |
3781 (or (vhdl-first-word (point)) | |
3782 (save-excursion | |
3783 (vhdl-beginning-of-statement-1 lim) | |
3784 (vhdl-backward-skip-label lim) | |
3785 (vhdl-first-word (point)))))) | |
3786 ;; "then": | |
3787 ((looking-at "t") | |
3788 (vector "elsif\\|else\\|end\\s-+if" | |
3789 (and (vhdl-last-word (point)) | |
3790 (or (vhdl-first-word (point)) | |
3791 (save-excursion | |
3792 (vhdl-beginning-of-statement-1 lim) | |
3793 (vhdl-backward-skip-label lim) | |
3794 (vhdl-first-word (point))))))) | |
3795 )))) | |
3796 | |
3797 (defconst vhdl-end-fwd-re "\\b\\(end\\|else\\|elsif\\)\\b\\([^_]\\|\\'\\)") | |
3798 | |
3799 (defconst vhdl-end-bwd-re "\\b\\(end\\|else\\|elsif\\)\\b[^_]") | |
3800 | |
3801 (defun vhdl-end-p (&optional lim) | |
3802 "Return t if we are looking at a real \"end\" keyword. | |
3803 Assumes that the caller will make sure that we are looking at | |
3804 vhdl-end-fwd-re, and are not inside a literal, and that we are not in | |
3805 the middle of an identifier that just happens to contain an \"end\" | |
3806 keyword." | |
3807 (or (not (looking-at "else")) | |
3808 ;; make sure that the "else" isn't inside a conditional signal | |
3809 ;; assignment. | |
3810 (save-excursion | |
3811 (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move) | |
3812 (or (eq (following-char) ?\;) | |
3813 (eq (point) lim))))) | |
3814 | |
3815 (defun vhdl-corresponding-begin (&optional lim) | |
3816 "If the word at the current position corresponds to an \"end\" | |
3817 keyword, then return a vector containing enough information to find | |
3818 the corresponding \"begin\" keyword, else return nil. The keyword to | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3819 search backward for is aref 0. The column in which the keyword must |
20665 | 3820 appear is aref 1 or nil if any column is suitable. The supplementary |
3821 keyword to search forward for is aref 2 or nil if this is not | |
3822 required. If aref 3 is t, then the \"begin\" keyword may be found in | |
3823 the middle of a statement. | |
3824 Assumes that the caller will make sure that we are not in the middle | |
3825 of an identifier that just happens to contain an \"end\" keyword." | |
3826 (save-excursion | |
3827 (let (pos) | |
3828 (if (and (looking-at vhdl-end-fwd-re) | |
3829 (not (vhdl-in-literal lim)) | |
3830 (vhdl-end-p lim)) | |
3831 (if (looking-at "el") | |
3832 ;; "else", "elsif": | |
3833 (vector "if\\|elsif" (vhdl-first-word (point)) "then" nil) | |
3834 ;; "end ...": | |
3835 (setq pos (point)) | |
3836 (forward-sexp) | |
3837 (skip-chars-forward " \t\n") | |
3838 (cond | |
3839 ;; "end if": | |
3840 ((looking-at "if\\b[^_]") | |
3841 (vector "else\\|elsif\\|if" | |
3842 (vhdl-first-word pos) | |
3843 "else\\|then" nil)) | |
3844 ;; "end component": | |
3845 ((looking-at "component\\b[^_]") | |
3846 (vector (buffer-substring (match-beginning 1) | |
3847 (match-end 1)) | |
3848 (vhdl-first-word pos) | |
3849 nil nil)) | |
3850 ;; "end units", "end record": | |
3851 ((looking-at "\\(units\\|record\\)\\b[^_]") | |
3852 (vector (buffer-substring (match-beginning 1) | |
3853 (match-end 1)) | |
3854 (vhdl-first-word pos) | |
3855 nil t)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3856 ;; "end block", "end process", "end procedural": |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3857 ((looking-at "\\(block\\|process\\|procedural\\)\\b[^_]") |
20665 | 3858 (vector "begin" (vhdl-first-word pos) nil nil)) |
3859 ;; "end case": | |
3860 ((looking-at "case\\b[^_]") | |
3861 (vector "case" (vhdl-first-word pos) "is" nil)) | |
3862 ;; "end generate": | |
3863 ((looking-at "generate\\b[^_]") | |
3864 (vector "generate\\|for\\|if" | |
3865 (vhdl-first-word pos) | |
3866 "generate" nil)) | |
3867 ;; "end loop": | |
3868 ((looking-at "loop\\b[^_]") | |
3869 (vector "loop\\|while\\|for" | |
3870 (vhdl-first-word pos) | |
3871 "loop" nil)) | |
3872 ;; "end for" (inside configuration declaration): | |
3873 ((looking-at "for\\b[^_]") | |
3874 (vector "for" (vhdl-first-word pos) nil nil)) | |
3875 ;; "end [id]": | |
3876 (t | |
3877 (vector "begin\\|architecture\\|configuration\\|entity\\|package\\|procedure\\|function" | |
3878 (vhdl-first-word pos) | |
3879 ;; return an alist of (statement . keyword) mappings | |
3880 '( | |
3881 ;; "begin ... end [id]": | |
3882 ("begin" . nil) | |
3883 ;; "architecture ... is ... begin ... end [id]": | |
3884 ("architecture" . "is") | |
3885 ;; "configuration ... is ... end [id]": | |
3886 ("configuration" . "is") | |
3887 ;; "entity ... is ... end [id]": | |
3888 ("entity" . "is") | |
3889 ;; "package ... is ... end [id]": | |
3890 ("package" . "is") | |
3891 ;; "procedure ... is ... begin ... end [id]": | |
3892 ("procedure" . "is") | |
3893 ;; "function ... is ... begin ... end [id]": | |
3894 ("function" . "is") | |
3895 ) | |
3896 nil)) | |
3897 ))) ; "end ..." | |
3898 ))) | |
3899 | |
3900 (defconst vhdl-leader-re | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3901 "\\b\\(block\\|component\\|process\\|procedural\\|for\\)\\b[^_]") |
20665 | 3902 |
3903 (defun vhdl-end-of-leader () | |
3904 (save-excursion | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3905 (cond ((looking-at "block\\|process\\|procedural") |
20665 | 3906 (if (save-excursion |
3907 (forward-sexp) | |
3908 (skip-chars-forward " \t\n") | |
3909 (= (following-char) ?\()) | |
3910 (forward-sexp 2) | |
3911 (forward-sexp)) | |
3912 (point)) | |
3913 ((looking-at "component") | |
3914 (forward-sexp 2) | |
3915 (point)) | |
3916 ((looking-at "for") | |
3917 (forward-sexp 2) | |
3918 (skip-chars-forward " \t\n") | |
3919 (while (looking-at "[,:(]") | |
3920 (forward-sexp) | |
3921 (skip-chars-forward " \t\n")) | |
3922 (point)) | |
3923 (t nil) | |
3924 ))) | |
3925 | |
3926 (defconst vhdl-trailer-re | |
3927 "\\b\\(is\\|then\\|generate\\|loop\\)\\b[^_]") | |
3928 | |
3929 (defconst vhdl-statement-fwd-re | |
3930 "\\b\\(if\\|for\\|while\\)\\b\\([^_]\\|\\'\\)" | |
3931 "A regular expression for searching forward that matches all known | |
3932 \"statement\" keywords.") | |
3933 | |
3934 (defconst vhdl-statement-bwd-re | |
3935 "\\b\\(if\\|for\\|while\\)\\b[^_]" | |
3936 "A regular expression for searching backward that matches all known | |
3937 \"statement\" keywords.") | |
3938 | |
3939 (defun vhdl-statement-p (&optional lim) | |
3940 "Return t if we are looking at a real \"statement\" keyword. | |
3941 Assumes that the caller will make sure that we are looking at | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3942 vhdl-statement-fwd-re, and are not inside a literal, and that we are not |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3943 in the middle of an identifier that just happens to contain a |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
3944 \"statement\" keyword." |
20665 | 3945 (cond |
3946 ;; "for" ... "generate": | |
3947 ((and (looking-at "f") | |
3948 ;; Make sure it's the start of a parameter specification. | |
3949 (save-excursion | |
3950 (forward-sexp 2) | |
3951 (skip-chars-forward " \t\n") | |
3952 (looking-at "in\\b[^_]")) | |
3953 ;; Make sure it's not an "end for". | |
3954 (save-excursion | |
3955 (backward-sexp) | |
3956 (not (looking-at "end\\s-+\\w")))) | |
3957 t) | |
3958 ;; "if" ... "then", "if" ... "generate", "if" ... "loop": | |
3959 ((and (looking-at "i") | |
3960 ;; Make sure it's not an "end if". | |
3961 (save-excursion | |
3962 (backward-sexp) | |
3963 (not (looking-at "end\\s-+\\w")))) | |
3964 t) | |
3965 ;; "while" ... "loop": | |
3966 ((looking-at "w") | |
3967 t) | |
3968 )) | |
3969 | |
3970 (defconst vhdl-case-alternative-re "when[( \t\n][^;=>]+=>" | |
3971 "Regexp describing a case statement alternative key.") | |
3972 | |
3973 (defun vhdl-case-alternative-p (&optional lim) | |
3974 "Return t if we are looking at a real case alternative. | |
3975 Assumes that the caller will make sure that we are looking at | |
3976 vhdl-case-alternative-re, and are not inside a literal, and that | |
3977 we are not in the middle of an identifier that just happens to | |
3978 contain a \"when\" keyword." | |
3979 (save-excursion | |
3980 (let (foundp) | |
3981 (while (and (not foundp) | |
3982 (re-search-backward ";\\|<=" lim 'move)) | |
3983 (if (or (= (preceding-char) ?_) | |
3984 (vhdl-in-literal lim)) | |
3985 (backward-char) | |
3986 (setq foundp t))) | |
3987 (or (eq (following-char) ?\;) | |
3988 (eq (point) lim))) | |
3989 )) | |
3990 | |
3991 ;; Core syntactic movement functions: | |
3992 | |
3993 (defconst vhdl-b-t-b-re | |
3994 (concat vhdl-begin-bwd-re "\\|" vhdl-end-bwd-re)) | |
3995 | |
3996 (defun vhdl-backward-to-block (&optional lim) | |
3997 "Move backward to the previous \"begin\" or \"end\" keyword." | |
3998 (let (foundp) | |
3999 (while (and (not foundp) | |
4000 (re-search-backward vhdl-b-t-b-re lim 'move)) | |
4001 (if (or (= (preceding-char) ?_) | |
4002 (vhdl-in-literal lim)) | |
4003 (backward-char) | |
4004 (cond | |
4005 ;; "begin" keyword: | |
4006 ((and (looking-at vhdl-begin-fwd-re) | |
4007 (/= (preceding-char) ?_) | |
4008 (vhdl-begin-p lim)) | |
4009 (setq foundp 'begin)) | |
4010 ;; "end" keyword: | |
4011 ((and (looking-at vhdl-end-fwd-re) | |
4012 (/= (preceding-char) ?_) | |
4013 (vhdl-end-p lim)) | |
4014 (setq foundp 'end)) | |
4015 )) | |
4016 ) | |
4017 foundp | |
4018 )) | |
4019 | |
4020 (defun vhdl-forward-sexp (&optional count lim) | |
4021 "Move forward across one balanced expression (sexp). | |
4022 With COUNT, do it that many times." | |
4023 (interactive "p") | |
4024 (let ((count (or count 1)) | |
4025 (case-fold-search t) | |
4026 end-vec target) | |
4027 (save-excursion | |
4028 (while (> count 0) | |
4029 ;; skip whitespace | |
4030 (skip-chars-forward " \t\n") | |
4031 ;; Check for an unbalanced "end" keyword | |
4032 (if (and (looking-at vhdl-end-fwd-re) | |
4033 (/= (preceding-char) ?_) | |
4034 (not (vhdl-in-literal lim)) | |
4035 (vhdl-end-p lim) | |
4036 (not (looking-at "else"))) | |
4037 (error | |
4038 "Containing expression ends prematurely in vhdl-forward-sexp")) | |
4039 ;; If the current keyword is a "begin" keyword, then find the | |
4040 ;; corresponding "end" keyword. | |
4041 (if (setq end-vec (vhdl-corresponding-end lim)) | |
4042 (let ( | |
4043 ;; end-re is the statement keyword to search for | |
4044 (end-re | |
4045 (concat "\\b\\(" (aref end-vec 0) "\\)\\b\\([^_]\\|\\'\\)")) | |
4046 ;; column is either the statement keyword target column | |
4047 ;; or nil | |
4048 (column (aref end-vec 1)) | |
4049 (eol (vhdl-point 'eol)) | |
4050 foundp literal placeholder) | |
4051 ;; Look for the statement keyword. | |
4052 (while (and (not foundp) | |
4053 (re-search-forward end-re nil t) | |
4054 (setq placeholder (match-end 1)) | |
4055 (goto-char (match-beginning 0))) | |
4056 ;; If we are in a literal, or not in the right target | |
4057 ;; column and not on the same line as the begin, then | |
4058 ;; try again. | |
4059 (if (or (and column | |
4060 (/= (current-indentation) column) | |
4061 (> (point) eol)) | |
4062 (= (preceding-char) ?_) | |
4063 (setq literal (vhdl-in-literal lim))) | |
4064 (if (eq literal 'comment) | |
4065 (end-of-line) | |
4066 (forward-char)) | |
4067 ;; An "else" keyword corresponds to both the opening brace | |
4068 ;; of the following sexp and the closing brace of the | |
4069 ;; previous sexp. | |
4070 (if (not (looking-at "else")) | |
4071 (goto-char placeholder)) | |
4072 (setq foundp t)) | |
4073 ) | |
4074 (if (not foundp) | |
4075 (error "Unbalanced keywords in vhdl-forward-sexp")) | |
4076 ) | |
4077 ;; If the current keyword is not a "begin" keyword, then just | |
4078 ;; perform the normal forward-sexp. | |
4079 (forward-sexp) | |
4080 ) | |
4081 (setq count (1- count)) | |
4082 ) | |
4083 (setq target (point))) | |
4084 (goto-char target) | |
4085 nil)) | |
4086 | |
4087 (defun vhdl-backward-sexp (&optional count lim) | |
4088 "Move backward across one balanced expression (sexp). | |
4089 With COUNT, do it that many times. LIM bounds any required backward | |
4090 searches." | |
4091 (interactive "p") | |
4092 (let ((count (or count 1)) | |
4093 (case-fold-search t) | |
4094 begin-vec target) | |
4095 (save-excursion | |
4096 (while (> count 0) | |
4097 ;; Perform the normal backward-sexp, unless we are looking at | |
4098 ;; "else" - an "else" keyword corresponds to both the opening brace | |
4099 ;; of the following sexp and the closing brace of the previous sexp. | |
4100 (if (and (looking-at "else\\b\\([^_]\\|\\'\\)") | |
4101 (/= (preceding-char) ?_) | |
4102 (not (vhdl-in-literal lim))) | |
4103 nil | |
4104 (backward-sexp) | |
4105 (if (and (looking-at vhdl-begin-fwd-re) | |
4106 (/= (preceding-char) ?_) | |
4107 (not (vhdl-in-literal lim)) | |
4108 (vhdl-begin-p lim)) | |
4109 (error "Containing expression ends prematurely in vhdl-backward-sexp"))) | |
4110 ;; If the current keyword is an "end" keyword, then find the | |
4111 ;; corresponding "begin" keyword. | |
4112 (if (and (setq begin-vec (vhdl-corresponding-begin lim)) | |
4113 (/= (preceding-char) ?_)) | |
4114 (let ( | |
4115 ;; begin-re is the statement keyword to search for | |
4116 (begin-re | |
4117 (concat "\\b\\(" (aref begin-vec 0) "\\)\\b[^_]")) | |
4118 ;; column is either the statement keyword target column | |
4119 ;; or nil | |
4120 (column (aref begin-vec 1)) | |
4121 ;; internal-p controls where the statement keyword can | |
4122 ;; be found. | |
4123 (internal-p (aref begin-vec 3)) | |
4124 (last-backward (point)) last-forward | |
4125 foundp literal keyword) | |
4126 ;; Look for the statement keyword. | |
4127 (while (and (not foundp) | |
4128 (re-search-backward begin-re lim t) | |
4129 (setq keyword | |
4130 (buffer-substring (match-beginning 1) | |
4131 (match-end 1)))) | |
4132 ;; If we are in a literal or in the wrong column, | |
4133 ;; then try again. | |
4134 (if (or (and column | |
4135 (and (/= (current-indentation) column) | |
4136 ;; possibly accept current-column as | |
4137 ;; well as current-indentation. | |
4138 (or (not internal-p) | |
4139 (/= (current-column) column)))) | |
4140 (= (preceding-char) ?_) | |
4141 (vhdl-in-literal lim)) | |
4142 (backward-char) | |
4143 ;; If there is a supplementary keyword, then | |
4144 ;; search forward for it. | |
4145 (if (and (setq begin-re (aref begin-vec 2)) | |
4146 (or (not (listp begin-re)) | |
4147 ;; If begin-re is an alist, then find the | |
4148 ;; element corresponding to the actual | |
4149 ;; keyword that we found. | |
4150 (progn | |
4151 (setq begin-re | |
4152 (assoc keyword begin-re)) | |
4153 (and begin-re | |
4154 (setq begin-re (cdr begin-re)))))) | |
4155 (and | |
4156 (setq begin-re | |
4157 (concat "\\b\\(" begin-re "\\)\\b[^_]")) | |
4158 (save-excursion | |
4159 (setq last-forward (point)) | |
4160 ;; Look for the supplementary keyword | |
4161 ;; (bounded by the backward search start | |
4162 ;; point). | |
4163 (while (and (not foundp) | |
4164 (re-search-forward begin-re | |
4165 last-backward t) | |
4166 (goto-char (match-beginning 1))) | |
4167 ;; If we are in a literal, then try again. | |
4168 (if (or (= (preceding-char) ?_) | |
4169 (setq literal | |
4170 (vhdl-in-literal last-forward))) | |
4171 (if (eq literal 'comment) | |
4172 (goto-char | |
4173 (min (vhdl-point 'eol) last-backward)) | |
4174 (forward-char)) | |
4175 ;; We have found the supplementary keyword. | |
4176 ;; Save the position of the keyword in foundp. | |
4177 (setq foundp (point))) | |
4178 ) | |
4179 foundp) | |
4180 ;; If the supplementary keyword was found, then | |
4181 ;; move point to the supplementary keyword. | |
4182 (goto-char foundp)) | |
4183 ;; If there was no supplementary keyword, then | |
4184 ;; point is already at the statement keyword. | |
4185 (setq foundp t))) | |
4186 ) ; end of the search for the statement keyword | |
4187 (if (not foundp) | |
4188 (error "Unbalanced keywords in vhdl-backward-sexp")) | |
4189 )) | |
4190 (setq count (1- count)) | |
4191 ) | |
4192 (setq target (point))) | |
4193 (goto-char target) | |
4194 nil)) | |
4195 | |
4196 (defun vhdl-backward-up-list (&optional count limit) | |
4197 "Move backward out of one level of blocks. | |
4198 With argument, do this that many times." | |
4199 (interactive "p") | |
4200 (let ((count (or count 1)) | |
4201 target) | |
4202 (save-excursion | |
4203 (while (> count 0) | |
4204 (if (looking-at vhdl-defun-re) | |
4205 (error "Unbalanced blocks")) | |
4206 (vhdl-backward-to-block limit) | |
4207 (setq count (1- count))) | |
4208 (setq target (point))) | |
4209 (goto-char target))) | |
4210 | |
4211 (defun vhdl-end-of-defun (&optional count) | |
4212 "Move forward to the end of a VHDL defun." | |
4213 (interactive) | |
4214 (let ((case-fold-search t)) | |
4215 (vhdl-beginning-of-defun) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4216 (if (not (looking-at "block\\|process\\|procedural")) |
20665 | 4217 (re-search-forward "\\bis\\b")) |
4218 (vhdl-forward-sexp))) | |
4219 | |
4220 (defun vhdl-mark-defun () | |
4221 "Put mark at end of this \"defun\", point at beginning." | |
4222 (interactive) | |
4223 (let ((case-fold-search t)) | |
4224 (push-mark) | |
4225 (vhdl-beginning-of-defun) | |
4226 (push-mark) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4227 (if (not (looking-at "block\\|process\\|procedural")) |
20665 | 4228 (re-search-forward "\\bis\\b")) |
4229 (vhdl-forward-sexp) | |
4230 (exchange-point-and-mark))) | |
4231 | |
4232 (defun vhdl-beginning-of-libunit () | |
4233 "Move backward to the beginning of a VHDL library unit. | |
4234 Returns the location of the corresponding begin keyword, unless search | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4235 stops due to beginning or end of buffer. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4236 Note that if point is between the \"libunit\" keyword and the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4237 corresponding \"begin\" keyword, then that libunit will not be |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4238 recognised, and the search will continue backwards. If point is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4239 at the \"begin\" keyword, then the defun will be recognised. The |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4240 returned point is at the first character of the \"libunit\" keyword." |
20665 | 4241 (let ((last-forward (point)) |
4242 (last-backward | |
4243 ;; Just in case we are actually sitting on the "begin" | |
4244 ;; keyword, allow for the keyword and an extra character, | |
4245 ;; as this will be used when looking forward for the | |
4246 ;; "begin" keyword. | |
4247 (save-excursion (forward-word 1) (1+ (point)))) | |
4248 foundp literal placeholder) | |
4249 ;; Find the "libunit" keyword. | |
4250 (while (and (not foundp) | |
4251 (re-search-backward vhdl-libunit-re nil 'move)) | |
4252 ;; If we are in a literal, or not at a real libunit, then try again. | |
4253 (if (or (= (preceding-char) ?_) | |
4254 (vhdl-in-literal (point-min)) | |
4255 (not (vhdl-libunit-p))) | |
4256 (backward-char) | |
4257 ;; Find the corresponding "begin" keyword. | |
4258 (setq last-forward (point)) | |
4259 (while (and (not foundp) | |
4260 (re-search-forward "\\bis\\b[^_]" last-backward t) | |
4261 (setq placeholder (match-beginning 0))) | |
4262 (if (or (= (preceding-char) ?_) | |
4263 (setq literal (vhdl-in-literal last-forward))) | |
4264 ;; It wasn't a real keyword, so keep searching. | |
4265 (if (eq literal 'comment) | |
4266 (goto-char | |
4267 (min (vhdl-point 'eol) last-backward)) | |
4268 (forward-char)) | |
4269 ;; We have found the begin keyword, loop will exit. | |
4270 (setq foundp placeholder))) | |
4271 ;; Go back to the libunit keyword | |
4272 (goto-char last-forward))) | |
4273 foundp)) | |
4274 | |
4275 (defun vhdl-beginning-of-defun (&optional count) | |
4276 "Move backward to the beginning of a VHDL defun. | |
4277 With argument, do it that many times. | |
4278 Returns the location of the corresponding begin keyword, unless search | |
4279 stops due to beginning or end of buffer." | |
4280 ;; Note that if point is between the "defun" keyword and the | |
4281 ;; corresponding "begin" keyword, then that defun will not be | |
4282 ;; recognised, and the search will continue backwards. If point is | |
4283 ;; at the "begin" keyword, then the defun will be recognised. The | |
4284 ;; returned point is at the first character of the "defun" keyword. | |
4285 (interactive "p") | |
4286 (let ((count (or count 1)) | |
4287 (case-fold-search t) | |
4288 (last-forward (point)) | |
4289 foundp) | |
4290 (while (> count 0) | |
4291 (setq foundp nil) | |
4292 (goto-char last-forward) | |
4293 (let ((last-backward | |
4294 ;; Just in case we are actually sitting on the "begin" | |
4295 ;; keyword, allow for the keyword and an extra character, | |
4296 ;; as this will be used when looking forward for the | |
4297 ;; "begin" keyword. | |
4298 (save-excursion (forward-word 1) (1+ (point)))) | |
4299 begin-string literal) | |
4300 (while (and (not foundp) | |
4301 (re-search-backward vhdl-defun-re nil 'move)) | |
4302 ;; If we are in a literal, then try again. | |
4303 (if (or (= (preceding-char) ?_) | |
4304 (vhdl-in-literal (point-min))) | |
4305 (backward-char) | |
4306 (if (setq begin-string (vhdl-corresponding-defun)) | |
4307 ;; This is a real defun keyword. | |
4308 ;; Find the corresponding "begin" keyword. | |
4309 ;; Look for the begin keyword. | |
4310 (progn | |
4311 ;; Save the search start point. | |
4312 (setq last-forward (point)) | |
4313 (while (and (not foundp) | |
4314 (search-forward begin-string last-backward t)) | |
4315 (if (or (= (preceding-char) ?_) | |
4316 (save-match-data | |
4317 (setq literal (vhdl-in-literal last-forward)))) | |
4318 ;; It wasn't a real keyword, so keep searching. | |
4319 (if (eq literal 'comment) | |
4320 (goto-char | |
4321 (min (vhdl-point 'eol) last-backward)) | |
4322 (forward-char)) | |
4323 ;; We have found the begin keyword, loop will exit. | |
4324 (setq foundp (match-beginning 0))) | |
4325 ) | |
4326 ;; Go back to the defun keyword | |
4327 (goto-char last-forward)) ; end search for begin keyword | |
4328 )) | |
4329 ) ; end of the search for the defun keyword | |
4330 ) | |
4331 (setq count (1- count)) | |
4332 ) | |
4333 (vhdl-keep-region-active) | |
4334 foundp)) | |
4335 | |
4336 (defun vhdl-beginning-of-statement (&optional count lim) | |
4337 "Go to the beginning of the innermost VHDL statement. | |
4338 With prefix arg, go back N - 1 statements. If already at the | |
4339 beginning of a statement then go to the beginning of the preceding | |
4340 one. If within a string or comment, or next to a comment (only | |
4341 whitespace between), move by sentences instead of statements. | |
4342 | |
4343 When called from a program, this function takes 2 optional args: the | |
4344 prefix arg, and a buffer position limit which is the farthest back to | |
4345 search." | |
4346 (interactive "p") | |
4347 (let ((count (or count 1)) | |
4348 (case-fold-search t) | |
4349 (lim (or lim (point-min))) | |
4350 (here (point)) | |
4351 state) | |
4352 (save-excursion | |
4353 (goto-char lim) | |
4354 (setq state (parse-partial-sexp (point) here nil nil))) | |
4355 (if (and (interactive-p) | |
4356 (or (nth 3 state) | |
4357 (nth 4 state) | |
4358 (looking-at (concat "[ \t]*" comment-start-skip)))) | |
4359 (forward-sentence (- count)) | |
4360 (while (> count 0) | |
4361 (vhdl-beginning-of-statement-1 lim) | |
4362 (setq count (1- count)))) | |
4363 ;; its possible we've been left up-buf of lim | |
4364 (goto-char (max (point) lim)) | |
4365 ) | |
4366 (vhdl-keep-region-active)) | |
4367 | |
4368 (defconst vhdl-e-o-s-re | |
4369 (concat ";\\|" vhdl-begin-fwd-re "\\|" vhdl-statement-fwd-re)) | |
4370 | |
4371 (defun vhdl-end-of-statement () | |
4372 "Very simple implementation." | |
4373 (interactive) | |
4374 (re-search-forward vhdl-e-o-s-re)) | |
4375 | |
4376 (defconst vhdl-b-o-s-re | |
4377 (concat ";\\|\(\\|\)\\|\\bwhen\\b[^_]\\|" | |
4378 vhdl-begin-bwd-re "\\|" vhdl-statement-bwd-re)) | |
4379 | |
4380 (defun vhdl-beginning-of-statement-1 (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4381 "Move to the start of the current statement, or the previous |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4382 statement if already at the beginning of one." |
20665 | 4383 (let ((lim (or lim (point-min))) |
4384 (here (point)) | |
4385 (pos (point)) | |
4386 donep) | |
4387 ;; go backwards one balanced expression, but be careful of | |
4388 ;; unbalanced paren being reached | |
4389 (if (not (vhdl-safe (progn (backward-sexp) t))) | |
4390 (progn | |
4391 (backward-up-list 1) | |
4392 (forward-char) | |
4393 (vhdl-forward-syntactic-ws here) | |
4394 (setq donep t))) | |
4395 (while (and (not donep) | |
4396 (not (bobp)) | |
4397 ;; look backwards for a statement boundary | |
4398 (re-search-backward vhdl-b-o-s-re lim 'move)) | |
4399 (if (or (= (preceding-char) ?_) | |
4400 (vhdl-in-literal lim)) | |
4401 (backward-char) | |
4402 (cond | |
4403 ;; If we are looking at an open paren, then stop after it | |
4404 ((eq (following-char) ?\() | |
4405 (forward-char) | |
4406 (vhdl-forward-syntactic-ws here) | |
4407 (setq donep t)) | |
4408 ;; If we are looking at a close paren, then skip it | |
4409 ((eq (following-char) ?\)) | |
4410 (forward-char) | |
4411 (setq pos (point)) | |
4412 (backward-sexp) | |
4413 (if (< (point) lim) | |
4414 (progn (goto-char pos) | |
4415 (vhdl-forward-syntactic-ws here) | |
4416 (setq donep t)))) | |
4417 ;; If we are looking at a semicolon, then stop | |
4418 ((eq (following-char) ?\;) | |
4419 (progn | |
4420 (forward-char) | |
4421 (vhdl-forward-syntactic-ws here) | |
4422 (setq donep t))) | |
4423 ;; If we are looking at a "begin", then stop | |
4424 ((and (looking-at vhdl-begin-fwd-re) | |
4425 (/= (preceding-char) ?_) | |
4426 (vhdl-begin-p nil)) | |
4427 ;; If it's a leader "begin", then find the | |
4428 ;; right place | |
4429 (if (looking-at vhdl-leader-re) | |
4430 (save-excursion | |
4431 ;; set a default stop point at the begin | |
4432 (setq pos (point)) | |
4433 ;; is the start point inside the leader area ? | |
4434 (goto-char (vhdl-end-of-leader)) | |
4435 (vhdl-forward-syntactic-ws here) | |
4436 (if (< (point) here) | |
4437 ;; start point was not inside leader area | |
4438 ;; set stop point at word after leader | |
4439 (setq pos (point)))) | |
4440 (forward-word 1) | |
4441 (vhdl-forward-syntactic-ws here) | |
4442 (setq pos (point))) | |
4443 (goto-char pos) | |
4444 (setq donep t)) | |
4445 ;; If we are looking at a "statement", then stop | |
4446 ((and (looking-at vhdl-statement-fwd-re) | |
4447 (/= (preceding-char) ?_) | |
4448 (vhdl-statement-p nil)) | |
4449 (setq donep t)) | |
4450 ;; If we are looking at a case alternative key, then stop | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4451 ((and (looking-at vhdl-case-alternative-re) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4452 (vhdl-case-alternative-p lim)) |
20665 | 4453 (save-excursion |
4454 ;; set a default stop point at the when | |
4455 (setq pos (point)) | |
4456 ;; is the start point inside the case alternative key ? | |
4457 (looking-at vhdl-case-alternative-re) | |
4458 (goto-char (match-end 0)) | |
4459 (vhdl-forward-syntactic-ws here) | |
4460 (if (< (point) here) | |
4461 ;; start point was not inside the case alternative key | |
4462 ;; set stop point at word after case alternative keyleader | |
4463 (setq pos (point)))) | |
4464 (goto-char pos) | |
4465 (setq donep t)) | |
4466 ;; Bogus find, continue | |
4467 (t | |
4468 (backward-char))))) | |
4469 )) | |
4470 | |
4471 ;; Defuns for calculating the current syntactic state: | |
4472 | |
4473 (defun vhdl-get-library-unit (bod placeholder) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4474 "If there is an enclosing library unit at bod, with it's \"begin\" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4475 keyword at placeholder, then return the library unit type." |
20665 | 4476 (let ((here (vhdl-point 'bol))) |
4477 (if (save-excursion | |
4478 (goto-char placeholder) | |
4479 (vhdl-safe (vhdl-forward-sexp 1 bod)) | |
4480 (<= here (point))) | |
4481 (save-excursion | |
4482 (goto-char bod) | |
4483 (cond | |
4484 ((looking-at "e") 'entity) | |
4485 ((looking-at "a") 'architecture) | |
4486 ((looking-at "c") 'configuration) | |
4487 ((looking-at "p") | |
4488 (save-excursion | |
4489 (goto-char bod) | |
4490 (forward-sexp) | |
4491 (vhdl-forward-syntactic-ws here) | |
4492 (if (looking-at "body\\b[^_]") | |
4493 'package-body 'package)))))) | |
4494 )) | |
4495 | |
4496 (defun vhdl-get-block-state (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4497 "Finds and records all the closest opens. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4498 lim is the furthest back we need to search (it should be the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4499 previous libunit keyword)." |
20665 | 4500 (let ((here (point)) |
4501 (lim (or lim (point-min))) | |
4502 keyword sexp-start sexp-mid sexp-end | |
4503 preceding-sexp containing-sexp | |
4504 containing-begin containing-mid containing-paren) | |
4505 (save-excursion | |
4506 ;; Find the containing-paren, and use that as the limit | |
4507 (if (setq containing-paren | |
4508 (save-restriction | |
4509 (narrow-to-region lim (point)) | |
4510 (vhdl-safe (scan-lists (point) -1 1)))) | |
4511 (setq lim containing-paren)) | |
4512 ;; Look backwards for "begin" and "end" keywords. | |
4513 (while (and (> (point) lim) | |
4514 (not containing-sexp)) | |
4515 (setq keyword (vhdl-backward-to-block lim)) | |
4516 (cond | |
4517 ((eq keyword 'begin) | |
4518 ;; Found a "begin" keyword | |
4519 (setq sexp-start (point)) | |
4520 (setq sexp-mid (vhdl-corresponding-mid lim)) | |
4521 (setq sexp-end (vhdl-safe | |
4522 (save-excursion | |
4523 (vhdl-forward-sexp 1 lim) (point)))) | |
4524 (if (and sexp-end (<= sexp-end here)) | |
4525 ;; we want to record this sexp, but we only want to | |
4526 ;; record the last-most of any of them before here | |
4527 (or preceding-sexp | |
4528 (setq preceding-sexp sexp-start)) | |
4529 ;; we're contained in this sexp so put sexp-start on | |
4530 ;; front of list | |
4531 (setq containing-sexp sexp-start) | |
4532 (setq containing-mid sexp-mid) | |
4533 (setq containing-begin t))) | |
4534 ((eq keyword 'end) | |
4535 ;; Found an "end" keyword | |
4536 (forward-sexp) | |
4537 (setq sexp-end (point)) | |
4538 (setq sexp-mid nil) | |
4539 (setq sexp-start | |
4540 (or (vhdl-safe (vhdl-backward-sexp 1 lim) (point)) | |
4541 (progn (backward-sexp) (point)))) | |
4542 ;; we want to record this sexp, but we only want to | |
4543 ;; record the last-most of any of them before here | |
4544 (or preceding-sexp | |
4545 (setq preceding-sexp sexp-start))) | |
4546 ))) | |
4547 ;; Check if the containing-paren should be the containing-sexp | |
4548 (if (and containing-paren | |
4549 (or (null containing-sexp) | |
4550 (< containing-sexp containing-paren))) | |
4551 (setq containing-sexp containing-paren | |
4552 preceding-sexp nil | |
4553 containing-begin nil | |
4554 containing-mid nil)) | |
4555 (vector containing-sexp preceding-sexp containing-begin containing-mid) | |
4556 )) | |
4557 | |
4558 | |
4559 (defconst vhdl-s-c-a-re | |
4560 (concat vhdl-case-alternative-re "\\|" vhdl-case-header-key)) | |
4561 | |
4562 (defun vhdl-skip-case-alternative (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4563 "Skip forward over case/when bodies, with optional maximal |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4564 limit. If no next case alternative is found, nil is returned and point |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4565 is not moved." |
20665 | 4566 (let ((lim (or lim (point-max))) |
4567 (here (point)) | |
4568 donep foundp) | |
4569 (while (and (< (point) lim) | |
4570 (not donep)) | |
4571 (if (and (re-search-forward vhdl-s-c-a-re lim 'move) | |
4572 (save-match-data | |
4573 (not (vhdl-in-literal))) | |
4574 (/= (match-beginning 0) here)) | |
4575 (progn | |
4576 (goto-char (match-beginning 0)) | |
4577 (cond | |
4578 ((and (looking-at "case") | |
4579 (re-search-forward "\\bis[^_]" lim t)) | |
4580 (backward-sexp) | |
4581 (vhdl-forward-sexp)) | |
4582 (t | |
4583 (setq donep t | |
4584 foundp t)))))) | |
4585 (if (not foundp) | |
4586 (goto-char here)) | |
4587 foundp)) | |
4588 | |
4589 (defun vhdl-backward-skip-label (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4590 "Skip backward over a label, with optional maximal |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4591 limit. If label is not found, nil is returned and point |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4592 is not moved." |
20665 | 4593 (let ((lim (or lim (point-min))) |
4594 placeholder) | |
4595 (if (save-excursion | |
4596 (vhdl-backward-syntactic-ws lim) | |
4597 (and (eq (preceding-char) ?:) | |
4598 (progn | |
4599 (backward-sexp) | |
4600 (setq placeholder (point)) | |
4601 (looking-at vhdl-label-key)))) | |
4602 (goto-char placeholder)) | |
4603 )) | |
4604 | |
4605 (defun vhdl-forward-skip-label (&optional lim) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4606 "Skip forward over a label, with optional maximal |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4607 limit. If label is not found, nil is returned and point |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4608 is not moved." |
20665 | 4609 (let ((lim (or lim (point-max)))) |
4610 (if (looking-at vhdl-label-key) | |
4611 (progn | |
4612 (goto-char (match-end 0)) | |
4613 (vhdl-forward-syntactic-ws lim))) | |
4614 )) | |
4615 | |
4616 (defun vhdl-get-syntactic-context () | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4617 "Guess the syntactic description of the current line of VHDL code." |
20665 | 4618 (save-excursion |
4619 (save-restriction | |
4620 (beginning-of-line) | |
4621 (let* ((indent-point (point)) | |
4622 (case-fold-search t) | |
4623 vec literal containing-sexp preceding-sexp | |
4624 containing-begin containing-mid containing-leader | |
4625 char-before-ip char-after-ip begin-after-ip end-after-ip | |
4626 placeholder lim library-unit | |
4627 ) | |
4628 | |
4629 ;; Reset the syntactic context | |
4630 (setq vhdl-syntactic-context nil) | |
4631 | |
4632 (save-excursion | |
4633 ;; Move to the start of the previous library unit, and | |
4634 ;; record the position of the "begin" keyword. | |
4635 (setq placeholder (vhdl-beginning-of-libunit)) | |
4636 ;; The position of the "libunit" keyword gives us a gross | |
4637 ;; limit point. | |
4638 (setq lim (point)) | |
4639 ) | |
4640 | |
4641 ;; If there is a previous library unit, and we are enclosed by | |
4642 ;; it, then set the syntax accordingly. | |
4643 (and placeholder | |
4644 (setq library-unit (vhdl-get-library-unit lim placeholder)) | |
4645 (vhdl-add-syntax library-unit lim)) | |
4646 | |
4647 ;; Find the surrounding state. | |
4648 (if (setq vec (vhdl-get-block-state lim)) | |
4649 (progn | |
4650 (setq containing-sexp (aref vec 0)) | |
4651 (setq preceding-sexp (aref vec 1)) | |
4652 (setq containing-begin (aref vec 2)) | |
4653 (setq containing-mid (aref vec 3)) | |
4654 )) | |
4655 | |
4656 ;; set the limit on the farthest back we need to search | |
4657 (setq lim (if containing-sexp | |
4658 (save-excursion | |
4659 (goto-char containing-sexp) | |
4660 ;; set containing-leader if required | |
4661 (if (looking-at vhdl-leader-re) | |
4662 (setq containing-leader (vhdl-end-of-leader))) | |
4663 (vhdl-point 'bol)) | |
4664 (point-min))) | |
4665 | |
4666 ;; cache char before and after indent point, and move point to | |
4667 ;; the most likely position to perform the majority of tests | |
4668 (goto-char indent-point) | |
4669 (skip-chars-forward " \t") | |
4670 (setq literal (vhdl-in-literal lim)) | |
4671 (setq char-after-ip (following-char)) | |
4672 (setq begin-after-ip (and | |
4673 (not literal) | |
4674 (looking-at vhdl-begin-fwd-re) | |
4675 (vhdl-begin-p))) | |
4676 (setq end-after-ip (and | |
4677 (not literal) | |
4678 (looking-at vhdl-end-fwd-re) | |
4679 (vhdl-end-p))) | |
4680 (vhdl-backward-syntactic-ws lim) | |
4681 (setq char-before-ip (preceding-char)) | |
4682 (goto-char indent-point) | |
4683 (skip-chars-forward " \t") | |
4684 | |
4685 ;; now figure out syntactic qualities of the current line | |
4686 (cond | |
4687 ;; CASE 1: in a string or comment. | |
4688 ((memq literal '(string comment)) | |
4689 (vhdl-add-syntax literal (vhdl-point 'bopl))) | |
4690 ;; CASE 2: Line is at top level. | |
4691 ((null containing-sexp) | |
4692 ;; Find the point to which indentation will be relative | |
4693 (save-excursion | |
4694 (if (null preceding-sexp) | |
4695 ;; CASE 2X.1 | |
4696 ;; no preceding-sexp -> use the preceding statement | |
4697 (vhdl-beginning-of-statement-1 lim) | |
4698 ;; CASE 2X.2 | |
4699 ;; if there is a preceding-sexp then indent relative to it | |
4700 (goto-char preceding-sexp) | |
4701 ;; if not at boi, then the block-opening keyword is | |
4702 ;; probably following a label, so we need a different | |
4703 ;; relpos | |
4704 (if (/= (point) (vhdl-point 'boi)) | |
4705 ;; CASE 2X.3 | |
4706 (vhdl-beginning-of-statement-1 lim))) | |
4707 ;; v-b-o-s could have left us at point-min | |
4708 (and (bobp) | |
4709 ;; CASE 2X.4 | |
4710 (vhdl-forward-syntactic-ws indent-point)) | |
4711 (setq placeholder (point))) | |
4712 (cond | |
4713 ;; CASE 2A : we are looking at a block-open | |
4714 (begin-after-ip | |
4715 (vhdl-add-syntax 'block-open placeholder)) | |
4716 ;; CASE 2B: we are looking at a block-close | |
4717 (end-after-ip | |
4718 (vhdl-add-syntax 'block-close placeholder)) | |
4719 ;; CASE 2C: we are looking at a top-level statement | |
4720 ((progn | |
4721 (vhdl-backward-syntactic-ws lim) | |
4722 (or (bobp) | |
4723 (= (preceding-char) ?\;))) | |
4724 (vhdl-add-syntax 'statement placeholder)) | |
4725 ;; CASE 2D: we are looking at a top-level statement-cont | |
4726 (t | |
4727 (vhdl-beginning-of-statement-1 lim) | |
4728 ;; v-b-o-s could have left us at point-min | |
4729 (and (bobp) | |
4730 ;; CASE 2D.1 | |
4731 (vhdl-forward-syntactic-ws indent-point)) | |
4732 (vhdl-add-syntax 'statement-cont (point))) | |
4733 )) ; end CASE 2 | |
4734 ;; CASE 3: line is inside parentheses. Most likely we are | |
4735 ;; either in a subprogram argument (interface) list, or a | |
4736 ;; continued expression containing parentheses. | |
4737 ((null containing-begin) | |
4738 (vhdl-backward-syntactic-ws containing-sexp) | |
4739 (cond | |
4740 ;; CASE 3A: we are looking at the arglist closing paren | |
4741 ((eq char-after-ip ?\)) | |
4742 (goto-char containing-sexp) | |
4743 (vhdl-add-syntax 'arglist-close (vhdl-point 'boi))) | |
4744 ;; CASE 3B: we are looking at the first argument in an empty | |
4745 ;; argument list. | |
4746 ((eq char-before-ip ?\() | |
4747 (goto-char containing-sexp) | |
4748 (vhdl-add-syntax 'arglist-intro (vhdl-point 'boi))) | |
4749 ;; CASE 3C: we are looking at an arglist continuation line, | |
4750 ;; but the preceding argument is on the same line as the | |
4751 ;; opening paren. This case includes multi-line | |
4752 ;; expression paren groupings. | |
4753 ((and (save-excursion | |
4754 (goto-char (1+ containing-sexp)) | |
4755 (skip-chars-forward " \t") | |
4756 (not (eolp)) | |
4757 (not (looking-at "--"))) | |
4758 (save-excursion | |
4759 (vhdl-beginning-of-statement-1 containing-sexp) | |
4760 (skip-chars-backward " \t(") | |
4761 (<= (point) containing-sexp))) | |
4762 (goto-char containing-sexp) | |
4763 (vhdl-add-syntax 'arglist-cont-nonempty (vhdl-point 'boi))) | |
4764 ;; CASE 3D: we are looking at just a normal arglist | |
4765 ;; continuation line | |
4766 (t (vhdl-beginning-of-statement-1 containing-sexp) | |
4767 (vhdl-forward-syntactic-ws indent-point) | |
4768 (vhdl-add-syntax 'arglist-cont (vhdl-point 'boi))) | |
4769 )) | |
4770 ;; CASE 4: A block mid open | |
4771 ((and begin-after-ip | |
4772 (looking-at containing-mid)) | |
4773 (goto-char containing-sexp) | |
4774 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s | |
4775 (if (looking-at vhdl-trailer-re) | |
4776 ;; CASE 4.1 | |
4777 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil))) | |
4778 (vhdl-backward-skip-label (vhdl-point 'boi)) | |
4779 (vhdl-add-syntax 'block-open (point))) | |
4780 ;; CASE 5: block close brace | |
4781 (end-after-ip | |
4782 (goto-char containing-sexp) | |
4783 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s | |
4784 (if (looking-at vhdl-trailer-re) | |
4785 ;; CASE 5.1 | |
4786 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil))) | |
4787 (vhdl-backward-skip-label (vhdl-point 'boi)) | |
4788 (vhdl-add-syntax 'block-close (point))) | |
4789 ;; CASE 6: A continued statement | |
4790 ((and (/= char-before-ip ?\;) | |
4791 ;; check it's not a trailer begin keyword, or a begin | |
4792 ;; keyword immediately following a label. | |
4793 (not (and begin-after-ip | |
4794 (or (looking-at vhdl-trailer-re) | |
4795 (save-excursion | |
4796 (vhdl-backward-skip-label containing-sexp))))) | |
4797 ;; check it's not a statement keyword | |
4798 (not (and (looking-at vhdl-statement-fwd-re) | |
4799 (vhdl-statement-p))) | |
4800 ;; see if the b-o-s is before the indent point | |
4801 (> indent-point | |
4802 (save-excursion | |
4803 (vhdl-beginning-of-statement-1 containing-sexp) | |
4804 ;; If we ended up after a leader, then this will | |
4805 ;; move us forward to the start of the first | |
4806 ;; statement. Note that a containing sexp here is | |
4807 ;; always a keyword, not a paren, so this will | |
4808 ;; have no effect if we hit the containing-sexp. | |
4809 (vhdl-forward-syntactic-ws indent-point) | |
4810 (setq placeholder (point)))) | |
4811 ;; check it's not a block-intro | |
4812 (/= placeholder containing-sexp) | |
4813 ;; check it's not a case block-intro | |
4814 (save-excursion | |
4815 (goto-char placeholder) | |
4816 (or (not (looking-at vhdl-case-alternative-re)) | |
4817 (> (match-end 0) indent-point)))) | |
4818 ;; Make placeholder skip a label, but only if it puts us | |
4819 ;; before the indent point at the start of a line. | |
4820 (let ((new placeholder)) | |
4821 (if (and (> indent-point | |
4822 (save-excursion | |
4823 (goto-char placeholder) | |
4824 (vhdl-forward-skip-label indent-point) | |
4825 (setq new (point)))) | |
4826 (save-excursion | |
4827 (goto-char new) | |
4828 (eq new (progn (back-to-indentation) (point))))) | |
4829 (setq placeholder new))) | |
4830 (vhdl-add-syntax 'statement-cont placeholder) | |
4831 (if begin-after-ip | |
4832 (vhdl-add-syntax 'block-open))) | |
4833 ;; Statement. But what kind? | |
4834 ;; CASE 7: A case alternative key | |
4835 ((and (looking-at vhdl-case-alternative-re) | |
4836 (vhdl-case-alternative-p containing-sexp)) | |
4837 ;; for a case alternative key, we set relpos to the first | |
4838 ;; non-whitespace char on the line containing the "case" | |
4839 ;; keyword. | |
4840 (goto-char containing-sexp) | |
4841 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s | |
4842 (if (looking-at vhdl-trailer-re) | |
4843 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil))) | |
4844 (vhdl-add-syntax 'case-alternative (vhdl-point 'boi))) | |
4845 ;; CASE 8: statement catchall | |
4846 (t | |
4847 ;; we know its a statement, but we need to find out if it is | |
4848 ;; the first statement in a block | |
4849 (if containing-leader | |
4850 (goto-char containing-leader) | |
4851 (goto-char containing-sexp) | |
4852 ;; Note that a containing sexp here is always a keyword, | |
4853 ;; not a paren, so skip over the keyword. | |
4854 (forward-sexp)) | |
4855 ;; move to the start of the first statement | |
4856 (vhdl-forward-syntactic-ws indent-point) | |
4857 (setq placeholder (point)) | |
4858 ;; we want to ignore case alternatives keys when skipping forward | |
4859 (let (incase-p) | |
4860 (while (looking-at vhdl-case-alternative-re) | |
4861 (setq incase-p (point)) | |
4862 ;; we also want to skip over the body of the | |
4863 ;; case/when statement if that doesn't put us at | |
4864 ;; after the indent-point | |
4865 (while (vhdl-skip-case-alternative indent-point)) | |
4866 ;; set up the match end | |
4867 (looking-at vhdl-case-alternative-re) | |
4868 (goto-char (match-end 0)) | |
4869 ;; move to the start of the first case alternative statement | |
4870 (vhdl-forward-syntactic-ws indent-point) | |
4871 (setq placeholder (point))) | |
4872 (cond | |
4873 ;; CASE 8A: we saw a case/when statement so we must be | |
4874 ;; in a switch statement. find out if we are at the | |
4875 ;; statement just after a case alternative key | |
4876 ((and incase-p | |
4877 (= (point) indent-point)) | |
4878 ;; relpos is the "when" keyword | |
4879 (vhdl-add-syntax 'statement-case-intro incase-p)) | |
4880 ;; CASE 8B: any old statement | |
4881 ((< (point) indent-point) | |
4882 ;; relpos is the first statement of the block | |
4883 (vhdl-add-syntax 'statement placeholder) | |
4884 (if begin-after-ip | |
4885 (vhdl-add-syntax 'block-open))) | |
4886 ;; CASE 8C: first statement in a block | |
4887 (t | |
4888 (goto-char containing-sexp) | |
4889 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s | |
4890 (if (looking-at vhdl-trailer-re) | |
4891 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil))) | |
4892 (vhdl-backward-skip-label (vhdl-point 'boi)) | |
4893 (vhdl-add-syntax 'statement-block-intro (point)) | |
4894 (if begin-after-ip | |
4895 (vhdl-add-syntax 'block-open))) | |
4896 ))) | |
4897 ) | |
4898 | |
4899 ;; now we need to look at any modifiers | |
4900 (goto-char indent-point) | |
4901 (skip-chars-forward " \t") | |
4902 (if (looking-at "--") | |
4903 (vhdl-add-syntax 'comment)) | |
4904 ;; return the syntax | |
4905 vhdl-syntactic-context)))) | |
4906 | |
4907 ;; Standard indentation line-ups: | |
4908 | |
4909 (defun vhdl-lineup-arglist (langelem) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4910 "Lineup the current arglist line with the arglist appearing just |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4911 after the containing paren which starts the arglist." |
20665 | 4912 (save-excursion |
4913 (let* ((containing-sexp | |
4914 (save-excursion | |
4915 ;; arglist-cont-nonempty gives relpos == | |
4916 ;; to boi of containing-sexp paren. This | |
4917 ;; is good when offset is +, but bad | |
4918 ;; when it is vhdl-lineup-arglist, so we | |
4919 ;; have to special case a kludge here. | |
4920 (if (memq (car langelem) '(arglist-intro arglist-cont-nonempty)) | |
4921 (progn | |
4922 (beginning-of-line) | |
4923 (backward-up-list 1) | |
4924 (skip-chars-forward " \t" (vhdl-point 'eol))) | |
4925 (goto-char (cdr langelem))) | |
4926 (point))) | |
4927 (cs-curcol (save-excursion | |
4928 (goto-char (cdr langelem)) | |
4929 (current-column)))) | |
4930 (if (save-excursion | |
4931 (beginning-of-line) | |
4932 (looking-at "[ \t]*)")) | |
4933 (progn (goto-char (match-end 0)) | |
4934 (backward-sexp) | |
4935 (forward-char) | |
4936 (vhdl-forward-syntactic-ws) | |
4937 (- (current-column) cs-curcol)) | |
4938 (goto-char containing-sexp) | |
4939 (or (eolp) | |
4940 (let ((eol (vhdl-point 'eol)) | |
4941 (here (progn | |
4942 (forward-char) | |
4943 (skip-chars-forward " \t") | |
4944 (point)))) | |
4945 (vhdl-forward-syntactic-ws) | |
4946 (if (< (point) eol) | |
4947 (goto-char here)))) | |
4948 (- (current-column) cs-curcol) | |
4949 )))) | |
4950 | |
4951 (defun vhdl-lineup-arglist-intro (langelem) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4952 "Lineup an arglist-intro line to just after the open paren." |
20665 | 4953 (save-excursion |
4954 (let ((cs-curcol (save-excursion | |
4955 (goto-char (cdr langelem)) | |
4956 (current-column))) | |
4957 (ce-curcol (save-excursion | |
4958 (beginning-of-line) | |
4959 (backward-up-list 1) | |
4960 (skip-chars-forward " \t" (vhdl-point 'eol)) | |
4961 (current-column)))) | |
4962 (- ce-curcol cs-curcol -1)))) | |
4963 | |
4964 (defun vhdl-lineup-comment (langelem) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4965 "Support old behavior for comment indentation. We look at |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4966 vhdl-comment-only-line-offset to decide how to indent comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4967 only-lines." |
20665 | 4968 (save-excursion |
4969 (back-to-indentation) | |
4970 ;; at or to the right of comment-column | |
4971 (if (>= (current-column) comment-column) | |
4972 (vhdl-comment-indent) | |
4973 ;; otherwise, indent as specified by vhdl-comment-only-line-offset | |
4974 (if (not (bolp)) | |
4975 (or (car-safe vhdl-comment-only-line-offset) | |
4976 vhdl-comment-only-line-offset) | |
4977 (or (cdr-safe vhdl-comment-only-line-offset) | |
4978 (car-safe vhdl-comment-only-line-offset) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4979 -1000 ;jam it against the left side |
20665 | 4980 ))))) |
4981 | |
4982 (defun vhdl-lineup-statement-cont (langelem) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
4983 "Line up statement-cont after the assignment operator." |
20665 | 4984 (save-excursion |
4985 (let* ((relpos (cdr langelem)) | |
4986 (assignp (save-excursion | |
4987 (goto-char (vhdl-point 'boi)) | |
4988 (and (re-search-forward "\\(<\\|:\\)=" | |
4989 (vhdl-point 'eol) t) | |
4990 (- (point) (vhdl-point 'boi))))) | |
4991 (curcol (progn | |
4992 (goto-char relpos) | |
4993 (current-column))) | |
4994 foundp) | |
4995 (while (and (not foundp) | |
4996 (< (point) (vhdl-point 'eol))) | |
4997 (re-search-forward "\\(<\\|:\\)=\\|(" (vhdl-point 'eol) 'move) | |
4998 (if (vhdl-in-literal (cdr langelem)) | |
4999 (forward-char) | |
5000 (if (= (preceding-char) ?\() | |
5001 ;; skip over any parenthesized expressions | |
5002 (goto-char (min (vhdl-point 'eol) | |
5003 (scan-lists (point) 1 1))) | |
5004 ;; found an assignment operator (not at eol) | |
5005 (setq foundp (not (looking-at "\\s-*$")))))) | |
5006 (if (not foundp) | |
5007 ;; there's no assignment operator on the line | |
5008 vhdl-basic-offset | |
5009 ;; calculate indentation column after assign and ws, unless | |
5010 ;; our line contains an assignment operator | |
5011 (if (not assignp) | |
5012 (progn | |
5013 (forward-char) | |
5014 (skip-chars-forward " \t") | |
5015 (setq assignp 0))) | |
5016 (- (current-column) assignp curcol)) | |
5017 ))) | |
5018 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5019 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 5020 ;; Indentation commands |
5021 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5022 (defsubst vhdl-in-comment-p () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5023 "Check if point is to right of beginning comment delimiter." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5024 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5025 (save-excursion ; finds an unquoted comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5026 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5027 (re-search-forward "^\\([^\"]*\"[^\"]*\"\\)*[^\"]*--" position t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5028 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5029 (defsubst vhdl-in-string-p () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5030 "Check if point is in a string." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5031 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5032 (save-excursion ; preceeded by odd number of string delimiters? |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5033 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5034 (eq position (re-search-forward "^\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5035 position t))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5036 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5037 (defsubst vhdl-in-comment-or-string-p () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5038 "Check if point is in a comment or a string." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5039 (and (vhdl-in-comment-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5040 (vhdl-in-string-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5041 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5042 (defun vhdl-electric-tab (&optional prefix-arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5043 "If preceeding character is part of a word or a paren then hippie-expand, |
20665 | 5044 else if right of non whitespace on line then tab-to-tab-stop, |
5045 else if last command was a tab or return then dedent one step, | |
5046 else indent `correctly'." | |
5047 (interactive "*P") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5048 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5049 (cond ((= (char-syntax (preceding-char)) ?w) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5050 (let ((case-fold-search (not vhdl-word-completion-case-sensitive)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5051 (case-replace nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5052 (vhdl-expand-abbrev prefix-arg))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5053 ((or (= (preceding-char) ?\() (= (preceding-char) ?\))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5054 (let ((case-fold-search (not vhdl-word-completion-case-sensitive)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5055 (case-replace nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5056 (vhdl-expand-paren prefix-arg))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5057 ((> (current-column) (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5058 (tab-to-tab-stop)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5059 ((and (or (eq last-command 'vhdl-electric-tab) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5060 (eq last-command 'vhdl-electric-return)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5061 (/= 0 (current-indentation))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5062 (backward-delete-char-untabify vhdl-basic-offset nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5063 (t (vhdl-indent-line))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5064 (setq this-command 'vhdl-electric-tab))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5065 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5066 (defun vhdl-electric-return () |
20665 | 5067 "newline-and-indent or indent-new-comment-line if in comment and preceding |
5068 character is a space." | |
5069 (interactive) | |
5070 (if (and (= (preceding-char) ? ) (vhdl-in-comment-p)) | |
5071 (indent-new-comment-line) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5072 (newline-and-indent))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5073 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5074 (defvar vhdl-progress-info nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5075 "Array variable for progress information: 0 begin, 1 end, 2 time.") |
20665 | 5076 |
5077 (defun vhdl-indent-line () | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5078 "Indent the current line as VHDL code. Returns the amount of |
20665 | 5079 indentation change." |
5080 (interactive) | |
5081 (let* ((syntax (vhdl-get-syntactic-context)) | |
5082 (pos (- (point-max) (point))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5083 ;; special case: comments at or right of comment-column |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5084 (indent (if (and (eq (car (car syntax)) 'comment) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5085 (>= (vhdl-get-offset (car syntax)) comment-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5086 (vhdl-get-offset (car syntax)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5087 (apply '+ (mapcar 'vhdl-get-offset syntax)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5088 ; (indent (apply '+ (mapcar 'vhdl-get-offset syntax))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5089 (shift-amt (- indent (current-indentation)))) |
20665 | 5090 (and vhdl-echo-syntactic-information-p |
5091 (message "syntax: %s, indent= %d" syntax indent)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5092 (unless (zerop shift-amt) |
20665 | 5093 (delete-region (vhdl-point 'bol) (vhdl-point 'boi)) |
5094 (beginning-of-line) | |
5095 (indent-to indent)) | |
5096 (if (< (point) (vhdl-point 'boi)) | |
5097 (back-to-indentation) | |
5098 ;; If initial point was within line's indentation, position after | |
5099 ;; the indentation. Else stay at same point in text. | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5100 (when (> (- (point-max) pos) (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5101 (goto-char (- (point-max) pos)))) |
20665 | 5102 (run-hooks 'vhdl-special-indent-hook) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5103 ;; update progress status |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5104 (when vhdl-progress-info |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5105 (aset vhdl-progress-info 1 (+ (aref vhdl-progress-info 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5106 (if (> -500 shift-amt) 0 shift-amt))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5107 (when (< vhdl-progress-interval |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5108 (- (nth 1 (current-time)) (aref vhdl-progress-info 2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5109 (message "Indenting... (%2d%s)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5110 (/ (* 100 (- (point) (aref vhdl-progress-info 0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5111 (- (aref vhdl-progress-info 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5112 (aref vhdl-progress-info 0))) "%") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5113 (aset vhdl-progress-info 2 (nth 1 (current-time))))) |
20665 | 5114 shift-amt)) |
5115 | |
5116 (defun vhdl-indent-buffer () | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5117 "Indent whole buffer as VHDL code. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5118 Calls `indent-region' for whole buffer and adds progress reporting." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5119 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5120 (when vhdl-progress-interval |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5121 (setq vhdl-progress-info (vector (point-min) (point-max) 0))) |
20665 | 5122 (indent-region (point-min) (point-max) nil) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5123 (when vhdl-progress-interval (message "Indenting...done")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5124 (setq vhdl-progress-info nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5125 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5126 (defun vhdl-indent-region (start end column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5127 "Indent region as VHDL code. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5128 Adds progress reporting to `indent-region'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5129 (interactive "r\nP") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5130 (when vhdl-progress-interval (setq vhdl-progress-info (vector start end 0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5131 (indent-region start end column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5132 (when vhdl-progress-interval (message "Indenting...done")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5133 (setq vhdl-progress-info nil)) |
20665 | 5134 |
5135 (defun vhdl-indent-sexp (&optional endpos) | |
5136 "Indent each line of the list starting just after point. | |
5137 If optional arg ENDPOS is given, indent each line, stopping when | |
5138 ENDPOS is encountered." | |
5139 (interactive) | |
5140 (save-excursion | |
5141 (let ((beg (point)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5142 (end (progn (vhdl-forward-sexp nil endpos) (point)))) |
20665 | 5143 (indent-region beg end nil)))) |
5144 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 5146 ;; Miscellaneous commands |
5147 | |
5148 (defun vhdl-show-syntactic-information () | |
5149 "Show syntactic information for current line." | |
5150 (interactive) | |
5151 (message "syntactic analysis: %s" (vhdl-get-syntactic-context)) | |
5152 (vhdl-keep-region-active)) | |
5153 | |
5154 ;; Verification and regression functions: | |
5155 | |
5156 (defun vhdl-regress-line (&optional arg) | |
5157 "Check syntactic information for current line." | |
5158 (interactive "P") | |
5159 (let ((expected (save-excursion | |
5160 (end-of-line) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5161 (when (search-backward " -- ((" (vhdl-point 'bol) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5162 (forward-char 4) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5163 (read (current-buffer))))) |
20665 | 5164 (actual (vhdl-get-syntactic-context)) |
5165 (expurgated)) | |
5166 ;; remove the library unit symbols | |
5167 (mapcar | |
5168 (function | |
5169 (lambda (elt) | |
5170 (if (memq (car elt) '(entity configuration package | |
5171 package-body architecture)) | |
5172 nil | |
5173 (setq expurgated (append expurgated (list elt)))))) | |
5174 actual) | |
5175 (if (and (not arg) expected (listp expected)) | |
5176 (if (not (equal expected expurgated)) | |
5177 (error "Should be: %s, is: %s" expected expurgated)) | |
5178 (save-excursion | |
5179 (beginning-of-line) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5180 (when (not (looking-at "^\\s-*\\(--.*\\)?$")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5181 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5182 (if (search-backward " -- ((" (vhdl-point 'bol) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5183 (kill-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5184 (insert " -- ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5185 (insert (format "%s" expurgated)))))) |
20665 | 5186 (vhdl-keep-region-active)) |
5187 | |
5188 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5189 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5190 ;;; Alignment, whitespace fixup, beautifying |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5191 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 5192 |
5193 (defvar vhdl-align-alist | |
5194 '( | |
5195 ;; after some keywords | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5196 (vhdl-mode "\\<\\(constant\\|quantity\\|signal\\|terminal\\|variable\\)[ \t]" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5197 "\\<\\(constant\\|quantity\\|signal\\|terminal\\|variable\\)\\([ \t]+\\)" 2) |
20665 | 5198 ;; before ':' |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5199 (vhdl-mode ":[^=]" "\\([ \t]*\\):[^=]") |
20665 | 5200 ;; after direction specifications |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5201 (vhdl-mode ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5202 ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\([ \t]+\\)" 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5203 ;; before "==", ":=", "=>", and "<=" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5204 (vhdl-mode "==" "\\([ \t]*\\)==" 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5205 (vhdl-mode ":=" "\\([ \t]*\\):=" 1) ; since ":= ... =>" can occur |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5206 (vhdl-mode "<=" "\\([ \t]*\\)<=" 1) ; since "<= ... =>" can occur |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5207 (vhdl-mode "=>" "\\([ \t]*\\)=>" 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5208 (vhdl-mode ":=" "\\([ \t]*\\):=" 1) ; since "=> ... :=" can occur |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5209 (vhdl-mode "<=" "\\([ \t]*\\)<=" 1) ; since "=> ... <=" can occur |
20665 | 5210 ;; before some keywords |
5211 (vhdl-mode "[ \t]after\\>" "[^ \t]\\([ \t]+\\)after\\>" 1) | |
5212 (vhdl-mode "[ \t]when\\>" "[^ \t]\\([ \t]+\\)when\\>" 1) | |
5213 (vhdl-mode "[ \t]else\\>" "[^ \t]\\([ \t]+\\)else\\>" 1) | |
5214 ) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5215 "The format of this alist is (MODES [or MODE] REGEXP ALIGN-PATTERN SUBEXP). |
20665 | 5216 It is searched in order. If REGEXP is found anywhere in the first |
5217 line of a region to be aligned, ALIGN-PATTERN will be used for that | |
5218 region. ALIGN-PATTERN must include the whitespace to be expanded or | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5219 contracted. It may also provide regexps for the text surrounding the |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5220 whitespace. SUBEXP specifies which sub-expression of |
20665 | 5221 ALIGN-PATTERN matches the white space to be expanded/contracted.") |
5222 | |
5223 (defvar vhdl-align-try-all-clauses t | |
5224 "If REGEXP is not found on the first line of the region that clause | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5225 is ignored. If this variable is non-nil, then the clause is tried anyway.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5226 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5227 (defun vhdl-align-region (begin end &optional spacing alignment-list indent) |
20665 | 5228 "Attempt to align a range of lines based on the content of the |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5229 lines. The definition of `alignment-list' determines the matching |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5230 order and the manner in which the lines are aligned. If ALIGNMENT-LIST |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5231 is not specified `vhdl-align-alist' is used. If INDENT is non-nil, |
20665 | 5232 indentation is done before aligning." |
5233 (interactive "r\np") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5234 (setq alignment-list (or alignment-list vhdl-align-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5235 (setq spacing (or spacing 1)) |
20665 | 5236 (save-excursion |
5237 (let (bol indent) | |
5238 (goto-char end) | |
5239 (setq end (point-marker)) | |
5240 (goto-char begin) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5241 (setq bol (setq begin (progn (beginning-of-line) (point)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5242 ; (untabify bol end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5243 (when indent |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5244 (indent-region bol end nil)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5245 (let ((case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5246 (copy (copy-alist alignment-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5247 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5248 (while copy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5249 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5250 (goto-char begin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5251 (let (element |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5252 (eol (save-excursion (progn (end-of-line) (point))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5253 (setq element (nth 0 copy)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5254 (when (and (or (and (listp (car element)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5255 (memq major-mode (car element))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5256 (eq major-mode (car element))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5257 (or vhdl-align-try-all-clauses |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5258 (re-search-forward (car (cdr element)) eol t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5259 (vhdl-align-region-1 begin end (car (cdr (cdr element))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5260 (car (cdr (cdr (cdr element)))) spacing)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5261 (setq copy (cdr copy)))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5262 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5263 (defun vhdl-align-region-1 (begin end match &optional substr spacing) |
20665 | 5264 "Align a range of lines from BEGIN to END. The regular expression |
5265 MATCH must match exactly one fields: the whitespace to be | |
5266 contracted/expanded. The alignment column will equal the | |
5267 rightmost column of the widest whitespace block. SPACING is | |
5268 the amount of extra spaces to add to the calculated maximum required. | |
5269 SPACING defaults to 1 so that at least one space is inserted after | |
5270 the token in MATCH." | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5271 (setq spacing (or spacing 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5272 (setq substr (or substr 1)) |
20665 | 5273 (save-excursion |
5274 (let (distance (max 0) (lines 0) bol eol width) | |
5275 ;; Determine the greatest whitespace distance to the alignment | |
5276 ;; character | |
5277 (goto-char begin) | |
5278 (setq eol (progn (end-of-line) (point)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5279 bol (setq begin (progn (beginning-of-line) (point)))) |
20665 | 5280 (while (< bol end) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5281 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5282 (when (and (re-search-forward match eol t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5283 (not (vhdl-in-comment-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5284 (setq distance (- (match-beginning substr) bol)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5285 (when (> distance max) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5286 (setq max distance)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5287 (forward-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5288 (setq bol (point) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5289 eol (save-excursion (end-of-line) (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5290 (setq lines (1+ lines))) |
20665 | 5291 ;; Now insert enough maxs to push each assignment operator to |
5292 ;; the same column. We need to use 'lines' as a counter, since | |
5293 ;; the location of the mark may change | |
5294 (goto-char (setq bol begin)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5295 (setq eol (save-excursion (end-of-line) (point))) |
20665 | 5296 (while (> lines 0) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5297 (when (and (re-search-forward match eol t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5298 (not (vhdl-in-comment-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5299 (setq width (- (match-end substr) (match-beginning substr))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5300 (setq distance (- (match-beginning substr) bol)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5301 (goto-char (match-beginning substr)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5302 (delete-char width) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5303 (insert-char ? (+ (- max distance) spacing))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5304 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5305 (forward-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5306 (setq bol (point) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5307 eol (save-excursion (end-of-line) (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5308 (setq lines (1- lines)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5309 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5310 (defun vhdl-align-inline-comment-region-1 (beg end &optional spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5311 "Align inline comments in region." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5312 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5313 (let ((high-start 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5314 (high-length 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5315 (case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5316 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5317 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5318 ;; search for longest code line and longest inline comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5319 (while (< (point) end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5320 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5321 ((and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5322 (looking-at "^\\(.*[^ \t\n-]+\\)\\s-*\\(--\\s-*.*\\)$")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5323 (setq high-start |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5324 (max high-start (- (match-end 1) (match-beginning 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5325 (setq high-length |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5326 (max high-length (- (match-end 2) (match-beginning 2))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5327 ((and (looking-at "^\\(\\s-*\\))\\(--\\s-*.*\\)$") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5328 (>= (- (match-end 1) (match-beginning 1)) comment-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5329 (setq high-length |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5330 (max high-length (- (match-end 2) (match-beginning 2)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5331 (beginning-of-line 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5332 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5333 (setq spacing (or spacing 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5334 (setq high-start (+ high-start spacing)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5335 ;; align as nice as possible |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5336 (while (< (point) end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5337 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5338 (or (looking-at "^.*[^ \t\n-]+\\(\\s-*\\)--") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5339 (and (looking-at "^\\(\\s-*\\)--") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5340 (>= (- (match-end 1) (match-beginning 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5341 comment-column)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5342 (goto-char (match-end 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5343 (delete-region (match-beginning 1) (match-end 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5344 (insert-char ? spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5345 (cond ((<= high-start comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5346 (indent-to comment-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5347 ((<= (+ high-start high-length) end-comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5348 (indent-to high-start)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5349 (t (indent-to comment-column)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5350 (beginning-of-line 2)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5351 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5352 (defun vhdl-align-noindent-region (beg end &optional spacing no-message) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5353 "Align region without indentation." |
20665 | 5354 (interactive "r\nP") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5355 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5356 (let (pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5357 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5358 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5359 (setq beg (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5360 (goto-char end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5361 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5362 (untabify beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5363 (unless no-message (message "Aligning...")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5364 (vhdl-fixup-whitespace-region beg end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5365 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5366 (if (not vhdl-align-groups) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5367 ;; align entire region |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5368 (progn (vhdl-align-region beg end spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5369 (vhdl-align-inline-comment-region-1 beg end)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5370 ;; align groups |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5371 (while (and (< beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5372 (re-search-forward "^\\s-*$" end t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5373 (setq pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5374 (vhdl-align-region beg pos spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5375 (vhdl-align-inline-comment-region-1 beg pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5376 (setq beg (1+ pos)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5377 (goto-char beg)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5378 ;; align last group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5379 (when (< beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5380 (vhdl-align-region beg end spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5381 (vhdl-align-inline-comment-region-1 beg end))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5382 (unless no-message (message "Aligning...done"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5383 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5384 (defun vhdl-align-group (&optional spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5385 "Align group of lines between empty lines." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5386 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5387 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5388 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5389 beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5390 (setq end (if (re-search-forward "^\\s-*$" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5391 (point-marker) (point-max))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5392 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5393 (setq beg (if (re-search-backward "^\\s-*$" nil t) (point) (point-min))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5394 (untabify beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5395 (message "Aligning...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5396 (vhdl-fixup-whitespace-region beg end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5397 (vhdl-align-region beg end spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5398 (vhdl-align-inline-comment-region-1 beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5399 (message "Aligning...done")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5400 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5401 (defun vhdl-align-noindent-buffer () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5402 "Align buffer without indentation." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5403 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5404 (vhdl-align-noindent-region (point-min) (point-max))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5405 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5406 (defun vhdl-align-inline-comment-region (beg end &optional spacing no-message) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5407 "Align inline comments within a region. Groups of code lines separated by |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5408 empty lines are aligned individually, if `vhdl-align-groups' is non-nil." |
20665 | 5409 (interactive "r\nP") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5410 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5411 (let (pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5412 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5413 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5414 (setq beg (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5415 (goto-char end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5416 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5417 (untabify beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5418 (unless no-message (message "Aligning inline comments...")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5419 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5420 (if (not vhdl-align-groups) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5421 ;; align entire region |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5422 (vhdl-align-inline-comment-region-1 beg end spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5423 ;; align groups |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5424 (while (and (< beg end) (re-search-forward "^\\s-*$" end t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5425 (setq pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5426 (vhdl-align-inline-comment-region-1 beg pos spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5427 (setq beg (1+ pos)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5428 (goto-char beg)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5429 ;; align last group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5430 (when (< beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5431 (vhdl-align-inline-comment-region-1 beg end spacing)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5432 (unless no-message (message "Aligning inline comments...done")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5433 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5434 (defun vhdl-align-inline-comment-group (&optional spacing) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5435 "Align inline comments within a group of lines between empty lines." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5436 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5437 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5438 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5439 beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5440 (setq end (if (re-search-forward "^\\s-*$" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5441 (point-marker) (point-max))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5442 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5443 (setq beg (if (re-search-backward "^\\s-*$" nil t) (point) (point-min))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5444 (untabify beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5445 (message "Aligning inline comments...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5446 (vhdl-align-inline-comment-region-1 beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5447 (message "Aligning inline comments...done")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5448 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5449 (defun vhdl-align-inline-comment-buffer () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5450 "Align inline comments within buffer. Groups of code lines separated by |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5451 empty lines are aligned individually, if `vhdl-align-groups' is non-nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5452 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5453 (vhdl-align-inline-comment-region (point-min) (point-max))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5454 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5455 (defun vhdl-fixup-whitespace-region (beg end &optional no-message) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5456 "Fixup whitespace in region. Surround operator symbols by one space, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5457 eliminate multiple spaces (except at beginning of line), eliminate spaces at |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5458 end of line, do nothing in comments." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5459 (interactive "r") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5460 (unless no-message (message "Fixing up whitespace...")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5461 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5462 (goto-char end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5463 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5464 ;; surround operator symbols by one space |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5465 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5466 (while (re-search-forward "\\([^/:<>=]\\|^\\)\\(--\\|:\\|=\\|<\\|>\\|:=\\|<=\\|>=\\|=>\\)\\([^=>]\\|$\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5467 end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5468 (if (equal "--" (match-string 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5469 (re-search-forward ".*\n" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5470 (replace-match "\\1 \\2 \\3"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5471 ;; have no space before and one space after `,' and ';' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5472 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5473 (while (re-search-forward "\\(--\\|\\s-*\\([,;]\\)\\)" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5474 (if (equal "--" (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5475 (re-search-forward ".*\n" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5476 (replace-match "\\2 " nil nil nil 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5477 ;; eliminate multiple spaces and spaces at end of line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5478 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5479 (while (or (and (looking-at "--.*\n") (re-search-forward "--.*\n" end t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5480 (and (looking-at "\\s-+$") (re-search-forward "\\s-+$" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5481 (progn (replace-match "" nil nil) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5482 (and (looking-at "\\s-+;") (re-search-forward "\\s-+;" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5483 (progn (replace-match ";" nil nil) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5484 (and (looking-at "^\\s-+") (re-search-forward "^\\s-+" end t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5485 (and (looking-at "\\s-+--") (re-search-forward "\\s-+" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5486 (progn (replace-match " " nil nil) t )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5487 (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5488 (progn (replace-match " " nil nil) t )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5489 (re-search-forward "\\S-+" end t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5490 (unless no-message (message "Fixing up whitespace...done"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5491 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5492 (defun vhdl-fixup-whitespace-buffer () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5493 "Fixup whitespace in buffer. Surround operator symbols by one space, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5494 eliminate multiple spaces (except at beginning of line), eliminate spaces at |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5495 end of line, do nothing in comments." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5496 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5497 (vhdl-fixup-whitespace-region (point-min) (point-max))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5498 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5499 (defun vhdl-beautify-region (beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5500 "Beautify region by applying indentation, whitespace fixup, alignment, and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5501 case fixing to a resion. Calls functions `vhdl-indent-buffer', |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5502 `vhdl-align-noindent-buffer' (variable `vhdl-align-groups' set to non-nil), and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5503 `vhdl-fix-case-buffer'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5504 (interactive "r") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5505 (vhdl-indent-region beg end nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5506 (let ((vhdl-align-groups t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5507 (vhdl-align-noindent-region beg end)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5508 (vhdl-fix-case-region beg end)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5509 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5510 (defun vhdl-beautify-buffer () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5511 "Beautify buffer by applying indentation, whitespace fixup, alignment, and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5512 case fixing to entire buffer. Calls `vhdl-beautify-region' for the entire |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5513 buffer." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5514 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5515 (vhdl-beautify-region (point-min) (point-max))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5516 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5517 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5518 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5519 ;;; Electrification |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5520 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5521 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5522 (defconst vhdl-template-prompt-syntax "[^ =<>][^<>@.\n]*[^ =<>]" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5523 "Syntax of prompt inserted by template generators.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5524 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5525 (defvar vhdl-template-invoked-by-hook nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5526 "Indicates whether a template has been invoked by a hook or by key or menu. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5527 Used for undoing after template abortion.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5528 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5529 ;; correct different behavior of function `unread-command-events' in XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5530 (defalias 'vhdl-character-to-event |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5531 (if (string-match "XEmacs" emacs-version) 'character-to-event 'identity)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5532 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5533 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5534 ;; Enabling/disabling |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5535 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5536 (defun vhdl-mode-line-update () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5537 "Update the modeline string for VHDL major mode." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5538 (setq mode-name (concat "VHDL" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5539 (and (or vhdl-electric-mode vhdl-stutter-mode) "/") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5540 (and vhdl-electric-mode "e") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5541 (and vhdl-stutter-mode "s"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5542 (force-mode-line-update)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5543 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5544 (defun vhdl-electric-mode (arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5545 "Toggle VHDL electric mode. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5546 Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5547 (interactive "P") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5548 (setq vhdl-electric-mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5549 (cond ((or (not arg) (zerop arg)) (not vhdl-electric-mode)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5550 ((> arg 0) t) (t nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5551 (vhdl-mode-line-update)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5552 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5553 (defun vhdl-stutter-mode (arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5554 "Toggle VHDL stuttering mode. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5555 Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5556 (interactive "P") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5557 (setq vhdl-stutter-mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5558 (cond ((or (not arg) (zerop arg)) (not vhdl-stutter-mode)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5559 ((> arg 0) t) (t nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5560 (vhdl-mode-line-update)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5561 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5562 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5563 ;; Stuttering |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5564 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5565 (defun vhdl-electric-dash (count) |
20665 | 5566 "-- starts a comment, --- draws a horizontal line, |
5567 ---- starts a display comment" | |
5568 (interactive "p") | |
5569 (if vhdl-stutter-mode | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5570 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5571 ((and abbrev-start-location (= abbrev-start-location (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5572 (setq abbrev-start-location nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5573 (goto-char last-abbrev-location) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5574 (beginning-of-line nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5575 (vhdl-comment-display)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5576 ((/= (preceding-char) ?-) ; standard dash (minus) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5577 (self-insert-command count)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5578 (t (self-insert-command count) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5579 (message "Enter '-' for horiz. line, 'CR' for commenting-out code, else enter comment") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5580 (let ((next-input (read-char))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5581 (if (= next-input ?-) ; triple dash |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5582 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5583 (vhdl-comment-display-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5584 (message |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5585 "Enter '-' for display comment, else continue coding") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5586 (let ((next-input (read-char))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5587 (if (= next-input ?-) ; four dashes |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5588 (vhdl-comment-display t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5589 (setq unread-command-events ; pushback the char |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5590 (list (vhdl-character-to-event next-input)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5591 (setq unread-command-events ; pushback the char |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5592 (list (vhdl-character-to-event next-input))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5593 (vhdl-comment-insert))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5594 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5595 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5596 (defun vhdl-electric-open-bracket (count) "'[' --> '(', '([' --> '['" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5597 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5598 (if (and vhdl-stutter-mode (= count 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5599 (if (= (preceding-char) ?\() |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5600 (progn (delete-char -1) (insert-char ?\[ 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5601 (insert-char ?\( 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5602 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5603 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5604 (defun vhdl-electric-close-bracket (count) "']' --> ')', ')]' --> ']'" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5605 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5606 (if (and vhdl-stutter-mode (= count 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5607 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5608 (if (= (preceding-char) ?\)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5609 (progn (delete-char -1) (insert-char ?\] 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5610 (insert-char ?\) 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5611 (blink-matching-open)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5612 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5613 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5614 (defun vhdl-electric-quote (count) "'' --> \"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5615 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5616 (if (and vhdl-stutter-mode (= count 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5617 (if (= (preceding-char) last-input-char) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5618 (progn (delete-backward-char 1) (insert-char ?\" 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5619 (insert-char ?\' 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5620 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5621 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5622 (defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5623 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5624 (if (and vhdl-stutter-mode (= count 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5625 (cond ((= (preceding-char) last-input-char) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5626 (progn (delete-char -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5627 (when (not (eq (preceding-char) ? )) (insert " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5628 (insert ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5629 (setq this-command 'vhdl-electric-colon))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5630 ((and |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5631 (eq last-command 'vhdl-electric-colon) (= (preceding-char) ? )) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5632 (progn (delete-char -1) (insert "= "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5633 (t (insert-char ?\; 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5634 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5635 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5636 (defun vhdl-electric-comma (count) "',,' --> ' <= '" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5637 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5638 (if (and vhdl-stutter-mode (= count 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5639 (cond ((= (preceding-char) last-input-char) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5640 (progn (delete-char -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5641 (when (not (eq (preceding-char) ? )) (insert " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5642 (insert "<= "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5643 (t (insert-char ?\, 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5644 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5645 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5646 (defun vhdl-electric-period (count) "'..' --> ' => '" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5647 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5648 (if (and vhdl-stutter-mode (= count 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5649 (cond ((= (preceding-char) last-input-char) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5650 (progn (delete-char -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5651 (when (not (eq (preceding-char) ? )) (insert " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5652 (insert "=> "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5653 (t (insert-char ?\. 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5654 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5655 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5656 (defun vhdl-electric-equal (count) "'==' --> ' == '" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5657 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5658 (if (and vhdl-stutter-mode (= count 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5659 (cond ((= (preceding-char) last-input-char) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5660 (progn (delete-char -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5661 (when (not (eq (preceding-char) ? )) (insert " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5662 (insert "== "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5663 (t (insert-char ?\= 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5664 (self-insert-command count))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5665 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5666 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 5667 ;; VHDL templates |
5668 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5669 (defun vhdl-template-paired-parens () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5670 "Insert a pair of round parentheses, placing point between them." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5671 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5672 (insert "()") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5673 (backward-char)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5674 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5675 (defun vhdl-template-alias () |
20665 | 5676 "Insert alias declaration." |
5677 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5678 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5679 (vhdl-insert-keyword "ALIAS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5680 (when (vhdl-template-field "name" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5681 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5682 (unless (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5683 (concat "[type" (and (vhdl-standard-p 'ams) " or nature") "]") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5684 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5685 (backward-delete-char 3)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5686 (vhdl-insert-keyword " IS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5687 (vhdl-template-field "name" ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5688 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5689 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5690 (defun vhdl-template-architecture () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5691 "Insert architecture." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5692 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5693 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5694 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5695 arch-name entity-exists string |
20665 | 5696 (case-fold-search t)) |
5697 (vhdl-insert-keyword "ARCHITECTURE ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5698 (when (setq arch-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5699 (vhdl-template-field "name" nil t start (point))) |
20665 | 5700 (vhdl-insert-keyword " OF ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5701 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5702 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5703 (setq entity-exists (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5704 "\\<entity \\(\\w+\\) is\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5705 (setq string (match-string 1)))) |
20665 | 5706 (if (and entity-exists (not (equal string ""))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5707 (insert string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5708 (vhdl-template-field "entity name")) |
20665 | 5709 (vhdl-insert-keyword " IS") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5710 (vhdl-template-begin-end |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5711 (unless (vhdl-standard-p '87) "ARCHITECTURE") arch-name margin |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5712 (memq vhdl-insert-empty-lines '(unit all)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5713 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5714 (defun vhdl-template-array (kind &optional secondary) |
20665 | 5715 "Insert array type definition." |
5716 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5717 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5718 (vhdl-insert-keyword "ARRAY (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5719 (when (or (vhdl-template-field "range" nil (not secondary) start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5720 secondary) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5721 (vhdl-insert-keyword ") OF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5722 (vhdl-template-field (if (eq kind 'type) "type" "nature")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5723 (vhdl-insert-keyword ";")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5724 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5725 (defun vhdl-template-assert () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5726 "Insert an assertion statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5727 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5728 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5729 (vhdl-insert-keyword "ASSERT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5730 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5731 (when (vhdl-template-field "condition (negated)" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5732 (when vhdl-conditions-in-parenthesis (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5733 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5734 (vhdl-insert-keyword " REPORT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5735 (unless (vhdl-template-field "string expression" nil nil nil nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5736 (delete-region start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5737 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5738 (vhdl-insert-keyword " SEVERITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5739 (unless (vhdl-template-field "[NOTE | WARNING | ERROR | FAILURE]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5740 (delete-region start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5741 (insert ";")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5742 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5743 (defun vhdl-template-attribute () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5744 "Insert an attribute declaration or specification." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5745 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5746 (if (eq (vhdl-decision-query |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5747 "attribute" "(d)eclaration or (s)pecification?" t) ?s) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5748 (vhdl-template-attribute-spec) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5749 (vhdl-template-attribute-decl))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5750 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5751 (defun vhdl-template-attribute-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5752 "Insert an attribute declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5753 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5754 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5755 (vhdl-insert-keyword "ATTRIBUTE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5756 (when (vhdl-template-field "name" " : " t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5757 (vhdl-template-field "type" ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5758 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5759 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5760 (defun vhdl-template-attribute-spec () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5761 "Insert an attribute specification." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5762 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5763 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5764 (vhdl-insert-keyword "ATTRIBUTE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5765 (when (vhdl-template-field "name" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5766 (vhdl-insert-keyword " OF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5767 (vhdl-template-field "entity names | OTHERS | ALL" " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5768 (vhdl-template-field "entity class") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5769 (vhdl-insert-keyword " IS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5770 (vhdl-template-field "expression" ";")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5771 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5772 (defun vhdl-template-block () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5773 "Insert a block." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5774 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5775 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5776 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5777 label) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5778 (vhdl-insert-keyword ": BLOCK ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5779 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5780 (when (setq label (vhdl-template-field "label" nil t start (+ (point) 8))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5781 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5782 (forward-char 1) |
20665 | 5783 (insert "(") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5784 (if (vhdl-template-field "[guard expression]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5785 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5786 (delete-char -2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5787 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " IS")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5788 (vhdl-template-begin-end "BLOCK" label margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5789 (vhdl-comment-block)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5790 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5791 (defun vhdl-template-block-configuration () |
20665 | 5792 "Insert a block configuration statement." |
5793 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5794 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5795 (start (point))) |
20665 | 5796 (vhdl-insert-keyword "FOR ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5797 (when (vhdl-template-field "block name" nil t start (point)) |
20665 | 5798 (vhdl-insert-keyword "\n\n") |
5799 (indent-to margin) | |
5800 (vhdl-insert-keyword "END FOR;") | |
5801 (end-of-line 0) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5802 (indent-to (+ margin vhdl-basic-offset))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5803 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5804 (defun vhdl-template-break () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5805 "Insert a break statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5806 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5807 (let (position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5808 (vhdl-insert-keyword "BREAK") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5809 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5810 (insert " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5811 (while (or |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5812 (progn (vhdl-insert-keyword "FOR ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5813 (if (vhdl-template-field "[quantity name]" " USE " t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5814 (progn (vhdl-template-field "quantity name" " => ") t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5815 (kill-word -1) nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5816 (vhdl-template-field "[quantity name]" " => " t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5817 (vhdl-template-field "expression") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5818 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5819 (insert ", ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5820 (delete-region position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5821 (unless (vhdl-sequential-statement-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5822 (vhdl-insert-keyword " ON ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5823 (if (vhdl-template-field "[sensitivity list]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5824 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5825 (delete-region position (point)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5826 (vhdl-insert-keyword " WHEN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5827 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5828 (if (vhdl-template-field "[condition]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5829 (when vhdl-conditions-in-parenthesis (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5830 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5831 (insert ";"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5832 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5833 (defun vhdl-template-case (&optional kind) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5834 "Insert a case statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5835 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5836 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5837 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5838 label) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5839 (unless kind (setq kind (if (vhdl-sequential-statement-p) 'is 'use))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5840 (if (or (not (eq vhdl-optional-labels 'all)) (vhdl-standard-p '87)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5841 (vhdl-insert-keyword "CASE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5842 (vhdl-insert-keyword ": CASE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5843 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5844 (setq label (vhdl-template-field "[label]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5845 (unless label (delete-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5846 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5847 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5848 (when (vhdl-template-field "expression" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5849 (vhdl-insert-keyword (concat " " (if (eq kind 'is) "IS" "USE") "\n\n")) |
20665 | 5850 (indent-to margin) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5851 (vhdl-insert-keyword "END CASE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5852 (when label (insert " " label)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5853 (insert ";") |
20665 | 5854 (forward-line -1) |
5855 (indent-to (+ margin vhdl-basic-offset)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5856 (vhdl-insert-keyword "WHEN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5857 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5858 (insert " => ;\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5859 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5860 (vhdl-insert-keyword "WHEN OTHERS => null;") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5861 (goto-char position))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5862 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5863 (defun vhdl-template-case-is () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5864 "Insert a sequential case statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5865 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5866 (vhdl-template-case 'is)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5867 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5868 (defun vhdl-template-case-use () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5869 "Insert a simultaneous case statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5870 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5871 (vhdl-template-case 'use)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5872 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5873 (defun vhdl-template-component () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5874 "Insert a component declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5875 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5876 (vhdl-template-component-decl)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5877 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5878 (defun vhdl-template-component-conf () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5879 "Insert a component configuration (uses `vhdl-template-configuration-spec' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5880 since these are almost equivalent)." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5881 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5882 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5883 (result (vhdl-template-configuration-spec t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5884 (when result |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5885 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5886 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5887 (vhdl-insert-keyword "END FOR;") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5888 (when (eq result 'no-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5889 (end-of-line -0))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5890 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5891 (defun vhdl-template-component-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5892 "Insert a component declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5893 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5894 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5895 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5896 name end-column) |
20665 | 5897 (vhdl-insert-keyword "COMPONENT ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5898 (when (setq name (vhdl-template-field "name" nil t start (point))) |
20665 | 5899 (insert "\n\n") |
5900 (indent-to margin) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5901 (vhdl-insert-keyword "END COMPONENT") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5902 (unless (vhdl-standard-p '87) (insert " " name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5903 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5904 (setq end-column (current-column)) |
20665 | 5905 (end-of-line -0) |
5906 (indent-to (+ margin vhdl-basic-offset)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5907 (vhdl-template-generic-list t t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5908 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5909 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5910 (vhdl-template-port-list t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5911 (beginning-of-line 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5912 (forward-char end-column)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5913 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5914 (defun vhdl-template-component-inst () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5915 "Insert a component instantiation statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5916 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5917 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5918 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5919 unit position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5920 (when (vhdl-template-field "instance label" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5921 (insert ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5922 (if (vhdl-standard-p '87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5923 (vhdl-template-field "component name") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5924 ;; direct instantiation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5925 (setq unit (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5926 "[COMPONENT | ENTITY | CONFIGURATION]" " " t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5927 (setq unit (upcase (or unit ""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5928 (cond ((equal unit "ENTITY") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5929 (vhdl-template-field "library name" "." nil nil nil nil "work") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5930 (vhdl-template-field "entity name" "(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5931 (if (vhdl-template-field "[architecture name]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5932 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5933 (delete-char -1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5934 ((equal unit "CONFIGURATION") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5935 (vhdl-template-field "library name" "." nil nil nil nil "work") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5936 (vhdl-template-field "configuration name")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5937 (t (vhdl-template-field "component name")))) |
20665 | 5938 (insert "\n") |
5939 (indent-to (+ margin vhdl-basic-offset)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5940 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5941 (vhdl-insert-keyword "GENERIC ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5942 (when (vhdl-template-map position t t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5943 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5944 (indent-to (+ margin vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5945 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5946 (vhdl-insert-keyword "PORT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5947 (unless (vhdl-template-map position t t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5948 (kill-line -0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5949 (delete-char -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5950 (insert ";")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5951 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5952 (defun vhdl-template-conditional-signal-asst () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5953 "Insert a conditional signal assignment." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5954 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5955 (when (vhdl-template-field "target signal") |
20665 | 5956 (insert " <= ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5957 ; (if (not (equal (vhdl-template-field "[GUARDED] [TRANSPORT]") "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5958 ; (insert " ")) |
20665 | 5959 (let ((margin (current-column)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5960 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5961 position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5962 (vhdl-template-field "waveform") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5963 (setq position (point)) |
20665 | 5964 (vhdl-insert-keyword " WHEN ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5965 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5966 (while (and (vhdl-template-field "[condition]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5967 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5968 (when vhdl-conditions-in-parenthesis (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5969 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5970 (vhdl-insert-keyword " ELSE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5971 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5972 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5973 (vhdl-template-field "[waveform]" nil t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5974 (setq position (point)) |
20665 | 5975 (vhdl-insert-keyword " WHEN ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5976 (when vhdl-conditions-in-parenthesis (insert "("))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5977 (delete-region position (point)) |
20665 | 5978 (insert ";") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5979 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5980 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5981 (defun vhdl-template-configuration () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5982 "Insert a configuration specification if within an architecture, |
20665 | 5983 a block or component configuration if within a configuration declaration, |
5984 a configuration declaration if not within a design unit." | |
5985 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5986 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5987 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5988 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5989 ((and (save-excursion ; architecture body |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5990 (re-search-backward "^\\(architecture\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5991 (equal "ARCHITECTURE" (upcase (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5992 (vhdl-template-configuration-spec)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5993 ((and (save-excursion ; configuration declaration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5994 (re-search-backward "^\\(configuration\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5995 (equal "CONFIGURATION" (upcase (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5996 (if (eq (vhdl-decision-query |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5997 "configuration" "(b)lock or (c)omponent configuration?" t) ?c) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5998 (vhdl-template-component-conf) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
5999 (vhdl-template-block-configuration))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6000 (t (vhdl-template-configuration-decl)))))) ; otherwise |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6001 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6002 (defun vhdl-template-configuration-spec (&optional optional-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6003 "Insert a configuration specification." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6004 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6005 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6006 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6007 aspect position) |
20665 | 6008 (vhdl-insert-keyword "FOR ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6009 (when (vhdl-template-field "component names | OTHERS | ALL" " : " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6010 t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6011 (vhdl-template-field "component type" "\n") |
20665 | 6012 (indent-to (+ margin vhdl-basic-offset)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6013 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6014 (vhdl-insert-keyword "USE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6015 (if (and optional-use |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6016 (not (setq aspect (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6017 "[ENTITY | CONFIGURATION | OPEN]" " " t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6018 (progn (delete-region start (point)) 'no-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6019 (unless optional-use |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6020 (setq aspect (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6021 "ENTITY | CONFIGURATION | OPEN" " "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6022 (setq aspect (upcase (or aspect ""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6023 (cond ((equal aspect "ENTITY") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6024 (vhdl-template-field "library name" "." nil nil nil nil "work") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6025 (vhdl-template-field "entity name" "(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6026 (if (vhdl-template-field "[architecture name]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6027 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6028 (delete-char -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6029 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6030 (indent-to (+ margin (* 2 vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6031 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6032 (vhdl-insert-keyword "GENERIC ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6033 (when (vhdl-template-map position t t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6034 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6035 (indent-to (+ margin (* 2 vhdl-basic-offset)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6036 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6037 (vhdl-insert-keyword "PORT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6038 (unless (vhdl-template-map position t t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6039 (kill-line -0) |
20665 | 6040 (delete-char -1)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6041 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6042 t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6043 ((equal aspect "CONFIGURATION") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6044 (vhdl-template-field "library name" "." nil nil nil nil "work") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6045 (vhdl-template-field "configuration name" ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6046 (t (backward-delete-char 1) (insert ";") t)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6047 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6048 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6049 (defun vhdl-template-configuration-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6050 "Insert a configuration declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6051 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6052 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6053 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6054 (case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6055 entity-exists string name position) |
20665 | 6056 (vhdl-insert-keyword "CONFIGURATION ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6057 (when (setq name (vhdl-template-field "name" nil t start (point))) |
20665 | 6058 (vhdl-insert-keyword " OF ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6059 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6060 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6061 (setq entity-exists (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6062 "\\<entity \\(\\w*\\) is\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6063 (setq string (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6064 (if (and entity-exists (not (equal string ""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6065 (insert string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6066 (vhdl-template-field "entity name")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6067 (vhdl-insert-keyword " IS\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6068 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6069 (indent-to (+ margin vhdl-basic-offset)) |
20665 | 6070 (setq position (point)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6071 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6072 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) |
20665 | 6073 (indent-to margin) |
6074 (vhdl-insert-keyword "END ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6075 (unless (vhdl-standard-p '87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6076 (vhdl-insert-keyword "CONFIGURATION ")) |
20665 | 6077 (insert name ";") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6078 (goto-char position)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6079 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6080 (defun vhdl-template-constant () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6081 "Insert a constant declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6082 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6083 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6084 (in-arglist (vhdl-in-argument-list-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6085 (vhdl-insert-keyword "CONSTANT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6086 (when (vhdl-template-field "name" nil t start (point)) |
20665 | 6087 (insert " : ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6088 (when in-arglist (vhdl-insert-keyword "IN ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6089 (vhdl-template-field "type") |
20665 | 6090 (if in-arglist |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6091 (progn (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6092 (vhdl-comment-insert-inline)) |
20665 | 6093 (let ((position (point))) |
6094 (insert " := ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6095 (unless (vhdl-template-field "[initialization]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6096 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6097 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6098 (vhdl-comment-insert-inline)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6099 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6100 (defun vhdl-template-default () |
20665 | 6101 "Insert nothing." |
6102 (interactive) | |
6103 (insert " ") | |
6104 (unexpand-abbrev) | |
6105 (backward-word 1) | |
6106 (vhdl-case-word 1) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6107 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6108 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6109 (defun vhdl-template-default-indent () |
20665 | 6110 "Insert nothing and indent." |
6111 (interactive) | |
6112 (insert " ") | |
6113 (unexpand-abbrev) | |
6114 (backward-word 1) | |
6115 (vhdl-case-word 1) | |
6116 (forward-char 1) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6117 (vhdl-indent-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6118 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6119 (defun vhdl-template-disconnect () |
20665 | 6120 "Insert a disconnect statement." |
6121 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6122 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6123 (vhdl-insert-keyword "DISCONNECT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6124 (when (vhdl-template-field "signal names | OTHERS | ALL" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6125 " : " t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6126 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6127 (vhdl-insert-keyword " AFTER ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6128 (vhdl-template-field "time expression" ";")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6129 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6130 (defun vhdl-template-else () |
20665 | 6131 "Insert an else statement." |
6132 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6133 (let ((case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6134 margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6135 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6136 (vhdl-insert-keyword "ELSE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6137 (if (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6138 (re-search-backward "\\(\\<when\\>\\|;\\)" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6139 (equal "WHEN" (upcase (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6140 (insert " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6141 (vhdl-indent-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6142 (setq margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6143 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6144 (indent-to (+ margin vhdl-basic-offset)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6145 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6146 (defun vhdl-template-elsif () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6147 "Insert an elsif statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6148 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6149 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6150 margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6151 (vhdl-insert-keyword "ELSIF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6152 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6153 (when (vhdl-template-field "condition" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6154 (when vhdl-conditions-in-parenthesis (insert ")")) |
20665 | 6155 (vhdl-indent-line) |
6156 (setq margin (current-indentation)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6157 (vhdl-insert-keyword |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6158 (concat " " (if (vhdl-sequential-statement-p) "THEN" "USE") "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6159 (indent-to (+ margin vhdl-basic-offset))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6160 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6161 (defun vhdl-template-entity () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6162 "Insert an entity." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6163 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6164 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6165 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6166 name end-column) |
20665 | 6167 (vhdl-insert-keyword "ENTITY ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6168 (when (setq name (vhdl-template-field "name" nil t start (point))) |
20665 | 6169 (vhdl-insert-keyword " IS\n\n") |
6170 (indent-to margin) | |
6171 (vhdl-insert-keyword "END ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6172 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ENTITY ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6173 (insert name ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6174 (setq end-column (current-column)) |
20665 | 6175 (end-of-line -0) |
6176 (indent-to (+ margin vhdl-basic-offset)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6177 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6178 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6179 (when (vhdl-template-generic-list t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6180 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6181 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6182 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6183 (when (vhdl-template-port-list t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6184 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6185 (beginning-of-line 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6186 (forward-char end-column)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6187 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6188 (defun vhdl-template-exit () |
20665 | 6189 "Insert an exit statement." |
6190 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6191 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6192 (vhdl-insert-keyword "EXIT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6193 (unless (vhdl-template-field "[loop label]" nil t) |
20665 | 6194 (delete-char -1)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6195 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6196 (vhdl-insert-keyword " WHEN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6197 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6198 (if (vhdl-template-field "[condition]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6199 (when vhdl-conditions-in-parenthesis (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6200 (delete-region position (point)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6201 (insert ";"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6202 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6203 (defun vhdl-template-file () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6204 "Insert a file declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6205 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6206 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6207 (vhdl-insert-keyword "FILE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6208 (when (vhdl-template-field "name" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6209 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6210 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6211 (unless (vhdl-standard-p '87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6212 (vhdl-insert-keyword " OPEN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6213 (unless (vhdl-template-field "[READ_MODE | WRITE_MODE | APPEND_MODE]" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6214 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6215 (backward-delete-char 6))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6216 (vhdl-insert-keyword " IS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6217 (when (vhdl-standard-p '87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6218 (vhdl-template-field "[IN | OUT]" " " t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6219 (vhdl-template-field "filename-string" nil nil nil nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6220 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6221 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6222 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6223 (defun vhdl-template-for () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6224 "Insert a block or component configuration if within a configuration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6225 declaration, a configuration specification if within an architecture |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6226 declarative part (and not within a subprogram), and a for-loop otherwise." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6227 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6228 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6229 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6230 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6231 ((and (save-excursion ; configuration declaration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6232 (re-search-backward "^\\(configuration\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6233 (equal "CONFIGURATION" (upcase (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6234 (if (eq (vhdl-decision-query |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6235 "for" "(b)lock or (c)omponent configuration?" t) ?c) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6236 (vhdl-template-component-conf) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6237 (vhdl-template-block-configuration))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6238 ((and (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6239 (re-search-backward ; architecture declarative part |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6240 "^\\(architecture\\|entity\\|begin\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6241 (equal "ARCHITECTURE" (upcase (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6242 (not (and (save-excursion ; not subprogram |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6243 (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6244 "^\\s-*\\(architecture\\|begin\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6245 (equal "BEGIN" (upcase (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6246 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6247 (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6248 "^\\s-*\\(function\\|procedure\\)\\>" nil t))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6249 (vhdl-template-configuration-spec)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6250 ((vhdl-sequential-statement-p) ; sequential statement |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6251 (vhdl-template-for-loop)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6252 (t (vhdl-template-for-generate)))))) ; concurrent statement |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6253 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6254 (defun vhdl-template-for-generate () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6255 "Insert a for-generate." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6256 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6257 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6258 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6259 label string position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6260 (vhdl-insert-keyword ": FOR ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6261 (setq position (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6262 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6263 (when (setq label (vhdl-template-field "label" nil t start position)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6264 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6265 (vhdl-template-field "loop variable") |
20665 | 6266 (vhdl-insert-keyword " IN ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6267 (vhdl-template-field "range") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6268 (vhdl-template-generate-body margin label)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6269 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6270 (defun vhdl-template-for-loop () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6271 "Insert a for loop." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6272 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6273 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6274 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6275 label index) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6276 (if (not (eq vhdl-optional-labels 'all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6277 (vhdl-insert-keyword "FOR ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6278 (vhdl-insert-keyword ": FOR ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6279 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6280 (setq label (vhdl-template-field "[label]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6281 (unless label (delete-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6282 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6283 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6284 (when (setq index (vhdl-template-field "loop variable" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6285 nil t start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6286 (vhdl-insert-keyword " IN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6287 (vhdl-template-field "range") |
20665 | 6288 (vhdl-insert-keyword " LOOP\n\n") |
6289 (indent-to margin) | |
6290 (vhdl-insert-keyword "END LOOP") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6291 (if label |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6292 (insert " " label ";") |
20665 | 6293 (insert ";") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6294 (when vhdl-self-insert-comments (insert " -- " index))) |
20665 | 6295 (forward-line -1) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6296 (indent-to (+ margin vhdl-basic-offset))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6297 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6298 (defun vhdl-template-footer () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6299 "Insert a VHDL file footer." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6300 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6301 (unless (equal vhdl-file-footer "") |
20665 | 6302 (save-excursion |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6303 (goto-char (point-max)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6304 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6305 (vhdl-insert-string-or-file vhdl-file-footer)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6306 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6307 (defun vhdl-template-function (&optional kind) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6308 "Insert a function declaration or body." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6309 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6310 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6311 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6312 name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6313 (vhdl-insert-keyword "FUNCTION ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6314 (when (setq name (vhdl-template-field "name" nil t start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6315 (vhdl-template-argument-list t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6316 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6317 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6318 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6319 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6320 (vhdl-insert-keyword "RETURN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6321 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6322 (if (if kind (eq kind 'body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6323 (eq (vhdl-decision-query nil "(d)eclaration or (b)ody?") ?b)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6324 (progn (vhdl-insert-keyword " IS") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6325 (vhdl-template-begin-end |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6326 (unless (vhdl-standard-p '87) "FUNCTION") name margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6327 (vhdl-comment-block)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6328 (insert ";"))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6329 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6330 (defun vhdl-template-function-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6331 "Insert a function declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6332 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6333 (vhdl-template-function 'decl)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6334 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6335 (defun vhdl-template-function-body () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6336 "Insert a function declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6337 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6338 (vhdl-template-function 'body)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6339 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6340 (defun vhdl-template-generate () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6341 "Insert a generation scheme." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6342 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6343 (if (eq (vhdl-decision-query nil "(f)or or (i)f?" t) ?i) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6344 (vhdl-template-if-generate) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6345 (vhdl-template-for-generate))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6346 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6347 (defun vhdl-template-generic () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6348 "Insert generic declaration, or generic map in instantiation statements." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6349 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6350 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6351 (case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6352 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6353 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6354 ((and (save-excursion ; entity declaration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6355 (re-search-backward "^\\(entity\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6356 (equal "ENTITY" (upcase (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6357 (vhdl-template-generic-list nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6358 ((or (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6359 (or (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6360 (looking-at "^\\s-*\\w+\\s-*:\\s-*\\w+"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6361 (equal 'statement-cont (car (car (vhdl-get-syntactic-context))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6362 (vhdl-insert-keyword "GENERIC ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6363 (vhdl-template-map start)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6364 (t (vhdl-template-generic-list nil t)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6365 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6366 (defun vhdl-template-group () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6367 "Insert group or group template declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6368 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6369 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6370 (if (eq (vhdl-decision-query |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6371 "group" "(d)eclaration or (t)emplate declaration?" t) ?t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6372 (vhdl-template-group-template) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6373 (vhdl-template-group-decl)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6374 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6375 (defun vhdl-template-group-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6376 "Insert group declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6377 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6378 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6379 (vhdl-insert-keyword "GROUP ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6380 (when (vhdl-template-field "name" " : " t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6381 (vhdl-template-field "template name" " (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6382 (vhdl-template-field "constituent list" ");") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6383 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6384 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6385 (defun vhdl-template-group-template () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6386 "Insert group template declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6387 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6388 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6389 (vhdl-insert-keyword "GROUP ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6390 (when (vhdl-template-field "template name" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6391 (vhdl-insert-keyword " IS (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6392 (vhdl-template-field "entity class list" ");") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6393 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6394 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6395 (defun vhdl-template-header () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6396 "Insert a VHDL file header." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6397 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6398 (unless (equal vhdl-file-header "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6399 (let ((case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6400 (project-name (or (nth 0 (aget vhdl-project-alist vhdl-project)) "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6401 (project-desc (or (nth 2 (aget vhdl-project-alist vhdl-project)) "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6402 eot) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6403 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6404 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6405 (save-restriction |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6406 (widen) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6407 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6408 (vhdl-insert-string-or-file vhdl-file-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6409 (setq eot (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6410 (narrow-to-region (point-min) eot) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6411 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6412 (while (search-forward "<projectdesc>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6413 (replace-match project-desc t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6414 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6415 (while (search-forward "<filename>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6416 (replace-match (buffer-name) t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6417 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6418 (while (search-forward "<author>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6419 (replace-match "" t t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6420 (insert (user-full-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6421 (when user-mail-address (insert " <" user-mail-address ">"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6422 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6423 (while (search-forward "<login>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6424 (replace-match (user-login-name) t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6425 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6426 (while (search-forward "<project>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6427 (replace-match project-name t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6428 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6429 (while (search-forward "<company>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6430 (replace-match vhdl-company-name t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6431 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6432 (while (search-forward "<platform>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6433 (replace-match vhdl-platform-spec t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6434 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6435 ;; Replace <RCS> with $, so that RCS for the source is |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6436 ;; not over-enthusiastic with replacements |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6437 (while (search-forward "<RCS>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6438 (replace-match "$" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6439 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6440 (while (search-forward "<date>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6441 (replace-match "" t t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6442 (vhdl-template-insert-date)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6443 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6444 (let (string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6445 (while |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6446 (re-search-forward "<\\(\\(\\w\\|\\s_\\)*\\) string>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6447 (setq string (read-string (concat (match-string 1) ": "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6448 (replace-match string t t))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6449 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6450 (when (search-forward "<cursor>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6451 (replace-match "" t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6452 (when (or (not project-name) (equal project-name "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6453 (message "You can specify a project title in custom variable `vhdl-project-alist'")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6454 (when (or (not project-desc) (equal project-desc "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6455 (message "You can specify a project description in custom variable `vhdl-project-alist'")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6456 (when (equal vhdl-company-name "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6457 (message "You can specify a company name in custom variable `vhdl-company-name'")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6458 (when (equal vhdl-platform-spec "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6459 (message "You can specify a platform in custom variable `vhdl-platform-spec'")))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6460 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6461 (defun vhdl-template-if () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6462 "Insert a sequential if statement or an if-generate statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6463 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6464 (if (vhdl-sequential-statement-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6465 (vhdl-template-if-then) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6466 (if (and (vhdl-standard-p 'ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6467 (eq (vhdl-decision-query "if" "(g)enerate or (u)se?" t) ?u)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6468 (vhdl-template-if-use) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6469 (vhdl-template-if-generate)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6470 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6471 (defun vhdl-template-if-generate () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6472 "Insert an if-generate." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6473 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6474 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6475 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6476 label string position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6477 (vhdl-insert-keyword ": IF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6478 (setq position (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6479 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6480 (when (setq label (vhdl-template-field "label" nil t start position)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6481 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6482 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6483 (vhdl-template-field "condition") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6484 (when vhdl-conditions-in-parenthesis (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6485 (vhdl-template-generate-body margin label)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6486 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6487 (defun vhdl-template-if-then-use (kind) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6488 "Insert a sequential if statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6489 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6490 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6491 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6492 label) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6493 (if (or (not (eq vhdl-optional-labels 'all)) (vhdl-standard-p '87)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6494 (vhdl-insert-keyword "IF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6495 (vhdl-insert-keyword ": IF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6496 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6497 (setq label (vhdl-template-field "[label]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6498 (unless label (delete-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6499 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6500 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6501 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6502 (when (vhdl-template-field "condition" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6503 (when vhdl-conditions-in-parenthesis (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6504 (vhdl-insert-keyword |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6505 (concat " " (if (eq kind 'then) "THEN" "USE") "\n\n")) |
20665 | 6506 (indent-to margin) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6507 (vhdl-insert-keyword "END IF") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6508 (when label (insert " " label)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6509 (insert ";") |
20665 | 6510 (forward-line -1) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6511 (indent-to (+ margin vhdl-basic-offset))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6512 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6513 (defun vhdl-template-if-then () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6514 "Insert a sequential if statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6515 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6516 (vhdl-template-if-then-use 'then)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6517 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6518 (defun vhdl-template-if-use () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6519 "Insert a simultaneous if statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6520 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6521 (vhdl-template-if-then-use 'use)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6522 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6523 (defun vhdl-template-instance () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6524 "Insert a component instantiation statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6525 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6526 (vhdl-template-component-inst)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6527 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6528 (defun vhdl-template-library () |
20665 | 6529 "Insert a library specification." |
6530 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6531 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6532 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6533 name end-pos) |
20665 | 6534 (vhdl-insert-keyword "LIBRARY ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6535 (when (setq name (vhdl-template-field "names" nil t start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6536 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6537 (unless (string-match "," name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6538 (setq end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6539 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6540 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6541 (vhdl-insert-keyword "USE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6542 (insert name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6543 (vhdl-insert-keyword "..ALL;") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6544 (backward-char 5) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6545 (if (vhdl-template-field "package name") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6546 (forward-char 5) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6547 (delete-region end-pos (+ (point) 5))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6548 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6549 (defun vhdl-template-limit () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6550 "Insert a limit." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6551 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6552 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6553 (vhdl-insert-keyword "LIMIT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6554 (when (vhdl-template-field "quantity names | OTHERS | ALL" " : " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6555 t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6556 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6557 (vhdl-insert-keyword " WITH ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6558 (vhdl-template-field "real expression" ";")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6559 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6560 (defun vhdl-template-loop () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6561 "Insert a loop." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6562 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6563 (let ((char (vhdl-decision-query nil "(w)hile, (f)or, or (b)are?" t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6564 (cond ((eq char ?w) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6565 (vhdl-template-while-loop)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6566 ((eq char ?f) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6567 (vhdl-template-for-loop)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6568 (t (vhdl-template-bare-loop))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6569 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6570 (defun vhdl-template-bare-loop () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6571 "Insert a loop." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6572 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6573 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6574 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6575 label) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6576 (if (not (eq vhdl-optional-labels 'all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6577 (vhdl-insert-keyword "LOOP ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6578 (vhdl-insert-keyword ": LOOP ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6579 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6580 (setq label (vhdl-template-field "[label]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6581 (unless label (delete-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6582 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6583 (delete-char 1)) |
20665 | 6584 (insert "\n\n") |
6585 (indent-to margin) | |
6586 (vhdl-insert-keyword "END LOOP") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6587 (insert (if label (concat " " label ";") ";")) |
20665 | 6588 (forward-line -1) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6589 (indent-to (+ margin vhdl-basic-offset)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6590 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6591 (defun vhdl-template-map (&optional start optional secondary) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6592 "Insert a map specification with association list." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6593 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6594 (let ((start (or start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6595 margin end-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6596 (vhdl-insert-keyword "MAP (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6597 (if (not vhdl-association-list-with-formals) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6598 (if (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6599 (concat (and optional "[") "association list" (and optional "]")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6600 ")" (or (not secondary) optional) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6601 (and (not secondary) start) (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6602 t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6603 (if (and optional secondary) (delete-region start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6604 nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6605 (if vhdl-argument-list-indent |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6606 (setq margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6607 (setq margin (+ (current-indentation) vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6608 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6609 (indent-to margin)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6610 (if (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6611 (concat (and optional "[") "formal" (and optional "]")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6612 " => " (or (not secondary) optional) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6613 (and (not secondary) start) (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6614 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6615 (vhdl-template-field "actual" ",") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6616 (setq end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6617 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6618 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6619 (while (vhdl-template-field "[formal]" " => " t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6620 (vhdl-template-field "actual" ",") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6621 (setq end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6622 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6623 (indent-to margin)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6624 (delete-region end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6625 (backward-delete-char 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6626 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6627 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6628 t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6629 (when (and optional secondary) (delete-region start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6630 nil)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6631 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6632 (defun vhdl-template-modify (&optional noerror) |
20665 | 6633 "Actualize modification date." |
6634 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6635 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6636 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6637 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6638 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6639 (if (re-search-forward vhdl-modify-date-prefix-string nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6640 (progn (kill-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6641 (vhdl-template-insert-date)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6642 (unless noerror |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6643 (error (concat "Modification date prefix string \"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6644 vhdl-modify-date-prefix-string "\" not found")))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6645 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6646 (defun vhdl-template-modify-noerror () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6647 "Call `vhdl-template-modify' with NOERROR non-nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6648 (vhdl-template-modify t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6649 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6650 (defun vhdl-template-nature () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6651 "Insert a nature declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6652 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6653 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6654 name mid-pos end-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6655 (vhdl-insert-keyword "NATURE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6656 (when (setq name (vhdl-template-field "name" nil t start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6657 (vhdl-insert-keyword " IS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6658 (let ((definition |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6659 (upcase |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6660 (or (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6661 "across type | ARRAY | RECORD") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6662 "")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6663 (cond ((equal definition "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6664 (insert ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6665 ((equal definition "ARRAY") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6666 (kill-word -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6667 (vhdl-template-array 'nature t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6668 ((equal definition "RECORD") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6669 (setq mid-pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6670 (kill-word -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6671 (vhdl-template-record 'nature name t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6672 (t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6673 (vhdl-insert-keyword " ACROSS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6674 (vhdl-template-field "through type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6675 (vhdl-insert-keyword " THROUGH ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6676 (vhdl-template-field "reference name") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6677 (vhdl-insert-keyword " REFERENCE;"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6678 (when mid-pos |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6679 (setq end-pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6680 (goto-char mid-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6681 (end-of-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6682 (vhdl-comment-insert-inline) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6683 (when end-pos (goto-char end-pos)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6684 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6685 (defun vhdl-template-next () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6686 "Insert a next statement." |
20665 | 6687 (interactive) |
6688 (vhdl-insert-keyword "NEXT ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6689 (unless (vhdl-template-field "[loop label]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6690 (delete-char -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6691 (let ((position (point))) |
20665 | 6692 (vhdl-insert-keyword " WHEN ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6693 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6694 (if (vhdl-template-field "[condition]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6695 (when vhdl-conditions-in-parenthesis (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6696 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6697 (insert ";"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6698 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6699 (defun vhdl-template-others () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6700 "Insert an others aggregate." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6701 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6702 (vhdl-insert-keyword "(OTHERS => '')") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6703 (backward-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6704 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6705 (defun vhdl-template-package (&optional kind) |
20665 | 6706 "Insert a package specification or body." |
6707 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6708 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6709 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6710 name body position) |
20665 | 6711 (vhdl-insert-keyword "PACKAGE ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6712 (setq body (if kind (eq kind 'body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6713 (eq (vhdl-decision-query nil "(d)eclaration or (b)ody?") ?b))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6714 (when body (vhdl-insert-keyword "BODY ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6715 (when (setq name (vhdl-template-field "name" nil t start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6716 (vhdl-insert-keyword " IS\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6717 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6718 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6719 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6720 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6721 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6722 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6723 (vhdl-insert-keyword "END ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6724 (unless (vhdl-standard-p '87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6725 (vhdl-insert-keyword (concat "PACKAGE " (and body "BODY ")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6726 (insert (or name "") ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6727 (goto-char position)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6728 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6729 (defun vhdl-template-package-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6730 "Insert a package specification." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6731 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6732 (vhdl-template-package 'decl)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6733 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6734 (defun vhdl-template-package-body () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6735 "Insert a package body." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6736 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6737 (vhdl-template-package 'body)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6738 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6739 (defun vhdl-template-port () |
20665 | 6740 "Insert a port declaration, or port map in instantiation statements." |
6741 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6742 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6743 (case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6744 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6745 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6746 ((and (save-excursion ; entity declaration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6747 (re-search-backward "^\\(entity\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6748 (equal "ENTITY" (upcase (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6749 (vhdl-template-port-list nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6750 ((or (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6751 (or (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6752 (looking-at "^\\s-*\\w+\\s-*:\\s-*\\w+"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6753 (equal 'statement-cont (car (car (vhdl-get-syntactic-context))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6754 (vhdl-insert-keyword "PORT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6755 (vhdl-template-map start)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6756 (t (vhdl-template-port-list nil)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6757 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6758 (defun vhdl-template-procedural () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6759 "Insert a procedural." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6760 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6761 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6762 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6763 (case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6764 label) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6765 (vhdl-insert-keyword "PROCEDURAL ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6766 (when (memq vhdl-optional-labels '(process all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6767 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6768 (insert ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6769 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6770 (setq label (vhdl-template-field "[label]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6771 (unless label (delete-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6772 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6773 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6774 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "IS")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6775 (vhdl-template-begin-end "PROCEDURAL" label margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6776 (vhdl-comment-block))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6777 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6778 (defun vhdl-template-procedure (&optional kind) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6779 "Insert a procedure declaration or body." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6780 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6781 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6782 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6783 name) |
20665 | 6784 (vhdl-insert-keyword "PROCEDURE ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6785 (when (setq name (vhdl-template-field "name" nil t start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6786 (vhdl-template-argument-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6787 (if (if kind (eq kind 'body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6788 (eq (vhdl-decision-query nil "(d)eclaration or (b)ody?") ?b)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6789 (progn (vhdl-insert-keyword " IS") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6790 (when vhdl-auto-align |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6791 (vhdl-align-noindent-region start (point) 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6792 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6793 (vhdl-template-begin-end |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6794 (unless (vhdl-standard-p '87) "PROCEDURE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6795 name margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6796 (vhdl-comment-block)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6797 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6798 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6799 (end-of-line))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6800 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6801 (defun vhdl-template-procedure-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6802 "Insert a procedure declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6803 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6804 (vhdl-template-procedure 'decl)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6805 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6806 (defun vhdl-template-procedure-body () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6807 "Insert a procedure body." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6808 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6809 (vhdl-template-procedure 'body)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6810 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6811 (defun vhdl-template-process (&optional kind) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6812 "Insert a process." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6813 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6814 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6815 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6816 (case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6817 label seq input-signals clock reset final-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6818 (setq seq (if kind (eq kind 'seq) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6819 (eq (vhdl-decision-query |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6820 "process" "(c)ombinational or (s)equential?" t) ?s))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6821 (vhdl-insert-keyword "PROCESS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6822 (when (memq vhdl-optional-labels '(process all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6823 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6824 (insert ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6825 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6826 (setq label (vhdl-template-field "[label]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6827 (unless label (delete-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6828 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6829 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6830 (insert "(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6831 (if (not seq) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6832 (unless (setq input-signals |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6833 (vhdl-template-field "[sensitivity list]" ")" t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6834 (setq input-signals "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6835 (delete-char -2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6836 (setq clock (or (and (not (equal "" vhdl-clock-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6837 (progn (insert vhdl-clock-name) vhdl-clock-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6838 (vhdl-template-field "clock name") "<clock>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6839 (when (eq vhdl-reset-kind 'async) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6840 (insert ", ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6841 (setq reset (or (and (not (equal "" vhdl-reset-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6842 (progn (insert vhdl-reset-name) vhdl-reset-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6843 (vhdl-template-field "reset name") "<reset>"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6844 (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6845 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " IS")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6846 (vhdl-template-begin-end "PROCESS" label margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6847 (when seq (setq reset (vhdl-template-seq-process clock reset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6848 (when vhdl-prompt-for-comments |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6849 (setq final-pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6850 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6851 (when (and (re-search-backward "\\<begin\\>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6852 (re-search-backward "\\<process\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6853 (end-of-line -0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6854 (if (bobp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6855 (progn (insert "\n") (forward-line -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6856 (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6857 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6858 (insert "-- purpose: ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6859 (if (not (vhdl-template-field "[description]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6860 (vhdl-line-kill-entire) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6861 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6862 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6863 (insert "-- type : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6864 (insert (if seq "sequential" "combinational") "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6865 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6866 (insert "-- inputs : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6867 (if (not seq) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6868 (insert input-signals) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6869 (insert clock ", ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6870 (when reset (insert reset ", ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6871 (unless (vhdl-template-field "[signal names]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6872 (delete-char -2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6873 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6874 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6875 (insert "-- outputs: ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6876 (vhdl-template-field "[signal names]" nil t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6877 (goto-char final-pos)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6878 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6879 (defun vhdl-template-process-comb () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6880 "Insert a combinational process." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6881 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6882 (vhdl-template-process 'comb)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6883 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6884 (defun vhdl-template-process-seq () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6885 "Insert a sequential process." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6886 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6887 (vhdl-template-process 'seq)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6888 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6889 (defun vhdl-template-quantity () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6890 "Insert a quantity declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6891 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6892 (if (vhdl-in-argument-list-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6893 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6894 (vhdl-insert-keyword "QUANTITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6895 (when (vhdl-template-field "names" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6896 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6897 (vhdl-template-field "[IN | OUT]" " " t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6898 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6899 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6900 (vhdl-comment-insert-inline))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6901 (let ((char (vhdl-decision-query |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6902 "quantity" "(f)ree, (b)ranch, or (s)ource quantity?" t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6903 (cond ((eq char ?f) (vhdl-template-quantity-free)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6904 ((eq char ?b) (vhdl-template-quantity-branch)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6905 ((eq char ?s) (vhdl-template-quantity-source)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6906 (t (vhdl-template-undo (point) (point))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6907 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6908 (defun vhdl-template-quantity-free () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6909 "Insert a free quantity declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6910 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6911 (vhdl-insert-keyword "QUANTITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6912 (vhdl-template-field "names") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6913 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6914 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6915 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6916 (insert " := ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6917 (unless (vhdl-template-field "[initialization]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6918 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6919 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6920 (vhdl-comment-insert-inline))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6921 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6922 (defun vhdl-template-quantity-branch () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6923 "Insert a branch quantity declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6924 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6925 (let (position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6926 (vhdl-insert-keyword "QUANTITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6927 (when (vhdl-template-field "[across names]" " " t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6928 (vhdl-insert-keyword "ACROSS ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6929 (when (vhdl-template-field "[through names]" " " t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6930 (vhdl-insert-keyword "THROUGH ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6931 (vhdl-template-field "plus terminal name") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6932 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6933 (vhdl-insert-keyword " TO ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6934 (unless (vhdl-template-field "[minus terminal name]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6935 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6936 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6937 (vhdl-comment-insert-inline))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6938 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6939 (defun vhdl-template-quantity-source () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6940 "Insert a source quantity declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6941 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6942 (vhdl-insert-keyword "QUANTITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6943 (vhdl-template-field "names") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6944 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6945 (vhdl-template-field "type" " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6946 (if (eq (vhdl-decision-query nil "(s)pectrum or (n)oise?") ?n) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6947 (progn (vhdl-insert-keyword "NOISE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6948 (vhdl-template-field "power expression")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6949 (vhdl-insert-keyword "SPECTRUM ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6950 (vhdl-template-field "magnitude expression" ", ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6951 (vhdl-template-field "phase expression")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6952 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6953 (vhdl-comment-insert-inline)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6954 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6955 (defun vhdl-template-record (kind &optional name secondary) |
20665 | 6956 "Insert a record type declaration." |
6957 (interactive) | |
6958 (let ((margin (current-column)) | |
6959 (start (point)) | |
6960 (first t)) | |
6961 (vhdl-insert-keyword "RECORD\n") | |
6962 (indent-to (+ margin vhdl-basic-offset)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6963 (when (or (vhdl-template-field "element names" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6964 nil (not secondary) start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6965 secondary) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6966 (while (or first (vhdl-template-field "[element names]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6967 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6968 (vhdl-template-field (if (eq kind 'type) "type" "nature") ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6969 (vhdl-comment-insert-inline) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6970 (insert "\n") |
20665 | 6971 (indent-to (+ margin vhdl-basic-offset)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6972 (setq first nil)) |
20665 | 6973 (kill-line -0) |
6974 (indent-to margin) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6975 (vhdl-insert-keyword "END RECORD") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6976 (unless (vhdl-standard-p '87) (and name (insert " " name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6977 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6978 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6979 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6980 (defun vhdl-template-report () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6981 "Insert a report statement." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6982 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6983 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6984 (vhdl-insert-keyword "REPORT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6985 (if (equal "\"\"" (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6986 "string expression" nil t start (point) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6987 (backward-delete-char 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6988 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6989 (vhdl-insert-keyword " SEVERITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6990 (unless (vhdl-template-field "[NOTE | WARNING | ERROR | FAILURE]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6991 (delete-region start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6992 (insert ";")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6993 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6994 (defun vhdl-template-return () |
20665 | 6995 "Insert a return statement." |
6996 (interactive) | |
6997 (vhdl-insert-keyword "RETURN ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6998 (unless (vhdl-template-field "[expression]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
6999 (delete-char -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7000 (insert ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7001 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7002 (defun vhdl-template-selected-signal-asst () |
20665 | 7003 "Insert a selected signal assignment." |
7004 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7005 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7006 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7007 (choices t)) |
20665 | 7008 (let ((position (point))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7009 (vhdl-insert-keyword " SELECT ") |
20665 | 7010 (goto-char position)) |
7011 (vhdl-insert-keyword "WITH ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7012 (when (vhdl-template-field "selector expression" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7013 nil t start (+ (point) 7)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7014 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7015 (delete-char 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7016 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7017 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7018 (vhdl-template-field "target signal" " <= ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7019 ; (vhdl-template-field "[GUARDED] [TRANSPORT]") |
20665 | 7020 (insert "\n") |
7021 (indent-to (+ margin vhdl-basic-offset)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7022 (vhdl-template-field "waveform") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7023 (vhdl-insert-keyword " WHEN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7024 (vhdl-template-field "choices" ",") |
20665 | 7025 (insert "\n") |
7026 (indent-to (+ margin vhdl-basic-offset)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7027 (while (and choices (vhdl-template-field "[waveform]" nil t)) |
20665 | 7028 (vhdl-insert-keyword " WHEN ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7029 (if (setq choices (vhdl-template-field "[choices]" "," t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7030 (progn (insert "\n") (indent-to (+ margin vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7031 (vhdl-insert-keyword "OTHERS"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7032 (when choices |
20665 | 7033 (fixup-whitespace) |
7034 (delete-char -2)) | |
7035 (insert ";") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7036 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7037 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7038 (defun vhdl-template-signal () |
20665 | 7039 "Insert a signal declaration." |
7040 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7041 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7042 (in-arglist (vhdl-in-argument-list-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7043 (vhdl-insert-keyword "SIGNAL ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7044 (when (vhdl-template-field "names" nil t start (point)) |
20665 | 7045 (insert " : ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7046 (when in-arglist (vhdl-template-field "[IN | OUT | INOUT]" " " t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7047 (vhdl-template-field "type") |
20665 | 7048 (if in-arglist |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7049 (progn (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7050 (vhdl-comment-insert-inline)) |
20665 | 7051 (let ((position (point))) |
7052 (insert " := ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7053 (unless (vhdl-template-field "[initialization]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7054 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7055 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7056 (vhdl-comment-insert-inline)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7057 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7058 (defun vhdl-template-subnature () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7059 "Insert a subnature declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7060 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7061 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7062 position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7063 (vhdl-insert-keyword "SUBNATURE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7064 (when (vhdl-template-field "name" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7065 (vhdl-insert-keyword " IS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7066 (vhdl-template-field "nature" " (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7067 (if (vhdl-template-field "[index range]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7068 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7069 (delete-char -2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7070 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7071 (vhdl-insert-keyword " TOLERANCE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7072 (if (equal "\"\"" (vhdl-template-field "[string expression]" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7073 nil t nil nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7074 (delete-region position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7075 (vhdl-insert-keyword " ACROSS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7076 (vhdl-template-field "string expression" nil nil nil nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7077 (vhdl-insert-keyword " THROUGH")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7078 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7079 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7080 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7081 (defun vhdl-template-subprogram-body () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7082 "Insert a subprogram body." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7083 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7084 (if (eq (vhdl-decision-query nil "(p)rocedure or (f)unction?" t) ?f) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7085 (vhdl-template-function-body) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7086 (vhdl-template-procedure-body))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7087 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7088 (defun vhdl-template-subprogram-decl () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7089 "Insert a subprogram declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7090 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7091 (if (eq (vhdl-decision-query nil "(p)rocedure or (f)unction?" t) ?f) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7092 (vhdl-template-function-decl) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7093 (vhdl-template-procedure-decl))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7094 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7095 (defun vhdl-template-subtype () |
20665 | 7096 "Insert a subtype declaration." |
7097 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7098 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7099 (vhdl-insert-keyword "SUBTYPE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7100 (when (vhdl-template-field "name" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7101 (vhdl-insert-keyword " IS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7102 (vhdl-template-field "type" " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7103 (unless |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7104 (vhdl-template-field "[RANGE value range | ( index range )]" nil t) |
20665 | 7105 (delete-char -1)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7106 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7107 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7108 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7109 (defun vhdl-template-terminal () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7110 "Insert a terminal declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7111 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7112 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7113 (vhdl-insert-keyword "TERMINAL ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7114 (when (vhdl-template-field "names" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7115 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7116 (vhdl-template-field "nature") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7117 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7118 (vhdl-comment-insert-inline)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7119 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7120 (defun vhdl-template-type () |
20665 | 7121 "Insert a type declaration." |
7122 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7123 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7124 name mid-pos end-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7125 (vhdl-insert-keyword "TYPE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7126 (when (setq name (vhdl-template-field "name" nil t start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7127 (vhdl-insert-keyword " IS ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7128 (let ((definition |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7129 (upcase |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7130 (or (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7131 "[scalar type | ARRAY | RECORD | ACCESS | FILE]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7132 "")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7133 (cond ((equal definition "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7134 (backward-delete-char 4) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7135 (insert ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7136 ((equal definition "ARRAY") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7137 (kill-word -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7138 (vhdl-template-array 'type t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7139 ((equal definition "RECORD") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7140 (setq mid-pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7141 (kill-word -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7142 (vhdl-template-record 'type name t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7143 ((equal definition "ACCESS") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7144 (insert " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7145 (vhdl-template-field "type" ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7146 ((equal definition "FILE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7147 (vhdl-insert-keyword " OF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7148 (vhdl-template-field "type" ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7149 (t (insert ";"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7150 (when mid-pos |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7151 (setq end-pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7152 (goto-char mid-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7153 (end-of-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7154 (vhdl-comment-insert-inline) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7155 (when end-pos (goto-char end-pos)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7156 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7157 (defun vhdl-template-use () |
20665 | 7158 "Insert a use clause." |
7159 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7160 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7161 (case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7162 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7163 (vhdl-insert-keyword "USE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7164 (when (save-excursion (beginning-of-line) (looking-at "^\\s-*use\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7165 (vhdl-insert-keyword "..ALL;") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7166 (backward-char 6) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7167 (when (vhdl-template-field "library name" nil t start (+ (point) 6)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7168 (forward-char 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7169 (vhdl-template-field "package name") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7170 (forward-char 5)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7171 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7172 (defun vhdl-template-variable () |
20665 | 7173 "Insert a variable declaration." |
7174 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7175 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7176 (case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7177 (in-arglist (vhdl-in-argument-list-p))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7178 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7179 (if (or (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7180 (and (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7181 "\\<function\\|procedure\\|process\\|procedural\\|end\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7182 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7183 (not (progn (backward-word 1) (looking-at "\\<end\\>"))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7184 (save-excursion (backward-word 1) (looking-at "\\<shared\\>"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7185 (vhdl-insert-keyword "VARIABLE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7186 (vhdl-insert-keyword "SHARED VARIABLE "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7187 (when (vhdl-template-field "names" nil t start (point)) |
20665 | 7188 (insert " : ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7189 (when in-arglist (vhdl-template-field "[IN | OUT | INOUT]" " " t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7190 (vhdl-template-field "type") |
20665 | 7191 (if in-arglist |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7192 (progn (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7193 (vhdl-comment-insert-inline)) |
20665 | 7194 (let ((position (point))) |
7195 (insert " := ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7196 (unless (vhdl-template-field "[initialization]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7197 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7198 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7199 (vhdl-comment-insert-inline)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7200 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7201 (defun vhdl-template-wait () |
20665 | 7202 "Insert a wait statement." |
7203 (interactive) | |
7204 (vhdl-insert-keyword "WAIT ") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7205 (unless (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7206 "[ON sensitivity list] [UNTIL condition] [FOR time expression]" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7207 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7208 (delete-char -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7209 (insert ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7210 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7211 (defun vhdl-template-when () |
20665 | 7212 "Indent correctly if within a case statement." |
7213 (interactive) | |
7214 (let ((position (point)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7215 (case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7216 margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7217 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7218 (if (and (= (current-column) (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7219 (re-search-forward "\\<end\\>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7220 (looking-at "\\s-*\\<case\\>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7221 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7222 (setq margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7223 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7224 (delete-horizontal-space) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7225 (indent-to (+ margin vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7226 (goto-char position))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7227 (vhdl-insert-keyword "WHEN "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7228 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7229 (defun vhdl-template-while-loop () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7230 "Insert a while loop." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7231 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7232 (let* ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7233 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7234 label) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7235 (if (not (eq vhdl-optional-labels 'all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7236 (vhdl-insert-keyword "WHILE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7237 (vhdl-insert-keyword ": WHILE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7238 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7239 (setq label (vhdl-template-field "[label]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7240 (unless label (delete-char 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7241 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7242 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7243 (when vhdl-conditions-in-parenthesis (insert "(")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7244 (when (vhdl-template-field "condition" nil t start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7245 (when vhdl-conditions-in-parenthesis (insert ")")) |
20665 | 7246 (vhdl-insert-keyword " LOOP\n\n") |
7247 (indent-to margin) | |
7248 (vhdl-insert-keyword "END LOOP") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7249 (insert (if label (concat " " label ";") ";")) |
20665 | 7250 (forward-line -1) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7251 (indent-to (+ margin vhdl-basic-offset))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7252 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7253 (defun vhdl-template-with () |
20665 | 7254 "Insert a with statement (i.e. selected signal assignment)." |
7255 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7256 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7257 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7258 (if (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7259 (re-search-backward "\\(\\<limit\\>\\|;\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7260 (equal ";" (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7261 (vhdl-template-selected-signal-asst) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7262 (vhdl-insert-keyword "WITH "))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7263 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7264 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7265 ;; Special templates |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7266 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7267 (defun vhdl-template-clocked-wait () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7268 "Insert a wait statement for rising/falling clock edge." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7269 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7270 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7271 clock) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7272 (vhdl-insert-keyword "WAIT UNTIL ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7273 (when (setq clock |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7274 (or (and (not (equal "" vhdl-clock-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7275 (progn (insert vhdl-clock-name) vhdl-clock-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7276 (vhdl-template-field "clock name" nil t start (point)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7277 (insert "'event") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7278 (vhdl-insert-keyword " AND ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7279 (insert clock) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7280 (insert |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7281 " = " (if vhdl-clock-rising-edge vhdl-one-string vhdl-zero-string) ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7282 (vhdl-comment-insert-inline |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7283 (concat (if vhdl-clock-rising-edge "rising" "falling") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7284 " clock edge"))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7285 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7286 (defun vhdl-template-seq-process (clock reset) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7287 "Insert a template for the body of a sequential process." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7288 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7289 position) |
20665 | 7290 (vhdl-insert-keyword "IF ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7291 (when (eq vhdl-reset-kind 'async) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7292 (insert reset " = " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7293 (if vhdl-reset-active-high vhdl-one-string vhdl-zero-string)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7294 (vhdl-insert-keyword " THEN") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7295 (vhdl-comment-insert-inline |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7296 (concat "asynchronous reset (active " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7297 (if vhdl-reset-active-high "high" "low") ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7298 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7299 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7300 (insert "\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7301 (vhdl-insert-keyword "ELSIF ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7302 (if (eq vhdl-clock-edge-condition 'function) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7303 (insert (if vhdl-clock-rising-edge "rising" "falling") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7304 "_edge(" clock ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7305 (insert clock "'event") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7306 (vhdl-insert-keyword " AND ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7307 (insert clock " = " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7308 (if vhdl-clock-rising-edge vhdl-one-string vhdl-zero-string))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7309 (vhdl-insert-keyword " THEN") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7310 (vhdl-comment-insert-inline |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7311 (concat (if vhdl-clock-rising-edge "rising" "falling") " clock edge")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7312 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7313 (when (eq vhdl-reset-kind 'sync) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7314 (vhdl-insert-keyword "IF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7315 (setq reset (or (and (not (equal "" vhdl-reset-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7316 (progn (insert vhdl-reset-name) vhdl-reset-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7317 (vhdl-template-field "reset name") "<reset>")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7318 (insert " = " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7319 (if vhdl-reset-active-high vhdl-one-string vhdl-zero-string)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7320 (vhdl-insert-keyword " THEN") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7321 (vhdl-comment-insert-inline |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7322 (concat "synchronous reset (active " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7323 (if vhdl-reset-active-high "high" "low") ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7324 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7325 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7326 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7327 (vhdl-insert-keyword "ELSE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7328 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7329 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7330 (vhdl-insert-keyword "END IF;")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7331 (when (eq vhdl-reset-kind 'none) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7332 (setq position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7333 (insert "\n") (indent-to margin) |
20665 | 7334 (vhdl-insert-keyword "END IF;") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7335 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7336 reset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7337 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7338 (defun vhdl-template-standard-package (library package) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7339 "Insert specification of a standard package. Include a library |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7340 specification, if not already there." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7341 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7342 (case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7343 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7344 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7345 (and (not (bobp)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7346 (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7347 (concat "^\\s-*\\(library\\s-+\\(\\(\\w\\|\\s_\\)+,\\s-+\\)*" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7348 library "\\|end\\)\\>") nil t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7349 (unless (and (match-string 1) (string-match "library" (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7350 (vhdl-insert-keyword "LIBRARY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7351 (insert library ";\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7352 (indent-to margin)) |
20665 | 7353 (vhdl-insert-keyword "USE ") |
7354 (insert library "." package) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7355 (vhdl-insert-keyword ".ALL;"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7356 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7357 (defun vhdl-template-package-math-complex () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7358 "Insert specification of `math_complex' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7359 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7360 (vhdl-template-standard-package "ieee" "math_complex")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7361 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7362 (defun vhdl-template-package-math-real () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7363 "Insert specification of `math_real' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7364 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7365 (vhdl-template-standard-package "ieee" "math_real")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7366 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7367 (defun vhdl-template-package-numeric-bit () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7368 "Insert specification of `numeric_bit' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7369 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7370 (vhdl-template-standard-package "ieee" "numeric_bit")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7371 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7372 (defun vhdl-template-package-numeric-std () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7373 "Insert specification of `numeric_std' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7374 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7375 (vhdl-template-standard-package "ieee" "numeric_std")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7376 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7377 (defun vhdl-template-package-std-logic-1164 () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7378 "Insert specification of `std_logic_1164' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7379 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7380 (vhdl-template-standard-package "ieee" "std_logic_1164")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7381 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7382 (defun vhdl-template-package-std-logic-arith () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7383 "Insert specification of `std_logic_arith' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7384 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7385 (vhdl-template-standard-package "ieee" "std_logic_arith")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7386 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7387 (defun vhdl-template-package-std-logic-misc () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7388 "Insert specification of `std_logic_misc' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7389 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7390 (vhdl-template-standard-package "ieee" "std_logic_misc")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7391 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7392 (defun vhdl-template-package-std-logic-signed () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7393 "Insert specification of `std_logic_signed' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7394 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7395 (vhdl-template-standard-package "ieee" "std_logic_signed")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7396 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7397 (defun vhdl-template-package-std-logic-textio () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7398 "Insert specification of `std_logic_textio' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7399 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7400 (vhdl-template-standard-package "ieee" "std_logic_textio")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7401 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7402 (defun vhdl-template-package-std-logic-unsigned () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7403 "Insert specification of `std_logic_unsigned' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7404 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7405 (vhdl-template-standard-package "ieee" "std_logic_unsigned")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7406 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7407 (defun vhdl-template-package-textio () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7408 "Insert specification of `textio' package." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7409 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7410 (vhdl-template-standard-package "std" "textio")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7411 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7412 (defun vhdl-template-directive (directive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7413 "Insert directive." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7414 (unless (= (current-indentation) (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7415 (delete-horizontal-space) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7416 (insert " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7417 (insert "-- pragma " directive)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7418 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7419 (defun vhdl-template-directive-translate-on () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7420 "Insert directive 'translate_on'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7421 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7422 (vhdl-template-directive "translate_on")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7423 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7424 (defun vhdl-template-directive-translate-off () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7425 "Insert directive 'translate_off'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7426 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7427 (vhdl-template-directive "translate_off")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7428 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7429 (defun vhdl-template-directive-synthesis-on () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7430 "Insert directive 'synthesis_on'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7431 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7432 (vhdl-template-directive "synthesis_on")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7433 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7434 (defun vhdl-template-directive-synthesis-off () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7435 "Insert directive 'synthesis_off'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7436 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7437 (vhdl-template-directive "synthesis_off")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7438 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7439 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7440 ;; Comment templates and functions |
20665 | 7441 |
7442 (defun vhdl-comment-indent () | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7443 "Indent comments." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7444 (let* ((position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7445 (col |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7446 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7447 (forward-line -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7448 (if (re-search-forward "--" position t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7449 (- (current-column) 2) ; existing comment at bol stays there |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7450 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7451 (skip-chars-backward " \t") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7452 (max comment-column ; else indent to comment column |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7453 (1+ (current-column))))))) ; except leave at least one space |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7454 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7455 col)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7456 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7457 (defun vhdl-comment-insert () |
20665 | 7458 "Start a comment at the end of the line. |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7459 If on line with code, indent at least `comment-column'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7460 If starting after end-comment-column, start a new line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7461 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7462 (when (> (current-column) end-comment-column) (newline-and-indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7463 (if (or (looking-at "\\s-*$") ; end of line |
20665 | 7464 (and (not unread-command-events) ; called with key binding or menu |
7465 (not (end-of-line)))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7466 (let (margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7467 (while (= (preceding-char) ?-) (delete-char -1)) |
20665 | 7468 (setq margin (current-column)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7469 (delete-horizontal-space) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7470 (if (bolp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7471 (progn (indent-to margin) (insert "--")) |
20665 | 7472 (insert " ") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7473 (indent-to comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7474 (insert "--")) |
20665 | 7475 (if (not unread-command-events) (insert " "))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7476 ;; else code following current point implies commenting out code |
20665 | 7477 (let (next-input code) |
7478 (while (= (preceding-char) ?-) (delete-char -2)) | |
7479 (while (= (setq next-input (read-char)) 13) ; CR | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7480 (insert "--") ; or have a space after it? |
20665 | 7481 (forward-char -2) |
7482 (forward-line 1) | |
7483 (message "Enter CR if commenting out a line of code.") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7484 (setq code t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7485 (when (not code) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7486 (insert "--")) ; hardwire to 1 space or use vhdl-basic-offset? |
20665 | 7487 (setq unread-command-events |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7488 (list (vhdl-character-to-event next-input)))))) ; pushback the char |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7489 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7490 (defun vhdl-comment-display (&optional line-exists) |
20665 | 7491 "Add 2 comment lines at the current indent, making a display comment." |
7492 (interactive) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7493 (let ((margin (current-indentation))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7494 (when (not line-exists) (vhdl-comment-display-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7495 (insert "\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7496 (insert "\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7497 (vhdl-comment-display-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7498 (end-of-line -0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7499 (insert "-- "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7500 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7501 (defun vhdl-comment-display-line () |
20665 | 7502 "Displays one line of dashes." |
7503 (interactive) | |
7504 (while (= (preceding-char) ?-) (delete-char -2)) | |
7505 (let* ((col (current-column)) | |
7506 (len (- end-comment-column col))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7507 (insert-char ?- len))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7508 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7509 (defun vhdl-comment-append-inline () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7510 "Append empty inline comment to current line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7511 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7512 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7513 (delete-horizontal-space) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7514 (insert " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7515 (indent-to comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7516 (insert "-- ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7517 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7518 (defun vhdl-comment-insert-inline (&optional string always-insert) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7519 "Insert inline comment." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7520 (when (or (and string (or vhdl-self-insert-comments always-insert)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7521 (and (not string) vhdl-prompt-for-comments)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7522 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7523 (insert " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7524 (indent-to comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7525 (insert "-- ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7526 (if (or (and string (progn (insert string) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7527 (vhdl-template-field "[comment]" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7528 (when (> (current-column) end-comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7529 (setq position (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7530 (re-search-backward "-- ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7531 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7532 (indent-to comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7533 (goto-char position)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7534 (delete-region position (point)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7535 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7536 (defun vhdl-comment-block () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7537 "Insert comment for code block." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7538 (when vhdl-prompt-for-comments |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7539 (let ((final-pos (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7540 (case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7541 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7542 (when (and (re-search-backward "^\\s-*begin\\>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7543 (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7544 "\\<\\(architecture\\|block\\|function\\|procedure\\|process\\|procedural\\)\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7545 nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7546 (let (margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7547 (back-to-indentation) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7548 (setq margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7549 (end-of-line -0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7550 (if (bobp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7551 (progn (insert "\n") (forward-line -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7552 (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7553 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7554 (insert "-- purpose: ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7555 (unless (vhdl-template-field "[description]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7556 (vhdl-line-kill-entire))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7557 (goto-char final-pos)))) |
20665 | 7558 |
7559 (defun vhdl-comment-uncomment-region (beg end &optional arg) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7560 "Comment out region if not commented out, uncomment otherwise." |
20665 | 7561 (interactive "r\nP") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7562 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7563 (goto-char (1- end)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7564 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7565 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7566 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7567 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7568 (setq beg (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7569 (if (looking-at comment-start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7570 (comment-region beg end -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7571 (comment-region beg end)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7572 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7573 (defun vhdl-comment-uncomment-line (&optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7574 "Comment out line if not commented out, uncomment otherwise." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7575 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7576 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7577 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7578 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7579 (forward-line (or arg 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7580 (vhdl-comment-uncomment-region position (point))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7581 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7582 (defun vhdl-comment-kill-region (beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7583 "Kill comments in region." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7584 (interactive "r") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7585 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7586 (goto-char end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7587 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7588 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7589 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7590 (while (< (point) end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7591 (if (looking-at "^\\(\\s-*--.*\n\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7592 (progn (delete-region (match-beginning 1) (match-end 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7593 (beginning-of-line 2))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7594 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7595 (defun vhdl-comment-kill-inline-region (beg end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7596 "Kill inline comments in region." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7597 (interactive "r") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7598 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7599 (goto-char end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7600 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7601 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7602 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7603 (while (< (point) end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7604 (when (looking-at "^.*[^ \t\n-]+\\(\\s-*--.*\\)$") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7605 (delete-region (match-beginning 1) (match-end 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7606 (beginning-of-line 2)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7607 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7608 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7609 ;; Subtemplates |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7610 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7611 (defun vhdl-template-begin-end (construct name margin &optional empty-lines) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7612 "Insert a begin ... end pair with optional name after the end. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7613 Point is left between them." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7614 (let (position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7615 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7616 (when (or empty-lines (eq vhdl-insert-empty-lines 'all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7617 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7618 (vhdl-insert-keyword "BEGIN") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7619 (when (and (or construct name) vhdl-self-insert-comments) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7620 (insert " --") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7621 (when construct (insert " ") (vhdl-insert-keyword construct)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7622 (when name (insert " " name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7623 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7624 (when (or empty-lines (eq vhdl-insert-empty-lines 'all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7625 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7626 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7627 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7628 (when (or empty-lines (eq vhdl-insert-empty-lines 'all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7629 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7630 (vhdl-insert-keyword "END") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7631 (when construct (insert " ") (vhdl-insert-keyword construct)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7632 (insert (if name (concat " " name) "") ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7633 (goto-char position))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7634 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7635 (defun vhdl-template-argument-list (&optional is-function) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7636 "Read from user a procedure or function argument list." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7637 (insert " (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7638 (let ((margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7639 (start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7640 (end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7641 not-empty interface semicolon-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7642 (when (not vhdl-argument-list-indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7643 (setq margin (+ (current-indentation) vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7644 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7645 (indent-to margin)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7646 (setq interface (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7647 (concat "[CONSTANT | SIGNAL" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7648 (unless is-function " | VARIABLE") "]") " " t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7649 (while (vhdl-template-field "[names]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7650 (setq not-empty t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7651 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7652 (when (not is-function) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7653 (if (and interface (equal (upcase interface) "CONSTANT")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7654 (vhdl-insert-keyword "IN ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7655 (vhdl-template-field "[IN | OUT | INOUT]" " " t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7656 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7657 (setq semicolon-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7658 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7659 (vhdl-comment-insert-inline) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7660 (setq end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7661 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7662 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7663 (setq interface (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7664 (concat "[CONSTANT | SIGNAL" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7665 (unless is-function " | VARIABLE") "]") " " t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7666 (delete-region end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7667 (when semicolon-pos (goto-char semicolon-pos)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7668 (if not-empty |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7669 (progn (delete-char 1) (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7670 (backward-delete-char 2)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7671 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7672 (defun vhdl-template-generic-list (optional &optional no-value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7673 "Read from user a generic spec argument list." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7674 (let (margin |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7675 (start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7676 (vhdl-insert-keyword "GENERIC (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7677 (setq margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7678 (when (not vhdl-argument-list-indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7679 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7680 (back-to-indentation) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7681 (setq margin (+ (current-column) vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7682 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7683 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7684 (indent-to margin))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7685 (let ((vhdl-generics (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7686 (concat (and optional "[") "name" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7687 (and no-value "s") (and optional "]")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7688 nil optional))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7689 (if (not vhdl-generics) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7690 (if optional |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7691 (progn (vhdl-line-kill-entire) (end-of-line -0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7692 (when (not vhdl-argument-list-indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7693 (vhdl-line-kill-entire) (end-of-line -0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7694 (vhdl-template-undo start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7695 nil ) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7696 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7697 (let (semicolon-pos end-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7698 (while vhdl-generics |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7699 (vhdl-template-field "type") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7700 (if no-value |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7701 (progn (setq semicolon-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7702 (insert ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7703 (insert " := ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7704 (unless (vhdl-template-field "[value]" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7705 (delete-char -4)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7706 (setq semicolon-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7707 (insert ";")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7708 (vhdl-comment-insert-inline) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7709 (setq end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7710 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7711 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7712 (setq vhdl-generics (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7713 (concat "[name" (and no-value "s") "]") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7714 " : " t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7715 (delete-region end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7716 (goto-char semicolon-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7717 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7718 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7719 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7720 t))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7721 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7722 (defun vhdl-template-port-list (optional) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7723 "Read from user a port spec argument list." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7724 (let ((start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7725 margin vhdl-ports object) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7726 (vhdl-insert-keyword "PORT (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7727 (setq margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7728 (when (not vhdl-argument-list-indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7729 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7730 (back-to-indentation) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7731 (setq margin (+ (current-column) vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7732 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7733 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7734 (indent-to margin))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7735 (when (vhdl-standard-p 'ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7736 (setq object (vhdl-template-field "[SIGNAL | TERMINAL | QUANTITY]" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7737 " " t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7738 (setq vhdl-ports (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7739 (concat (and optional "[") "names" (and optional "]")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7740 nil optional)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7741 (if (not vhdl-ports) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7742 (if optional |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7743 (progn (vhdl-line-kill-entire) (end-of-line -0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7744 (when (not vhdl-argument-list-indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7745 (vhdl-line-kill-entire) (end-of-line -0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7746 (vhdl-template-undo start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7747 nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7748 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7749 (let (semicolon-pos end-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7750 (while vhdl-ports |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7751 (cond ((or (null object) (equal "SIGNAL" (upcase object))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7752 (vhdl-template-field "IN | OUT | INOUT" " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7753 ((equal "QUANTITY" (upcase object)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7754 (vhdl-template-field "[IN | OUT]" " " t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7755 (vhdl-template-field |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7756 (if (and object (equal "TERMINAL" (upcase object))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7757 "nature" "type")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7758 (setq semicolon-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7759 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7760 (vhdl-comment-insert-inline) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7761 (setq end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7762 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7763 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7764 (when (vhdl-standard-p 'ams) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7765 (setq object (vhdl-template-field "[SIGNAL | TERMINAL | QUANTITY]" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7766 " " t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7767 (setq vhdl-ports (vhdl-template-field "[names]" " : " t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7768 (delete-region end-pos (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7769 (goto-char semicolon-pos) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7770 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7771 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7772 (when vhdl-auto-align (vhdl-align-noindent-region start end-pos 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7773 t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7774 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7775 (defun vhdl-template-generate-body (margin label) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7776 "Insert body for generate template." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7777 (vhdl-insert-keyword " GENERATE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7778 (if (not (vhdl-standard-p '87)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7779 (vhdl-template-begin-end "GENERATE" label margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7780 (insert "\n\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7781 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7782 (vhdl-insert-keyword "END GENERATE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7783 (insert label ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7784 (end-of-line 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7785 (indent-to (+ margin vhdl-basic-offset)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7786 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7787 (defun vhdl-template-insert-date () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7788 "Insert date in appropriate format." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7789 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7790 (insert |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7791 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7792 ;; 'american, 'european', 'scientific kept for backward compatibility |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7793 ((eq vhdl-date-format 'american) (format-time-string "%m/%d/%Y" nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7794 ((eq vhdl-date-format 'european) (format-time-string "%d.%m.%Y" nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7795 ((eq vhdl-date-format 'scientific) (format-time-string "%Y/%m/%d" nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7796 (t (format-time-string vhdl-date-format nil))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7797 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7798 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 7799 ;; Help functions |
7800 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7801 (defun vhdl-electric-space (count) |
20665 | 7802 "Expand abbreviations and self-insert space(s), do indent-new-comment-line |
7803 if in comment and past end-comment-column." | |
7804 (interactive "p") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7805 (cond ((vhdl-in-comment-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7806 (self-insert-command count) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7807 (cond ((>= (current-column) (+ 2 end-comment-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7808 (backward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7809 (indent-new-comment-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7810 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7811 (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7812 ((>= (current-column) end-comment-column) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7813 (indent-new-comment-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7814 (t nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7815 ((or (and (>= (preceding-char) ?a) (<= (preceding-char) ?z)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7816 (and (>= (preceding-char) ?A) (<= (preceding-char) ?Z))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7817 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7818 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7819 (expand-abbrev))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7820 (self-insert-command count)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7821 (t (self-insert-command count)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7822 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7823 (defun vhdl-template-field (prompt &optional follow-string optional |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7824 begin end is-string default) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7825 "Prompt for string and insert it in buffer with optional FOLLOW-STRING. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7826 If OPTIONAL is nil, the prompt is left if an empty string is inserted. If |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7827 an empty string is inserted, return nil and call `vhdl-template-undo' for |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7828 the region between BEGIN and END. IS-STRING indicates whether a string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7829 with double-quotes is to be inserted. DEFAULT specifies a default string." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7830 (let ((position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7831 string) |
20665 | 7832 (insert "<" prompt ">") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7833 (setq string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7834 (condition-case () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7835 (read-from-minibuffer (concat prompt ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7836 (or (and is-string '("\"\"" . 2)) default) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7837 vhdl-minibuffer-local-map) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7838 (quit (if (and optional begin end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7839 (progn (beep) "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7840 (keyboard-quit))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7841 (when (or (not (equal string "")) optional) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7842 (delete-region position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7843 (when (and (equal string "") optional begin end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7844 (vhdl-template-undo begin end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7845 (message "Template aborted")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7846 (when (not (equal string "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7847 (insert string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7848 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7849 vhdl-keywords-regexp)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7850 (when (or (not (equal string "")) (not optional)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7851 (insert (or follow-string ""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7852 (if (equal string "") nil string))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7853 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7854 (defun vhdl-decision-query (string prompt &optional optional) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7855 "Query a decision from the user." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7856 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7857 (when string (vhdl-insert-keyword (concat string " "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7858 (message prompt) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7859 (let ((char (read-char))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7860 (delete-region start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7861 (if (and optional (eq char ?\r)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7862 (progn (insert " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7863 (unexpand-abbrev) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7864 (throw 'abort "Template aborted")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7865 char)))) |
20665 | 7866 |
7867 (defun vhdl-insert-keyword (keyword) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7868 "Insert KEYWORD and adjust case." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7869 (insert (if vhdl-upper-case-keywords (upcase keyword) (downcase keyword)))) |
20665 | 7870 |
7871 (defun vhdl-case-keyword (keyword) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7872 "Adjust case of KEYWORD." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7873 (if vhdl-upper-case-keywords (upcase keyword) (downcase keyword))) |
20665 | 7874 |
7875 (defun vhdl-case-word (num) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7876 "Adjust case or following NUM words." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7877 (if vhdl-upper-case-keywords (upcase-word num) (downcase-word num))) |
20665 | 7878 |
7879 (defun vhdl-minibuffer-tab (&optional prefix-arg) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7880 "If preceeding character is part of a word or a paren then hippie-expand, |
20665 | 7881 else if right of non whitespace on line then tab-to-tab-stop, |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7882 else indent line in proper way for current major mode (used for word |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7883 completion in VHDL minibuffer)." |
20665 | 7884 (interactive "P") |
7885 (cond ((= (char-syntax (preceding-char)) ?w) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7886 (let ((case-fold-search (not vhdl-word-completion-case-sensitive)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7887 (case-replace nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7888 (vhdl-expand-abbrev prefix-arg))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7889 ((or (= (preceding-char) ?\() (= (preceding-char) ?\))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7890 (let ((case-fold-search (not vhdl-word-completion-case-sensitive)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7891 (case-replace nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7892 (vhdl-expand-paren prefix-arg))) |
20665 | 7893 ((> (current-column) (current-indentation)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7894 (tab-to-tab-stop)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7895 (t (if (eq indent-line-function 'indent-to-left-margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7896 (insert-tab prefix-arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7897 (if prefix-arg |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7898 (funcall indent-line-function prefix-arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7899 (funcall indent-line-function)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7900 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7901 (defun vhdl-template-search-prompt () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7902 "Search for left out template prompts and query again." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7903 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7904 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7905 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7906 (when (or (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7907 (concat "<\\(" vhdl-template-prompt-syntax "\\)>") nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7908 (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7909 (concat "<\\(" vhdl-template-prompt-syntax "\\)>") nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7910 (let ((string (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7911 (replace-match "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7912 (vhdl-template-field string)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7913 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7914 (defun vhdl-template-undo (begin end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7915 "Undo aborted template by deleting region and unexpanding the keyword." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7916 (cond (vhdl-template-invoked-by-hook |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7917 (goto-char end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7918 (insert " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7919 (delete-region begin end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7920 (unexpand-abbrev)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7921 (t (delete-region begin end)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7922 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7923 (defun vhdl-insert-string-or-file (string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7924 "Insert STRING or file contents if STRING is an existing file name." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7925 (unless (equal string "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7926 (cond ((file-exists-p string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7927 (forward-char (cadr (insert-file-contents string)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7928 (t (insert string))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7929 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7930 (defun vhdl-sequential-statement-p () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7931 "Check if point is within sequential statement part." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7932 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7933 (let ((case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7934 (start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7935 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7936 (set-match-data nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7937 (while (and (re-search-backward "^\\s-*\\(begin\\|end\\(\\s-*\\(case\\|if\\|loop\\)\\)?\\)\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7938 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7939 (match-string 2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7940 (and (match-data) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7941 (equal "BEGIN" (upcase (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7942 (re-search-backward "^\\s-*\\(\\w+\\s-*:\\s-*\\)?\\(\\w+\\s-+\\)?\\(function\\|procedure\\|process\\|procedural\\|end\\)\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7943 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7944 (not (equal "END" (upcase (match-string 3))))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7945 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7946 (defun vhdl-in-argument-list-p () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7947 "Check if within an argument list." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7948 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7949 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7950 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7951 (or (string-match "arglist" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7952 (format "%s" (car (car (vhdl-get-syntactic-context))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7953 (progn (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7954 (looking-at "^\\s-*\\(generic\\|port\\|\\(\\(impure\\|pure\\)\\s-+\\|\\)function\\|procedure\\)\\>\\s-*\\(\\w+\\s-*\\)?(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7955 )))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7956 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7957 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 7958 ;; Abbrev hooks |
7959 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7960 (defun vhdl-hooked-abbrev (func) |
20665 | 7961 "Do function, if syntax says abbrev is a keyword, invoked by hooked abbrev, |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7962 but not if inside a comment or quote)." |
20665 | 7963 (if (or (vhdl-in-comment-p) |
7964 (vhdl-in-string-p) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7965 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7966 (forward-word -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7967 (and (looking-at "\\<end\\>") (not (looking-at "\\<end;"))))) |
20665 | 7968 (progn |
7969 (insert " ") | |
7970 (unexpand-abbrev) | |
7971 (delete-char -1)) | |
7972 (if (not vhdl-electric-mode) | |
7973 (progn | |
7974 (insert " ") | |
7975 (unexpand-abbrev) | |
7976 (backward-word 1) | |
7977 (vhdl-case-word 1) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7978 (delete-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7979 (let ((invoke-char last-command-char) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7980 (abbrev-mode -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7981 (vhdl-template-invoked-by-hook t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7982 (let ((caught (catch 'abort |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7983 (funcall func)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7984 (when (stringp caught) (message caught))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7985 (when (= invoke-char ?-) (setq abbrev-start-location (point))) |
20665 | 7986 ;; delete CR which is still in event queue |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7987 (if (string-match "XEmacs" emacs-version) |
20665 | 7988 (enqueue-eval-event 'delete-char -1) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7989 (setq unread-command-events ; push back a delete char |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7990 (list (vhdl-character-to-event ?\177)))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7991 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7992 (defun vhdl-template-alias-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7993 (vhdl-hooked-abbrev 'vhdl-template-alias)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7994 (defun vhdl-template-architecture-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7995 (vhdl-hooked-abbrev 'vhdl-template-architecture)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7996 (defun vhdl-template-assert-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7997 (vhdl-hooked-abbrev 'vhdl-template-assert)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7998 (defun vhdl-template-attribute-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
7999 (vhdl-hooked-abbrev 'vhdl-template-attribute)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8000 (defun vhdl-template-block-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8001 (vhdl-hooked-abbrev 'vhdl-template-block)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8002 (defun vhdl-template-break-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8003 (vhdl-hooked-abbrev 'vhdl-template-break)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8004 (defun vhdl-template-case-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8005 (vhdl-hooked-abbrev 'vhdl-template-case)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8006 (defun vhdl-template-component-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8007 (vhdl-hooked-abbrev 'vhdl-template-component)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8008 (defun vhdl-template-instance-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8009 (vhdl-hooked-abbrev 'vhdl-template-instance)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8010 (defun vhdl-template-conditional-signal-asst-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8011 (vhdl-hooked-abbrev 'vhdl-template-conditional-signal-asst)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8012 (defun vhdl-template-configuration-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8013 (vhdl-hooked-abbrev 'vhdl-template-configuration)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8014 (defun vhdl-template-constant-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8015 (vhdl-hooked-abbrev 'vhdl-template-constant)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8016 (defun vhdl-template-disconnect-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8017 (vhdl-hooked-abbrev 'vhdl-template-disconnect)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8018 (defun vhdl-template-display-comment-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8019 (vhdl-hooked-abbrev 'vhdl-comment-display)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8020 (defun vhdl-template-else-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8021 (vhdl-hooked-abbrev 'vhdl-template-else)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8022 (defun vhdl-template-elsif-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8023 (vhdl-hooked-abbrev 'vhdl-template-elsif)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8024 (defun vhdl-template-entity-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8025 (vhdl-hooked-abbrev 'vhdl-template-entity)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8026 (defun vhdl-template-exit-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8027 (vhdl-hooked-abbrev 'vhdl-template-exit)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8028 (defun vhdl-template-file-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8029 (vhdl-hooked-abbrev 'vhdl-template-file)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8030 (defun vhdl-template-for-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8031 (vhdl-hooked-abbrev 'vhdl-template-for)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8032 (defun vhdl-template-function-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8033 (vhdl-hooked-abbrev 'vhdl-template-function)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8034 (defun vhdl-template-generic-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8035 (vhdl-hooked-abbrev 'vhdl-template-generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8036 (defun vhdl-template-group-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8037 (vhdl-hooked-abbrev 'vhdl-template-group)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8038 (defun vhdl-template-library-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8039 (vhdl-hooked-abbrev 'vhdl-template-library)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8040 (defun vhdl-template-limit-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8041 (vhdl-hooked-abbrev 'vhdl-template-limit)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8042 (defun vhdl-template-if-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8043 (vhdl-hooked-abbrev 'vhdl-template-if)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8044 (defun vhdl-template-bare-loop-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8045 (vhdl-hooked-abbrev 'vhdl-template-bare-loop)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8046 (defun vhdl-template-map-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8047 (vhdl-hooked-abbrev 'vhdl-template-map)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8048 (defun vhdl-template-nature-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8049 (vhdl-hooked-abbrev 'vhdl-template-nature)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8050 (defun vhdl-template-next-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8051 (vhdl-hooked-abbrev 'vhdl-template-next)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8052 (defun vhdl-template-package-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8053 (vhdl-hooked-abbrev 'vhdl-template-package)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8054 (defun vhdl-template-port-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8055 (vhdl-hooked-abbrev 'vhdl-template-port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8056 (defun vhdl-template-procedural-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8057 (vhdl-hooked-abbrev 'vhdl-template-procedural)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8058 (defun vhdl-template-procedure-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8059 (vhdl-hooked-abbrev 'vhdl-template-procedure)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8060 (defun vhdl-template-process-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8061 (vhdl-hooked-abbrev 'vhdl-template-process)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8062 (defun vhdl-template-quantity-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8063 (vhdl-hooked-abbrev 'vhdl-template-quantity)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8064 (defun vhdl-template-report-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8065 (vhdl-hooked-abbrev 'vhdl-template-report)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8066 (defun vhdl-template-return-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8067 (vhdl-hooked-abbrev 'vhdl-template-return)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8068 (defun vhdl-template-selected-signal-asst-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8069 (vhdl-hooked-abbrev 'vhdl-template-selected-signal-asst)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8070 (defun vhdl-template-signal-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8071 (vhdl-hooked-abbrev 'vhdl-template-signal)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8072 (defun vhdl-template-subnature-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8073 (vhdl-hooked-abbrev 'vhdl-template-subnature)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8074 (defun vhdl-template-subtype-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8075 (vhdl-hooked-abbrev 'vhdl-template-subtype)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8076 (defun vhdl-template-terminal-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8077 (vhdl-hooked-abbrev 'vhdl-template-terminal)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8078 (defun vhdl-template-type-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8079 (vhdl-hooked-abbrev 'vhdl-template-type)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8080 (defun vhdl-template-use-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8081 (vhdl-hooked-abbrev 'vhdl-template-use)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8082 (defun vhdl-template-variable-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8083 (vhdl-hooked-abbrev 'vhdl-template-variable)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8084 (defun vhdl-template-wait-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8085 (vhdl-hooked-abbrev 'vhdl-template-wait)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8086 (defun vhdl-template-when-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8087 (vhdl-hooked-abbrev 'vhdl-template-when)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8088 (defun vhdl-template-while-loop-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8089 (vhdl-hooked-abbrev 'vhdl-template-while-loop)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8090 (defun vhdl-template-with-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8091 (vhdl-hooked-abbrev 'vhdl-template-with)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8092 (defun vhdl-template-and-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8093 (vhdl-hooked-abbrev 'vhdl-template-and)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8094 (defun vhdl-template-or-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8095 (vhdl-hooked-abbrev 'vhdl-template-or)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8096 (defun vhdl-template-nand-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8097 (vhdl-hooked-abbrev 'vhdl-template-nand)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8098 (defun vhdl-template-nor-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8099 (vhdl-hooked-abbrev 'vhdl-template-nor)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8100 (defun vhdl-template-xor-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8101 (vhdl-hooked-abbrev 'vhdl-template-xor)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8102 (defun vhdl-template-xnor-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8103 (vhdl-hooked-abbrev 'vhdl-template-xnor)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8104 (defun vhdl-template-not-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8105 (vhdl-hooked-abbrev 'vhdl-template-not)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8106 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8107 (defun vhdl-template-default-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8108 (vhdl-hooked-abbrev 'vhdl-template-default)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8109 (defun vhdl-template-default-indent-hook () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8110 (vhdl-hooked-abbrev 'vhdl-template-default-indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8111 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8112 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8113 ;; Template insertion from completion list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8114 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8115 (defun vhdl-template-insert-construct (name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8116 "Insert the built-in construct template with NAME." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8117 (interactive |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8118 (list (let ((completion-ignore-case t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8119 (completing-read "Construct name: " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8120 vhdl-template-construct-alist nil t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8121 (vhdl-template-insert-fun |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8122 (car (cdr (assoc name vhdl-template-construct-alist))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8123 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8124 (defun vhdl-template-insert-package (name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8125 "Insert the built-in package template with NAME." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8126 (interactive |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8127 (list (let ((completion-ignore-case t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8128 (completing-read "Package name: " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8129 vhdl-template-package-alist nil t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8130 (vhdl-template-insert-fun |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8131 (car (cdr (assoc name vhdl-template-package-alist))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8132 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8133 (defun vhdl-template-insert-directive (name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8134 "Insert the built-in directive template with NAME." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8135 (interactive |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8136 (list (let ((completion-ignore-case t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8137 (completing-read "Directive name: " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8138 vhdl-template-directive-alist nil t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8139 (vhdl-template-insert-fun |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8140 (car (cdr (assoc name vhdl-template-directive-alist))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8141 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8142 (defun vhdl-template-insert-fun (fun) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8143 "Call FUN to insert a built-in template." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8144 (let ((caught (catch 'abort (when fun (funcall fun))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8145 (when (stringp caught) (message caught)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8146 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8147 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8148 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8149 ;;; Models |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8151 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8152 (defun vhdl-model-insert (model-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8153 "Insert the user model with name MODEL-NAME." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8154 (interactive |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8155 (let ((completion-ignore-case t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8156 (list (completing-read "Model name: " vhdl-model-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8157 (vhdl-indent-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8158 (let ((start (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8159 (margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8160 (case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8161 model position prompt string end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8162 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8163 (when (setq model (assoc model-name vhdl-model-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8164 ;; insert model |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8165 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8166 (delete-horizontal-space) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8167 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8168 (vhdl-insert-string-or-file (nth 1 model)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8169 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8170 ;; indent code |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8171 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8172 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8173 (while (< (point) end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8174 (unless (looking-at "^$") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8175 (insert-char ? margin)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8176 (beginning-of-line 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8177 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8178 ;; insert clock |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8179 (unless (equal "" vhdl-clock-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8180 (while (re-search-forward "<clock>" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8181 (replace-match vhdl-clock-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8182 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8183 ;; insert reset |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8184 (unless (equal "" vhdl-reset-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8185 (while (re-search-forward "<reset>" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8186 (replace-match vhdl-reset-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8187 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8188 ;; query prompts |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8189 (while (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8190 (concat "<\\(" vhdl-template-prompt-syntax "\\)>") end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8191 (unless (equal "cursor" (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8192 (setq position (match-beginning 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8193 (setq prompt (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8194 (replace-match "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8195 (setq string (vhdl-template-field prompt nil t)) |
42942 | 8196 ;; replace occurrences of same prompt |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8197 (while (re-search-forward (concat "<\\(" prompt "\\)>") end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8198 (replace-match (or string ""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8199 (goto-char position))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8200 (goto-char start) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8201 ;; goto final position |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8202 (if (re-search-forward "<cursor>" end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8203 (replace-match "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8204 (goto-char end)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8205 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8206 (defun vhdl-model-defun () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8207 "Define help and hook functions for user models." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8208 (let ((model-alist vhdl-model-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8209 model-name model-keyword) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8210 (while model-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8211 ;; define functions for user models that can be invoked from menu and key |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8212 ;; bindings and which themselves call `vhdl-model-insert' with the model |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8213 ;; name as argument |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8214 (setq model-name (nth 0 (car model-alist))) |
26464 | 8215 (eval `(defun ,(vhdl-function-name "vhdl-model" model-name) () |
8216 ,(concat "Insert model for \"" model-name "\".") | |
8217 (interactive) | |
8218 (vhdl-model-insert ,model-name))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8219 ;; define hooks for user models that are invoked from keyword abbrevs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8220 (setq model-keyword (nth 3 (car model-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8221 (unless (equal model-keyword "") |
26464 | 8222 (eval `(defun |
8223 ,(vhdl-function-name | |
8224 "vhdl-model" model-name "hook") () | |
8225 (vhdl-hooked-abbrev | |
8226 ',(vhdl-function-name "vhdl-model" model-name))))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8227 (setq model-alist (cdr model-alist))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8228 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8229 (vhdl-model-defun) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8230 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8231 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8232 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8233 ;;; Port translation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8234 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8235 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8236 (defvar vhdl-port-list nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8237 "Variable to hold last PORT map parsed.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8238 ;; structure: (parenthesised expression means list of such entries) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8239 ;; ((generic-names) generic-type generic-init generic-comment) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8240 ;; ((port-names) port-object port-direct port-type port-comment) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8241 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8242 (defun vhdl-parse-string (string &optional optional) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8243 "Check that the text following point matches the regexp in STRING. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8244 END is the point beyond which matching/searching should not go." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8245 (if (looking-at string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8246 (re-search-forward string nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8247 (unless optional |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8248 (throw 'parse (format "Syntax error near line %s" (vhdl-current-line)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8249 nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8250 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8251 (defun vhdl-replace-string (regexp-cons string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8252 "Replace STRING from car of REGEXP-CONS to cdr of REGEXP-CONS." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8253 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8254 (if (string-match (car regexp-cons) string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8255 (replace-match (cdr regexp-cons) t nil string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8256 string))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8257 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8258 (defun vhdl-port-flatten () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8259 "Flatten port list so that only one generic/port exists per line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8260 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8261 (if (not vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8262 (error "No port read") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8263 (message "Flattening port...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8264 (let ((new-vhdl-port-list (list (car vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8265 (old-vhdl-port-list (cdr vhdl-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8266 old-port-list new-port-list old-port new-port names) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8267 ;; traverse port list and flatten entries |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8268 (while old-vhdl-port-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8269 (setq old-port-list (car old-vhdl-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8270 (setq new-port-list nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8271 (while old-port-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8272 (setq old-port (car old-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8273 (setq names (car old-port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8274 (while names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8275 (setq new-port (cons (list (car names)) (cdr old-port))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8276 (setq new-port-list (append new-port-list (list new-port))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8277 (setq names (cdr names))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8278 (setq old-port-list (cdr old-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8279 (setq old-vhdl-port-list (cdr old-vhdl-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8280 (setq new-vhdl-port-list (append new-vhdl-port-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8281 (list new-port-list)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8282 (setq vhdl-port-list new-vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8283 (message "Flattening port...done")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8284 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8285 (defun vhdl-port-copy () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8286 "Get generic and port information from an entity or component declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8287 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8288 (message "Reading port...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8289 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8290 (let ((case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8291 parse-error end-of-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8292 name generics ports |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8293 object names direct type init comment) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8294 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8295 (setq |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8296 parse-error |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8297 (catch 'parse |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8298 ;; check if within entity or component declaration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8299 (when (or (not (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8300 "^\\s-*\\(component\\|entity\\|end\\)\\>" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8301 (equal "end" (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8302 (throw 'parse "Not within entity or component declaration")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8303 (forward-word 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8304 (vhdl-parse-string "\\s-*\\(\\w+\\)\\s-*\\(is\\)?\\s-*$") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8305 (setq name (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8306 (vhdl-forward-syntactic-ws) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8307 ;; parse generic clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8308 (when (vhdl-parse-string "generic[ \t\n]*(" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8309 (vhdl-forward-syntactic-ws) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8310 (setq end-of-list (looking-at ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8311 (while (not end-of-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8312 ;; parse names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8313 (vhdl-parse-string "\\(\\w+\\)[ \t\n]*") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8314 (setq names (list (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8315 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\)[ \t\n]*" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8316 (setq names (append names (list (match-string 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8317 ;; parse type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8318 (vhdl-parse-string ":[ \t\n]*\\([^():;\n]+\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8319 (setq type (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8320 (setq comment nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8321 (while (looking-at "(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8322 (setq type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8323 (concat type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8324 (buffer-substring |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8325 (point) (progn (forward-sexp) (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8326 (and (vhdl-parse-string "\\([^():;\n]*\\)" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8327 (match-string 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8328 ;; special case: closing parenthesis is on separate line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8329 (when (and type (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" type)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8330 (setq comment (substring type (match-beginning 2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8331 (setq type (substring type 0 (match-beginning 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8332 ;; strip of trailing whitespace |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8333 (string-match "\\(\\(\\s-*\\S-+\\)+\\)\\s-*" type) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8334 (setq type (substring type 0 (match-end 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8335 ;; parse initialization expression |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8336 (setq init nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8337 (when (vhdl-parse-string ":=[ \t\n]*" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8338 (vhdl-parse-string "\\([^();\n]*\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8339 (setq init (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8340 (while (looking-at "(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8341 (setq init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8342 (concat init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8343 (buffer-substring |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8344 (point) (progn (forward-sexp) (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8345 (and (vhdl-parse-string "\\([^();\n]*\\)" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8346 (match-string 1)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8347 ;; special case: closing parenthesis is on separate line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8348 (when (and init (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" init)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8349 (setq comment (substring init (match-beginning 2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8350 (setq init (substring init 0 (match-beginning 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8351 (vhdl-forward-syntactic-ws)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8352 (skip-chars-forward " \t") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8353 ;; parse inline comment, special case: as above, no initial. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8354 (unless comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8355 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8356 (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8357 (vhdl-forward-syntactic-ws) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8358 (setq end-of-list (vhdl-parse-string ")" t)) |
26464 | 8359 (vhdl-parse-string ";\\s-*") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8360 ;; parse inline comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8361 (unless comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8362 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8363 (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8364 (vhdl-forward-syntactic-ws) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8365 ;; save everything in list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8366 (setq generics (append generics |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8367 (list (list names type init comment)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8368 ;; parse port clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8369 (when (vhdl-parse-string "port[ \t\n]*(" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8370 (vhdl-forward-syntactic-ws) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8371 (setq end-of-list (looking-at ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8372 (while (not end-of-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8373 ;; parse object |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8374 (setq object |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8375 (and (vhdl-parse-string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8376 "\\(signal\\|quantity\\|terminal\\)[ \t\n]*" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8377 (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8378 ;; parse names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8379 (vhdl-parse-string "\\(\\w+\\)[ \t\n]*") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8380 (setq names (list (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8381 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\)[ \t\n]*" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8382 (setq names (append names (list (match-string 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8383 ;; parse direction |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8384 (vhdl-parse-string ":[ \t\n]*") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8385 (setq direct |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8386 (and (vhdl-parse-string "\\(IN\\|OUT\\|INOUT\\)[ \t\n]+" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8387 (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8388 ;; parse type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8389 (vhdl-parse-string "\\([^();\n]+\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8390 (setq type (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8391 (setq comment nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8392 (while (looking-at "(") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8393 (setq type (concat type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8394 (buffer-substring |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8395 (point) (progn (forward-sexp) (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8396 (and (vhdl-parse-string "\\([^();\n]*\\)" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8397 (match-string 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8398 ;; special case: closing parenthesis is on separate line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8399 (when (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" type) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8400 (setq comment (substring type (match-beginning 2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8401 (setq type (substring type 0 (match-beginning 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8402 ;; strip of trailing whitespace |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8403 (string-match "\\(\\(\\s-*\\S-+\\)+\\)\\s-*" type) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8404 (setq type (substring type 0 (match-end 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8405 (vhdl-forward-syntactic-ws) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8406 (setq end-of-list (vhdl-parse-string ")" t)) |
26464 | 8407 (vhdl-parse-string ";\\s-*") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8408 ;; parse inline comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8409 (unless comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8410 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8411 (match-string 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8412 (vhdl-forward-syntactic-ws) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8413 ;; save everything in list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8414 (setq ports |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8415 (append ports |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8416 (list (list names object direct type comment)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8417 nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8418 ;; finish parsing |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8419 (if parse-error |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8420 (error parse-error) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8421 (setq vhdl-port-list (list name generics ports)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8422 (message "Reading port...done"))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8423 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8424 (defun vhdl-port-paste-generic (&optional no-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8425 "Paste a generic clause." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8426 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8427 list-margin start names generic |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8428 (generics-list (nth 1 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8429 ;; paste generic clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8430 (when generics-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8431 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8432 (vhdl-insert-keyword "GENERIC (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8433 (unless vhdl-argument-list-indent |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8434 (insert "\n") (indent-to (+ margin vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8435 (setq list-margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8436 (while generics-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8437 ;; paste names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8438 (setq generic (car generics-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8439 (setq names (nth 0 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8440 (while names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8441 (insert (car names)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8442 (setq names (cdr names)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8443 (when names (insert ", "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8444 ;; paste type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8445 (insert " : " (nth 1 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8446 ;; paste initialization |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8447 (when (and (not no-init) (nth 2 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8448 (insert " := " (nth 2 generic))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8449 (unless (cdr generics-list) (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8450 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8451 ;; paste comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8452 (when (and vhdl-include-port-comments (nth 3 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8453 (vhdl-comment-insert-inline (nth 3 generic) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8454 (setq generics-list (cdr generics-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8455 (when generics-list (insert "\n") (indent-to list-margin))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8456 ;; align generic clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8457 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1 t))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8458 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8459 (defun vhdl-port-paste-port () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8460 "Paste a port clause." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8461 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8462 list-margin start names port |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8463 (ports-list (nth 2 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8464 ;; paste port clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8465 (when ports-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8466 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8467 (vhdl-insert-keyword "PORT (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8468 (unless vhdl-argument-list-indent |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8469 (insert "\n") (indent-to (+ margin vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8470 (setq list-margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8471 (while ports-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8472 (setq port (car ports-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8473 ;; paste object |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8474 (when (nth 1 port) (insert (nth 1 port) " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8475 ;; paste names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8476 (setq names (nth 0 port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8477 (while names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8478 (insert (car names)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8479 (setq names (cdr names)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8480 (when names (insert ", "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8481 ;; paste direction |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8482 (insert " : ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8483 (when (nth 2 port) (insert (nth 2 port) " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8484 ;; paste type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8485 (insert (nth 3 port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8486 (unless (cdr ports-list) (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8487 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8488 ;; paste comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8489 (when (and vhdl-include-port-comments (nth 4 port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8490 (vhdl-comment-insert-inline (nth 4 port) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8491 (setq ports-list (cdr ports-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8492 (when ports-list (insert "\n") (indent-to list-margin))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8493 ;; align port clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8494 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8495 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8496 (defun vhdl-port-paste-declaration (kind) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8497 "Paste as an entity or component declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8498 (vhdl-indent-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8499 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8500 (name (nth 0 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8501 (vhdl-insert-keyword (if (eq kind 'entity) "ENTITY " "COMPONENT ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8502 (insert name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8503 (if (eq kind 'entity) (vhdl-insert-keyword " IS")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8504 ;; paste generic and port clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8505 (when (nth 1 vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8506 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8507 (when (and (memq vhdl-insert-empty-lines '(unit all)) (eq kind 'entity)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8508 (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8509 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8510 (vhdl-port-paste-generic (eq kind 'component))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8511 (when (nth 2 vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8512 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8513 (when (and (memq vhdl-insert-empty-lines '(unit all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8514 (eq kind 'entity)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8515 (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8516 (indent-to (+ margin vhdl-basic-offset))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8517 (vhdl-port-paste-port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8518 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8519 (when (and (memq vhdl-insert-empty-lines '(unit all)) (eq kind 'entity)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8520 (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8521 (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8522 (vhdl-insert-keyword "END") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8523 (if (eq kind 'entity) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8524 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8525 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " ENTITY")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8526 (insert " " name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8527 (vhdl-insert-keyword " COMPONENT") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8528 (unless (vhdl-standard-p '87) (insert " " name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8529 (insert ";"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8530 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8531 (defun vhdl-port-paste-entity () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8532 "Paste as an entity declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8533 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8534 (if (not vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8535 (error "No port read") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8536 (message "Pasting port as entity...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8537 (vhdl-port-paste-declaration 'entity) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8538 (message "Pasting port as entity...done"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8539 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8540 (defun vhdl-port-paste-component () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8541 "Paste as a component declaration." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8542 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8543 (if (not vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8544 (error "No port read") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8545 (message "Pasting port as component...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8546 (vhdl-port-paste-declaration 'component) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8547 (message "Pasting port as component...done"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8548 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8549 (defun vhdl-port-paste-generic-map (&optional secondary no-constants) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8550 "Paste as a generic map." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8551 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8552 (unless secondary (vhdl-indent-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8553 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8554 list-margin start generic |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8555 (generics-list (nth 1 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8556 (when generics-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8557 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8558 (vhdl-insert-keyword "GENERIC MAP (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8559 (if (not vhdl-association-list-with-formals) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8560 ;; paste list of actual generics |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8561 (while generics-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8562 (insert (or (nth 2 (car generics-list)) " ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8563 (setq generics-list (cdr generics-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8564 (insert (if generics-list ", " ")"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8565 (unless vhdl-argument-list-indent |
26464 | 8566 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset)))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8567 (setq list-margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8568 (while generics-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8569 (setq generic (car generics-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8570 ;; paste formal and actual generic |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8571 (insert (car (nth 0 generic)) " => " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8572 (if no-constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8573 (car (nth 0 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8574 (or (nth 2 generic) ""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8575 (setq generics-list (cdr generics-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8576 (insert (if generics-list "," ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8577 ;; paste comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8578 (when (and vhdl-include-port-comments (nth 3 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8579 (vhdl-comment-insert-inline (nth 3 generic) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8580 (when generics-list (insert "\n") (indent-to list-margin))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8581 ;; align generic map |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8582 (when vhdl-auto-align |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8583 (vhdl-align-noindent-region start (point) 1 t)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8584 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8585 (defun vhdl-port-paste-port-map () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8586 "Paste as a port map." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8587 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8588 list-margin start port |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8589 (ports-list (nth 2 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8590 (when ports-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8591 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8592 (vhdl-insert-keyword "PORT MAP (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8593 (if (not vhdl-association-list-with-formals) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8594 ;; paste list of actual ports |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8595 (while ports-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8596 (insert (vhdl-replace-string vhdl-actual-port-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8597 (car (nth 0 (car ports-list))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8598 (setq ports-list (cdr ports-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8599 (insert (if ports-list ", " ");"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8600 (unless vhdl-argument-list-indent |
26464 | 8601 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset)))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8602 (setq list-margin (current-column)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8603 (while ports-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8604 (setq port (car ports-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8605 ;; paste formal and actual port |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8606 (insert (car (nth 0 port)) " => ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8607 (insert (vhdl-replace-string vhdl-actual-port-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8608 (car (nth 0 port)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8609 (setq ports-list (cdr ports-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8610 (insert (if ports-list "," ");")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8611 ;; paste comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8612 (when (or vhdl-include-direction-comments |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8613 (and vhdl-include-port-comments (nth 4 port))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8614 (vhdl-comment-insert-inline |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8615 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8616 (if vhdl-include-direction-comments |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8617 (format "%-4s" (or (concat (nth 2 port) " ") "")) "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8618 (if vhdl-include-port-comments (nth 4 port) "")) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8619 (when ports-list (insert "\n") (indent-to list-margin))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8620 ;; align port clause |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8621 (when vhdl-auto-align |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8622 (vhdl-align-noindent-region start (point) 1)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8623 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8624 (defun vhdl-port-paste-instance (&optional name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8625 "Paste as an instantiation." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8626 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8627 (if (not vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8628 (error "No port read") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8629 (let ((orig-vhdl-port-list vhdl-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8630 ;; flatten local copy of port list (must be flat for port mapping) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8631 (vhdl-port-flatten) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8632 (vhdl-indent-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8633 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8634 list-margin start generic port |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8635 (generics-list (nth 1 vhdl-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8636 (ports-list (nth 2 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8637 ;; paste instantiation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8638 (if name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8639 (insert name ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8640 (if (equal (cdr vhdl-instance-name) "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8641 (vhdl-template-field "instance name" ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8642 (insert (vhdl-replace-string vhdl-instance-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8643 (nth 0 vhdl-port-list)) ": "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8644 (message "Pasting port as instantiation...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8645 (if (vhdl-standard-p '87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8646 (insert (nth 0 vhdl-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8647 (vhdl-insert-keyword "ENTITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8648 (insert "work." (nth 0 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8649 (when (nth 1 vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8650 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8651 (vhdl-port-paste-generic-map t t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8652 (when (nth 2 vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8653 (insert "\n") (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8654 (vhdl-port-paste-port-map)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8655 (message "Pasting port as instantiation...done")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8656 (setq vhdl-port-list orig-vhdl-port-list)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8657 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8658 (defun vhdl-port-paste-signals (&optional initialize) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8659 "Paste ports as internal signals." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8660 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8661 (if (not vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8662 (error "No port read") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8663 (message "Pasting port as signals...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8664 (vhdl-indent-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8665 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8666 start port names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8667 (ports-list (nth 2 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8668 (when ports-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8669 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8670 (while ports-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8671 (setq port (car ports-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8672 ;; paste object |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8673 (if (nth 1 port) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8674 (insert (nth 1 port) " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8675 (vhdl-insert-keyword "SIGNAL ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8676 ;; paste actual port signals |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8677 (setq names (nth 0 port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8678 (while names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8679 (insert (vhdl-replace-string vhdl-actual-port-name (car names))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8680 (setq names (cdr names)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8681 (when names (insert ", "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8682 ;; paste type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8683 (insert " : " (nth 3 port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8684 ;; paste initialization (inputs only) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8685 (when (and initialize (equal "in" (nth 2 port))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8686 (insert |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8687 " := " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8688 (if (string-match "(.+)" (nth 3 port)) "(others => '0')" "'0'"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8689 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8690 ;; paste comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8691 (when (and vhdl-include-port-comments (nth 4 port)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8692 (vhdl-comment-insert-inline (nth 4 port) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8693 (setq ports-list (cdr ports-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8694 (when ports-list (insert "\n") (indent-to margin))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8695 ;; align signal list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8696 (when vhdl-auto-align (vhdl-align-noindent-region start (point) 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8697 (message "Pasting port as signals...done"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8698 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8699 (defun vhdl-port-paste-constants () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8700 "Paste generics as constants." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8701 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8702 (if (not vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8703 (error "No port read") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8704 (let ((orig-vhdl-port-list vhdl-port-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8705 (message "Pasting port as constants...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8706 ;; flatten local copy of port list (must be flat for constant initial.) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8707 (vhdl-port-flatten) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8708 (vhdl-indent-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8709 (let ((margin (current-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8710 start generic name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8711 (generics-list (nth 1 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8712 (when generics-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8713 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8714 (while generics-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8715 (setq generic (car generics-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8716 (vhdl-insert-keyword "CONSTANT ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8717 ;; paste generic constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8718 (setq name (nth 0 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8719 (when name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8720 (insert (car name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8721 ;; paste type |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8722 (insert " : " (nth 1 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8723 ;; paste initialization |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8724 (when (nth 2 generic) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8725 (insert " := " (nth 2 generic))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8726 (insert ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8727 ;; paste comment |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8728 (when (and vhdl-include-port-comments (nth 3 generic)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8729 (vhdl-comment-insert-inline (nth 3 generic) t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8730 (setq generics-list (cdr generics-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8731 (when generics-list (insert "\n") (indent-to margin)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8732 ;; align signal list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8733 (when vhdl-auto-align |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8734 (vhdl-align-noindent-region start (point) 1)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8735 (message "Pasting port as constants...done") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8736 (setq vhdl-port-list orig-vhdl-port-list)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8737 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8738 (defun vhdl-port-paste-testbench () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8739 "Paste as a bare-bones test bench." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8740 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8741 (if (not vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8742 (error "No port read") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8743 (message "Pasting port as test bench...") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8744 (let ((case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8745 (ent-name (vhdl-replace-string vhdl-testbench-entity-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8746 (nth 0 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8747 (source-buffer (current-buffer)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8748 arch-name ent-file-name arch-file-name no-entity position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8749 ;; open entity file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8750 (when (not (eq vhdl-testbench-create-files 'none)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8751 (string-match "\\.[^.]*\\'" (buffer-file-name (current-buffer))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8752 (setq ent-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8753 (concat ent-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8754 (substring (buffer-file-name (current-buffer)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8755 (match-beginning 0)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8756 (when (file-exists-p ent-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8757 (if (y-or-n-p |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8758 (concat "File `" ent-file-name "' exists; overwrite? ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8759 (progn (delete-file ent-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8760 (when (get-file-buffer ent-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8761 (set-buffer ent-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8762 (set-buffer-modified-p nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8763 (kill-buffer ent-file-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8764 (if (eq vhdl-testbench-create-files 'separate) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8765 (setq no-entity t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8766 (error "Pasting port as test bench...aborted")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8767 (unless no-entity |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8768 (set-buffer source-buffer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8769 (find-file ent-file-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8770 (let ((margin 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8771 (unless (and (eq vhdl-testbench-create-files 'separate) no-entity) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8772 ;; paste entity header |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8773 (unless (equal "" vhdl-testbench-entity-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8774 (vhdl-insert-string-or-file vhdl-testbench-entity-header)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8775 (vhdl-comment-display-line) (insert "\n\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8776 ;; paste std_logic_1164 package |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8777 (vhdl-insert-keyword "LIBRARY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8778 (insert "ieee;\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8779 (vhdl-insert-keyword "USE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8780 (insert "ieee.std_logic_1164.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8781 (vhdl-insert-keyword "ALL;") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8782 (insert "\n\n") (indent-to margin) (vhdl-comment-display-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8783 (insert "\n\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8784 ;; paste entity declaration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8785 (vhdl-insert-keyword "ENTITY ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8786 (insert ent-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8787 (vhdl-insert-keyword " IS") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8788 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8789 (insert "\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8790 (vhdl-insert-keyword "END ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8791 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ENTITY ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8792 (insert ent-name ";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8793 (insert "\n\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8794 (vhdl-comment-display-line) (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8795 ;; get architecture name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8796 (setq arch-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8797 (if (equal (cdr vhdl-testbench-architecture-name) "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8798 (read-from-minibuffer "architecture name: " |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8799 nil vhdl-minibuffer-local-map) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8800 (vhdl-replace-string vhdl-testbench-architecture-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8801 (nth 0 vhdl-port-list)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8802 ;; open architecture file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8803 (when (eq vhdl-testbench-create-files 'separate) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8804 (save-buffer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8805 (string-match "\\.[^.]*\\'" (buffer-file-name (current-buffer))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8806 (setq arch-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8807 (concat arch-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8808 (substring (buffer-file-name (current-buffer)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8809 (match-beginning 0)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8810 (when (file-exists-p arch-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8811 (if (y-or-n-p |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8812 (concat "File `" ent-file-name "' exists; overwrite? ")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8813 (progn (delete-file arch-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8814 (when (get-file-buffer arch-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8815 (set-buffer (get-file-buffer arch-file-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8816 (set-buffer-modified-p nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8817 (kill-buffer arch-file-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8818 (error "Pasting port as test bench...aborted"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8819 (set-buffer source-buffer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8820 (find-file arch-file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8821 ;; paste architecture header |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8822 (unless (equal "" vhdl-testbench-architecture-header) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8823 (vhdl-insert-string-or-file vhdl-testbench-architecture-header)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8824 (vhdl-comment-display-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8825 (insert "\n")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8826 (insert "\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8827 ;; paste architecture body |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8828 (vhdl-insert-keyword "ARCHITECTURE ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8829 (insert arch-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8830 (vhdl-insert-keyword " OF ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8831 (insert ent-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8832 (vhdl-insert-keyword " IS") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8833 (insert "\n\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8834 ;; paste component declaration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8835 (when (vhdl-standard-p '87) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8836 (vhdl-port-paste-component) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8837 (insert "\n\n") (indent-to margin)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8838 ;; paste constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8839 (when (nth 1 vhdl-port-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8840 (vhdl-port-paste-constants) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8841 (insert "\n\n") (indent-to margin)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8842 ;; paste internal signals |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8843 (vhdl-port-paste-signals vhdl-testbench-initialize-signals) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8844 ;; paste custom declarations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8845 (unless (equal "" vhdl-testbench-declarations) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8846 (insert "\n\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8847 (vhdl-insert-string-or-file vhdl-testbench-declarations) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8848 (delete-indentation)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8849 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8850 (insert "\n\n") (indent-to margin) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8851 (vhdl-comment-display-line) (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8852 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8853 (vhdl-template-begin-end |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8854 (unless (vhdl-standard-p '87) "ARCHITECTURE") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8855 arch-name margin t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8856 ;; paste instantiation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8857 (vhdl-port-paste-instance |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8858 (vhdl-replace-string vhdl-testbench-dut-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8859 (nth 0 vhdl-port-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8860 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8861 ;; paste custom statements |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8862 (unless (equal "" vhdl-testbench-statements) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8863 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8864 (vhdl-insert-string-or-file vhdl-testbench-statements)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8865 (insert "\n") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8866 (indent-to (+ margin vhdl-basic-offset)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8867 (when (not (eq vhdl-testbench-create-files 'none)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8868 (save-buffer)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8869 (message "Pasting port as test bench...done"))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8870 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8871 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8872 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8873 ;;; Miscellaneous |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8874 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8875 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8876 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8877 ;; Hippie expand customization |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8878 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8879 (defvar vhdl-expand-upper-case nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8880 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8881 (defun vhdl-try-expand-abbrev (old) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8882 "Try expanding abbreviations from `vhdl-abbrev-list'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8883 (unless old |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8884 (he-init-string (he-dabbrev-beg) (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8885 (setq he-expand-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8886 (let ((abbrev-list vhdl-abbrev-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8887 (sel-abbrev-list '())) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8888 (while abbrev-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8889 (when (or (not (stringp (car abbrev-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8890 (string-match |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8891 (concat "^" he-search-string) (car abbrev-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8892 (setq sel-abbrev-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8893 (cons (car abbrev-list) sel-abbrev-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8894 (setq abbrev-list (cdr abbrev-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8895 (nreverse sel-abbrev-list)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8896 (while (and he-expand-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8897 (or (not (stringp (car he-expand-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8898 (he-string-member (car he-expand-list) he-tried-table t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8899 ; (equal (car he-expand-list) he-search-string))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8900 (unless (stringp (car he-expand-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8901 (setq vhdl-expand-upper-case (car he-expand-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8902 (setq he-expand-list (cdr he-expand-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8903 (if (null he-expand-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8904 (progn (when old (he-reset-string)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8905 nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8906 (he-substitute-string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8907 (if vhdl-expand-upper-case |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8908 (upcase (car he-expand-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8909 (car he-expand-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8910 t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8911 (setq he-expand-list (cdr he-expand-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8912 t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8913 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8914 (defun vhdl-he-list-beg () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8915 "Also looks at the word before `(' in order to better match parenthesized |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8916 expressions (e.g. for index ranges of types and signals)." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8917 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8918 (condition-case () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8919 (progn (backward-up-list 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8920 (skip-syntax-backward "w_")) ; crashes in `viper-mode' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8921 (error ())) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8922 (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8923 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8924 ;; override `he-list-beg' from `hippie-exp' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8925 (unless (and (boundp 'viper-mode) viper-mode) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8926 (require 'hippie-exp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8927 (defalias 'he-list-beg 'vhdl-he-list-beg)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8928 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8929 ;; function for expanding abbrevs and dabbrevs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8930 (fset 'vhdl-expand-abbrev (make-hippie-expand-function |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8931 '(try-expand-dabbrev |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8932 try-expand-dabbrev-all-buffers |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8933 vhdl-try-expand-abbrev))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8934 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8935 ;; function for expanding parenthesis |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8936 (fset 'vhdl-expand-paren (make-hippie-expand-function |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8937 '(try-expand-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8938 try-expand-list-all-buffers))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8939 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8940 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8941 ;; Case fixing |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8942 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8943 (defun vhdl-fix-case-region-1 (beg end upper-case word-regexp &optional count) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8944 "Convert all words matching word-regexp in region to lower or upper case, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8945 depending on parameter upper-case." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8946 (let ((case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8947 (case-replace nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8948 (last-update 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8949 (vhdl-ext-syntax-table |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8950 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8951 (goto-char end) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8952 (setq end (point-marker)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8953 (goto-char beg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8954 (while (re-search-forward word-regexp end t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8955 (or (vhdl-in-comment-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8956 (vhdl-in-string-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8957 (if upper-case |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8958 (upcase-word -1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8959 (downcase-word -1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8960 (when (and count vhdl-progress-interval |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8961 (< vhdl-progress-interval |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8962 (- (nth 1 (current-time)) last-update))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8963 (message "Fixing case... (%2d%s)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8964 (+ (* count 25) (/ (* 25 (- (point) beg)) (- end beg))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8965 "%") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8966 (setq last-update (nth 1 (current-time))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8967 (goto-char end))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8968 (and count vhdl-progress-interval (message "Fixing case...done")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8969 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8970 (defun vhdl-fix-case-region (beg end &optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8971 "Convert all VHDL words in region to lower or upper case, depending on |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8972 variables vhdl-upper-case-{keywords,types,attributes,enum-values}." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8973 (interactive "r\nP") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8974 (vhdl-fix-case-region-1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8975 beg end vhdl-upper-case-keywords vhdl-keywords-regexp 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8976 (vhdl-fix-case-region-1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8977 beg end vhdl-upper-case-types vhdl-types-regexp 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8978 (vhdl-fix-case-region-1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8979 beg end vhdl-upper-case-attributes (concat "'" vhdl-attributes-regexp) 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8980 (vhdl-fix-case-region-1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8981 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8982 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8983 (defun vhdl-fix-case-buffer () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8984 "Convert all VHDL words in buffer to lower or upper case, depending on |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8985 variables vhdl-upper-case-{keywords,types,attributes,enum-values}." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8986 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8987 (vhdl-fix-case-region (point-min) (point-max))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8988 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8989 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8990 ;; Line handling functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8991 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8992 (defun vhdl-current-line () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8993 "Return the line number of the line containing point." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8994 (save-restriction |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8995 (widen) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8996 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8997 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8998 (1+ (count-lines 1 (point)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
8999 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9000 (defun vhdl-line-kill-entire (&optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9001 "Delete entire line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9002 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9003 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9004 (kill-line (or arg 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9005 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9006 (defun vhdl-line-kill (&optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9007 "Kill current line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9008 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9009 (vhdl-line-kill-entire arg)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9010 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9011 (defun vhdl-line-copy (&optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9012 "Copy current line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9013 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9014 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9015 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9016 (let ((position (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9017 (forward-line (or arg 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9018 (copy-region-as-kill position (point))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9019 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9020 (defun vhdl-line-yank () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9021 "Yank entire line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9022 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9023 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9024 (yank)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9025 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9026 (defun vhdl-line-expand (&optional prefix-arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9027 "Hippie-expand current line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9028 (interactive "P") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9029 (let ((case-fold-search t) (case-replace nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9030 (hippie-expand-try-functions-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9031 '(try-expand-line try-expand-line-all-buffers))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9032 (hippie-expand prefix-arg))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9033 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9034 (defun vhdl-line-transpose-next (&optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9035 "Interchange this line with next line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9036 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9037 (forward-line 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9038 (transpose-lines (or arg 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9039 (forward-line -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9040 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9041 (defun vhdl-line-transpose-previous (&optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9042 "Interchange this line with previous line." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9043 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9044 (forward-line 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9045 (transpose-lines (- 0 (or arg 0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9046 (forward-line -1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9047 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9048 (defun vhdl-line-open () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9049 "Open a new line and indent." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9050 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9051 (end-of-line -0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9052 (newline-and-indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9053 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9054 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9055 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9056 ;;; Project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9057 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9058 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9059 (defun vhdl-project-switch (name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9060 "Switch to project NAME." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9061 (setq vhdl-project name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9062 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9063 (speedbar-refresh))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9064 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9065 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9066 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9067 ;;; Compilation |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9068 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9069 ;; (using `compile.el') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9070 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9071 (defun vhdl-compile-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9072 "Initialize for compilation." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9073 (unless compilation-error-regexp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9074 (setq compilation-error-regexp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9075 (let ((commands-alist vhdl-compiler-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9076 regexp-alist sublist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9077 (while commands-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9078 (setq sublist (nth 5 (car commands-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9079 (unless (equal "" (car sublist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9080 (setq regexp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9081 (cons (list (nth 0 sublist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9082 (if (= 0 (nth 1 sublist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9083 (if (string-match |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9084 "XEmacs" emacs-version) 9 nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9085 (nth 1 sublist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9086 (nth 2 sublist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9087 regexp-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9088 (setq commands-alist (cdr commands-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9089 regexp-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9090 (unless compilation-file-regexp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9091 (setq compilation-file-regexp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9092 (let ((commands-alist vhdl-compiler-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9093 regexp-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9094 (while commands-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9095 (unless (equal "" (car (nth 6 (car commands-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9096 (setq regexp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9097 (append regexp-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9098 (list (nth 6 (car commands-alist)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9099 (setq commands-alist (cdr commands-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9100 regexp-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9101 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9102 (defun vhdl-compile () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9103 "Compile current buffer using the VHDL compiler specified in |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9104 `vhdl-compiler'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9105 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9106 (vhdl-compile-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9107 (let* ((command-elem (assoc vhdl-compiler vhdl-compiler-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9108 (command (nth 1 command-elem)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9109 (default-directory (expand-file-name (nth 4 command-elem)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9110 (when command |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9111 (compile (concat command " " vhdl-compiler-options |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9112 (unless (string-equal vhdl-compiler-options "") " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9113 (buffer-file-name)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9114 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9115 (defun vhdl-make () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9116 "Call make command for compilation of all updated source files (requires |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9117 `Makefile')." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9118 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9119 (vhdl-compile-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9120 (let* ((command-elem (assoc vhdl-compiler vhdl-compiler-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9121 (command (nth 2 command-elem)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9122 (default-directory (expand-file-name (nth 4 command-elem)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9123 (if (equal command "") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9124 (compile "make") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9125 (compile command)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9126 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9127 (defun vhdl-generate-makefile () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9128 "Generate new `Makefile'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9129 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9130 (vhdl-compile-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9131 (let* ((command-elem (assoc vhdl-compiler vhdl-compiler-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9132 (command (nth 3 command-elem)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9133 (default-directory (expand-file-name (nth 4 command-elem)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9134 (if (not (equal command "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9135 (compile command) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9136 (error "No such command specified for `%s'" vhdl-compiler)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9137 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9138 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9139 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9140 ;;; Hideshow |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9142 ;; (using `hideshow.el') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9143 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9144 (defun vhdl-forward-unit (&optional count) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9145 "Find begin and end of VHDL design units (for hideshow)." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9146 (interactive "p") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9147 (let ((case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9148 (if (< count 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9149 (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9150 "^\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9151 (re-search-forward "^end\\>" nil t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9152 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9153 (when (string-match "XEmacs" emacs-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9154 (require 'hideshow)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9155 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9156 (unless (assq 'vhdl-mode hs-special-modes-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9157 (setq hs-special-modes-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9158 (cons |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9159 '(vhdl-mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9160 "\\(^\\)\\(architecture\\|ARCHITECTURE\\|configuration\\|CONFIGURATION\\|entity\\|ENTITY\\|package\\|PACKAGE\\)\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9161 "\\(^\\)\\(end\\|END\\)\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9162 "--\\( \\|$\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9163 vhdl-forward-unit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9164 hs-special-modes-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9165 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9166 (defun vhdl-hideshow-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9167 "Initialize `hideshow'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9168 (if vhdl-hide-all-init |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9169 (add-hook 'hs-minor-mode-hook 'hs-hide-all) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9170 (remove-hook 'hs-minor-mode-hook 'hs-hide-all)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9171 (if vhdl-hideshow-menu |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9172 (hs-minor-mode 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9173 (when (boundp 'hs-minor-mode) (hs-minor-mode 0)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9174 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9175 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9176 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9177 ;;; Font locking |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9178 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 9179 ;; (using `font-lock.el') |
9180 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9181 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9182 ;; Help functions for translate-off region highlighting |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9183 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9184 (defun vhdl-within-translate-off () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9185 "Return point if within translate-off region, else nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9186 (and (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9187 (re-search-backward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9188 "^\\s-*--\\s-*pragma\\s-*translate_\\(on\\|off\\)\\s-*\n" nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9189 (equal "off" (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9190 (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9191 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9192 (defun vhdl-start-translate-off (limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9193 "Return point before translate-off pragma if before LIMIT, else nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9194 (when (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9195 "^\\s-*--\\s-*pragma\\s-*translate_off\\s-*\n" limit t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9196 (match-beginning 0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9197 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9198 (defun vhdl-end-translate-off (limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9199 "Return point after translate-on pragma if before LIMIT, else nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9200 (re-search-forward "^\\s-*--\\s-*pragma\\s-*translate_on\\s-*\n" limit t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9201 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9202 (defun vhdl-match-translate-off (limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9203 "Match a translate-off block, setting match-data and returning t, else nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9204 (when (< (point) limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9205 (let ((start (or (vhdl-within-translate-off) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9206 (vhdl-start-translate-off limit))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9207 (case-fold-search t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9208 (when start |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9209 (let ((end (or (vhdl-end-translate-off limit) limit))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9210 (set-match-data (list start end)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9211 (goto-char end)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9212 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9213 (defun vhdl-font-lock-match-item (limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9214 "Match, and move over, any declaration item after point. Adapted from |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9215 `font-lock-match-c-style-declaration-item-and-skip-to-next'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9216 (condition-case nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9217 (save-restriction |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9218 (narrow-to-region (point-min) limit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9219 ;; match item |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9220 (when (looking-at "\\s-*\\(\\w+\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9221 (save-match-data |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9222 (goto-char (match-end 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9223 ;; move to next item |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9224 (if (looking-at "\\(\\s-*,\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9225 (goto-char (match-end 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9226 (end-of-line) t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9227 (error t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9228 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9229 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 9230 ;; Syntax definitions |
9231 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9232 (defconst vhdl-font-lock-syntactic-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9233 '(("\\(\'\\).\\(\'\\)" (1 (7 . ?\')) (2 (7 . ?\')))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9234 "Mark single quotes as having string quote syntax in 'c' instances.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9235 |
20665 | 9236 (defvar vhdl-font-lock-keywords nil |
9237 "Regular expressions to highlight in VHDL Mode.") | |
9238 | |
9239 (defconst vhdl-font-lock-keywords-0 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9240 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9241 ;; highlight template prompts |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9242 (list (concat "\\(<" vhdl-template-prompt-syntax ">\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9243 1 'vhdl-font-lock-prompt-face t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9244 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9245 ;; highlight directives |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9246 '("--\\s-*pragma\\s-+\\(.*\\)$" 1 vhdl-font-lock-directive-face t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9247 ) |
20665 | 9248 "For consideration as a value of `vhdl-font-lock-keywords'. |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9249 This does highlighting of template prompts and directives (pragmas).") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9250 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9251 (defvar vhdl-font-lock-keywords-1 nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9252 ;; set in `vhdl-font-lock-init' because dependent on custom variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9253 "For consideration as a value of `vhdl-font-lock-keywords'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9254 This does highlighting of keywords and standard identifiers.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9255 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9256 (defconst vhdl-font-lock-keywords-2 |
20665 | 9257 (list |
9258 ;; highlight names of units, subprograms, and components when declared | |
9259 (list | |
9260 (concat | |
9261 "^\\s-*\\(" | |
9262 "architecture\\|configuration\\|entity\\|package\\(\\s-+body\\|\\)\\|" | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9263 "\\(\\(impure\\|pure\\)\\s-+\\|\\)function\\|procedure\\|component" |
20665 | 9264 "\\)\\s-+\\(\\w+\\)") |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9265 5 'font-lock-function-name-face) |
20665 | 9266 |
9267 ;; highlight entity names of architectures and configurations | |
9268 (list | |
9269 "^\\s-*\\(architecture\\|configuration\\)\\s-+\\w+\\s-+of\\s-+\\(\\w+\\)" | |
9270 2 'font-lock-function-name-face) | |
9271 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9272 ;; highlight labels of common constructs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9273 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9274 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9275 "^\\s-*\\(\\w+\\)\\s-*:\\(\\s-\\|\n\\)*\\(\\(" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9276 "assert\\|block\\|case\\|component\\|configuration\\|entity\\|exit\\|" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9277 "for\\|if\\|loop\\|next\\|null\\|postponed\\|process\\|" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9278 (when (vhdl-standard-p 'ams) "procedural\\|") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9279 "with\\|while" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9280 "\\)\\>\\|[^\n]*<=\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9281 1 'font-lock-function-name-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9282 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9283 ;; highlight label and component name of component instantiations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9284 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9285 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9286 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n]*\\(component\\s-+\\|\\)\\(\\w+\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9287 "\\(\\s-\\|\n\\)+\\(generic\\|port\\)\\s-+map\\>") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9288 '(1 font-lock-function-name-face) '(3 font-lock-function-name-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9289 |
20665 | 9290 ;; highlight names and labels at end of constructs |
9291 (list | |
9292 (concat | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9293 "^\\s-*end\\s-+\\(\\(" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9294 "architecture\\|block\\|case\\|component\\|configuration\\|entity\\|" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9295 "for\\|function\\|generate\\|if\\|loop\\|package\\(\\s-+body\\|\\)\\|" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9296 "procedure\\|\\(postponed\\s-+\\|\\)process\\|" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9297 (when (vhdl-standard-p 'ams) "procedural\\|") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9298 "units" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9299 "\\)\\>\\|\\)\\s-*\\(\\w*\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9300 5 'font-lock-function-name-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9301 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9302 ;; highlight labels in exit and next statements |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9303 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9304 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9305 "^\\s-*\\(\\w+\\s-*:\\s-*\\)?\\(exit\\|next\\)\\s-+\\(\\w*\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9306 3 'font-lock-function-name-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9307 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9308 ;; highlight entity name in attribute specifications |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9309 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9310 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9311 "^\\s-*attribute\\s-+\\w+\\s-+of\\s-+\\(\\w+\\(,\\s-*\\w+\\)*\\)\\s-*:") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9312 1 'font-lock-function-name-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9313 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9314 ;; highlight labels in component specifications |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9315 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9316 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9317 "^\\s-*for\\s-+\\(\\w+\\(,\\s-*\\w+\\)*\\)\\s-*:" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9318 "\\(\\s-\\|\n\\)*\\(\\w+\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9319 '(1 font-lock-function-name-face) '(4 font-lock-function-name-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9320 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9321 ;; highlight attribute name in attribute declarations/specifications |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9322 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9323 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9324 "^\\s-*attribute\\s-+\\(\\w+\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9325 1 'vhdl-font-lock-attribute-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9326 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9327 ;; highlight type/nature name in (sub)type/(sub)nature declarations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9328 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9329 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9330 "^\\s-*\\(sub\\|\\)\\(nature\\|type\\)\\s-+\\(\\w+\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9331 3 'font-lock-type-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9332 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9333 ;; highlight signal/variable/constant declaration names |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9334 (list "\\(:[^=]\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9335 '(vhdl-font-lock-match-item |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9336 (progn (goto-char (match-beginning 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9337 (skip-syntax-backward " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9338 (skip-syntax-backward "w_") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9339 (skip-syntax-backward " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9340 (while (= (preceding-char) ?,) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9341 (backward-char 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9342 (skip-syntax-backward " ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9343 (skip-syntax-backward "w_") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9344 (skip-syntax-backward " "))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9345 ; (skip-chars-backward "^-(\n\";") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9346 (goto-char (match-end 1)) (1 font-lock-variable-name-face))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9347 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9348 ;; highlight alias/group declaration names and for-loop/-generate variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9349 (list "\\<\\(alias\\|for\\|group\\)\\s-+\\w+\\s-+\\(in\\|is\\)\\>" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9350 '(vhdl-font-lock-match-item |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9351 (progn (goto-char (match-end 1)) (match-beginning 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9352 nil (1 font-lock-variable-name-face))) |
20665 | 9353 ) |
9354 "For consideration as a value of `vhdl-font-lock-keywords'. | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9355 This does context sensitive highlighting of names and labels.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9356 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9357 (defvar vhdl-font-lock-keywords-3 nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9358 ;; set in `vhdl-font-lock-init' because dependent on custom variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9359 "For consideration as a value of `vhdl-font-lock-keywords'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9360 This does highlighting of words with special syntax.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9361 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9362 (defvar vhdl-font-lock-keywords-4 nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9363 ;; set in `vhdl-font-lock-init' because dependent on custom variables |
20665 | 9364 "For consideration as a value of `vhdl-font-lock-keywords'. |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9365 This does highlighting of additional reserved words.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9366 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9367 (defconst vhdl-font-lock-keywords-5 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9368 ;; background highlight translate-off regions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9369 '((vhdl-match-translate-off (0 vhdl-font-lock-translate-off-face append))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9370 "For consideration as a value of `vhdl-font-lock-keywords'. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9371 This does background highlighting of translate-off regions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9372 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9373 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 9374 ;; Font and color definitions |
9375 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9376 (defvar vhdl-font-lock-prompt-face 'vhdl-font-lock-prompt-face |
20665 | 9377 "Face name to use for prompts.") |
9378 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9379 (defvar vhdl-font-lock-attribute-face 'vhdl-font-lock-attribute-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9380 "Face name to use for standardized attributes.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9381 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9382 (defvar vhdl-font-lock-enumvalue-face 'vhdl-font-lock-enumvalue-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9383 "Face name to use for standardized enumeration values.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9384 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9385 (defvar vhdl-font-lock-function-face 'vhdl-font-lock-function-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9386 "Face name to use for standardized functions and packages.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9387 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9388 (defvar vhdl-font-lock-directive-face 'vhdl-font-lock-directive-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9389 "Face name to use for directives.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9390 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9391 (defvar vhdl-font-lock-reserved-words-face 'vhdl-font-lock-reserved-words-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9392 "Face name to use for additional reserved words.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9393 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9394 (defvar vhdl-font-lock-translate-off-face 'vhdl-font-lock-translate-off-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9395 "Face name to use for translate-off regions.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9396 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9397 ;; face names to use for words with special syntax. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9398 (let ((syntax-alist vhdl-special-syntax-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9399 name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9400 (while syntax-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9401 (setq name (vhdl-function-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9402 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face")) |
26464 | 9403 (eval `(defvar ,name ',name |
9404 ,(concat "Face name to use for " | |
9405 (nth 0 (car syntax-alist)) "."))) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9406 (setq syntax-alist (cdr syntax-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9407 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9408 (defgroup vhdl-highlight-faces nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9409 "Faces for highlighting." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9410 :group 'vhdl-highlight) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9411 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9412 ;; add faces used from `font-lock' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9413 (custom-add-to-group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9414 'vhdl-highlight-faces 'font-lock-comment-face 'custom-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9415 (custom-add-to-group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9416 'vhdl-highlight-faces 'font-lock-string-face 'custom-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9417 (custom-add-to-group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9418 'vhdl-highlight-faces 'font-lock-keyword-face 'custom-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9419 (custom-add-to-group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9420 'vhdl-highlight-faces 'font-lock-type-face 'custom-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9421 (custom-add-to-group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9422 'vhdl-highlight-faces 'font-lock-function-name-face 'custom-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9423 (custom-add-to-group |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9424 'vhdl-highlight-faces 'font-lock-variable-name-face 'custom-face) |
20665 | 9425 |
9426 (defface vhdl-font-lock-prompt-face | |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9427 '((((class color) (background light)) (:foreground "Red" :weight bold)) |
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9428 (((class color) (background dark)) (:foreground "Pink" :weight bold)) |
20665 | 9429 (t (:inverse-video t))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9430 "Font lock mode face used to highlight prompts." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9431 :group 'vhdl-highlight-faces |
20665 | 9432 :group 'font-lock-highlighting-faces) |
9433 | |
9434 (defface vhdl-font-lock-attribute-face | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9435 '((((class color) (background light)) (:foreground "Orchid")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9436 (((class color) (background dark)) (:foreground "LightSteelBlue")) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9437 (t (:slant italic :weight bold))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9438 "Font lock mode face used to highlight standardized attributes." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9439 :group 'vhdl-highlight-faces |
20665 | 9440 :group 'font-lock-highlighting-faces) |
9441 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9442 (defface vhdl-font-lock-enumvalue-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9443 '((((class color) (background light)) (:foreground "Gold4")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9444 (((class color) (background dark)) (:foreground "BurlyWood")) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9445 (t (:slant italic :weight bold))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9446 "Font lock mode face used to highlight standardized enumeration values." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9447 :group 'vhdl-highlight-faces |
20665 | 9448 :group 'font-lock-highlighting-faces) |
9449 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9450 (defface vhdl-font-lock-function-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9451 '((((class color) (background light)) (:foreground "Orchid4")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9452 (((class color) (background dark)) (:foreground "Orchid1")) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9453 (t (:slant italic :weight bold))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9454 "Font lock mode face used to highlight standardized functions and packages." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9455 :group 'vhdl-highlight-faces |
20665 | 9456 :group 'font-lock-highlighting-faces) |
9457 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9458 (defface vhdl-font-lock-directive-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9459 '((((class color) (background light)) (:foreground "CadetBlue")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9460 (((class color) (background dark)) (:foreground "Aquamarine")) |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9461 (t (:slant italic :weight bold))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9462 "Font lock mode face used to highlight directives." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9463 :group 'vhdl-highlight-faces |
20665 | 9464 :group 'font-lock-highlighting-faces) |
9465 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9466 (defface vhdl-font-lock-reserved-words-face |
42455
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9467 '((((class color) (background light)) (:foreground "Orange" :weight bold)) |
7662f312caf2
(various face definitions): Use :weight and :slant.
Richard M. Stallman <rms@gnu.org>
parents:
42441
diff
changeset
|
9468 (((class color) (background dark)) (:foreground "Yellow" :weight bold)) |
20665 | 9469 (t ())) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9470 "Font lock mode face used to highlight additional reserved words." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9471 :group 'vhdl-highlight-faces |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9472 :group 'font-lock-highlighting-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9473 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9474 (defface vhdl-font-lock-translate-off-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9475 '((((class color) (background light)) (:background "LightGray")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9476 (((class color) (background dark)) (:background "DimGray")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9477 (t ())) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9478 "Font lock mode face used to background highlight translate-off regions." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9479 :group 'vhdl-highlight-faces |
20665 | 9480 :group 'font-lock-highlighting-faces) |
9481 | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9482 ;; font lock mode faces used to highlight words with special syntax. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9483 (let ((syntax-alist vhdl-special-syntax-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9484 (while syntax-alist |
26464 | 9485 (eval `(defface ,(vhdl-function-name |
9486 "vhdl-font-lock" (car (car syntax-alist)) "face") | |
9487 '((((class color) (background light)) | |
9488 (:foreground ,(nth 2 (car syntax-alist)))) | |
9489 (((class color) (background dark)) | |
9490 (:foreground ,(nth 3 (car syntax-alist)))) | |
9491 (t ())) | |
9492 ,(concat "Font lock mode face used to highlight " | |
9493 (nth 0 (car syntax-alist)) ".") | |
9494 :group 'vhdl-highlight-faces | |
9495 :group 'font-lock-highlighting-faces)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9496 (setq syntax-alist (cdr syntax-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9497 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9498 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 9499 ;; Font lock initialization |
9500 | |
9501 (defun vhdl-font-lock-init () | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9502 "Initialize fontification." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9503 ;; highlight keywords and standardized types, attributes, enumeration |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9504 ;; values, and subprograms |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9505 (setq vhdl-font-lock-keywords-1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9506 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9507 (list (concat "'" vhdl-attributes-regexp) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9508 1 'vhdl-font-lock-attribute-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9509 (list vhdl-types-regexp 1 'font-lock-type-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9510 (list vhdl-functions-regexp 1 'vhdl-font-lock-function-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9511 (list vhdl-packages-regexp 1 'vhdl-font-lock-function-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9512 (list vhdl-enum-values-regexp 1 'vhdl-font-lock-enumvalue-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9513 (list vhdl-keywords-regexp 1 'font-lock-keyword-face))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9514 ;; highlight words with special syntax. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9515 (setq vhdl-font-lock-keywords-3 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9516 (let ((syntax-alist vhdl-special-syntax-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9517 keywords) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9518 (while syntax-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9519 (setq keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9520 (cons |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9521 (cons (concat "\\<\\(" (nth 1 (car syntax-alist)) "\\)\\>") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9522 (vhdl-function-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9523 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9524 keywords)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9525 (setq syntax-alist (cdr syntax-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9526 keywords)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9527 ;; highlight additional reserved words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9528 (setq vhdl-font-lock-keywords-4 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9529 (list (list vhdl-reserved-words-regexp 1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9530 'vhdl-font-lock-reserved-words-face))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9531 ;; highlight everything together |
20665 | 9532 (setq vhdl-font-lock-keywords |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9533 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9534 vhdl-font-lock-keywords-0 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9535 (when vhdl-highlight-keywords vhdl-font-lock-keywords-1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9536 (when (or vhdl-highlight-forbidden-words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9537 vhdl-highlight-verilog-keywords) vhdl-font-lock-keywords-4) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9538 (when vhdl-highlight-special-words vhdl-font-lock-keywords-3) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9539 (when vhdl-highlight-names vhdl-font-lock-keywords-2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9540 (when vhdl-highlight-translate-off vhdl-font-lock-keywords-5)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9541 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9542 ;; initialize fontification for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9543 (vhdl-font-lock-init) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9544 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9545 (defun vhdl-fontify-buffer () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9546 "Re-initialize fontification and fontify buffer." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9547 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9548 (setq font-lock-defaults |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9549 (list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9550 'vhdl-font-lock-keywords nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9551 (not vhdl-highlight-case-sensitive) '((?\_ . "w")) 'beginning-of-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9552 '(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9553 (when (fboundp 'font-lock-unset-defaults) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9554 (font-lock-unset-defaults)) ; not implemented in XEmacs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9555 (font-lock-set-defaults) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9556 (font-lock-fontify-buffer)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9557 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9558 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9559 ;; Initialization for postscript printing |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9560 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9561 (defun vhdl-ps-print-settings () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9562 "Initialize custom face and page settings for postscript printing." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9563 ;; define custom face settings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9564 (unless (or (not vhdl-print-customize-faces) |
20665 | 9565 ps-print-color-p) |
9566 (set (make-local-variable 'ps-bold-faces) | |
9567 '(font-lock-keyword-face | |
9568 font-lock-type-face | |
9569 vhdl-font-lock-attribute-face | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9570 vhdl-font-lock-enumvalue-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9571 vhdl-font-lock-directive-face)) |
20665 | 9572 (set (make-local-variable 'ps-italic-faces) |
9573 '(font-lock-comment-face | |
9574 font-lock-function-name-face | |
9575 font-lock-type-face | |
9576 vhdl-font-lock-attribute-face | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9577 vhdl-font-lock-enumvalue-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9578 vhdl-font-lock-directive-face)) |
20665 | 9579 (set (make-local-variable 'ps-underlined-faces) |
9580 '(font-lock-string-face)) | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9581 (setq ps-always-build-face-reference t)) |
20665 | 9582 ;; define page settings, so that a line containing 79 characters (default) |
9583 ;; fits into one column | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9584 (when vhdl-print-two-column |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9585 (set (make-local-variable 'ps-landscape-mode) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9586 (set (make-local-variable 'ps-number-of-columns) 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9587 (set (make-local-variable 'ps-font-size) 7.0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9588 (set (make-local-variable 'ps-header-title-font-size) 10.0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9589 (set (make-local-variable 'ps-header-font-size) 9.0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9590 (set (make-local-variable 'ps-header-offset) 12.0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9591 (when (eq ps-paper-type 'letter) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9592 (set (make-local-variable 'ps-inter-column) 40.0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9593 (set (make-local-variable 'ps-left-margin) 40.0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9594 (set (make-local-variable 'ps-right-margin) 40.0)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9595 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9596 (defun vhdl-ps-print-init () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9597 "Initialize postscript printing." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9598 (if (string-match "XEmacs" emacs-version) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9599 (vhdl-ps-print-settings) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9600 (make-local-variable 'ps-print-hook) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9601 (add-hook 'ps-print-hook 'vhdl-ps-print-settings))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9602 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9603 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9604 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9605 ;;; Hierarchy browser (using `speedbar.el') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9606 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9607 ;; Allows displaying the hierarchy of all VHDL design units contained in a |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9608 ;; directory by using the speedbar. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9609 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9610 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9611 ;; Variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9612 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9613 (defvar vhdl-entity-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9614 "Cache with entities and corresponding architectures and configurations for |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9615 each visited directory.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9616 ;; structure: (parenthesised expression means list of such entries) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9617 ;; (directory-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9618 ;; (ent-name ent-file ent-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9619 ;; (arch-name arch-file arch-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9620 ;; (inst-name inst-file inst-line inst-ent-name inst-arch-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9621 ;; (conf-name conf-file conf-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9622 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9623 (defvar vhdl-package-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9624 "Cache with packages for each visited directory.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9625 ;; structure: (parenthesised expression means list of such entries) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9626 ;; (directory-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9627 ;; (pack-name pack-file pack-line pack-body-file pack-body-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9628 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9629 (defvar vhdl-ent-inst-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9630 "Cache with instantiated entities for each visited directory.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9631 ;; structure: (parenthesised expression means list of such entries) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9632 ;; (directory-name (inst-ent-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9633 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9634 (defvar vhdl-project-entity-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9635 "Cache with entities and corresponding architectures and configurations for |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9636 each visited project.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9637 ;; same structure as `vhdl-entity-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9638 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9639 (defvar vhdl-project-package-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9640 "Cache with packages for each visited directory.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9641 ;; same structure as `vhdl-package-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9642 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9643 (defvar vhdl-project-ent-inst-list nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9644 "Cache with instantiated entities for each visited directory.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9645 ;; same structure as `vhdl-ent-inst-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9646 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9647 (defvar vhdl-speedbar-shown-units-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9648 "Alist of design units simultaneously open in the current speedbar for each |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9649 directory and project.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9650 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9651 (defvar vhdl-speedbar-last-file-name nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9652 "Last file for which design units were highlighted.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9653 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9654 (defvar vhdl-file-alist nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9655 "Cache with design units in each file.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9656 ;; structure (parenthesised expression means list of such entries) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9657 ;; (file-name (ent-list) (arch-list) (conf-list) (pack-list) (inst-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9658 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9659 ;; help function |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9660 (defsubst vhdl-speedbar-project-p () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9661 "Return non-nil if a project is displayed, i.e. directories or files are |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9662 specified." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9663 (nth 1 (aget vhdl-project-alist vhdl-project))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9664 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9665 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9666 ;; Scan functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9667 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9668 (defun vhdl-scan-file-contents (name &optional num-string) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9669 "Scan contents of VHDL files in FILE-LIST." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9670 (string-match "\\(.*/\\)\\(.*\\)" name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9671 ; (unless (file-directory-p (match-string 1 name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9672 ; (message "No such directory: \"%s\"" (match-string 1 name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9673 (let* ((is-directory (= (match-beginning 2) (match-end 2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9674 (file-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9675 (if is-directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9676 (nreverse (vhdl-get-source-files t name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9677 (vhdl-directory-files (match-string 1 name) t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9678 (wildcard-to-regexp (match-string 2 name))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9679 (case-fold-search t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9680 (source-buffer (current-buffer)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9681 ent-alist pack-alist ent-inst-list no-files) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9682 (when (and (not is-directory) (null file-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9683 (message "No such file: \"%s\"" name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9684 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9685 (when file-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9686 (setq no-files (length file-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9687 ;; do for all files |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9688 (while file-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9689 (message "Scanning %s %s\"%s\"... (%2d%s)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9690 (if is-directory "directory" "files") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9691 (or num-string "") name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9692 (/ (* 100 (- no-files (length file-list))) no-files) "%") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9693 (let ((file-name (abbreviate-file-name (car file-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9694 opened arch-name ent-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9695 ent-list arch-list conf-list pack-list inst-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9696 ;; open file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9697 (if (find-buffer-visiting file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9698 (set-buffer (find-buffer-visiting file-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9699 (set-buffer (find-file-noselect file-name nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9700 (setq opened t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9701 (modify-syntax-entry ?_ "w" (syntax-table)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9702 ;; scan for entities |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9703 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9704 (while (re-search-forward "^\\s-*entity\\s-+\\(\\w+\\)" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9705 (let* ((ent-entry (aget ent-alist (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9706 (arch-alist (nth 2 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9707 (conf-alist (nth 3 ent-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9708 (setq ent-list (cons (match-string 1) ent-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9709 (aput 'ent-alist (match-string 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9710 (list file-name (vhdl-current-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9711 arch-alist conf-alist nil)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9712 ;; scan for architectures and instantiations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9713 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9714 (while (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9715 (concat |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9716 "^\\s-*\\(architecture\\s-+\\(\\w+\\)\\s-+of\\s-+\\(\\w+\\)\\|" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9717 "\\(\\w+\\)\\s-*:\\(\\s-\\|\n\\)*\\(entity\\s-+\\w+\\.\\)?" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9718 "\\(\\w+\\)\\(\\s-*(\\(\\w+\\))\\)?\\(\\s-\\|\n\\|--.*\n\\)*" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9719 "\\(generic\\|port\\)\\s-+map\\>\\)") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9720 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9721 (if (match-string 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9722 ;; architecture found |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9723 (let* ((ent-entry (aget ent-alist (match-string 3))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9724 (arch-alist (nth 2 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9725 (conf-alist (nth 3 ent-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9726 (setq arch-name (match-string 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9727 (setq ent-name (match-string 3)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9728 (setq arch-list (cons arch-name arch-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9729 (vhdl-aappend 'arch-alist arch-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9730 (list file-name (vhdl-current-line) nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9731 (setq ent-entry (list (nth 0 ent-entry) (nth 1 ent-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9732 arch-alist conf-alist nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9733 (aput 'ent-alist ent-name ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9734 ;; instantiation found |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9735 (let* ((ent-entry (aget ent-alist ent-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9736 (arch-alist (nth 2 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9737 (arch-entry (aget arch-alist arch-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9738 (inst-alist (nth 2 arch-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9739 (inst-name (match-string 4)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9740 (inst-ent-name (match-string 7)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9741 (inst-arch-name (match-string 9)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9742 (conf-alist (nth 3 ent-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9743 (re-search-backward ":" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9744 (setq inst-list (cons inst-name inst-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9745 (vhdl-aappend 'inst-alist inst-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9746 (list file-name (vhdl-current-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9747 inst-ent-name inst-arch-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9748 (setq arch-entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9749 (list (nth 0 arch-entry) (nth 1 arch-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9750 inst-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9751 (vhdl-aappend 'arch-alist arch-name arch-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9752 (setq ent-entry (list (nth 0 ent-entry) (nth 1 ent-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9753 arch-alist conf-alist nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9754 (aput 'ent-alist ent-name ent-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9755 (unless (member inst-ent-name ent-inst-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9756 (setq ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9757 (cons inst-ent-name ent-inst-list)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9758 ;; scan for configurations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9759 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9760 (while (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9761 "^\\s-*configuration\\s-+\\(\\w+\\)\\s-+of\\s-+\\(\\w+\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9762 nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9763 (let* ((ent-entry (aget ent-alist (match-string 2))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9764 (arch-alist (nth 2 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9765 (conf-alist (nth 3 ent-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9766 (setq conf-list (cons (match-string 1) conf-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9767 (vhdl-aappend 'conf-alist (match-string 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9768 (list file-name (vhdl-current-line))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9769 (setq ent-entry (list (nth 0 ent-entry) (nth 1 ent-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9770 arch-alist conf-alist nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9771 (aput 'ent-alist (match-string 2) ent-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9772 ;; scan for packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9773 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9774 (while (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9775 "^\\s-*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9776 (let ((pack-entry (aget pack-alist (match-string 2)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9777 (setq pack-list (cons (match-string 2) pack-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9778 (aput 'pack-alist (match-string 2) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9779 (if (not (match-string 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9780 (list file-name (vhdl-current-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9781 (nth 2 pack-entry) (nth 3 pack-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9782 (list (nth 0 pack-entry) (nth 1 pack-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9783 file-name (vhdl-current-line)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9784 (setq file-list (cdr file-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9785 ;; add design units to variable `vhdl-file-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9786 (aput 'vhdl-file-alist file-name |
26464 | 9787 (list ent-list arch-list conf-list pack-list inst-list)) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9788 ;; close file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9789 (if opened |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9790 (kill-buffer (current-buffer)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9791 (when (not vhdl-underscore-is-part-of-word) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9792 (modify-syntax-entry ?_ "_" vhdl-mode-syntax-table))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9793 (set-buffer source-buffer))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9794 ;; sort entities and packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9795 (setq ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9796 (sort ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9797 (function (lambda (a b) (string-lessp (car a) (car b)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9798 (setq pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9799 (sort pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9800 (function (lambda (a b) (string-lessp (car a) (car b)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9801 ;; put directory contents into cache |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9802 (when ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9803 (aput 'vhdl-entity-alist name ent-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9804 (when pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9805 (aput 'vhdl-package-alist name pack-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9806 (when ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9807 (aput 'vhdl-ent-inst-alist name (list ent-inst-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9808 (message "Scanning %s %s\"%s\"...done" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9809 (if is-directory "directory" "files") (or num-string "") name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9810 t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9811 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9812 (defun vhdl-scan-project-contents (project &optional rescan) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9813 "Scan the contents of all VHDL files found in the directories and files |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9814 of PROJECT." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9815 (let ((dir-list-tmp (nth 1 (aget vhdl-project-alist project))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9816 dir-list pro-ent-alist pro-pack-alist pro-ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9817 dir name num-dir act-dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9818 ;; resolve environment variables and path wildcards |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9819 (setq dir-list-tmp (vhdl-resolve-paths dir-list-tmp)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9820 ;; expand directories |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9821 (while dir-list-tmp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9822 (setq dir (car dir-list-tmp)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9823 ;; get subdirectories |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9824 (if (string-match "-r \\(.*/\\)" dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9825 (setq dir-list (append dir-list (vhdl-get-subdirs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9826 (match-string 1 dir)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9827 (setq dir-list (append dir-list (list dir)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9828 (setq dir-list-tmp (cdr dir-list-tmp))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9829 ;; get entities and packages of each directory in DIR-LIST |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9830 (setq num-dir (length dir-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9831 act-dir 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9832 (while dir-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9833 (setq name (abbreviate-file-name (car dir-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9834 (or (and (not rescan) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9835 (or (assoc name vhdl-entity-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9836 (assoc name vhdl-package-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9837 (vhdl-scan-file-contents name (format "(%s/%s) " act-dir num-dir))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9838 ;; merge entities and corresponding architectures and configurations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9839 (let ((ent-alist (aget vhdl-entity-alist name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9840 (while ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9841 (let* ((ent-name (car (car ent-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9842 (ent-entry (cdr (car ent-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9843 (pro-ent-entry (aget pro-ent-alist ent-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9844 (aput 'pro-ent-alist ent-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9845 (list (or (nth 0 pro-ent-entry) (nth 0 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9846 (or (nth 1 pro-ent-entry) (nth 1 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9847 (append (nth 2 pro-ent-entry) (nth 2 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9848 (append (nth 3 pro-ent-entry) (nth 3 ent-entry))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9849 (setq ent-alist (cdr ent-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9850 ;; merge packages and corresponding package bodies |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9851 (let ((pack-alist (aget vhdl-package-alist name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9852 (while pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9853 (let* ((pack-name (car (car pack-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9854 (pack-entry (cdr (car pack-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9855 (pro-pack-entry (aget pro-pack-alist pack-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9856 (aput 'pro-pack-alist pack-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9857 (list (or (nth 0 pro-pack-entry) (nth 0 pack-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9858 (or (nth 1 pro-pack-entry) (nth 1 pack-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9859 (or (nth 2 pro-pack-entry) (nth 2 pack-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9860 (or (nth 3 pro-pack-entry) (nth 3 pack-entry))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9861 (setq pack-alist (cdr pack-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9862 ;; merge list of instantiated entities |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9863 (setq pro-ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9864 (append pro-ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9865 (copy-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9866 (car (aget vhdl-ent-inst-alist name))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9867 (setq dir-list (cdr dir-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9868 act-dir (1+ act-dir))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9869 ;; sort lists and put them into the caches |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9870 (when pro-ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9871 (aput 'vhdl-project-entity-alist project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9872 (sort pro-ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9873 (function (lambda (a b) (string-lessp (car a) (car b))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9874 (when pro-pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9875 (aput 'vhdl-project-package-alist project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9876 (sort pro-pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9877 (function (lambda (a b) (string-lessp (car a) (car b))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9878 (when pro-ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9879 (aput 'vhdl-project-ent-inst-list project pro-ent-inst-list)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9880 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9881 (defun vhdl-get-hierarchy (ent-name arch-name level indent &optional ent-hier) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9882 "Get instantiation hierarchy beginning in architecture ARCH-NAME of |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9883 entity ENT-NAME." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9884 (let* ((ent-alist (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9885 (aget vhdl-project-entity-alist vhdl-project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9886 (aget vhdl-entity-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9887 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9888 (file-name-as-directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9889 (speedbar-line-path (1- indent))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9890 (ent-entry (aget ent-alist ent-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9891 (arch-entry (if arch-name (aget (nth 2 ent-entry) arch-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9892 (cdr (car (last (nth 2 ent-entry)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9893 (inst-list (nth 2 arch-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9894 inst-entry inst-ent-entry inst-arch-entry hier-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9895 (when (= level 0) (message "Extract design hierarchy...")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9896 (when (member ent-name ent-hier) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9897 (error (format "Instantiation loop detected; component \"%s\" instantiates itself" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9898 ent-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9899 (while inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9900 (setq inst-entry (car inst-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9901 (setq inst-ent-entry (aget ent-alist (nth 3 inst-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9902 (setq inst-arch-entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9903 (if (nth 4 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9904 (cons (nth 4 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9905 (aget (nth 2 inst-ent-entry) (nth 4 inst-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9906 (car (last (nth 2 inst-ent-entry))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9907 (setq hier-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9908 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9909 hier-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9910 (cons (list (nth 0 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9911 (cons (nth 1 inst-entry) (nth 2 inst-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9912 (nth 3 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9913 (cons (nth 0 inst-ent-entry) (nth 1 inst-ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9914 (nth 0 inst-arch-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9915 (cons (nth 1 inst-arch-entry) (nth 2 inst-arch-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9916 level) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9917 (vhdl-get-hierarchy (nth 3 inst-entry) (nth 4 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9918 (1+ level) indent |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9919 (cons ent-name ent-hier))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9920 (setq inst-list (cdr inst-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9921 (when (= level 0) (message "Extract design hierarchy...done")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9922 hier-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9923 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9924 (defun vhdl-get-instantiations (ent-name indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9925 "Get all instantiations of entity ENT-NAME." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9926 (let ((ent-alist (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9927 (aget vhdl-project-entity-alist vhdl-project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9928 (aget vhdl-entity-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9929 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9930 (file-name-as-directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9931 (speedbar-line-path indent)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9932 arch-alist inst-alist ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9933 ent-entry arch-entry inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9934 (while ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9935 (setq ent-entry (car ent-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9936 (setq arch-alist (nth 3 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9937 (while arch-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9938 (setq arch-entry (car arch-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9939 (setq inst-alist (nth 3 arch-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9940 (while inst-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9941 (setq inst-entry (car inst-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9942 (when (equal ent-name (nth 3 inst-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9943 (setq ent-inst-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9944 (cons (list (nth 0 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9945 (cons (nth 1 inst-entry) (nth 2 inst-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9946 (nth 0 ent-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9947 (cons (nth 1 ent-entry) (nth 2 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9948 (nth 0 arch-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9949 (cons (nth 1 arch-entry) (nth 2 arch-entry))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9950 ent-inst-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9951 (setq inst-alist (cdr inst-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9952 (setq arch-alist (cdr arch-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9953 (setq ent-alist (cdr ent-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9954 (nreverse ent-inst-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9955 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9956 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9957 ;; Add hierarchy browser functionality to speedbar. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9958 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9959 (defvar vhdl-speedbar-key-map nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9960 "Keymap used when in the VHDL hierarchy browser mode.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9961 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9962 (defvar vhdl-speedbar-menu-items |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9963 '(["Edit Design Unit" speedbar-edit-line t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9964 ["Expand Hierarchy" speedbar-expand-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9965 (save-excursion (beginning-of-line) (looking-at "[0-9]+: *.\\+. "))] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9966 ["Contract Hierarchy" speedbar-contract-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9967 (save-excursion (beginning-of-line) (looking-at "[0-9]+: *.-. "))] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9968 ["Rescan Hierarchy" vhdl-speedbar-rescan-hierarchy t] |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9969 "--" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9970 ["Copy Port" vhdl-speedbar-port-copy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9971 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9972 (beginning-of-line) (looking-at "[0-9]+: *\\[[-+?]\\] "))]) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9973 "Additional menu-items to add to speedbar frame.") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9974 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9975 (defun vhdl-speedbar-initialize () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9976 "Initialize speedbar." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9977 ;; general settings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9978 ; (set (make-local-variable 'speedbar-tag-hierarchy-method) nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9979 ;; VHDL file extensions (extracted from `auto-mode-alist') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9980 (let ((mode-alist auto-mode-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9981 (while mode-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9982 (when (eq (cdr (car mode-alist)) 'vhdl-mode) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9983 (speedbar-add-supported-extension (car (car mode-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9984 (setq mode-alist (cdr mode-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9985 ;; hierarchy browser settings |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9986 (when (boundp 'speedbar-mode-functions-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9987 (speedbar-add-mode-functions-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9988 '("vhdl hierarchy" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9989 (speedbar-item-info . vhdl-speedbar-item-info) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9990 (speedbar-line-path . speedbar-files-line-path))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9991 (unless vhdl-speedbar-key-map |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9992 (setq vhdl-speedbar-key-map (speedbar-make-specialized-keymap)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9993 (define-key vhdl-speedbar-key-map "e" 'speedbar-edit-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9994 (define-key vhdl-speedbar-key-map "\C-m" 'speedbar-edit-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9995 (define-key vhdl-speedbar-key-map "+" 'speedbar-expand-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9996 (define-key vhdl-speedbar-key-map "-" 'speedbar-contract-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9997 (define-key vhdl-speedbar-key-map "s" 'vhdl-speedbar-rescan-hierarchy) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9998 (define-key vhdl-speedbar-key-map "c" 'vhdl-speedbar-port-copy)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
9999 (define-key speedbar-key-map "h" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10000 (lambda () (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10001 (speedbar-change-initial-expansion-list "vhdl hierarchy"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10002 (speedbar-add-expansion-list '("vhdl hierarchy" vhdl-speedbar-menu-items |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10003 vhdl-speedbar-key-map |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10004 vhdl-speedbar-display-hierarchy)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10005 (setq speedbar-stealthy-function-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10006 (cons '("vhdl hierarchy" vhdl-speedbar-update-current-unit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10007 speedbar-stealthy-function-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10008 (when vhdl-speedbar-show-hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10009 (setq speedbar-initial-expansion-list-name "vhdl hierarchy")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10010 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10011 (defun vhdl-speedbar (&optional arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10012 "Open/close speedbar." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10013 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10014 (if (not (fboundp 'speedbar)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10015 (error "WARNING: Speedbar is only available in newer Emacs versions") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10016 (condition-case () ; due to bug in `speedbar-el' v0.7.2a |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10017 (speedbar-frame-mode arg) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10018 (error (error "WARNING: Install included `speedbar.el' patch first"))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10019 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10020 ;; initialize speedbar for VHDL Mode |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10021 (if (not (boundp 'speedbar-frame)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10022 (add-hook 'speedbar-load-hook 'vhdl-speedbar-initialize) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10023 (vhdl-speedbar-initialize) |
24835
9b89e017d20a
(vhdl-port-copy): Fix parsing bug.
Karl Heuer <kwzh@gnu.org>
parents:
24732
diff
changeset
|
10024 (when speedbar-frame (speedbar-refresh))) |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10025 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10026 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10027 ;; Display functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10028 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10029 ;; macros must be defined in the file they are used (copied from `speedbar.el') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10030 (defmacro speedbar-with-writable (&rest forms) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10031 "Allow the buffer to be writable and evaluate FORMS." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10032 (list 'let '((inhibit-read-only t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10033 (cons 'progn forms))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10034 (put 'speedbar-with-writable 'lisp-indent-function 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10035 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10036 (defun vhdl-speedbar-display-hierarchy (directory depth &optional rescan) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10037 "Display directory and hierarchy information in speedbar." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10038 (setq directory (abbreviate-file-name (file-name-as-directory directory))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10039 (setq speedbar-last-selected-file nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10040 (speedbar-with-writable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10041 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10042 (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10043 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10044 ;; insert project title |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10045 (vhdl-speedbar-make-title-line "Project:" 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10046 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10047 (insert "p:") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10048 (put-text-property start (point) 'invisible t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10049 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10050 (insert vhdl-project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10051 (put-text-property start (point) 'face 'speedbar-directory-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10052 (insert-char ?\n 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10053 ;; scan and insert hierarchy of project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10054 (vhdl-speedbar-insert-project-hierarchy vhdl-project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10055 speedbar-power-click)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10056 ;; insert directory path |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10057 (speedbar-directory-buttons directory depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10058 ;; insert subdirectories |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10059 (vhdl-speedbar-insert-dirs (speedbar-file-lists directory) depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10060 ;; scan and insert hierarchy of current directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10061 (vhdl-speedbar-insert-dir-hierarchy directory depth |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10062 speedbar-power-click) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10063 ;; expand subdirectories |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10064 (when (= depth 0) (vhdl-speedbar-expand-dirs directory)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10065 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10066 (defun vhdl-speedbar-insert-hierarchy (ent-alist pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10067 ent-inst-list depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10068 "Insert hierarchy of ENT-ALIST and PACK-ALIST." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10069 (if (not (or ent-alist pack-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10070 (vhdl-speedbar-make-title-line "No design units!" depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10071 (let (ent-entry pack-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10072 ;; insert entities |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10073 (when ent-alist (vhdl-speedbar-make-title-line "Entities:" depth)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10074 (while ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10075 (setq ent-entry (car ent-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10076 (speedbar-make-tag-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10077 'bracket ?+ 'vhdl-speedbar-expand-entity (nth 0 ent-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10078 (nth 0 ent-entry) 'vhdl-speedbar-find-file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10079 (cons (nth 1 ent-entry) (nth 2 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10080 'vhdl-speedbar-entity-face depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10081 (when (not (member (nth 0 ent-entry) ent-inst-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10082 (end-of-line 0) (insert " (top)") (forward-char 1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10083 (setq ent-alist (cdr ent-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10084 ;; insert packages |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10085 (when pack-alist (vhdl-speedbar-make-title-line "Packages:" depth)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10086 (while pack-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10087 (setq pack-entry (car pack-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10088 (vhdl-speedbar-make-pack-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10089 (nth 0 pack-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10090 (cons (nth 1 pack-entry) (nth 2 pack-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10091 (cons (nth 3 pack-entry) (nth 4 pack-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10092 depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10093 (setq pack-alist (cdr pack-alist)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10094 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10095 (defun vhdl-speedbar-insert-project-hierarchy (project &optional rescan) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10096 "Insert hierarchy of project. Rescan directories if RESCAN is non-nil, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10097 otherwise use cached data of directories." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10098 (when (or rescan (and (not (assoc project vhdl-project-entity-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10099 (not (assoc project vhdl-project-package-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10100 (vhdl-scan-project-contents project rescan)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10101 ;; insert design hierarchy in speedbar |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10102 (vhdl-speedbar-insert-hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10103 (aget vhdl-project-entity-alist project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10104 (aget vhdl-project-package-alist project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10105 (aget vhdl-project-ent-inst-list project) 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10106 ;; expand design units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10107 (vhdl-speedbar-expand-units project)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10108 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10109 (defun vhdl-speedbar-insert-dir-hierarchy (directory depth &optional rescan) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10110 "Insert hierarchy of DIRECTORY. Rescan directory if RESCAN is non-nil, |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10111 otherwise use cached data." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10112 (when (or rescan (and (not (assoc directory vhdl-entity-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10113 (not (assoc directory vhdl-package-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10114 (vhdl-scan-file-contents directory)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10115 (vhdl-speedbar-insert-hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10116 (aget vhdl-entity-alist directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10117 (aget vhdl-package-alist directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10118 (car (aget vhdl-ent-inst-alist directory)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10119 depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10120 (vhdl-speedbar-expand-units directory)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10121 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10122 (defun vhdl-speedbar-rescan-hierarchy () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10123 "Rescan hierarchy for the directory under the cursor or the current project." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10124 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10125 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10126 ;; the current project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10127 ((vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10128 (vhdl-scan-project-contents vhdl-project t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10129 (speedbar-refresh)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10130 ;; the top-level directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10131 ((save-excursion (beginning-of-line) (looking-at "[^0-9]")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10132 (re-search-forward "[0-9]+:" nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10133 (vhdl-scan-file-contents (abbreviate-file-name (speedbar-line-path))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10134 (speedbar-refresh)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10135 ;; the current directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10136 (t (let ((path (speedbar-line-path))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10137 (string-match "^\\(.+/\\)" path) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10138 (vhdl-scan-file-contents (abbreviate-file-name (match-string 1 path))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10139 (speedbar-refresh))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10140 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10141 (defun vhdl-speedbar-expand-dirs (directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10142 "Expand subdirectories in DIRECTORY according to |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10143 `speedbar-shown-directories'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10144 ;; (nicked from `speedbar-default-directory-list') |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10145 (let ((sf (cdr (reverse speedbar-shown-directories)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10146 (setq speedbar-shown-directories |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10147 (list (expand-file-name default-directory))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10148 (while sf |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10149 (when (speedbar-goto-this-file (car sf)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10150 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10151 (when (looking-at "[0-9]+:\\s-*<") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10152 (goto-char (match-end 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10153 (let* ((position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10154 (directory (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10155 (file-name-as-directory (speedbar-line-file))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10156 (speedbar-do-function-pointer)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10157 (setq sf (cdr sf))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10158 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10159 (defun vhdl-speedbar-expand-units (directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10160 "Expand design units in DIRECTORY according to |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10161 `vhdl-speedbar-shown-units-alist'." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10162 (let ((ent-alist (aget vhdl-speedbar-shown-units-alist directory))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10163 (adelete 'vhdl-speedbar-shown-units-alist directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10164 (while ent-alist ; expand entities |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10165 (vhdl-speedbar-goto-this-unit directory (car (car ent-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10166 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10167 (let ((arch-alist (nth 1 (car ent-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10168 position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10169 (when (looking-at "[0-9]+:\\s-*\\[") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10170 (goto-char (match-end 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10171 (setq position (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10172 (speedbar-do-function-pointer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10173 (while arch-alist ; expand architectures |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10174 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10175 (when (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10176 (concat "[0-9]+:\\s-*\\(\\[\\|{.}\\s-+" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10177 (car arch-alist) "\\>\\)") nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10178 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10179 (when (looking-at "[0-9]+:\\s-*{") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10180 (goto-char (match-end 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10181 (speedbar-do-function-pointer))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10182 (setq arch-alist (cdr arch-alist)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10183 (setq ent-alist (cdr ent-alist)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10184 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10185 (defun vhdl-speedbar-expand-entity (text token indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10186 "Expand/contract the entity under the cursor." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10187 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10188 ((string-match "+" text) ; expand entity |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10189 (let* ((ent-alist (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10190 (aget vhdl-project-entity-alist vhdl-project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10191 (aget vhdl-entity-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10192 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10193 (file-name-as-directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10194 (speedbar-line-path indent)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10195 (arch-alist (nth 2 (aget ent-alist token))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10196 (conf-alist (nth 3 (aget ent-alist token))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10197 (inst-alist (vhdl-get-instantiations token indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10198 arch-entry conf-entry inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10199 (if (not (or arch-alist conf-alist inst-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10200 (speedbar-change-expand-button-char ??) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10201 (speedbar-change-expand-button-char ?-) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10202 ;; add entity to `vhdl-speedbar-shown-units-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10203 (let* ((directory (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10204 vhdl-project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10205 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10206 (file-name-as-directory (speedbar-line-path))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10207 (ent-alist (aget vhdl-speedbar-shown-units-alist directory))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10208 (aput 'ent-alist (speedbar-line-text) nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10209 (aput 'vhdl-speedbar-shown-units-alist directory ent-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10210 (speedbar-with-writable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10211 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10212 (end-of-line) (forward-char 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10213 ;; insert architectures |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10214 (when arch-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10215 (vhdl-speedbar-make-title-line "Architectures:" (1+ indent))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10216 (while arch-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10217 (setq arch-entry (car arch-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10218 (speedbar-make-tag-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10219 'curly ?+ 'vhdl-speedbar-expand-architecture |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10220 (cons token (nth 0 arch-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10221 (nth 0 arch-entry) 'vhdl-speedbar-find-file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10222 (cons (nth 1 arch-entry) (nth 2 arch-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10223 'vhdl-speedbar-architecture-face (1+ indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10224 (setq arch-alist (cdr arch-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10225 ;; insert configurations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10226 (when conf-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10227 (vhdl-speedbar-make-title-line "Configurations:" (1+ indent))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10228 (while conf-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10229 (setq conf-entry (car conf-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10230 (speedbar-make-tag-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10231 nil nil nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10232 (cons token (nth 0 conf-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10233 (nth 0 conf-entry) 'vhdl-speedbar-find-file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10234 (cons (nth 1 conf-entry) (nth 2 conf-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10235 'vhdl-speedbar-configuration-face (1+ indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10236 (setq conf-alist (cdr conf-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10237 ;; insert instantiations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10238 (when inst-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10239 (vhdl-speedbar-make-title-line "Instantiations:" (1+ indent))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10240 (while inst-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10241 (setq inst-entry (car inst-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10242 (vhdl-speedbar-make-inst-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10243 (nth 0 inst-entry) (nth 1 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10244 (nth 2 inst-entry) (nth 3 inst-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10245 (nth 4 inst-entry) (nth 5 inst-entry) (1+ indent) 0) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10246 (setq inst-alist (cdr inst-alist))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10247 (setq speedbar-last-selected-file nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10248 (save-excursion (speedbar-stealthy-updates))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10249 ((string-match "-" text) ; contract entity |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10250 (speedbar-change-expand-button-char ?+) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10251 ;; remove entity from `vhdl-speedbar-shown-units-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10252 (let* ((directory (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10253 vhdl-project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10254 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10255 (file-name-as-directory (speedbar-line-path))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10256 (ent-alist (aget vhdl-speedbar-shown-units-alist directory))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10257 (adelete 'ent-alist (speedbar-line-text)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10258 (if ent-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10259 (aput 'vhdl-speedbar-shown-units-alist directory ent-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10260 (adelete 'vhdl-speedbar-shown-units-alist directory))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10261 (speedbar-delete-subblock indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10262 (t (error "No architectures, configurations, nor instantiations exist for this entity"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10263 (speedbar-center-buffer-smartly)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10264 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10265 (defun vhdl-speedbar-expand-architecture (text token indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10266 "Expand/contract the architecture under the cursor." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10267 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10268 ((string-match "+" text) ; expand architecture |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10269 (let ((hier-alist (vhdl-get-hierarchy (car token) (cdr token) 0 indent))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10270 (if (not hier-alist) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10271 (speedbar-change-expand-button-char ??) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10272 (speedbar-change-expand-button-char ?-) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10273 ;; add architecture to `vhdl-speedbar-shown-units-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10274 (let* ((path (speedbar-line-path)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10275 (dummy (string-match "^\\(.+/\\)\\([^/ ]+\\)" path)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10276 (ent-name (match-string 2 path)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10277 (directory (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10278 vhdl-project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10279 (abbreviate-file-name (match-string 1 path)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10280 (ent-alist (aget vhdl-speedbar-shown-units-alist directory)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10281 (arch-alist (nth 0 (aget ent-alist ent-name t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10282 (aput 'ent-alist ent-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10283 (list (cons (speedbar-line-text) arch-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10284 (aput 'vhdl-speedbar-shown-units-alist directory ent-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10285 (speedbar-with-writable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10286 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10287 (end-of-line) (forward-char 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10288 ;; insert instance hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10289 (when hier-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10290 (vhdl-speedbar-make-title-line "Subcomponents:" (1+ indent))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10291 (while hier-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10292 (let ((entry (car hier-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10293 (vhdl-speedbar-make-inst-line |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10294 (nth 0 entry) (nth 1 entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10295 (nth 2 entry) (nth 3 entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10296 (nth 4 entry) (nth 5 entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10297 (1+ indent) (nth 6 entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10298 (setq hier-alist (cdr hier-alist)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10299 (setq speedbar-last-selected-file nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10300 (save-excursion (speedbar-stealthy-updates))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10301 ((string-match "-" text) ; contract architecture |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10302 (speedbar-change-expand-button-char ?+) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10303 ;; remove architecture from `vhdl-speedbar-shown-units-alist' |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10304 (let* ((path (speedbar-line-path)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10305 (dummy (string-match "^\\(.+/\\)\\([^/ ]+\\)" path)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10306 (ent-name (match-string 2 path)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10307 (directory (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10308 vhdl-project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10309 (abbreviate-file-name (match-string 1 path)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10310 (ent-alist (aget vhdl-speedbar-shown-units-alist directory)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10311 (arch-alist (nth 0 (aget ent-alist ent-name t)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10312 (aput 'ent-alist ent-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10313 (list (delete (speedbar-line-text) arch-alist))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10314 (aput 'vhdl-speedbar-shown-units-alist directory ent-alist)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10315 (speedbar-delete-subblock indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10316 (t (error "No component instantiations contained in this architecture"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10317 (speedbar-center-buffer-smartly)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10318 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10319 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10320 ;; Display help functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10321 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10322 (defun vhdl-speedbar-update-current-unit (&optional no-position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10323 "Highlight all design units that are contained in the current file. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10324 NO-POSITION non-nil means do not re-position cursor." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10325 (let ((last-frame (selected-frame)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10326 file-name position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10327 ;; get current file name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10328 (select-frame speedbar-attached-frame) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10329 (setq file-name (abbreviate-file-name (or (buffer-file-name) ""))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10330 (unless (equal file-name speedbar-last-selected-file) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10331 (select-frame speedbar-frame) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10332 (set-buffer speedbar-buffer) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10333 (speedbar-with-writable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10334 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10335 ;; unhighlight last units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10336 (let* ((file-entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10337 (aget vhdl-file-alist speedbar-last-selected-file))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10338 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10339 "\\[.\\]" (nth 0 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10340 speedbar-last-selected-file 'vhdl-speedbar-entity-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10341 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10342 "{.}" (nth 1 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10343 speedbar-last-selected-file 'vhdl-speedbar-architecture-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10344 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10345 ">" (nth 2 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10346 speedbar-last-selected-file 'vhdl-speedbar-configuration-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10347 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10348 ">" (nth 3 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10349 speedbar-last-selected-file 'vhdl-speedbar-package-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10350 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10351 ">" (nth 4 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10352 speedbar-last-selected-file 'vhdl-speedbar-instantiation-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10353 ;; highlight current units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10354 (let* ((file-entry (aget vhdl-file-alist file-name))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10355 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10356 "\\[.\\]" (nth 0 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10357 file-name 'vhdl-speedbar-entity-selected-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10358 (setq position (or position (point-marker))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10359 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10360 "{.}" (nth 1 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10361 file-name 'vhdl-speedbar-architecture-selected-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10362 (setq position (or position (point-marker))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10363 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10364 ">" (nth 2 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10365 file-name 'vhdl-speedbar-configuration-selected-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10366 (setq position (or position (point-marker))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10367 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10368 ">" (nth 3 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10369 file-name 'vhdl-speedbar-package-selected-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10370 (setq position (or position (point-marker))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10371 (vhdl-speedbar-update-units |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10372 ">" (nth 4 file-entry) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10373 file-name 'vhdl-speedbar-instantiation-selected-face)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10374 (setq position (or position (point-marker))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10375 ;; move speedbar so the first highlighted unit is visible |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10376 (when (and position (not no-position)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10377 (goto-char position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10378 (speedbar-center-buffer-smartly) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10379 (speedbar-position-cursor-on-line)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10380 (setq speedbar-last-selected-file file-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10381 (select-frame last-frame) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10382 t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10383 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10384 (defun vhdl-speedbar-update-units (text unit-list file-name face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10385 "Help function to highlight design units." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10386 (let (position) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10387 (while unit-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10388 (goto-char (point-min)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10389 (while (re-search-forward |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10390 (concat text " \\(" (car unit-list) "\\)\\>") nil t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10391 (when (equal file-name (car (get-text-property |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10392 (match-beginning 1) 'speedbar-token))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10393 (setq position (or position (point-marker))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10394 (put-text-property (match-beginning 1) (match-end 1) 'face face))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10395 (setq unit-list (cdr unit-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10396 (when position (goto-char position)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10397 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10398 (defun vhdl-speedbar-make-inst-line (inst-name inst-file-marker |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10399 ent-name ent-file-marker |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10400 arch-name arch-file-marker |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10401 depth offset) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10402 "Insert instantiation entry." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10403 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10404 (insert (int-to-string depth) ":") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10405 (put-text-property start (point) 'invisible t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10406 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10407 (insert-char ? (+ depth (* offset vhdl-speedbar-hierarchy-indent))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10408 (insert "> ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10409 (put-text-property start (point) 'invisible nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10410 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10411 (insert inst-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10412 (speedbar-make-button |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10413 start (point) 'vhdl-speedbar-instantiation-face 'speedbar-highlight-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10414 'vhdl-speedbar-find-file inst-file-marker) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10415 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10416 (insert ": ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10417 (put-text-property start (point) 'invisible nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10418 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10419 (insert ent-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10420 (speedbar-make-button |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10421 start (point) 'vhdl-speedbar-entity-face 'speedbar-highlight-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10422 'vhdl-speedbar-find-file ent-file-marker) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10423 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10424 (when arch-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10425 (insert " (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10426 (put-text-property start (point) 'invisible nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10427 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10428 (insert arch-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10429 (speedbar-make-button |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10430 start (point) 'vhdl-speedbar-architecture-face 'speedbar-highlight-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10431 'vhdl-speedbar-find-file arch-file-marker) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10432 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10433 (insert ")")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10434 (put-text-property start (point) 'invisible nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10435 (insert-char ?\n 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10436 (put-text-property (1- (point)) (point) 'invisible nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10437 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10438 (defun vhdl-speedbar-make-pack-line (pack-name pack-file-marker |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10439 body-file-marker depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10440 "Insert package entry." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10441 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10442 (insert (int-to-string depth) ":") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10443 (put-text-property start (point) 'invisible t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10444 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10445 (insert-char ? depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10446 (insert "> ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10447 (put-text-property start (point) 'invisible nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10448 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10449 (insert pack-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10450 (speedbar-make-button |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10451 start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10452 'vhdl-speedbar-find-file pack-file-marker) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10453 (when (car body-file-marker) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10454 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10455 (insert " (") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10456 (put-text-property start (point) 'invisible nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10457 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10458 (insert "body") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10459 (speedbar-make-button |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10460 start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10461 'vhdl-speedbar-find-file body-file-marker) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10462 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10463 (insert ")") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10464 (put-text-property start (point) 'invisible nil)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10465 (insert-char ?\n 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10466 (put-text-property (1- (point)) (point) 'invisible nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10467 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10468 (defun vhdl-speedbar-make-title-line (text depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10469 "Insert design unit title entry." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10470 (let ((start (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10471 (insert (int-to-string depth) ":") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10472 (put-text-property start (point) 'invisible t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10473 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10474 (insert-char ? depth) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10475 (put-text-property start (point) 'invisible nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10476 (setq start (point)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10477 (insert text) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10478 (speedbar-make-button start (point) nil nil nil nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10479 (insert-char ?\n 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10480 (put-text-property start (point) 'invisible nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10481 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10482 (defun vhdl-speedbar-insert-dirs (files level) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10483 "Insert subdirectories." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10484 (let ((dirs (car files))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10485 (while dirs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10486 (speedbar-make-tag-line 'angle ?+ 'vhdl-speedbar-dired (car dirs) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10487 (car dirs) 'speedbar-dir-follow nil |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10488 'speedbar-directory-face level) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10489 (setq dirs (cdr dirs))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10490 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10491 (defun vhdl-speedbar-dired (text token indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10492 "Speedbar click handler for directory expand button in hierarchy mode." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10493 (cond ((string-match "+" text) ; we have to expand this dir |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10494 (setq speedbar-shown-directories |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10495 (cons (expand-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10496 (concat (speedbar-line-path indent) token "/")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10497 speedbar-shown-directories)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10498 (speedbar-change-expand-button-char ?-) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10499 (speedbar-reset-scanners) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10500 (speedbar-with-writable |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10501 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10502 (end-of-line) (forward-char 1) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10503 (vhdl-speedbar-insert-dirs |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10504 (speedbar-file-lists |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10505 (concat (speedbar-line-path indent) token "/")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10506 (1+ indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10507 (speedbar-reset-scanners) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10508 (vhdl-speedbar-insert-dir-hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10509 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10510 (concat (speedbar-line-path indent) token "/")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10511 (1+ indent) speedbar-power-click))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10512 (setq speedbar-last-selected-file nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10513 (save-excursion (speedbar-stealthy-updates))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10514 ((string-match "-" text) ; we have to contract this node |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10515 (speedbar-reset-scanners) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10516 (let ((oldl speedbar-shown-directories) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10517 (newl nil) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10518 (td (expand-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10519 (concat (speedbar-line-path indent) token)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10520 (while oldl |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10521 (if (not (string-match (concat "^" (regexp-quote td)) (car oldl))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10522 (setq newl (cons (car oldl) newl))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10523 (setq oldl (cdr oldl))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10524 (setq speedbar-shown-directories (nreverse newl))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10525 (speedbar-change-expand-button-char ?+) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10526 (speedbar-delete-subblock indent)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10527 (t (error "Ooops... not sure what to do"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10528 (speedbar-center-buffer-smartly)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10529 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10530 (defun vhdl-speedbar-item-info () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10531 "Derive and display information about this line item." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10532 (save-excursion |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10533 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10534 ;; skip invisible number info |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10535 (when (looking-at "[0-9]+:") (goto-char (match-end 0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10536 (when (looking-at "p:") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10537 (message "Project \"%s\"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10538 (nth 0 (aget vhdl-project-alist vhdl-project)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10539 (cond |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10540 ;; directory entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10541 ((looking-at "\\s-*<[-+?]> ") (speedbar-files-item-info)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10542 ;; design unit entry |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10543 ((looking-at "\\s-*\\([[{][-+?][]}]\\|>\\) ") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10544 (goto-char (match-end 0)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10545 (let ((face (get-text-property (point) 'face))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10546 (message |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10547 "%s \"%s\" in \"%s\"" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10548 ;; design unit kind |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10549 (cond ((or (eq face 'vhdl-speedbar-entity-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10550 (eq face 'vhdl-speedbar-entity-selected-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10551 "Entity") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10552 ((or (eq face 'vhdl-speedbar-architecture-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10553 (eq face 'vhdl-speedbar-architecture-selected-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10554 "Architecture") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10555 ((or (eq face 'vhdl-speedbar-configuration-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10556 (eq face 'vhdl-speedbar-configuration-selected-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10557 "Configuration") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10558 ((or (eq face 'vhdl-speedbar-package-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10559 (eq face 'vhdl-speedbar-package-selected-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10560 "Package") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10561 ((or (eq face 'vhdl-speedbar-instantiation-face) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10562 (eq face 'vhdl-speedbar-instantiation-selected-face)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10563 "Instantiation") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10564 (t "")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10565 ;; design unit name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10566 (buffer-substring-no-properties |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10567 (point) (progn (looking-at"\\(\\w\\|_\\)+") (match-end 0))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10568 ;; file name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10569 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10570 (or (car (get-text-property (point) 'speedbar-token)) "?")))))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10571 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10572 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10573 ;; Help functions |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10574 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10575 (defun vhdl-get-subdirs (directory) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10576 "Recursively get subdirectories of DIRECTORY." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10577 (let ((dir-list (list (file-name-as-directory directory))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10578 subdir-list file-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10579 (setq file-list (vhdl-directory-files directory t "\\w.*")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10580 (while file-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10581 (when (file-directory-p (car file-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10582 (setq dir-list (append dir-list (vhdl-get-subdirs (car file-list))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10583 (setq file-list (cdr file-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10584 dir-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10585 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10586 (defun vhdl-resolve-paths (path-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10587 "Resolve environment variables and path wildcards in PATH-LIST." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10588 (let (path-list-1 path-list-2 path-list-3 path-beg path-end dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10589 ;; resolve environment variables |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10590 (while path-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10591 (setq dir (car path-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10592 (while (string-match "\\(.*\\)${?\\(\\(\\w\\|_\\)+\\)}?\\(.*\\)" dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10593 (setq dir (concat (match-string 1 dir) (getenv (match-string 2 dir)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10594 (match-string 4 dir)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10595 (setq path-list-1 (cons dir path-list-1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10596 (setq path-list (cdr path-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10597 ;; eliminate non-existent directories |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10598 (while path-list-1 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10599 (setq dir (car path-list-1)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10600 (string-match "\\(-r \\)?\\(\\([^?*]*/\\)*\\)" dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10601 (if (file-directory-p (match-string 2 dir)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10602 (setq path-list-2 (cons dir path-list-2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10603 (message "No such directory: \"%s\"" (match-string 2 dir))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10604 (setq path-list-1 (cdr path-list-1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10605 ;; resolve path wildcards |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10606 (while path-list-2 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10607 (setq dir (car path-list-2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10608 (if (string-match |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10609 "\\(-r \\)?\\(\\([^?*]*/\\)*\\)\\([^/]*[?*][^/]*\\)\\(/.*\\)" dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10610 (progn |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10611 (setq path-beg (match-string 1 dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10612 path-end (match-string 5 dir)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10613 (setq path-list-2 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10614 (append |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10615 (mapcar |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10616 (function |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10617 (lambda (var) (concat path-beg var path-end))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10618 (let ((all-list (vhdl-directory-files |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10619 (match-string 2 dir) t |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10620 (concat "\\<" (wildcard-to-regexp |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10621 (match-string 4 dir))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10622 dir-list) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10623 (while all-list |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10624 (when (file-directory-p (car all-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10625 (setq dir-list (cons (car all-list) dir-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10626 (setq all-list (cdr all-list))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10627 dir-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10628 (cdr path-list-2)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10629 (string-match "\\(-r \\)?\\(.*\\)/.*" dir) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10630 (when (file-directory-p (match-string 2 dir)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10631 (setq path-list-3 (cons dir path-list-3))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10632 (setq path-list-2 (cdr path-list-2)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10633 path-list-3)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10634 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10635 (defun vhdl-aappend (alist-symbol key value) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10636 "Append a key-value pair to an alist. |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10637 Similar to `aput' but moves the key-value pair to the tail of the alist." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10638 (let ((elem (aelement key value)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10639 (alist (adelete alist-symbol key))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10640 (set alist-symbol (append alist elem)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10641 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10642 (defun vhdl-speedbar-goto-this-unit (directory unit) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10643 "If UNIT is displayed in DIRECTORY, goto this line and return t, else nil." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10644 (let ((dest (point))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10645 (if (and (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10646 (progn (goto-char (point-min)) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10647 (speedbar-goto-this-file directory)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10648 (re-search-forward (concat "[]}] " unit "\\>") nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10649 (progn (speedbar-position-cursor-on-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10650 t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10651 (goto-char dest) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10652 nil))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10653 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10654 (defun vhdl-speedbar-find-file (text token indent) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10655 "When user clicks on TEXT, load file with name and position in TOKEN." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10656 (if (not (car token)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10657 (error "Design unit does not exist") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10658 (speedbar-find-file-in-frame (car token)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10659 (goto-line (cdr token)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10660 (recenter) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10661 (vhdl-speedbar-update-current-unit t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10662 (speedbar-set-timer speedbar-update-speed) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10663 (speedbar-maybee-jump-to-attached-frame))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10664 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10665 (defun vhdl-speedbar-toggle-hierarchy () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10666 "Toggle between hierarchy and file browsing mode." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10667 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10668 (if (not (boundp 'speedbar-mode-functions-list)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10669 (error "WARNING: Install included `speedbar.el' patch first") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10670 (if (equal speedbar-initial-expansion-list-name "vhdl hierarchy") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10671 (speedbar-change-initial-expansion-list "files") |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10672 (speedbar-change-initial-expansion-list "vhdl hierarchy")))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10673 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10674 (defun vhdl-speedbar-port-copy () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10675 "Copy the port of the entity under the cursor." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10676 (interactive) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10677 (beginning-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10678 (if (re-search-forward "\\([0-9]\\)+:\\s-*\\[[-+?]\\] \\(\\(\\w\\|\\s_\\)+\\)" |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10679 (save-excursion (end-of-line) (point)) t) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10680 (condition-case () |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10681 (let* ((indent (string-to-number (match-string 1))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10682 (ent-name (match-string 2)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10683 (ent-alist (if (vhdl-speedbar-project-p) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10684 (aget vhdl-project-entity-alist vhdl-project) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10685 (aget vhdl-entity-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10686 (abbreviate-file-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10687 (file-name-as-directory |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10688 (speedbar-line-path indent)))))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10689 (ent-entry (aget ent-alist ent-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10690 (file-name (nth 0 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10691 opened) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10692 ;; open file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10693 (if (find-buffer-visiting file-name) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10694 (set-buffer (file-name-nondirectory file-name)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10695 (set-buffer (find-file-noselect file-name nil t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10696 (modify-syntax-entry ?\- ". 12" (syntax-table)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10697 (modify-syntax-entry ?\n ">" (syntax-table)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10698 (modify-syntax-entry ?\^M ">" (syntax-table)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10699 (setq opened t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10700 ;; scan port |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10701 (goto-line (nth 1 ent-entry)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10702 (end-of-line) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10703 (vhdl-port-copy) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10704 ;; close file |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10705 (when opened (kill-buffer (current-buffer)))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10706 (error (error "Port not scanned successfully"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10707 (error "No entity on current line"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10708 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10709 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10710 ;; Fontification |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10711 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10712 (defface vhdl-speedbar-entity-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10713 '((((class color) (background light)) (:foreground "ForestGreen")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10714 (((class color) (background dark)) (:foreground "PaleGreen"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10715 "Face used for displaying entity names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10716 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10717 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10718 (defface vhdl-speedbar-architecture-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10719 '((((class color) (background light)) (:foreground "Blue")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10720 (((class color) (background dark)) (:foreground "LightSkyBlue"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10721 "Face used for displaying architecture names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10722 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10723 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10724 (defface vhdl-speedbar-configuration-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10725 '((((class color) (background light)) (:foreground "DarkGoldenrod")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10726 (((class color) (background dark)) (:foreground "Salmon"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10727 "Face used for displaying configuration names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10728 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10729 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10730 (defface vhdl-speedbar-package-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10731 '((((class color) (background light)) (:foreground "Grey50")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10732 (((class color) (background dark)) (:foreground "Grey80"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10733 "Face used for displaying package names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10734 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10735 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10736 (defface vhdl-speedbar-instantiation-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10737 '((((class color) (background light)) (:foreground "Brown")) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10738 (((class color) (background dark)) (:foreground "Yellow"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10739 "Face used for displaying instantiation names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10740 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10741 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10742 (defface vhdl-speedbar-entity-selected-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10743 '((((class color) (background light)) (:foreground "ForestGreen" :underline t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10744 (((class color) (background dark)) (:foreground "PaleGreen" :underline t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10745 "Face used for displaying entity names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10746 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10747 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10748 (defface vhdl-speedbar-architecture-selected-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10749 '((((class color) (background light)) (:foreground "Blue" :underline t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10750 (((class color) (background dark)) (:foreground "LightSkyBlue" :underline t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10751 "Face used for displaying architecture names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10752 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10753 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10754 (defface vhdl-speedbar-configuration-selected-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10755 '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10756 (((class color) (background dark)) (:foreground "Salmon" :underline t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10757 "Face used for displaying configuration names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10758 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10759 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10760 (defface vhdl-speedbar-package-selected-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10761 '((((class color) (background light)) (:foreground "Grey50" :underline t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10762 (((class color) (background dark)) (:foreground "Grey80" :underline t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10763 "Face used for displaying package names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10764 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10765 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10766 (defface vhdl-speedbar-instantiation-selected-face |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10767 '((((class color) (background light)) (:foreground "Brown" :underline t)) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10768 (((class color) (background dark)) (:foreground "Yellow" :underline t))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10769 "Face used for displaying instantiation names." |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10770 :group 'speedbar-faces) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10771 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10772 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10773 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10774 ;;; Bug reports |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10775 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 10776 ;; (using `reporter.el') |
10777 | |
10778 (defconst vhdl-mode-help-address "vhdl-mode@geocities.com" | |
10779 "Address for VHDL Mode bug reports.") | |
10780 | |
10781 (defun vhdl-version () | |
10782 "Echo the current version of VHDL Mode in the minibuffer." | |
10783 (interactive) | |
10784 (message "Using VHDL Mode version %s" vhdl-version) | |
10785 (vhdl-keep-region-active)) | |
10786 | |
10787 ;; get reporter-submit-bug-report when byte-compiling | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10788 (eval-when-compile |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10789 (require 'reporter)) |
20665 | 10790 |
10791 (defun vhdl-submit-bug-report () | |
10792 "Submit via mail a bug report on VHDL Mode." | |
10793 (interactive) | |
10794 ;; load in reporter | |
10795 (and | |
10796 (y-or-n-p "Do you want to submit a report on VHDL Mode? ") | |
10797 (require 'reporter) | |
10798 (reporter-submit-bug-report | |
10799 vhdl-mode-help-address | |
10800 (concat "VHDL Mode " vhdl-version) | |
10801 (list | |
10802 ;; report all important variables | |
10803 'vhdl-offsets-alist | |
10804 'vhdl-comment-only-line-offset | |
10805 'tab-width | |
10806 'vhdl-electric-mode | |
10807 'vhdl-stutter-mode | |
10808 'vhdl-indent-tabs-mode | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10809 'vhdl-project-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10810 'vhdl-project |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10811 'vhdl-compiler-alist |
20665 | 10812 'vhdl-compiler |
10813 'vhdl-compiler-options | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10814 'vhdl-standard |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10815 'vhdl-basic-offset |
20665 | 10816 'vhdl-upper-case-keywords |
10817 'vhdl-upper-case-types | |
10818 'vhdl-upper-case-attributes | |
10819 'vhdl-upper-case-enum-values | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10820 'vhdl-upper-case-constants |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10821 'vhdl-electric-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10822 'vhdl-optional-labels |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10823 'vhdl-insert-empty-lines |
20665 | 10824 'vhdl-argument-list-indent |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10825 'vhdl-association-list-with-formals |
20665 | 10826 'vhdl-conditions-in-parenthesis |
10827 'vhdl-zero-string | |
10828 'vhdl-one-string | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10829 'vhdl-file-header |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10830 'vhdl-file-footer |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10831 'vhdl-company-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10832 'vhdl-platform-spec |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10833 'vhdl-date-format |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10834 'vhdl-modify-date-prefix-string |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10835 'vhdl-modify-date-on-saving |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10836 'vhdl-reset-kind |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10837 'vhdl-reset-active-high |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10838 'vhdl-clock-rising-edge |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10839 'vhdl-clock-edge-condition |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10840 'vhdl-clock-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10841 'vhdl-reset-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10842 'vhdl-model-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10843 'vhdl-include-port-comments |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10844 'vhdl-include-direction-comments |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10845 'vhdl-actual-port-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10846 'vhdl-instance-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10847 'vhdl-testbench-entity-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10848 'vhdl-testbench-architecture-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10849 'vhdl-testbench-dut-name |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10850 'vhdl-testbench-entity-header |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10851 'vhdl-testbench-architecture-header |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10852 'vhdl-testbench-declarations |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10853 'vhdl-testbench-statements |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10854 'vhdl-testbench-initialize-signals |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10855 'vhdl-testbench-create-files |
20665 | 10856 'vhdl-self-insert-comments |
10857 'vhdl-prompt-for-comments | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10858 'vhdl-inline-comment-column |
20665 | 10859 'vhdl-end-comment-column |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10860 'vhdl-auto-align |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10861 'vhdl-align-groups |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10862 'vhdl-highlight-keywords |
20665 | 10863 'vhdl-highlight-names |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10864 'vhdl-highlight-special-words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10865 'vhdl-highlight-forbidden-words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10866 'vhdl-highlight-verilog-keywords |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10867 'vhdl-highlight-translate-off |
20665 | 10868 'vhdl-highlight-case-sensitive |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10869 'vhdl-special-syntax-alist |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10870 'vhdl-forbidden-words |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10871 'vhdl-forbidden-syntax |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10872 'vhdl-speedbar |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10873 'vhdl-speedbar-show-hierarchy |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10874 'vhdl-speedbar-hierarchy-indent |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10875 'vhdl-index-menu |
20665 | 10876 'vhdl-source-file-menu |
10877 'vhdl-hideshow-menu | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10878 'vhdl-hide-all-init |
20665 | 10879 'vhdl-print-two-column |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10880 'vhdl-print-customize-faces |
20665 | 10881 'vhdl-intelligent-tab |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10882 'vhdl-word-completion-case-sensitive |
20665 | 10883 'vhdl-word-completion-in-minibuffer |
10884 'vhdl-underscore-is-part-of-word | |
10885 'vhdl-mode-hook | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10886 'vhdl-startup-warnings) |
20665 | 10887 (function |
10888 (lambda () | |
10889 (insert | |
10890 (if vhdl-special-indent-hook | |
10891 (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" | |
10892 "vhdl-special-indent-hook is set to '" | |
10893 (format "%s" vhdl-special-indent-hook) | |
10894 ".\nPerhaps this is your problem?\n" | |
10895 "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n") | |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10896 "\n")))) |
20665 | 10897 nil |
24732
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10898 "Dear VHDL Mode maintainers,"))) |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10899 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10900 |
b2451ff2b19e
Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents:
23465
diff
changeset
|
10901 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
20665 | 10902 |
10903 (provide 'vhdl-mode) | |
10904 | |
10905 ;;; vhdl-mode.el ends here |