annotate lisp/progmodes/vhdl-mode.el @ 87008:888320f5e3f7

*** empty log message ***
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 03 Dec 2007 09:28:15 +0000
parents f873840f9fea
children e1c8546ca1d5 4bc33ffdda1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1 ;;; vhdl-mode.el --- major mode for editing VHDL code
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
74373
18704db78140 Fix Copyright format.
Glenn Morris <rgm@gnu.org>
parents: 73915
diff changeset
3 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 75143
diff changeset
4 ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6 ;; Authors: Reto Zimmermann <reto@gnu.org>
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7 ;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
8 ;; Maintainer: Reto Zimmermann <reto@gnu.org>
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9 ;; Keywords: languages vhdl
74373
18704db78140 Fix Copyright format.
Glenn Morris <rgm@gnu.org>
parents: 73915
diff changeset
10 ;; WWW: http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12 (defconst vhdl-version "3.33.6"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13 "VHDL Mode version number.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15 (defconst vhdl-time-stamp "2005-08-30"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16 "VHDL Mode time stamp for last update.")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; This file is part of GNU Emacs.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; GNU Emacs is free software; you can redistribute it and/or modify
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21 ;; it under the terms of the GNU General Public License as published by
78234
c1ec1c8a8d2e Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 77371
diff changeset
22 ;; the Free Software Foundation; either version 3, or (at your option)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
23 ;; any later version.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;; GNU Emacs is distributed in the hope that it will be useful,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28 ;; GNU General Public License for more details.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30 ;; You should have received a copy of the GNU General Public License
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
31 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 64064
diff changeset
32 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 64064
diff changeset
33 ;; Boston, MA 02110-1301, USA.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
34
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
35 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
36 ;;; Commentary:
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
38
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
39 ;; This package provides an Emacs major mode for editing VHDL code.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
40 ;; It includes the following features:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
41
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
42 ;; - Syntax highlighting
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
43 ;; - Indentation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
44 ;; - Template insertion (electrification)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
45 ;; - Insertion of file headers
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
46 ;; - Insertion of user-specified models
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
47 ;; - Port translation / testbench generation
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
48 ;; - Structural composition
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
49 ;; - Configuration generation
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
50 ;; - Sensitivity list updating
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
51 ;; - File browser
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
52 ;; - Design hierarchy browser
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
53 ;; - Source file compilation (syntax analysis)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
54 ;; - Makefile generation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
55 ;; - Code hiding
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
56 ;; - Word/keyword completion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
57 ;; - Block commenting
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
58 ;; - Code fixing/alignment/beautification
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
59 ;; - Postscript printing
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
60 ;; - VHDL'87/'93 and VHDL-AMS supported
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
61 ;; - Comprehensive menu
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
62 ;; - Fully customizable
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
63 ;; - Works under GNU Emacs (recommended) and XEmacs
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
64
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
65 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
66 ;; Documentation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
67
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
68 ;; See comment string of function `vhdl-mode' or type `C-c C-h' in Emacs.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
69
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
70 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
71 ;; Emacs Versions
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
72
64986
e6581ac8240c (vhdl-emacs-21): Set t for Emacs 21, 22, and so on.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64849
diff changeset
73 ;; supported: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
74 ;; tested on: GNU Emacs 20.4, XEmacs 21.1 (marginally)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
75
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
76 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
77 ;; Installation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
78
64986
e6581ac8240c (vhdl-emacs-21): Set t for Emacs 21, 22, and so on.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64849
diff changeset
79 ;; Prerequisites: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
80
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
81 ;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
82 ;; or into an arbitrary directory that is added to the load path by the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
83 ;; following line in your Emacs start-up file `.emacs':
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
84
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
85 ;; (setq load-path (cons (expand-file-name "<directory-name>") load-path))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
86
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
87 ;; If you already have the compiled `vhdl-mode.elc' file, put it in the same
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
88 ;; directory. Otherwise, byte-compile the source file:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
89 ;; Emacs: M-x byte-compile-file RET vhdl-mode.el RET
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
90 ;; Unix: emacs -batch -q -no-site-file -f batch-byte-compile vhdl-mode.el
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
91
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
92 ;; Add the following lines to the `site-start.el' file in the `site-lisp'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
93 ;; directory of your Emacs installation or to your Emacs start-up file `.emacs'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
94 ;; (not required in Emacs 20.X):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
95
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
96 ;; (autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
97 ;; (setq auto-mode-alist (cons '("\\.vhdl?\\'" . vhdl-mode) auto-mode-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
98
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
99 ;; More detailed installation instructions are included in the official
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
100 ;; VHDL Mode distribution.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
101
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
102 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
103 ;; Acknowledgements
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
104
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
105 ;; 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
106 ;; and Steve Grout.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
107
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
108 ;; Fontification approach suggested by Ken Wood <ken@eda.com.au>.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
109 ;; Ideas about alignment from John Wiegley <johnw@gnu.org>.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
110
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
111 ;; Many thanks to all the users who sent me bug reports and enhancement
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
112 ;; requests.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
113 ;; Thanks to Colin Marquardt for his serious beta testing, his innumerable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
114 ;; enhancement suggestions and the fruitful discussions.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
115 ;; 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
116 ;; Thanks to Ulf Klaperski for the indentation speedup hint.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
117
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
118 ;; 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
119 ;; Systems Laboratory, Swiss Federal Institute of Technology Zurich, for
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
120 ;; giving me the opportunity to develop this code.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
121 ;; 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
122 ;; of the Swiss Government.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
123
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
124 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
125
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
126 ;;; Code:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
127
64986
e6581ac8240c (vhdl-emacs-21): Set t for Emacs 21, 22, and so on.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64849
diff changeset
128 ;; Emacs 21+ handling
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
129 (defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not (featurep 'xemacs)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
130 "Non-nil if GNU Emacs 21, 22, ... is used.")
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
131 (defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not (featurep 'xemacs)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
132 "Non-nil if GNU Emacs 22, ... is used.")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
133
65241
9c07af802d9a (compilation-file-regexp-alist, itimer-version, lazy-lock-defer-contextually,
Juanma Barranquero <lekktu@gmail.com>
parents: 64986
diff changeset
134 (defvar compilation-file-regexp-alist)
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
135 (defvar conf-alist)
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
136 (defvar conf-entry)
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
137 (defvar conf-key)
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
138 (defvar ent-alist)
65241
9c07af802d9a (compilation-file-regexp-alist, itimer-version, lazy-lock-defer-contextually,
Juanma Barranquero <lekktu@gmail.com>
parents: 64986
diff changeset
139 (defvar itimer-version)
9c07af802d9a (compilation-file-regexp-alist, itimer-version, lazy-lock-defer-contextually,
Juanma Barranquero <lekktu@gmail.com>
parents: 64986
diff changeset
140 (defvar lazy-lock-defer-contextually)
9c07af802d9a (compilation-file-regexp-alist, itimer-version, lazy-lock-defer-contextually,
Juanma Barranquero <lekktu@gmail.com>
parents: 64986
diff changeset
141 (defvar lazy-lock-defer-on-scrolling)
9c07af802d9a (compilation-file-regexp-alist, itimer-version, lazy-lock-defer-contextually,
Juanma Barranquero <lekktu@gmail.com>
parents: 64986
diff changeset
142 (defvar lazy-lock-defer-on-the-fly)
65867
035abbbac402 (speedbar-attached-frame): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65809
diff changeset
143 (defvar speedbar-attached-frame)
035abbbac402 (speedbar-attached-frame): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65809
diff changeset
144
65241
9c07af802d9a (compilation-file-regexp-alist, itimer-version, lazy-lock-defer-contextually,
Juanma Barranquero <lekktu@gmail.com>
parents: 64986
diff changeset
145
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
146 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
147 ;;; Variables
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
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
150 ;; help function for user options
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
151 (defun vhdl-custom-set (variable value &rest functions)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
152 "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
153 (if (fboundp 'custom-set-default)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
154 (custom-set-default variable value)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
155 (set-default variable value))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
156 (while functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
157 (when (fboundp (car functions)) (funcall (car functions)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
158 (setq functions (cdr functions))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
159
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
160 (defun vhdl-widget-directory-validate (widget)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
161 "Check that the value of WIDGET is a valid directory entry (i.e. ends with
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
162 '/' or is empty)."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
163 (let ((val (widget-value widget)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
164 (unless (string-match "^\\(\\|.*/\\)$" val)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
165 (widget-put widget :error "Invalid directory entry: must end with '/'")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
166 widget)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
167
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
168 ;; help string for user options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
169 (defconst vhdl-name-doc-string "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
170
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
171 FROM REGEXP is a regular expression matching the original name:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
172 \".*\" matches the entire string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
173 \"\\(...\\)\" matches a substring
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
174 TO STRING specifies the string to be inserted as new name:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
175 \"\\&\" means substitute entire matched text
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
176 \"\\N\" means substitute what matched the Nth \"\\(...\\)\"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
177 Examples:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
178 \".*\" \"\\&\" inserts original string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
179 \".*\" \"\\&_i\" attaches \"_i\" to original string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
180 \"\\(.*\\)_[io]$\" \"\\1\" strips off \"_i\" or \"_o\" from original string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
181 \".*\" \"foo\" inserts constant string \"foo\"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
182 \".*\" \"\" inserts empty string")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
183
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
184 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
185 ;; User variables
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
186
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
187 (defgroup vhdl nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
188 "Customizations for VHDL Mode."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
189 :prefix "vhdl-"
21651
86fcccceba7b *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21466
diff changeset
190 :group 'languages
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
191 ; :version "21.2" ; comment out for XEmacs
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
192 )
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
193
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
194 (defgroup vhdl-mode nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
195 "Customizations for modes."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
196 :group 'vhdl)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
197
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
198 (defcustom vhdl-electric-mode t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
199 "*Non-nil enables electrification (automatic template generation).
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
200 If nil, template generators can still be invoked through key bindings and
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
201 menu. Is indicated in the modeline by \"/e\" after the mode name and can be
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
202 toggled by `\\[vhdl-electric-mode]'."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
203 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
204 :group 'vhdl-mode)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
205
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
206 (defcustom vhdl-stutter-mode t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
207 "*Non-nil enables stuttering.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
208 Is indicated in the modeline by \"/s\" after the mode name and can be toggled
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
209 by `\\[vhdl-stutter-mode]'."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
210 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
211 :group 'vhdl-mode)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
212
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
213 (defcustom vhdl-indent-tabs-mode nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
214 "*Non-nil means indentation can insert tabs.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
215 Overrides local variable `indent-tabs-mode'."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
216 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
217 :group 'vhdl-mode)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
218
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
219
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
220 (defgroup vhdl-compile nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
221 "Customizations for compilation."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
222 :group 'vhdl)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
223
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
224 (defcustom vhdl-compiler-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
225 '(
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
226 ;; Cadence Leapfrog: cv -file test.vhd
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
227 ;; duluth: *E,430 (test.vhd,13): identifier (POSITIV) is not declared
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
228 ("Cadence Leapfrog" "cv" "-work \\1 -file" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
229 nil "mkdir \\1" "./" "work/" "Makefile" "leapfrog"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
230 ("duluth: \\*E,[0-9]+ (\\(.+\\),\\([0-9]+\\)):" 1 2 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
231 ("\\1/entity" "\\2/\\1" "\\1/configuration"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
232 "\\1/package" "\\1/body" downcase))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
233 ;; Cadence Affirma NC vhdl: ncvhdl test.vhd
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
234 ;; ncvhdl_p: *E,IDENTU (test.vhd,13|25): identifier
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
235 ;; (PLL_400X_TOP) is not declared [10.3].
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
236 ("Cadence NC" "ncvhdl" "-work \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
237 nil "mkdir \\1" "./" "work/" "Makefile" "ncvhdl"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
238 ("ncvhdl_p: \\*E,\\w+ (\\(.+\\),\\([0-9]+\\)|\\([0-9]+\\)):" 1 2 3) ("" 0)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
239 ("\\1/entity/pc.db" "\\2/\\1/pc.db" "\\1/configuration/pc.db"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
240 "\\1/package/pc.db" "\\1/body/pc.db" downcase))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
241 ;; Ikos Voyager: analyze test.vhd
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
242 ;; analyze test.vhd
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
243 ;; E L4/C5: this library unit is inaccessible
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
244 ("Ikos" "analyze" "-l \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
245 nil "mkdir \\1" "./" "work/" "Makefile" "ikos"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
246 ("E L\\([0-9]+\\)/C\\([0-9]+\\):" 0 1 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
247 ("^analyze +\\(.+ +\\)*\\(.+\\)$" 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
248 nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
249 ;; ModelSim, Model Technology: vcom test.vhd
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
250 ;; ERROR: test.vhd(14): Unknown identifier: positiv
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
251 ;; WARNING[2]: test.vhd(85): Possible infinite loop
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
252 ;; ** Error: adder.vhd(190): Unknown identifier: ctl_numb
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
253 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
254 nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
255 ("\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*: \\(.+\\)(\\([0-9]+\\)):" 2 3 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
256 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
257 "\\1/_primary.dat" "\\1/body.dat" downcase))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
258 ;; ProVHDL, Synopsys LEDA: provhdl -w work -f test.vhd
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
259 ;; test.vhd:34: error message
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
260 ("LEDA ProVHDL" "provhdl" "-w \\1 -f" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
261 nil "mkdir \\1" "./" "work/" "Makefile" "provhdl"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
262 ("\\([^ \t\n]+\\):\\([0-9]+\\): " 1 2 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
263 ("ENTI/\\1.vif" "ARCH/\\1-\\2.vif" "CONF/\\1.vif"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
264 "PACK/\\1.vif" "BODY/BODY-\\1.vif" upcase))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
265 ;; QuickHDL, Mentor Graphics: qvhcom test.vhd
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
266 ;; ERROR: test.vhd(24): near "dnd": expecting: END
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
267 ;; WARNING[4]: test.vhd(30): A space is required between ...
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
268 ("QuickHDL" "qvhcom" "-work \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
269 nil "mkdir \\1" "./" "work/" "Makefile" "quickhdl"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
270 ("\\(ERROR\\|WARNING\\)[^:]*: \\(.+\\)(\\([0-9]+\\)):" 2 3 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
271 ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
272 "\\1/_primary.dat" "\\1/body.dat" downcase))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
273 ;; Savant: scram -publish-cc test.vhd
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
274 ;; test.vhd:87: _set_passed_through_out_port(IIR_Boolean) not defined for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
275 ("Savant" "scram" "-publish-cc -design-library-name \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
276 nil "mkdir \\1" "./" "work._savant_lib/" "Makefile" "savant"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
277 ("\\([^ \t\n]+\\):\\([0-9]+\\): " 1 2 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
278 ("\\1_entity.vhdl" "\\2_secondary_units._savant_lib/\\2_\\1.vhdl"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
279 "\\1_config.vhdl" "\\1_package.vhdl"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
280 "\\1_secondary_units._savant_lib/\\1_package_body.vhdl" downcase))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
281 ;; Simili: vhdlp -work test.vhd
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
282 ;; Error: CSVHDL0002: test.vhd: (line 97): Invalid prefix
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
283 ("Simili" "vhdlp" "-work \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
284 nil "mkdir \\1" "./" "work/" "Makefile" "simili"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
285 ("\\(Error\\|Warning\\): \\w+: \\(.+\\): (line \\([0-9]+\\)): " 2 3 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
286 ("\\1/prim.var" "\\2/_\\1.var" "\\1/prim.var"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
287 "\\1/prim.var" "\\1/_body.var" downcase))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
288 ;; Speedwave (Innoveda): analyze -libfile vsslib.ini -src test.vhd
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
289 ;; ERROR[11]::File test.vhd Line 100: Use of undeclared identifier
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
290 ("Speedwave" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
291 nil "mkdir \\1" "./" "work/" "Makefile" "speedwave"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
292 ("^ *ERROR\[[0-9]+\]::File \\(.+\\) Line \\([0-9]+\\):" 1 2 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
293 nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
294 ;; Synopsys, VHDL Analyzer (sim): vhdlan -nc test.vhd
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
295 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
296 ("Synopsys" "vhdlan" "-nc -work \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
297 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
298 ("\\*\\*Error: vhdlan,[0-9]+ \\(.+\\)(\\([0-9]+\\)):" 1 2 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
299 ("\\1.sim" "\\2__\\1.sim" "\\1.sim" "\\1.sim" "\\1__.sim" upcase))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
300 ;; Synopsys, VHDL Analyzer (syn): vhdlan -nc -spc test.vhd
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
301 ;; **Error: vhdlan,703 test.vhd(22): OTHERS is not legal in this context.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
302 ("Synopsys Design Compiler" "vhdlan" "-nc -spc -work \\1" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
303 nil "mkdir \\1" "./" "work/" "Makefile" "synopsys_dc"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
304 ("\\*\\*Error: vhdlan,[0-9]+ \\(.+\\)(\\([0-9]+\\)):" 1 2 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
305 ("\\1.syn" "\\2__\\1.syn" "\\1.syn" "\\1.syn" "\\1__.syn" upcase))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
306 ;; Synplify:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
307 ;; @W:"test.vhd":57:8:57:9|Optimizing register bit count_x(5) to a constant 0
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
308 ("Synplify" "n/a" "n/a" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
309 nil "mkdir \\1" "./" "work/" "Makefile" "synplify"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
310 ("@[EWN]:\"\\(.+\\)\":\\([0-9]+\\):\\([0-9]+\\):" 1 2 3) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
311 nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
312 ;; Vantage: analyze -libfile vsslib.ini -src test.vhd
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
313 ;; Compiling "test.vhd" line 1...
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
314 ;; **Error: LINE 49 *** No aggregate value is valid in this context.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
315 ("Vantage" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
316 nil "mkdir \\1" "./" "work/" "Makefile" "vantage"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
317 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
318 ("^ *Compiling \"\\(.+\\)\" " 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
319 nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
320 ;; VeriBest: vc vhdl test.vhd
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
321 ;; (no file name printed out!)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
322 ;; 32: Z <= A and BitA ;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
323 ;; ^^^^
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
324 ;; [Error] Name BITA is unknown
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
325 ("VeriBest" "vc" "vhdl" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
326 nil "mkdir \\1" "./" "work/" "Makefile" "veribest"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
327 ("^ +\\([0-9]+\\): +[^ ]" 0 1 0) ("" 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
328 nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
329 ;; Viewlogic: analyze -libfile vsslib.ini -src test.vhd
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
330 ;; Compiling "test.vhd" line 1...
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
331 ;; **Error: LINE 49 *** No aggregate value is valid in this context.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
332 ("Viewlogic" "analyze" "-libfile vsslib.ini -src" "make" "-f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
333 nil "mkdir \\1" "./" "work/" "Makefile" "viewlogic"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
334 ("\\*\\*Error: LINE \\([0-9]+\\) \\*\\*\\*" 0 1 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
335 ("^ *Compiling \"\\(.+\\)\" " 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
336 nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
337 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
338 "*List of available VHDL compilers and their properties.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
339 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
340 Compiler:
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
341 Compiler name : name used in option `vhdl-compiler' to choose compiler
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
342 Compile command : command used for source file compilation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
343 Compile options : compile options (\"\\1\" inserts library name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
344 Make command : command used for compilation using a Makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
345 Make options : make options (\"\\1\" inserts Makefile name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
346 Generate Makefile: use built-in function or command to generate a Makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
347 \(\"\\1\" inserts Makefile name, \"\\2\" inserts library name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
348 Library command : command to create library directory \(\"\\1\" inserts
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
349 library directory, \"\\2\" inserts library name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
350 Compile directory: where compilation is run and the Makefile is placed
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
351 Library directory: directory of default library
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
352 Makefile name : name of Makefile (default is \"Makefile\")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
353 ID string : compiler identification string (see `vhdl-project-alist')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
354 Error message:
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
355 Regexp : regular expression to match error messages (*)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
356 File subexp index: index of subexpression that matches the file name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
357 Line subexp index: index of subexpression that matches the line number
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
358 Column subexp idx: index of subexpression that matches the column number
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
359 File message:
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
360 Regexp : regular expression to match a file name message
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
361 File subexp index: index of subexpression that matches the file name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
362 Unit-to-file name mapping: mapping of library unit names to names of files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
363 generated by the compiler (used for Makefile generation)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
364 To string : string a name is mapped to (\"\\1\" inserts the unit name,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
365 \"\\2\" inserts the entity name for architectures)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
366 Case adjustment : adjust case of inserted unit names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
367
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
368 \(*) The regular expression must match the error message starting from the
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
369 beginning of the line (but not necessarily to the end of the line).
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
370
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
371 Compile options allows insertion of the library name (see `vhdl-project-alist')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
372 in order to set the compilers library option (e.g. \"vcom -work my_lib\").
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
373
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
374 For Makefile generation, the built-in function can be used (requires
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
375 specification of the unit-to-file name mapping). Alternatively, an
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
376 external command can be specified. Work directory allows specification of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
377 an alternative \"work\" library path (e.g. \"WORK/\" instead of \"work/\",
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
378 used for Makefile generation). To use another library name than \"work\",
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
379 customize `vhdl-project-alist'. The library command is inserted in Makefiles
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
380 to automatically create the library directory if not existent.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
381
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
382 Compile options, compile directory, library directory, and Makefile name are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
383 overwritten by the project settings if a project is defined (see
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
384 `vhdl-project-alist'). Directory paths are relative to the source file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
385 directory.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
386
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
387 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
388 out a file name message in advance. In this case, set \"File Subexp Index\"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
389 under \"Error Message\" to 0 and fill out the \"File Message\" entries.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
390 If no file name at all is printed out, set both \"File Message\" entries to 0
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
391 \(a default file name message will be printed out instead, does not work in
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
392 XEmacs).
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
393
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
394 A compiler is selected for syntax analysis (`\\[vhdl-compile]') by
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
395 assigning its name to option `vhdl-compiler'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
396
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
397 Please send any missing or erroneous compiler properties to the maintainer for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
398 updating.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
399
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
400 NOTE: Activate new error and file message regexps and reflect the new setting
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
401 in the choice list of option `vhdl-compiler' by restarting Emacs."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
402 :type '(repeat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
403 (list :tag "Compiler" :indent 2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
404 (string :tag "Compiler name ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
405 (string :tag "Compile command ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
406 (string :tag "Compile options " "-work \\1")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
407 (string :tag "Make command " "make")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
408 (string :tag "Make options " "-f \\1")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
409 (choice :tag "Generate Makefile "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
410 (const :tag "Built-in function" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
411 (string :tag "Command" "vmake \\2 > \\1"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
412 (string :tag "Library command " "mkdir \\1")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
413 (directory :tag "Compile directory "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
414 :validate vhdl-widget-directory-validate "./")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
415 (directory :tag "Library directory "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
416 :validate vhdl-widget-directory-validate "work/")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
417 (file :tag "Makefile name " "Makefile")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
418 (string :tag "ID string ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
419 (list :tag "Error message" :indent 4
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
420 (regexp :tag "Regexp ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
421 (integer :tag "File subexp index")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
422 (integer :tag "Line subexp index")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
423 (integer :tag "Column subexp idx"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
424 (list :tag "File message" :indent 4
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
425 (regexp :tag "Regexp ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
426 (integer :tag "File subexp index"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
427 (choice :tag "Unit-to-file name mapping"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
428 :format "%t: %[Value Menu%] %v\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
429 (const :tag "Not defined" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
430 (list :tag "To string" :indent 4
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
431 (string :tag "Entity " "\\1.vhd")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
432 (string :tag "Architecture " "\\2_\\1.vhd")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
433 (string :tag "Configuration " "\\1.vhd")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
434 (string :tag "Package " "\\1.vhd")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
435 (string :tag "Package Body " "\\1_body.vhd")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
436 (choice :tag "Case adjustment "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
437 (const :tag "None" identity)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
438 (const :tag "Upcase" upcase)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
439 (const :tag "Downcase" downcase))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
440 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
441 (vhdl-custom-set variable value 'vhdl-update-mode-menu))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
442 :group 'vhdl-compile)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
443
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
444 (defcustom vhdl-compiler "ModelSim"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
445 "*Specifies the VHDL compiler to be used for syntax analysis.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
446 Select a compiler name from the ones defined in option `vhdl-compiler-alist'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
447 :type (let ((alist vhdl-compiler-alist) list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
448 (while alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
449 (setq list (cons (list 'const (caar alist)) list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
450 (setq alist (cdr alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
451 (append '(choice) (nreverse list)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
452 :group 'vhdl-compile)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
453
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
454 (defcustom vhdl-compile-use-local-error-regexp t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
455 "*Non-nil means use buffer-local `compilation-error-regexp-alist'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
456 In this case, only error message regexps for VHDL compilers are active if
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
457 compilation is started from a VHDL buffer. Otherwise, the error message
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
458 regexps are appended to the predefined global regexps, and all regexps are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
459 active all the time. Note that by doing that, the predefined global regexps
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
460 might result in erroneous parsing of error messages for some VHDL compilers.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
461
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
462 NOTE: Activate the new setting by restarting Emacs."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
463 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
464 :group 'vhdl-compile)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
465
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
466 (defcustom vhdl-makefile-generation-hook nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
467 "*Functions to run at the end of Makefile generation.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
468 Allows to insert user specific parts into a Makefile.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
469
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
470 Example:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
471 \(lambda nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
472 \(re-search-backward \"^# Rule for compiling entire design\")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
473 \(insert \"# My target\\n\\n.MY_TARGET :\\n\\n\\n\"))"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
474 :type 'hook
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
475 :group 'vhdl-compile)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
476
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
477 (defcustom vhdl-default-library "work"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
478 "*Name of default library.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
479 Is overwritten by project settings if a project is active."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
480 :type 'string
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
481 :group 'vhdl-compile)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
482
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
483
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
484 (defgroup vhdl-project nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
485 "Customizations for projects."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
486 :group 'vhdl)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
487
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
488 (defcustom vhdl-project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
489 '(("Example 1" "Source files in two directories, custom library name, VHDL'87"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
490 "~/example1/" ("src/system/" "src/components/") ""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
491 (("ModelSim" "-87 \\2" "-f \\1 top_level" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
492 ("Synopsys" "-vhdl87 \\2" "-f \\1 top_level" ((".*/datapath/.*" . "-optimize \\3") (".*_tb\\.vhd" . nil))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
493 "lib/" "example3_lib" "lib/example3/" "Makefile_\\2" "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
494 ("Example 2" "Individual source files, multiple compilers in different directories"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
495 "$EXAMPLE2/" ("vhdl/system.vhd" "vhdl/component_*.vhd") ""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
496 nil "\\1/" "work" "\\1/work/" "Makefile" "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
497 ("Example 3" "Source files in a directory tree, multiple compilers in same directory"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
498 "/home/me/example3/" ("-r ./*/vhdl/") "/CVS/"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
499 nil "./" "work" "work-\\1/" "Makefile-\\1" "\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
500 -------------------------------------------------------------------------------
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
501 -- This is a multi-line project description
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
502 -- that can be used as a project dependent part of the file header.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
503 "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
504 "*List of projects and their properties.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
505 Name : name used in option `vhdl-project' to choose project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
506 Title : title of project (single-line string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
507 Default directory: default project directory (absolute path)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
508 Sources : a) source files : path + \"/\" + file name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
509 b) directory : path + \"/\"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
510 c) directory tree: \"-r \" + path + \"/\"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
511 Exclude regexp : matches file/directory names to be excluded as sources
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
512 Compile options : project-specific options for each compiler
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
513 Compiler name : name of compiler for which these options are valid
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
514 Compile options: project-specific compiler options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
515 (\"\\1\" inserts library name, \"\\2\" default options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
516 Make options: project-specific make options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
517 (\"\\1\" inserts Makefile name, \"\\2\" default options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
518 Exceptions : file-specific exceptions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
519 File name regexp: matches file names for which exceptions are valid
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
520 - Options : file-specific compiler options string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
521 (\"\\1\" inserts library name, \"\\2\" default options,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
522 \"\\3\" project-specific options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
523 - Do not compile: do not compile this file (in Makefile)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
524 Compile directory: where compilation is run and the Makefile is placed
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
525 \(\"\\1\" inserts compiler ID string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
526 Library name : name of library (default is \"work\")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
527 Library directory: path to library (\"\\1\" inserts compiler ID string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
528 Makefile name : name of Makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
529 (\"\\1\" inserts compiler ID string, \"\\2\" library name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
530 Description : description of project (multi-line string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
531
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
532 Project title and description are used to insert into the file header (see
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
533 option `vhdl-file-header').
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
534
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
535 The default directory must have an absolute path (use `M-TAB' for completion).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
536 All other paths can be absolute or relative to the default directory. All
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
537 paths must end with '/'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
538
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
539 The design units found in the sources (files and directories) are shown in the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
540 hierarchy browser. Path and file name can contain wildcards `*' and `?' as
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
541 well as \"./\" and \"../\" (\"sh\" syntax). Paths can also be absolute.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
542 Environment variables (e.g. \"$EXAMPLE2\") are resolved. If no sources are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
543 specified, the default directory is taken as source directory. Otherwise,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
544 the default directory is only taken as source directory if there is a sources
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
545 entry with the empty string or \"./\". Exclude regexp allows to filter out
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
546 specific file and directory names from the list of sources (e.g. CVS
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
547 directories).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
548
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
549 Files are compiled in the compile directory. Makefiles are also placed into
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
550 the compile directory. Library directory specifies which directory the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
551 compiler compiles into (used to generate the Makefile).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
552
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
553 Since different compile/library directories and Makefiles may exist for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
554 different compilers within one project, these paths and names allow the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
555 insertion of a compiler-dependent ID string (defined in `vhdl-compiler-alist').
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
556 Compile options, compile directory, library directory, and Makefile name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
557 overwrite the settings of the current compiler.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
558
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
559 File-specific compiler options (highest priority) overwrite project-specific
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
560 options which overwrite default options (lowest priority). Lower priority
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
561 options can be inserted in higher priority options. This allows to reuse
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
562 default options (e.g. \"-file\") in project- or file-specific options (e.g.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
563 \"-93 -file\").
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
564
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
565 NOTE: Reflect the new setting in the choice list of option `vhdl-project'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
566 by restarting Emacs."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
567 :type `(repeat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
568 (list :tag "Project" :indent 2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
569 (string :tag "Name ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
570 (string :tag "Title ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
571 (directory :tag "Default directory"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
572 :validate vhdl-widget-directory-validate
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
573 ,(abbreviate-file-name default-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
574 (repeat :tag "Sources " :indent 4
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
575 (directory :format " %v" "./"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
576 (regexp :tag "Exclude regexp ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
577 (repeat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
578 :tag "Compile options " :indent 4
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
579 (list :tag "Compiler" :indent 6
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
580 ,(let ((alist vhdl-compiler-alist) list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
581 (while alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
582 (setq list (cons (list 'const (caar alist)) list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
583 (setq alist (cdr alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
584 (append '(choice :tag "Compiler name")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
585 (nreverse list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
586 (string :tag "Compile options" "\\2")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
587 (string :tag "Make options " "\\2")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
588 (repeat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
589 :tag "Exceptions " :indent 8
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
590 (cons :format "%v"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
591 (regexp :tag "File name regexp ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
592 (choice :format "%[Value Menu%] %v"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
593 (string :tag "Options" "\\3")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
594 (const :tag "Do not compile" nil))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
595 (directory :tag "Compile directory"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
596 :validate vhdl-widget-directory-validate "./")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
597 (string :tag "Library name " "work")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
598 (directory :tag "Library directory"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
599 :validate vhdl-widget-directory-validate "work/")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
600 (file :tag "Makefile name " "Makefile")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
601 (string :tag "Description: (type `C-j' for newline)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
602 :format "%t\n%v\n")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
603 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
604 (vhdl-custom-set variable value
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
605 'vhdl-update-mode-menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
606 'vhdl-speedbar-refresh))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
607 :group 'vhdl-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
608
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
609 (defcustom vhdl-project nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
610 "*Specifies the default for the current project.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
611 Select a project name from the ones defined in option `vhdl-project-alist'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
612 Is used to determine the project title and description to be inserted in file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
613 headers and the source files/directories to be scanned in the hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
614 browser. The current project can also be changed temporarily in the menu."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
615 :type (let ((alist vhdl-project-alist) list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
616 (while alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
617 (setq list (cons (list 'const (caar alist)) list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
618 (setq alist (cdr alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
619 (append '(choice (const :tag "None" nil) (const :tag "--"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
620 (nreverse list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
621 :group 'vhdl-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
622
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
623 (defcustom vhdl-project-file-name '("\\1.prj")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
624 "*List of file names/paths for importing/exporting project setups.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
625 \"\\1\" is replaced by the project name (SPC is replaced by `_'), \"\\2\" is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
626 replaced by the user name (allows to have user-specific project setups).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
627 The first entry is used as file name to import/export individual project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
628 setups. All entries are used to automatically import project setups at
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
629 startup (see option `vhdl-project-auto-load'). Projects loaded from the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
630 first entry are automatically made current. Hint: specify local project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
631 setups in first entry, global setups in following entries; loading a local
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
632 project setup will make it current, while loading the global setups
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
633 is done without changing the current project.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
634 Names can also have an absolute path (i.e. project setups can be stored
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
635 in global directories)."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
636 :type '(repeat (string :tag "File name" "\\1.prj"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
637 :group 'vhdl-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
638
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
639 (defcustom vhdl-project-auto-load '(startup)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
640 "*Automatically load project setups from files.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
641 All project setup files that match the file names specified in option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
642 `vhdl-project-file-name' are automatically loaded. The project of the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
643 \(alphabetically) last loaded setup of the first `vhdl-project-file-name'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
644 entry is activated.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
645 A project setup file can be obtained by exporting a project (see menu).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
646 At startup: project setup file is loaded at Emacs startup"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
647 :type '(set (const :tag "At startup" startup))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
648 :group 'vhdl-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
649
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
650 (defcustom vhdl-project-sort t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
651 "*Non-nil means projects are displayed in alphabetical order."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
652 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
653 :group 'vhdl-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
654
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
655
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
656 (defgroup vhdl-style nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
657 "Customizations for coding styles."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
658 :group 'vhdl
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
659 :group 'vhdl-template
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
660 :group 'vhdl-port
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
661 :group 'vhdl-compose)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
662
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
663 (defcustom vhdl-standard '(87 nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
664 "*VHDL standards used.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
665 Basic standard:
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
666 VHDL'87 : IEEE Std 1076-1987
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
667 VHDL'93 : IEEE Std 1076-1993
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
668 Additional standards:
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
669 VHDL-AMS : IEEE Std 1076.1 (analog-mixed-signal)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
670 Math packages: IEEE Std 1076.2 (`math_real', `math_complex')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
671
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
672 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
673 \"Activate Options\"."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
674 :type '(list (choice :tag "Basic standard"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
675 (const :tag "VHDL'87" 87)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
676 (const :tag "VHDL'93" 93))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
677 (set :tag "Additional standards" :indent 2
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
678 (const :tag "VHDL-AMS" ams)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
679 (const :tag "Math packages" math)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
680 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
681 (vhdl-custom-set variable value
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
682 'vhdl-template-map-init
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
683 'vhdl-mode-abbrev-table-init
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
684 'vhdl-template-construct-alist-init
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
685 'vhdl-template-package-alist-init
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
686 'vhdl-update-mode-menu
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
687 'vhdl-words-init 'vhdl-font-lock-init))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
688 :group 'vhdl-style)
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-basic-offset 2
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
691 "*Amount of basic offset used for indentation.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
692 This value is used by + and - symbols in `vhdl-offsets-alist'."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
693 :type 'integer
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
694 :group 'vhdl-style)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
695
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
696 (defcustom vhdl-upper-case-keywords nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
697 "*Non-nil means convert keywords to upper case.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
698 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
699 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
700 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
701 (vhdl-custom-set variable value 'vhdl-abbrev-list-init))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
702 :group 'vhdl-style)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
703
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
704 (defcustom vhdl-upper-case-types nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
705 "*Non-nil means convert standardized types to upper case.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
706 This is done when expanded or by the fix case functions."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
707 :type 'boolean
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
708 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
709 (vhdl-custom-set variable value 'vhdl-abbrev-list-init))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
710 :group 'vhdl-style)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
711
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
712 (defcustom vhdl-upper-case-attributes nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
713 "*Non-nil means convert standardized attributes to upper case.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
714 This is done when expanded or by the fix case functions."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
715 :type 'boolean
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
716 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
717 (vhdl-custom-set variable value 'vhdl-abbrev-list-init))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
718 :group 'vhdl-style)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
719
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
720 (defcustom vhdl-upper-case-enum-values nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
721 "*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
722 This is done when expanded or by the fix case functions."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
723 :type 'boolean
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
724 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
725 (vhdl-custom-set variable value 'vhdl-abbrev-list-init))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
726 :group 'vhdl-style)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
727
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
728 (defcustom vhdl-upper-case-constants t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
729 "*Non-nil means convert standardized constants to upper case.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
730 This is done when expanded."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
731 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
732 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
733 (vhdl-custom-set variable value 'vhdl-abbrev-list-init))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
734 :group 'vhdl-style)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
735
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
736 (defcustom vhdl-use-direct-instantiation 'standard
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
737 "*Non-nil means use VHDL'93 direct component instantiation.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
738 Never : never
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
739 Standard: only in VHDL standards that allow it (VHDL'93 and higher)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
740 Always : always"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
741 :type '(choice (const :tag "Never" never)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
742 (const :tag "Standard" standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
743 (const :tag "Always" always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
744 :group 'vhdl-style)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
745
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
746
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
747 (defgroup vhdl-naming nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
748 "Customizations for naming conventions."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
749 :group 'vhdl)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
750
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
751 (defcustom vhdl-entity-file-name '(".*" . "\\&")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
752 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
753 "*Specifies how the entity file name is obtained.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
754 The entity file name can be obtained by modifying the entity name (e.g.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
755 attaching or stripping off a substring). The file extension is automatically
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
756 taken from the file name of the current buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
757 vhdl-name-doc-string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
758 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
759 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
760 :group 'vhdl-naming
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
761 :group 'vhdl-compose)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
762
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
763 (defcustom vhdl-architecture-file-name '("\\(.*\\) \\(.*\\)" . "\\1_\\2")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
764 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
765 "*Specifies how the architecture file name is obtained.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
766 The architecture file name can be obtained by modifying the entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
767 and/or architecture name (e.g. attaching or stripping off a substring). The
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
768 file extension is automatically taken from the file name of the current
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
769 buffer. The string that is matched against the regexp is the concatenation
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
770 of the entity and the architecture name separated by a space. This gives
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
771 access to both names (see default setting as example)."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
772 vhdl-name-doc-string)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
773 :type '(cons (regexp :tag "From regexp")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
774 (string :tag "To string "))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
775 :group 'vhdl-naming
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
776 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
777
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
778 (defcustom vhdl-configuration-file-name '(".*" . "\\&")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
779 (concat
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
780 "*Specifies how the configuration file name is obtained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
781 The configuration file name can be obtained by modifying the configuration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
782 name (e.g. attaching or stripping off a substring). The file extension is
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
783 automatically taken from the file name of the current buffer."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
784 vhdl-name-doc-string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
785 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
786 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
787 :group 'vhdl-naming
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
788 :group 'vhdl-compose)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
789
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
790 (defcustom vhdl-package-file-name '(".*" . "\\&")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
791 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
792 "*Specifies how the package file name is obtained.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
793 The package file name can be obtained by modifying the package name (e.g.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
794 attaching or stripping off a substring). The file extension is automatically
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
795 taken from the file name of the current buffer. Package files can be created
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
796 in a different directory by prepending a relative or absolute path to the
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
797 file name."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
798 vhdl-name-doc-string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
799 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
800 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
801 :group 'vhdl-naming
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
802 :group 'vhdl-compose)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
803
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
804 (defcustom vhdl-file-name-case 'identity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
805 "*Specifies how to change case for obtaining file names.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
806 When deriving a file name from a VHDL unit name, case can be changed as
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
807 follows:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
808 As Is: case is not changed (taken as is)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
809 Lower Case: whole name is changed to lower case
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
810 Upper Case: whole name is changed to upper case
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
811 Capitalize: first letter of each word in name is capitalized"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
812 :type '(choice (const :tag "As Is" identity)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
813 (const :tag "Lower Case" downcase)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
814 (const :tag "Upper Case" upcase)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
815 (const :tag "Capitalize" capitalize))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
816 :group 'vhdl-naming
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
817 :group 'vhdl-compose)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
818
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
819
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
820 (defgroup vhdl-template nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
821 "Customizations for electrification."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
822 :group 'vhdl)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
823
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
824 (defcustom vhdl-electric-keywords '(vhdl user)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
825 "*Type of keywords for which electrification is enabled.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
826 VHDL keywords: invoke built-in templates
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
827 User keywords: invoke user models (see option `vhdl-model-alist')"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
828 :type '(set (const :tag "VHDL keywords" vhdl)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
829 (const :tag "User model keywords" user))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
830 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
831 (vhdl-custom-set variable value 'vhdl-mode-abbrev-table-init))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
832 :group 'vhdl-template)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
833
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
834 (defcustom vhdl-optional-labels 'process
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
835 "*Constructs for which labels are to be queried.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
836 Template generators prompt for optional labels for:
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
837 None : no constructs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
838 Processes only: processes only (also procedurals in VHDL-AMS)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
839 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
840 :type '(choice (const :tag "None" none)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
841 (const :tag "Processes only" process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
842 (const :tag "All constructs" all))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
843 :group 'vhdl-template)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
844
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
845 (defcustom vhdl-insert-empty-lines 'unit
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
846 "*Specifies whether to insert empty lines in some templates.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
847 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
848 None : no constructs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
849 Design units only: entities, architectures, configurations, packages only
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
850 All constructs : also all constructs with BEGIN...END parts
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
851
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
852 Replaces option `vhdl-additional-empty-lines'."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
853 :type '(choice (const :tag "None" none)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
854 (const :tag "Design units only" unit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
855 (const :tag "All constructs" all))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
856 :group 'vhdl-template
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
857 :group 'vhdl-port
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
858 :group 'vhdl-compose)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
859
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
860 (defcustom vhdl-argument-list-indent nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
861 "*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
862 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
863 opening parenthesis and subsequent lines are indented accordingly.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
864 Otherwise, lists start on a new line and are indented as normal code."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
865 :type 'boolean
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
866 :group 'vhdl-template
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
867 :group 'vhdl-port
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
868 :group 'vhdl-compose)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
869
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
870 (defcustom vhdl-association-list-with-formals t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
871 "*Non-nil means write association lists with formal parameters.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
872 Templates prompt for formal and actual parameters (ports/generics).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
873 When pasting component instantiations, formals are included.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
874 If nil, only a list of actual parameters is entered."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
875 :type 'boolean
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
876 :group 'vhdl-template
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
877 :group 'vhdl-port
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
878 :group 'vhdl-compose)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
879
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
880 (defcustom vhdl-conditions-in-parenthesis nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
881 "*Non-nil means place parenthesis around condition expressions."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
882 :type 'boolean
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
883 :group 'vhdl-template)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
884
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
885 (defcustom vhdl-zero-string "'0'"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
886 "*String to use for a logic zero."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
887 :type 'string
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
888 :group 'vhdl-template)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
889
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
890 (defcustom vhdl-one-string "'1'"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
891 "*String to use for a logic one."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
892 :type 'string
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
893 :group 'vhdl-template)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
894
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
895
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
896 (defgroup vhdl-header nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
897 "Customizations for file header."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
898 :group 'vhdl-template
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
899 :group 'vhdl-compose)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
900
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
901 (defcustom vhdl-file-header "\
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
902 -------------------------------------------------------------------------------
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
903 -- Title : <title string>
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
904 -- Project : <project>
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
905 -------------------------------------------------------------------------------
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
906 -- File : <filename>
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
907 -- Author : <author>
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
908 -- Company : <company>
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
909 -- Created : <date>
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
910 -- Last update: <date>
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
911 -- Platform : <platform>
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
912 -- Standard : <standard>
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
913 <projectdesc>-------------------------------------------------------------------------------
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
914 -- Description: <cursor>
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
915 <copyright>-------------------------------------------------------------------------------
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
916 -- Revisions :
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
917 -- Date Version Author Description
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
918 -- <date> 1.0 <login>\tCreated
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
919 -------------------------------------------------------------------------------
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
920
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
921 "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
922 "*String or file to insert as file header.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
923 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
924 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
925 Type `C-j' for newlines.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
926 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
927 if the header needs to be version controlled.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
928
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
929 The following keywords for template generation are supported:
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
930 <filename> : replaced by the name of the buffer
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
931 <author> : replaced by the user name and email address
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
932 \(`user-full-name',`mail-host-address', `user-mail-address')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
933 <login> : replaced by user login name (`user-login-name')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
934 <company> : replaced by contents of option `vhdl-company-name'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
935 <date> : replaced by the current date
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
936 <year> : replaced by the current year
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
937 <project> : replaced by title of current project (`vhdl-project')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
938 <projectdesc> : replaced by description of current project (`vhdl-project')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
939 <copyright> : replaced by copyright string (`vhdl-copyright-string')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
940 <platform> : replaced by contents of option `vhdl-platform-spec'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
941 <standard> : replaced by the VHDL language standard(s) used
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
942 <... string> : replaced by a queried string (\"...\" is the prompt word)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
943 <title string>: replaced by file title in automatically generated files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
944 <cursor> : final cursor position
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
945
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
946 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
947 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
948 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
949 :group 'vhdl-header)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
950
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
951 (defcustom vhdl-file-footer ""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
952 "*String or file to insert as file footer.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
953 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
954 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
955 the end of the file).
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
956 Type `C-j' for newlines.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
957 The same keywords as in option `vhdl-file-header' can be used."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
958 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
959 :group 'vhdl-header)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
960
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
961 (defcustom vhdl-company-name ""
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
962 "*Name of company to insert in file header.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
963 See option `vhdl-file-header'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
964 :type 'string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
965 :group 'vhdl-header)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
966
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
967 (defcustom vhdl-copyright-string "\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
968 -------------------------------------------------------------------------------
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
969 -- Copyright (c) <year> <company>
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
970 "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
971 "*Copyright string to insert in file header.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
972 Can be multi-line string (type `C-j' for newline) and contain other file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
973 header keywords (see option `vhdl-file-header')."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
974 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
975 :group 'vhdl-header)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
976
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
977 (defcustom vhdl-platform-spec ""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
978 "*Specification of VHDL platform to insert in file header.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
979 The platform specification should contain names and versions of the
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
980 simulation and synthesis tools used.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
981 See option `vhdl-file-header'."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
982 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
983 :group 'vhdl-header)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
984
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
985 (defcustom vhdl-date-format "%Y-%m-%d"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
986 "*Specifies the date format to use in the header.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
987 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
988 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
989 `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
990 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
991 :group 'vhdl-header)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
992
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
993 (defcustom vhdl-modify-date-prefix-string "-- Last update: "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
994 "*Prefix string of modification date in VHDL file header.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
995 If actualization of the modification date is called (menu,
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
996 `\\[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
997 of the line replaced by the current date."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
998 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
999 :group 'vhdl-header)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1000
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1001 (defcustom vhdl-modify-date-on-saving t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1002 "*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
1003 Calls function `\\[vhdl-template-modify]').
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1004
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1005 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1006 \"Activate Options\"."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1007 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1008 :group 'vhdl-header)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1009
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1010
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1011 (defgroup vhdl-sequential-process nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1012 "Customizations for sequential processes."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1013 :group 'vhdl-template)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1014
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1015 (defcustom vhdl-reset-kind 'async
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1016 "*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
1017 :type '(choice (const :tag "None" none)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1018 (const :tag "Synchronous" sync)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1019 (const :tag "Asynchronous" async))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1020 :group 'vhdl-sequential-process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1021
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1022 (defcustom vhdl-reset-active-high nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1023 "*Non-nil means reset in sequential processes is active high.
73915
5b49e4f4dab8 (vhdl-reset-active-high, vhdl-clock-rising-edge): Improve previous doc
Glenn Morris <rgm@gnu.org>
parents: 73884
diff changeset
1024 Otherwise, reset is active low."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1025 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1026 :group 'vhdl-sequential-process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1027
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1028 (defcustom vhdl-clock-rising-edge t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1029 "*Non-nil means rising edge of clock triggers sequential processes.
73915
5b49e4f4dab8 (vhdl-reset-active-high, vhdl-clock-rising-edge): Improve previous doc
Glenn Morris <rgm@gnu.org>
parents: 73884
diff changeset
1030 Otherwise, falling edge triggers."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1031 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1032 :group 'vhdl-sequential-process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1033
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1034 (defcustom vhdl-clock-edge-condition 'standard
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1035 "*Syntax of the clock edge condition.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1036 Standard: \"clk'event and clk = '1'\"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1037 Function: \"rising_edge(clk)\""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1038 :type '(choice (const :tag "Standard" standard)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1039 (const :tag "Function" function))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1040 :group 'vhdl-sequential-process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1041
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1042 (defcustom vhdl-clock-name ""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1043 "*Name of clock signal to use in templates."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1044 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1045 :group 'vhdl-sequential-process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1046
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1047 (defcustom vhdl-reset-name ""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1048 "*Name of reset signal to use in templates."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1049 :type 'string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1050 :group 'vhdl-sequential-process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1051
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 (defgroup vhdl-model nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1054 "Customizations for user models."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1055 :group 'vhdl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1056
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1057 (defcustom vhdl-model-alist
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1058 '(("Example Model"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1059 "<label> : process (<clock>, <reset>)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1060 begin -- process <label>
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1061 if <reset> = '0' then -- asynchronous reset (active low)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1062 <cursor>
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1063 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
1064 if <enable> = '1' then -- synchronous load
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
1065
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1066 end if;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1067 end if;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1068 end process <label>;"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1069 "e" ""))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1070 "*List of user models.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1071 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
1072 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
1073 electrification (i.e. overriding existing or creating new keywords, see
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1074 option `vhdl-electric-keywords').
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1075 Name : name of model (string of words and spaces)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1076 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
1077 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
1078 (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
1079 Keyword : keyword to invoke model
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1080
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1081 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
1082 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
1083 the model. Special prompts are:
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1084 <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
1085 <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
1086 <cursor>: final cursor position
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1087 File header prompts (see variable `vhdl-file-header') are automatically
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1088 replaced, so that user models can also be used to insert different types of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1089 headers.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1090
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1091 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
1092 inserted, otherwise the string itself is inserted.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1093 The code within the models should be correctly indented.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1094 Type `C-j' for newlines.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1095
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1096 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1097 \"Activate Options\"."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1098 :type '(repeat (list :tag "Model" :indent 2
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1099 (string :tag "Name ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1100 (string :tag "String : (type `C-j' for newline)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1101 :format "%t\n%v")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1102 (sexp :tag "Key binding" x)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1103 (string :tag "Keyword " :format "%t: %v\n")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1104 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1105 (vhdl-custom-set variable value
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1106 'vhdl-model-map-init
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1107 'vhdl-model-defun
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1108 'vhdl-mode-abbrev-table-init
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1109 'vhdl-update-mode-menu))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1110 :group 'vhdl-model)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1111
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1112
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1113 (defgroup vhdl-compose nil
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1114 "Customizations for structural composition."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1115 :group 'vhdl)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1116
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1117 (defcustom vhdl-compose-architecture-name '(".*" . "str")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1118 (concat
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1119 "*Specifies how the component architecture name is obtained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1120 The component architecture name can be obtained by modifying the entity name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1121 \(e.g. attaching or stripping off a substring).
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1122 If TO STRING is empty, the architecture name is queried."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1123 vhdl-name-doc-string)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1124 :type '(cons (regexp :tag "From regexp")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1125 (string :tag "To string "))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1126 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1127
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1128 (defcustom vhdl-compose-configuration-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1129 '("\\(.*\\) \\(.*\\)" . "\\1_\\2_cfg")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1130 (concat
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1131 "*Specifies how the configuration name is obtained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1132 The configuration name can be obtained by modifying the entity and/or
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1133 architecture name (e.g. attaching or stripping off a substring). The string
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1134 that is matched against the regexp is the concatenation of the entity and the
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1135 architecture name separated by a space. This gives access to both names (see
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1136 default setting as example)."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1137 vhdl-name-doc-string)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1138 :type '(cons (regexp :tag "From regexp")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1139 (string :tag "To string "))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1140 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1141
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1142 (defcustom vhdl-components-package-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1143 '((".*" . "\\&_components") . "components")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1144 (concat
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1145 "*Specifies how the name for the components package is obtained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1146 The components package is a package containing all component declarations for
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
1147 the current design. Its name can be obtained by modifying the project name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1148 \(e.g. attaching or stripping off a substring). If no project is defined, the
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1149 DIRECTORY entry is chosen."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1150 vhdl-name-doc-string)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1151 :type '(cons (cons :tag "Project" :indent 2
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1152 (regexp :tag "From regexp")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1153 (string :tag "To string "))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1154 (string :tag "Directory:\n String "))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1155 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1156
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1157 (defcustom vhdl-use-components-package nil
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1158 "*Non-nil means use a separate components package for component declarations.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1159 Otherwise, component declarations are inserted and searched for in the
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1160 architecture declarative parts."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1161 :type 'boolean
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1162 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1163
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1164 (defcustom vhdl-compose-include-header t
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1165 "*Non-nil means include a header in automatically generated files."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1166 :type 'boolean
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1167 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1168
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1169 (defcustom vhdl-compose-create-files 'single
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1170 "*Specifies whether new files should be created for the new component.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1171 The component's entity and architecture are inserted:
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1172 None : in current buffer
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1173 Single file : in new single file
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1174 Separate files: in two separate files
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1175 The file names are obtained from variables `vhdl-entity-file-name' and
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1176 `vhdl-architecture-file-name'."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1177 :type '(choice (const :tag "None" none)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1178 (const :tag "Single file" single)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1179 (const :tag "Separate files" separate))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1180 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1181
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1182 (defcustom vhdl-compose-configuration-create-file nil
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1183 "*Specifies whether a new file should be created for the configuration.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1184 If non-nil, a new file is created for the configuration.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1185 The file name is obtained from variable `vhdl-configuration-file-name'."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1186 :type 'boolean
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1187 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1188
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1189 (defcustom vhdl-compose-configuration-hierarchical t
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1190 "*Specifies whether hierarchical configurations should be created.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1191 If non-nil, automatically created configurations are hierarchical and include
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1192 the whole hierarchy of subcomponents. Otherwise the configuration only
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1193 includes one level of subcomponents."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1194 :type 'boolean
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1195 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1196
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1197 (defcustom vhdl-compose-configuration-use-subconfiguration t
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1198 "*Specifies whether subconfigurations should be used inside configurations.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1199 If non-nil, automatically created configurations use configurations in binding
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1200 indications for subcomponents, if such configurations exist. Otherwise,
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1201 entities are used in binding indications for subcomponents."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1202 :type 'boolean
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1203 :group 'vhdl-compose)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1204
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1205
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1206 (defgroup vhdl-port nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1207 "Customizations for port translation functions."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1208 :group 'vhdl
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1209 :group 'vhdl-compose)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1210
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1211 (defcustom vhdl-include-port-comments nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1212 "*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
1213 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1214 :group 'vhdl-port)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1215
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1216 (defcustom vhdl-include-direction-comments nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1217 "*Non-nil means include port direction in instantiations as comments."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1218 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1219 :group 'vhdl-port)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1220
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1221 (defcustom vhdl-include-type-comments nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1222 "*Non-nil means include generic/port type in instantiations as comments."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1223 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1224 :group 'vhdl-port)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1225
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1226 (defcustom vhdl-include-group-comments 'never
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1227 "*Specifies whether to include group comments and spacings.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1228 The comments and empty lines between groups of ports are pasted:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1229 Never : never
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1230 Declarations: in entity/component/constant/signal declarations only
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1231 Always : also in generic/port maps"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1232 :type '(choice (const :tag "Never" never)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1233 (const :tag "Declarations" decl)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1234 (const :tag "Always" always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1235 :group 'vhdl-port)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1236
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1237 (defcustom vhdl-actual-port-name '(".*" . "\\&")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1238 (concat
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1239 "*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
1240 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
1241 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
1242 vhdl-name-doc-string)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1243 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1244 (string :tag "To string "))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1245 :group 'vhdl-port)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1246
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1247 (defcustom vhdl-instance-name '(".*" . "\\&_%d")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1248 (concat
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1249 "*Specifies how an instance name is obtained.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1250 The instance name can be obtained by modifying the name of the component to be
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1251 instantiated (e.g. attaching or stripping off a substring). \"%d\" is replaced
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1252 by a unique number (starting with 1).
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1253 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
1254 vhdl-name-doc-string)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1255 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1256 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1257 :group 'vhdl-port)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1258
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1259
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1260 (defgroup vhdl-testbench nil
64064
965579599592 (vhdl-testbench): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 63520
diff changeset
1261 "Customizations for testbench generation."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1262 :group 'vhdl-port)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1263
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1264 (defcustom vhdl-testbench-entity-name '(".*" . "\\&_tb")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1265 (concat
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1266 "*Specifies how the testbench entity name is obtained.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1267 The entity name of a testbench can be obtained by modifying the name of
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1268 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
1269 vhdl-name-doc-string)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1270 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1271 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1272 :group 'vhdl-testbench)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1273
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1274 (defcustom vhdl-testbench-architecture-name '(".*" . "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1275 (concat
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1276 "*Specifies how the testbench architecture name is obtained.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1277 The testbench architecture name can be obtained by modifying the name of
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1278 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
1279 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
1280 vhdl-name-doc-string)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1281 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1282 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1283 :group 'vhdl-testbench)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1284
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1285 (defcustom vhdl-testbench-configuration-name vhdl-compose-configuration-name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1286 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1287 "*Specifies how the testbench configuration name is obtained.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1288 The configuration name of a testbench can be obtained by modifying the entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1289 and/or architecture name (e.g. attaching or stripping off a substring). The
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1290 string that is matched against the regexp is the concatenation of the entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1291 and the architecture name separated by a space. This gives access to both
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1292 names (see default setting as example)."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1293 vhdl-name-doc-string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1294 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1295 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1296 :group 'vhdl-testbench)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1297
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1298 (defcustom vhdl-testbench-dut-name '(".*" . "DUT")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1299 (concat
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1300 "*Specifies how a DUT instance name is obtained.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1301 The design-under-test instance name (i.e. the component instantiated in the
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1302 testbench) can be obtained by modifying the component name (e.g. attaching
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1303 or stripping off a substring)."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1304 vhdl-name-doc-string)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1305 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1306 (string :tag "To string "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1307 :group 'vhdl-testbench)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1308
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1309 (defcustom vhdl-testbench-include-header t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1310 "*Non-nil means include a header in automatically generated files."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1311 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1312 :group 'vhdl-testbench)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1313
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1314 (defcustom vhdl-testbench-declarations "\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1315 -- clock
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1316 signal Clk : std_logic := '1';
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1317 "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1318 "*String or file to be inserted in the testbench declarative part.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1319 If the string specifies an existing file name, the contents of the file is
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1320 inserted, otherwise the string itself is inserted in the testbench
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1321 architecture before the BEGIN keyword.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1322 Type `C-j' for newlines."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1323 :type 'string
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1324 :group 'vhdl-testbench)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1325
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1326 (defcustom vhdl-testbench-statements "\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1327 -- clock generation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1328 Clk <= not Clk after 10 ns;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1329
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1330 -- waveform generation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1331 WaveGen_Proc: process
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1332 begin
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1333 -- insert signal assignments here
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
1334
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1335 wait until Clk = '1';
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1336 end process WaveGen_Proc;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1337 "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1338 "*String or file to be inserted in the testbench statement part.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1339 If the string specifies an existing file name, the contents of the file is
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1340 inserted, otherwise the string itself is inserted in the testbench
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1341 architecture before the END keyword.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1342 Type `C-j' for newlines."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1343 :type 'string
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1344 :group 'vhdl-testbench)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1345
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1346 (defcustom vhdl-testbench-initialize-signals nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1347 "*Non-nil means initialize signals with `0' when declared in testbench."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1348 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1349 :group 'vhdl-testbench)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1350
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1351 (defcustom vhdl-testbench-include-library t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1352 "*Non-nil means a library/use clause for std_logic_1164 is included."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1353 :type 'boolean
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1354 :group 'vhdl-testbench)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1355
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1356 (defcustom vhdl-testbench-include-configuration t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1357 "*Non-nil means a testbench configuration is attached at the end."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1358 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1359 :group 'vhdl-testbench)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1360
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1361 (defcustom vhdl-testbench-create-files 'single
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1362 "*Specifies whether new files should be created for the testbench.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1363 testbench entity and architecture are inserted:
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1364 None : in current buffer
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1365 Single file : in new single file
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1366 Separate files: in two separate files
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1367 The file names are obtained from variables `vhdl-testbench-entity-file-name'
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1368 and `vhdl-testbench-architecture-file-name'."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1369 :type '(choice (const :tag "None" none)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1370 (const :tag "Single file" single)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1371 (const :tag "Separate files" separate))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1372 :group 'vhdl-testbench)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1373
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1374 (defcustom vhdl-testbench-entity-file-name vhdl-entity-file-name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1375 (concat
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1376 "*Specifies how the testbench entity file name is obtained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1377 The entity file name can be obtained by modifying the testbench entity name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1378 \(e.g. attaching or stripping off a substring). The file extension is
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1379 automatically taken from the file name of the current buffer. Testbench
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1380 files can be created in a different directory by prepending a relative or
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1381 absolute path to the file name."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1382 vhdl-name-doc-string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1383 :type '(cons (regexp :tag "From regexp")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1384 (string :tag "To string "))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1385 :group 'vhdl-testbench)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1386
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1387 (defcustom vhdl-testbench-architecture-file-name vhdl-architecture-file-name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1388 (concat
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1389 "*Specifies how the testbench architecture file name is obtained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1390 The architecture file name can be obtained by modifying the testbench entity
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1391 and/or architecture name (e.g. attaching or stripping off a substring). The
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1392 string that is matched against the regexp is the concatenation of the entity
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1393 and the architecture name separated by a space. This gives access to both
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1394 names (see default setting as example). Testbench files can be created in
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1395 a different directory by prepending a relative or absolute path to the file
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1396 name."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1397 vhdl-name-doc-string)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1398 :type '(cons (regexp :tag "From regexp")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1399 (string :tag "To string "))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1400 :group 'vhdl-testbench)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1401
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1402
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1403 (defgroup vhdl-comment nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1404 "Customizations for comments."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1405 :group 'vhdl)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1406
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1407 (defcustom vhdl-self-insert-comments t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1408 "*Non-nil means various templates automatically insert help comments."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1409 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1410 :group 'vhdl-comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1411
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1412 (defcustom vhdl-prompt-for-comments t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1413 "*Non-nil means various templates prompt for user definable comments."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1414 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1415 :group 'vhdl-comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1416
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1417 (defcustom vhdl-inline-comment-column 40
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1418 "*Column to indent and align inline comments to.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1419 Overrides local option `comment-column'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1420
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1421 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1422 \"Activate Options\"."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1423 :type 'integer
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1424 :group 'vhdl-comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1425
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1426 (defcustom vhdl-end-comment-column 79
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1427 "*End of comment column.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1428 Comments that exceed this column number are wrapped.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1429
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1430 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1431 \"Activate Options\"."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1432 :type 'integer
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1433 :group 'vhdl-comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1434
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1435 (defvar end-comment-column)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1436
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1437
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1438 (defgroup vhdl-align nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1439 "Customizations for alignment."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1440 :group 'vhdl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1441
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1442 (defcustom vhdl-auto-align t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1443 "*Non-nil means align some templates automatically after generation."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1444 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1445 :group 'vhdl-align)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1446
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1447 (defcustom vhdl-align-groups t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1448 "*Non-nil means align groups of code lines separately.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1449 A group of code lines is a region of consecutive lines between two lines that
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1450 match the regexp in option `vhdl-align-group-separate'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1451 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1452 :group 'vhdl-align)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1453
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1454 (defcustom vhdl-align-group-separate "^\\s-*$"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1455 "*Regexp for matching a line that separates groups of lines for alignment.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1456 Examples:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1457 \"^\\s-*$\": matches an empty line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1458 \"^\\s-*\\(--.*\\)?$\": matches an empty line or a comment-only line"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1459 :type 'regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1460 :group 'vhdl-align)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1461
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1462 (defcustom vhdl-align-same-indent t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1463 "*Non-nil means align blocks with same indent separately.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1464 When a region or the entire buffer is aligned, the code is divided into
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1465 blocks of same indent which are aligned separately (except for argument/port
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1466 lists). This gives nicer alignment in most cases.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1467 Option `vhdl-align-groups' still applies within these blocks."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1468 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1469 :group 'vhdl-align)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1470
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1471
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1472 (defgroup vhdl-highlight nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1473 "Customizations for highlighting."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1474 :group 'vhdl)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1475
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1476 (defcustom vhdl-highlight-keywords t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1477 "*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
1478 The following faces are used:
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1479 `font-lock-keyword-face' : keywords
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1480 `font-lock-type-face' : standardized types
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1481 `vhdl-font-lock-attribute-face': standardized attributes
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1482 `vhdl-font-lock-enumvalue-face': standardized enumeration values
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1483 `vhdl-font-lock-function-face' : standardized function and package names
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1484
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1485 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1486 entry \"Fontify Buffer\")."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1487 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1488 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1489 (vhdl-custom-set variable value 'vhdl-font-lock-init))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1490 :group 'vhdl-highlight)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1491
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1492 (defcustom vhdl-highlight-names t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1493 "*Non-nil means highlight declaration names and construct labels.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1494 The following faces are used:
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1495 `font-lock-function-name-face' : names in declarations of units,
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1496 subprograms, components, as well as labels of VHDL constructs
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1497 `font-lock-type-face' : names in type/nature declarations
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1498 `vhdl-font-lock-attribute-face': names in attribute declarations
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1499 `font-lock-variable-name-face' : names in declarations of signals,
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1500 variables, constants, subprogram parameters, generics, and ports
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1501
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1502 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1503 entry \"Fontify Buffer\")."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1504 :type 'boolean
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1505 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1506 (vhdl-custom-set variable value 'vhdl-font-lock-init))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1507 :group 'vhdl-highlight)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1508
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1509 (defcustom vhdl-highlight-special-words nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1510 "*Non-nil means highlight words with special syntax.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1511 The words with syntax and color specified in option `vhdl-special-syntax-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1512 are highlighted accordingly.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1513 Can be used for visual support of naming conventions.
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 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1516 entry \"Fontify Buffer\")."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1517 :type 'boolean
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1518 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1519 (vhdl-custom-set variable value 'vhdl-font-lock-init))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1520 :group 'vhdl-highlight)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1521
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1522 (defcustom vhdl-highlight-forbidden-words nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1523 "*Non-nil means highlight forbidden words.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1524 The reserved words specified in option `vhdl-forbidden-words' or having the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1525 syntax specified in option `vhdl-forbidden-syntax' are highlighted in a
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1526 warning color (face `vhdl-font-lock-reserved-words-face') to indicate not to
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1527 use them.
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 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1530 entry \"Fontify Buffer\")."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1531 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1532 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1533 (vhdl-custom-set variable value
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1534 'vhdl-words-init 'vhdl-font-lock-init))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1535 :group 'vhdl-highlight)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1536
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1537 (defcustom vhdl-highlight-verilog-keywords nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1538 "*Non-nil means highlight Verilog keywords as reserved words.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1539 Verilog keywords are highlighted in a warning color (face
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1540 `vhdl-font-lock-reserved-words-face') to indicate not to use them.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1541
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1542 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1543 entry \"Fontify Buffer\")."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1544 :type 'boolean
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1545 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1546 (vhdl-custom-set variable value
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1547 'vhdl-words-init 'vhdl-font-lock-init))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1548 :group 'vhdl-highlight)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1549
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1550 (defcustom vhdl-highlight-translate-off nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1551 "*Non-nil means background-highlight code excluded from translation.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1552 That is, all code between \"-- pragma translate_off\" and
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1553 \"-- pragma translate_on\" is highlighted using a different background color
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1554 \(face `vhdl-font-lock-translate-off-face').
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1555 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
1556
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1557 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1558 entry \"Fontify Buffer\")."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1559 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1560 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1561 (vhdl-custom-set variable value 'vhdl-font-lock-init))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1562 :group 'vhdl-highlight)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1563
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1564 (defcustom vhdl-highlight-case-sensitive nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1565 "*Non-nil means consider case for highlighting.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1566 Possible trade-off:
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1567 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
1568 special syntax is not considered
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1569 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
1570 special syntax is considered
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1571 Overrides local option `font-lock-keywords-case-fold-search'.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1572
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1573 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1574 entry \"Fontify Buffer\")."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1575 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1576 :group 'vhdl-highlight)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1577
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1578 (defcustom vhdl-special-syntax-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1579 '(("generic/constant" "\\w+_[cg]" "Gold3" "BurlyWood1")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1580 ("type" "\\w+_t" "ForestGreen" "PaleGreen")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1581 ("variable" "\\w+_v" "Grey50" "Grey80"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1582 "*List of special syntax to be highlighted.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1583 If option `vhdl-highlight-special-words' is non-nil, words with the specified
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1584 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
1585
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1586 Name : string of words and spaces
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1587 Regexp : regular expression describing word syntax
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1588 (e.g. \"\\\w+_c\" matches word with suffix \"_c\")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1589 Color (light): foreground color for light background
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1590 (matching color examples: Gold3, Grey50, LimeGreen, Tomato,
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1591 LightSeaGreen, DodgerBlue, Gold, PaleVioletRed)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1592 Color (dark) : foreground color for dark background
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1593 (matching color examples: BurlyWood1, Grey80, Green, Coral,
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1594 AquaMarine2, LightSkyBlue1, Yellow, PaleVioletRed1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1595
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1596 Can be used for visual support of naming conventions, such as highlighting
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1597 different kinds of signals (e.g. \"Clk50\", \"Rst_n\") or objects (e.g.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1598 \"Signal_s\", \"Variable_v\", \"Constant_c\") by distinguishing them using
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1599 common substrings or name suffices.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1600 For each entry, a new face is generated with the specified colors and name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1601 \"vhdl-font-lock-\" + name + \"-face\".
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1602
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1603 NOTE: Activate a changed regexp in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1604 entry \"Fontify Buffer\"). All other changes require restarting Emacs."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1605 :type '(repeat (list :tag "Face" :indent 2
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1606 (string :tag "Name ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1607 (regexp :tag "Regexp " "\\w+_")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1608 (string :tag "Color (light)")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1609 (string :tag "Color (dark) ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1610 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1611 (vhdl-custom-set variable value 'vhdl-font-lock-init))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1612 :group 'vhdl-highlight)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1613
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1614 (defcustom vhdl-forbidden-words '()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1615 "*List of forbidden words to be highlighted.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1616 If option `vhdl-highlight-forbidden-words' is non-nil, these reserved
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1617 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
1618
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1619 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1620 entry \"Fontify Buffer\")."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1621 :type '(repeat (string :format "%v"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1622 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1623 (vhdl-custom-set variable value
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1624 'vhdl-words-init 'vhdl-font-lock-init))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1625 :group 'vhdl-highlight)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1626
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1627 (defcustom vhdl-forbidden-syntax ""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1628 "*Syntax of forbidden words to be highlighted.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1629 If option `vhdl-highlight-forbidden-words' is non-nil, words with this
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1630 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
1631 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
1632 highlights identifiers with 10 or more characters).
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 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1635 entry \"Fontify Buffer\")."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1636 :type 'regexp
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1637 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1638 (vhdl-custom-set variable value
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1639 'vhdl-words-init 'vhdl-font-lock-init))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1640 :group 'vhdl-highlight)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1641
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1642 (defcustom vhdl-directive-keywords '("pragma" "synopsys")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1643 "*List of compiler directive keywords recognized for highlighting.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1644
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1645 NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1646 entry \"Fontify Buffer\")."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1647 :type '(repeat (string :format "%v"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1648 :set (lambda (variable value)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1649 (vhdl-custom-set variable value
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1650 'vhdl-words-init 'vhdl-font-lock-init))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1651 :group 'vhdl-highlight)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1652
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1653
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1654 (defgroup vhdl-speedbar nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1655 "Customizations for speedbar."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1656 :group 'vhdl)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1657
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1658 (defcustom vhdl-speedbar-auto-open nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1659 "*Non-nil means automatically open speedbar at startup.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1660 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
1661 :type 'boolean
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1662 :group 'vhdl-speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1663
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1664 (defcustom vhdl-speedbar-display-mode 'files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1665 "*Specifies the default displaying mode when opening speedbar.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1666 Alternatively, the displaying mode can be selected from the speedbar menu or
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1667 by typing `f' (files), `h' (directory hierarchy) or `H' (project hierarchy)."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1668 :type '(choice (const :tag "Files" files)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1669 (const :tag "Directory hierarchy" directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1670 (const :tag "Project hierarchy" project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1671 :group 'vhdl-speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1672
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1673 (defcustom vhdl-speedbar-scan-limit '(10000000 (1000000 50))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1674 "*Limits scanning of large files and netlists.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1675 Design units: maximum file size to scan for design units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1676 Hierarchy (instances of subcomponents):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1677 File size: maximum file size to scan for instances (in bytes)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1678 Instances per arch: maximum number of instances to scan per architecture
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1679
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1680 \"None\" always means that there is no limit.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1681 In case of files not or incompletely scanned, a warning message and the file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1682 names are printed out.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1683 Background: scanning for instances is considerably slower than scanning for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1684 design units, especially when there are many instances. These limits should
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1685 prevent the scanning of large netlists."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1686 :type '(list (choice :tag "Design units"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1687 :format "%t : %[Value Menu%] %v"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1688 (const :tag "None" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1689 (integer :tag "File size"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1690 (list :tag "Hierarchy" :indent 2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1691 (choice :tag "File size"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1692 :format "%t : %[Value Menu%] %v"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1693 (const :tag "None" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1694 (integer :tag "Size "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1695 (choice :tag "Instances per arch"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1696 (const :tag "None" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1697 (integer :tag "Number "))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1698 :group 'vhdl-speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1699
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1700 (defcustom vhdl-speedbar-jump-to-unit t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1701 "*Non-nil means jump to the design unit code when opened in a buffer.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1702 The buffer cursor position is left unchanged otherwise."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1703 :type 'boolean
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1704 :group 'vhdl-speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1705
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1706 (defcustom vhdl-speedbar-update-on-saving t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1707 "*Automatically update design hierarchy when buffer is saved."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1708 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1709 :group 'vhdl-speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1710
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1711 (defcustom vhdl-speedbar-save-cache '(hierarchy display)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1712 "*Automatically save modified hierarchy caches when exiting Emacs.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1713 Hierarchy: design hierarchy information
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1714 Display: displaying information (which design units to expand)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1715 :type '(set (const :tag "Hierarchy" hierarchy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1716 (const :tag "Display" display))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1717 :group 'vhdl-speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1718
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1719 (defcustom vhdl-speedbar-cache-file-name ".emacs-vhdl-cache-\\1-\\2"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1720 "*Name of file for saving hierarchy cache.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1721 \"\\1\" is replaced by the project name if a project is specified,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1722 \"directory\" otherwise. \"\\2\" is replaced by the user name (allows for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1723 different users to have cache files in the same directory). Can also have
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1724 an absolute path (i.e. all caches can be stored in one global directory)."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1725 :type 'string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1726 :group 'vhdl-speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1727
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1728
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1729 (defgroup vhdl-menu nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1730 "Customizations for menues."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1731 :group 'vhdl)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1733 (defcustom vhdl-index-menu nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1734 "*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
1735 Alternatively, the speedbar can be used. Note that the index menu scans a file
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1736 when it is opened, while speedbar only scans the file upon request."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1737 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1738 :group 'vhdl-menu)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1739
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1740 (defcustom vhdl-source-file-menu nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1741 "*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
1742 Alternatively, the speedbar can be used."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1743 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1744 :group 'vhdl-menu)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1745
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1746 (defcustom vhdl-hideshow-menu nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1747 "*Non-nil means add hideshow menu and functionality at startup.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1748 Hideshow can also be enabled from the VHDL Mode menu.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1749 Hideshow allows hiding code of various VHDL constructs.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1750
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1751 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1752 \"Activate Options\"."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1753 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1754 :group 'vhdl-menu)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1755
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1756 (defcustom vhdl-hide-all-init nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1757 "*Non-nil means hide all design units initially after a file is loaded."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1758 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1759 :group 'vhdl-menu)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1760
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1761
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1762 (defgroup vhdl-print nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1763 "Customizations for printing."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1764 :group 'vhdl)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1765
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1766 (defcustom vhdl-print-two-column t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1767 "*Non-nil means print code in two columns and landscape format.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1768 Adjusts settings in a way that postscript printing (\"File\" menu, `ps-print')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1769 prints VHDL files in a nice two-column landscape style.
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1770
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1771 NOTE: Activate the new setting by restarting Emacs.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1772 Overrides `ps-print' settings locally."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1773 :type 'boolean
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1774 :group 'vhdl-print)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1775
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1776 (defcustom vhdl-print-customize-faces t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1777 "*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
1778
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1779 NOTE: Activate the new setting by restarting Emacs.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1780 Overrides `ps-print' settings locally."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1781 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1782 :group 'vhdl-print)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1783
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1784
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1785 (defgroup vhdl-misc nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1786 "Miscellaneous customizations."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1787 :group 'vhdl)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1788
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1789 (defcustom vhdl-intelligent-tab t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1790 "*Non-nil means `TAB' does indentation, word completion and tab insertion.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1791 That is, if preceeding character is part of a word then complete word,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1792 else if not at beginning of line then insert tab,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1793 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
1794 else indent current line (i.e. `TAB' is bound to `vhdl-electric-tab').
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1795 If nil, TAB always indents current line (i.e. `TAB' is bound to
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1796 `indent-according-to-mode').
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1797
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1798 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1799 \"Activate Options\"."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1800 :type 'boolean
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1801 :group 'vhdl-misc)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1802
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1803 (defcustom vhdl-indent-syntax-based t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1804 "*Non-nil means indent lines of code based on their syntactic context.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1805 Otherwise, a line is indented like the previous nonblank line. This can be
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1806 useful in large files where syntax-based indentation gets very slow."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1807 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1808 :group 'vhdl-misc)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1809
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1810 (defcustom vhdl-word-completion-case-sensitive nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1811 "*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
1812 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
1813 Otherwise, case is ignored."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1814 :type 'boolean
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1815 :group 'vhdl-misc)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1816
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1817 (defcustom vhdl-word-completion-in-minibuffer t
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1818 "*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
1819
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1820 NOTE: Activate the new setting by restarting Emacs."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1821 :type 'boolean
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1822 :group 'vhdl-misc)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1823
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1824 (defcustom vhdl-underscore-is-part-of-word nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1825 "*Non-nil means consider the underscore character `_' as part of word.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1826 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
1827 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
1828 are treated as single words otherwise.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1829
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1830 NOTE: Activate the new setting in a VHDL buffer by using the menu entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1831 \"Activate Options\"."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1832 :type 'boolean
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1833 :set (lambda (variable value)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1834 (vhdl-custom-set variable value 'vhdl-mode-syntax-table-init))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1835 :group 'vhdl-misc)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1836
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1837
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1838 (defgroup vhdl-related nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1839 "Related general customizations."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1840 :group 'vhdl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1841
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1842 ;; add related general customizations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1843 (custom-add-to-group 'vhdl-related 'hideshow 'custom-group)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
1844 (if (featurep 'xemacs)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1845 (custom-add-to-group 'vhdl-related 'paren-mode 'custom-variable)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1846 (custom-add-to-group 'vhdl-related 'paren-showing 'custom-group))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1847 (custom-add-to-group 'vhdl-related 'ps-print 'custom-group)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1848 (custom-add-to-group 'vhdl-related 'speedbar 'custom-group)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1849 (custom-add-to-group 'vhdl-related 'line-number-mode 'custom-variable)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
1850 (unless (featurep 'xemacs)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1851 (custom-add-to-group 'vhdl-related 'transient-mark-mode 'custom-variable))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1852 (custom-add-to-group 'vhdl-related 'user-full-name 'custom-variable)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1853 (custom-add-to-group 'vhdl-related 'mail-host-address 'custom-variable)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1854 (custom-add-to-group 'vhdl-related 'user-mail-address 'custom-variable)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1855
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1856 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1857 ;; Internal variables
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1858
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1859 (defvar vhdl-menu-max-size 20
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1860 "*Specifies the maximum size of a menu before splitting it into submenues.")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1861
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1862 (defvar vhdl-progress-interval 1
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1863 "*Interval used to update progress status during long operations.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1864 If a number, percentage complete gets updated after each interval of
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1865 that many seconds. To inhibit all messages, set this option to nil.")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1866
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1867 (defvar vhdl-inhibit-startup-warnings-p nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1868 "*If non-nil, inhibits start up compatibility warnings.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1869
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1870 (defvar vhdl-strict-syntax-p nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1871 "*If non-nil, all syntactic symbols must be found in `vhdl-offsets-alist'.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1872 If the syntactic symbol for a particular line does not match a symbol
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1873 in the offsets alist, an error is generated, otherwise no error is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1874 reported and the syntactic symbol is ignored.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1875
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1876 (defvar vhdl-echo-syntactic-information-p nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1877 "*If non-nil, syntactic info is echoed when the line is indented.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1878
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1879 (defconst vhdl-offsets-alist-default
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1880 '((string . -1000)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1881 (cpp-macro . -1000)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1882 (block-open . 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1883 (block-close . 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1884 (statement . 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1885 (statement-cont . vhdl-lineup-statement-cont)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1886 (statement-block-intro . +)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1887 (statement-case-intro . +)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1888 (case-alternative . +)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1889 (comment . vhdl-lineup-comment)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1890 (arglist-intro . +)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1891 (arglist-cont . 0)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1892 (arglist-cont-nonempty . vhdl-lineup-arglist)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1893 (arglist-close . vhdl-lineup-arglist)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1894 (entity . 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1895 (configuration . 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1896 (package . 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1897 (architecture . 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
1898 (package-body . 0)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1899 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1900 "Default settings for offsets of syntactic elements.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1901 Do not change this constant! See the variable `vhdl-offsets-alist' for
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1902 more information.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1903
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1904 (defvar vhdl-offsets-alist (copy-alist vhdl-offsets-alist-default)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1905 "*Association list of syntactic element symbols and indentation offsets.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1906 As described below, each cons cell in this list has the form:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1907
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1908 (SYNTACTIC-SYMBOL . OFFSET)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1909
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1910 When a line is indented, `vhdl-mode' first determines the syntactic
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1911 context of the line by generating a list of symbols called syntactic
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1912 elements. This list can contain more than one syntactic element and
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1913 the global variable `vhdl-syntactic-context' contains the context list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1914 for the line being indented. Each element in this list is actually a
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1915 cons cell of the syntactic symbol and a buffer position. This buffer
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1916 position is call the relative indent point for the line. Some
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1917 syntactic symbols may not have a relative indent point associated with
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1918 them.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1919
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1920 After the syntactic context list for a line is generated, `vhdl-mode'
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1921 calculates the absolute indentation for the line by looking at each
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1922 syntactic element in the list. First, it compares the syntactic
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1923 element against the SYNTACTIC-SYMBOL's in `vhdl-offsets-alist'. When it
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1924 finds a match, it adds the OFFSET to the column of the relative indent
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1925 point. The sum of this calculation for each element in the syntactic
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1926 list is the absolute offset for line being indented.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1927
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1928 If the syntactic element does not match any in the `vhdl-offsets-alist',
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1929 an error is generated if `vhdl-strict-syntax-p' is non-nil, otherwise
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1930 the element is ignored.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1931
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1932 Actually, OFFSET can be an integer, a function, a variable, or one of
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1933 the following symbols: `+', `-', `++', or `--'. These latter
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1934 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
1935 respectively: *1, *-1, *2, and *-2. If OFFSET is a function, it is
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1936 called with a single argument containing the cons of the syntactic
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1937 element symbol and the relative indent point. The function should
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1938 return an integer offset.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1939
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1940 Here is the current list of valid syntactic element symbols:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1941
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1942 string -- inside multi-line string
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1943 block-open -- statement block open
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1944 block-close -- statement block close
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1945 statement -- a VHDL statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1946 statement-cont -- a continuation of a VHDL statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1947 statement-block-intro -- the first line in a new statement block
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1948 statement-case-intro -- the first line in a case alternative block
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1949 case-alternative -- a case statement alternative clause
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1950 comment -- a line containing only a comment
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1951 arglist-intro -- the first line in an argument list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1952 arglist-cont -- subsequent argument list lines when no
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1953 arguments follow on the same line as the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1954 the arglist opening paren
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1955 arglist-cont-nonempty -- subsequent argument list lines when at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1956 least one argument follows on the same
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1957 line as the arglist opening paren
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1958 arglist-close -- the solo close paren of an argument list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1959 entity -- inside an entity declaration
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1960 configuration -- inside a configuration declaration
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1961 package -- inside a package declaration
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1962 architecture -- inside an architecture body
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
1963 package-body -- inside a package body")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1964
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1965 (defvar vhdl-comment-only-line-offset 0
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1966 "*Extra offset for line which contains only the start of a comment.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1967 Can contain an integer or a cons cell of the form:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1968
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1969 (NON-ANCHORED-OFFSET . ANCHORED-OFFSET)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1970
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1971 Where NON-ANCHORED-OFFSET is the amount of offset given to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1972 non-column-zero anchored comment-only lines, and ANCHORED-OFFSET is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1973 the amount of offset to give column-zero anchored comment-only lines.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1974 Just an integer as value is equivalent to (<val> . 0)")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1975
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1976 (defvar vhdl-special-indent-hook nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1977 "*Hook for user defined special indentation adjustments.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1978 This hook gets called after a line is indented by the mode.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1979
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1980 (defvar vhdl-style-alist
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1981 '(("IEEE"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1982 (vhdl-basic-offset . 4)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
1983 (vhdl-offsets-alist . ())))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1984 "Styles of Indentation.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1985 Elements of this alist are of the form:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1986
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1987 (STYLE-STRING (VARIABLE . VALUE) [(VARIABLE . VALUE) ...])
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1988
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1989 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
1990 style, VARIABLE is any `vhdl-mode' variable, and VALUE is the intended
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1991 value for that variable when using the selected style.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1992
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1993 There is one special case when VARIABLE is `vhdl-offsets-alist'. In this
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1994 case, the VALUE is a list containing elements of the form:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1995
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1996 (SYNTACTIC-SYMBOL . VALUE)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1997
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1998 as described in `vhdl-offsets-alist'. These are passed directly to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1999 `vhdl-set-offset' so there is no need to set every syntactic symbol in
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2000 your style, only those that are different from the default.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2001
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2002 ;; dynamically append the default value of most variables
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2003 (or (assoc "Default" vhdl-style-alist)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2004 (let* ((varlist '(vhdl-inhibit-startup-warnings-p
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2005 vhdl-strict-syntax-p
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2006 vhdl-echo-syntactic-information-p
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2007 vhdl-basic-offset
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2008 vhdl-offsets-alist
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2009 vhdl-comment-only-line-offset))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2010 (default (cons "Default"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2011 (mapcar
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2012 (function
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2013 (lambda (var)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2014 (cons var (symbol-value var))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2015 varlist))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2016 (setq vhdl-style-alist (cons default vhdl-style-alist))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2017
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2018 (defvar vhdl-mode-hook nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2019 "*Hook called by `vhdl-mode'.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2020
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2021
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2022 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2023 ;;; Required packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2024 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2025
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2026 ;; mandatory
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2027 (require 'assoc)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2028 (require 'compile) ; XEmacs
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2029 (require 'easymenu)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2030 (require 'hippie-exp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2031
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2032 ;; optional (minimize warning messages during compile)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2033 (eval-when-compile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2034 (require 'font-lock)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2035 (require 'ps-print)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2036 (require 'speedbar))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2037
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2038
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2039 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2040 ;;; Compatibility
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2041 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2042
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2043 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2044 ;; XEmacs compatibility
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2045
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2046 ;; active regions
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2047 (defun vhdl-keep-region-active ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2048 "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
2049 Ignore byte-compiler warnings you might see."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2050 (and (boundp 'zmacs-region-stays)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2051 (setq zmacs-region-stays t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2052
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2053 ;; `wildcard-to-regexp' is included only in XEmacs 21
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2054 (unless (fboundp 'wildcard-to-regexp)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2055 (defun wildcard-to-regexp (wildcard)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2056 "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
2057 (let* ((i (string-match "[*?]" wildcard))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2058 (result (substring wildcard 0 i))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2059 (len (length wildcard)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2060 (when i
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2061 (while (< i len)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2062 (let ((ch (aref wildcard i)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2063 (setq result (concat result
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2064 (cond ((eq ch ?*) "[^\000]*")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2065 ((eq ch ??) "[^\000]")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2066 (t (char-to-string ch)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2067 (setq i (1+ i)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2068 (concat "\\`" result "\\'"))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2069
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2070 ;; `regexp-opt' undefined (`xemacs-devel' not installed)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2071 ;; `regexp-opt' accelerates fontification by 10-20%
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2072 (unless (fboundp 'regexp-opt)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2073 ; (vhdl-warning-when-idle "Please install `xemacs-devel' package.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2074 (defun regexp-opt (strings &optional paren)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2075 (let ((open (if paren "\\(" "")) (close (if paren "\\)" "")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2076 (concat open (mapconcat 'regexp-quote strings "\\|") close))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2077
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2078 ;; `match-string-no-properties' undefined (XEmacs, what else?)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2079 (unless (fboundp 'match-string-no-properties)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2080 (defalias 'match-string-no-properties 'match-string))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2081
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2082 ;; `subst-char-in-string' undefined (XEmacs)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2083 (unless (fboundp 'subst-char-in-string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2084 (defun subst-char-in-string (fromchar tochar string &optional inplace)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2085 (let ((i (length string))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2086 (newstr (if inplace string (copy-sequence string))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2087 (while (> i 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2088 (setq i (1- i))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2089 (if (eq (aref newstr i) fromchar) (aset newstr i tochar)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2090 newstr)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2091
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2092 ;; `itimer.el': idle timer bug fix in version 1.09 (XEmacs 21.1.9)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
2093 (when (and (featurep 'xemacs) (string< itimer-version "1.09")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2094 (not noninteractive))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2095 (load "itimer")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2096 (when (string< itimer-version "1.09")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2097 (message "WARNING: Install included `itimer.el' patch first (see INSTALL file)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2098 (beep) (sit-for 5)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2099
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2100 ;; `file-expand-wildcards' undefined (XEmacs)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2101 (unless (fboundp 'file-expand-wildcards)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2102 (defun file-expand-wildcards (pattern &optional full)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2103 "Taken from Emacs' `files.el'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2104 (let* ((nondir (file-name-nondirectory pattern))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2105 (dirpart (file-name-directory pattern))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2106 (dirs (if (and dirpart (string-match "[[*?]" dirpart))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2107 (mapcar 'file-name-as-directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2108 (file-expand-wildcards (directory-file-name dirpart)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2109 (list dirpart)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2110 contents)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2111 (while dirs
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2112 (when (or (null (car dirs)) ; Possible if DIRPART is not wild.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2113 (file-directory-p (directory-file-name (car dirs))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2114 (let ((this-dir-contents
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2115 (delq nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2116 (mapcar #'(lambda (name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2117 (unless (string-match "\\`\\.\\.?\\'"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2118 (file-name-nondirectory name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2119 name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2120 (directory-files (or (car dirs) ".") full
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2121 (wildcard-to-regexp nondir))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2122 (setq contents
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2123 (nconc
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2124 (if (and (car dirs) (not full))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2125 (mapcar (function (lambda (name) (concat (car dirs) name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2126 this-dir-contents)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2127 this-dir-contents)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2128 contents))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2129 (setq dirs (cdr dirs)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2130 contents)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2131
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2132 ;; `member-ignore-case' undefined (XEmacs)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2133 (unless (fboundp 'member-ignore-case)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2134 (defalias 'member-ignore-case 'member))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2135
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2136 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2137 ;; Compatibility with older VHDL Mode versions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2138
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2139 (defvar vhdl-warnings nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2140 "Warnings to tell the user during start up.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2141
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2142 (defun vhdl-run-when-idle (secs repeat function)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2143 "Wait until idle, then run FUNCTION."
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
2144 (if (fboundp 'start-itimer)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2145 (start-itimer "vhdl-mode" function secs repeat t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2146 ; (run-with-idle-timer secs repeat function)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2147 ;; explicitely activate timer (necessary when Emacs is already idle)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2148 (aset (run-with-idle-timer secs repeat function) 0 nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2149
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2150 (defun vhdl-warning-when-idle (&rest args)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2151 "Wait until idle, then print out warning STRING and beep."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2152 (if noninteractive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2153 (vhdl-warning (apply 'format args) t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2154 (unless vhdl-warnings
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2155 (vhdl-run-when-idle .1 nil 'vhdl-print-warnings))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2156 (setq vhdl-warnings (cons (apply 'format args) vhdl-warnings))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2157
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2158 (defun vhdl-warning (string &optional nobeep)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2159 "Print out warning STRING and beep."
65584
6dbba0bd58df Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents: 65491
diff changeset
2160 (message "WARNING: %s" string)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2161 (unless (or nobeep noninteractive) (beep)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2162
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2163 (defun vhdl-print-warnings ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2164 "Print out messages in variable `vhdl-warnings'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2165 (let ((no-warnings (length vhdl-warnings)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2166 (setq vhdl-warnings (nreverse vhdl-warnings))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2167 (while vhdl-warnings
65584
6dbba0bd58df Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents: 65491
diff changeset
2168 (message "WARNING: %s" (car vhdl-warnings))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2169 (setq vhdl-warnings (cdr vhdl-warnings)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2170 (beep)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2171 (when (> no-warnings 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2172 (message "WARNING: See warnings in message buffer (type `C-c M-m')."))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2173
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2174 ;; Backward compatibility checks and fixes
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2175 ;; option `vhdl-compiler' changed format
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2176 (unless (stringp vhdl-compiler)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2177 (setq vhdl-compiler "ModelSim")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2178 (vhdl-warning-when-idle "Option `vhdl-compiler' has changed format; customize again"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2179
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2180 ;; option `vhdl-standard' changed format
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2181 (unless (listp vhdl-standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2182 (setq vhdl-standard '(87 nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2183 (vhdl-warning-when-idle "Option `vhdl-standard' has changed format; customize again"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2184
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2185 ;; option `vhdl-model-alist' changed format
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2186 (when (= (length (car vhdl-model-alist)) 3)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2187 (let ((old-alist vhdl-model-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2188 new-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2189 (while old-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2190 (setq new-alist (cons (append (car old-alist) '("")) new-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2191 (setq old-alist (cdr old-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2192 (setq vhdl-model-alist (nreverse new-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2193 (customize-save-variable 'vhdl-model-alist vhdl-model-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2194
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2195 ;; option `vhdl-project-alist' changed format
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2196 (when (= (length (car vhdl-project-alist)) 3)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2197 (let ((old-alist vhdl-project-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2198 new-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2199 (while old-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2200 (setq new-alist (cons (append (car old-alist) '("")) new-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2201 (setq old-alist (cdr old-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2202 (setq vhdl-project-alist (nreverse new-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2203 (customize-save-variable 'vhdl-project-alist vhdl-project-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2204
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2205 ;; option `vhdl-project-alist' changed format (3.31.1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2206 (when (= (length (car vhdl-project-alist)) 4)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2207 (let ((old-alist vhdl-project-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2208 new-alist elem)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2209 (while old-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2210 (setq elem (car old-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2211 (setq new-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2212 (cons (list (nth 0 elem) (nth 1 elem) "" (nth 2 elem)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2213 nil "./" "work" "work/" "Makefile" (nth 3 elem))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2214 new-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2215 (setq old-alist (cdr old-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2216 (setq vhdl-project-alist (nreverse new-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2217 (vhdl-warning-when-idle "Option `vhdl-project-alist' changed format; please re-customize"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2218
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2219 ;; option `vhdl-project-alist' changed format (3.31.12)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2220 (when (= (length (car vhdl-project-alist)) 10)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2221 (let ((tmp-alist vhdl-project-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2222 (while tmp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2223 (setcdr (nthcdr 3 (car tmp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2224 (cons "" (nthcdr 4 (car tmp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2225 (setq tmp-alist (cdr tmp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2226 (customize-save-variable 'vhdl-project-alist vhdl-project-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2227
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2228 ;; option `vhdl-compiler-alist' changed format (3.31.1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2229 (when (= (length (car vhdl-compiler-alist)) 7)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2230 (let ((old-alist vhdl-compiler-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2231 new-alist elem)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2232 (while old-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2233 (setq elem (car old-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2234 (setq new-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2235 (cons (list (nth 0 elem) (nth 1 elem) "" "make -f \\1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2236 (if (equal (nth 3 elem) "") nil (nth 3 elem))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2237 (nth 4 elem) "work/" "Makefile" (downcase (nth 0 elem))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2238 (nth 5 elem) (nth 6 elem) nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2239 new-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2240 (setq old-alist (cdr old-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2241 (setq vhdl-compiler-alist (nreverse new-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2242 (vhdl-warning-when-idle "Option `vhdl-compiler-alist' changed; please reset and re-customize"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2243
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2244 ;; option `vhdl-compiler-alist' changed format (3.31.10)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2245 (when (= (length (car vhdl-compiler-alist)) 12)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2246 (let ((tmp-alist vhdl-compiler-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2247 (while tmp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2248 (setcdr (nthcdr 4 (car tmp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2249 (cons "mkdir \\1" (nthcdr 5 (car tmp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2250 (setq tmp-alist (cdr tmp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2251 (customize-save-variable 'vhdl-compiler-alist vhdl-compiler-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2252
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2253 ;; option `vhdl-compiler-alist' changed format (3.31.11)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2254 (when (= (length (car vhdl-compiler-alist)) 13)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2255 (let ((tmp-alist vhdl-compiler-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2256 (while tmp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2257 (setcdr (nthcdr 3 (car tmp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2258 (cons "" (nthcdr 4 (car tmp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2259 (setq tmp-alist (cdr tmp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2260 (customize-save-variable 'vhdl-compiler-alist vhdl-compiler-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2261
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2262 ;; option `vhdl-compiler-alist' changed format (3.32.7)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2263 (when (= (length (nth 11 (car vhdl-compiler-alist))) 3)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2264 (let ((tmp-alist vhdl-compiler-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2265 (while tmp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2266 (setcdr (nthcdr 2 (nth 11 (car tmp-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2267 '(0 . nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2268 (setq tmp-alist (cdr tmp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2269 (customize-save-variable 'vhdl-compiler-alist vhdl-compiler-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2270
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2271 ;; option `vhdl-project': empty value changed from "" to nil (3.31.1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2272 (when (equal vhdl-project "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2273 (setq vhdl-project nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2274 (customize-save-variable 'vhdl-project vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2275
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2276 ;; option `vhdl-project-file-name': changed format (3.31.17 beta)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2277 (when (stringp vhdl-project-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2278 (setq vhdl-project-file-name (list vhdl-project-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2279 (customize-save-variable 'vhdl-project-file-name vhdl-project-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2280
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2281 ;; option `speedbar-indentation-width': introduced in speedbar 0.10
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2282 (if (not (boundp 'speedbar-indentation-width))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2283 (defvar speedbar-indentation-width 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2284 ;; set default to 2 if not already customized
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2285 (unless (get 'speedbar-indentation-width 'saved-value)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2286 (setq speedbar-indentation-width 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2287
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2288
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2289 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2290 ;;; Help functions / inline substitutions / macros
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2291 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2292
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2293 (defun vhdl-standard-p (standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2294 "Check if STANDARD is specified as used standard."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2295 (or (eq standard (car vhdl-standard))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2296 (memq standard (cadr vhdl-standard))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2297
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2298 (defun vhdl-project-p (&optional warning)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2299 "Return non-nil if a project is displayed, i.e. directories or files are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2300 specified."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2301 (if (assoc vhdl-project vhdl-project-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2302 vhdl-project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2303 (when (and vhdl-project warning)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2304 (vhdl-warning-when-idle "Project does not exist: \"%s\"" vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2305 nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2306
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2307 (defun vhdl-resolve-env-variable (string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2308 "Resolve environment variables in STRING."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2309 (while (string-match "\\(.*\\)${?\\(\\(\\w\\|_\\)+\\)}?\\(.*\\)" string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2310 (setq string (concat (match-string 1 string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2311 (getenv (match-string 2 string))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2312 (match-string 4 string))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2313 string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2314
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2315 (defun vhdl-default-directory ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2316 "Return the default directory of the current project or the directory of the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2317 current buffer if no project is defined."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2318 (if (vhdl-project-p)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2319 (expand-file-name (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2320 (nth 1 (aget vhdl-project-alist vhdl-project))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2321 default-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2322
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2323 (defmacro vhdl-prepare-search-1 (&rest body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2324 "Enable case insensitive search and switch to syntax table that includes '_',
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2325 then execute BODY, and finally restore the old environment. Used for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2326 consistent searching."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2327 `(let ((case-fold-search t) ; case insensitive search
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2328 (current-syntax-table (syntax-table))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2329 result
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2330 (restore-prog ; program to restore enviroment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2331 '(progn
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2332 ;; restore syntax table
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2333 (set-syntax-table current-syntax-table))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2334 ;; use extended syntax table
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2335 (set-syntax-table vhdl-mode-ext-syntax-table)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2336 ;; execute BODY safely
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2337 (setq result
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2338 (condition-case info
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2339 (progn ,@body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2340 (error (eval restore-prog) ; restore environment on error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2341 (error (cadr info))))) ; pass error up
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2342 ;; restore environment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2343 (eval restore-prog)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2344 result))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2345
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2346 (defmacro vhdl-prepare-search-2 (&rest body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2347 "Enable case insensitive search, switch to syntax table that includes '_',
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2348 and remove `intangible' overlays, then execute BODY, and finally restore the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2349 old environment. Used for consistent searching."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2350 `(let ((case-fold-search t) ; case insensitive search
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2351 (current-syntax-table (syntax-table))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2352 result overlay-all-list overlay-intangible-list overlay
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2353 (restore-prog ; program to restore enviroment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2354 '(progn
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2355 ;; restore syntax table
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2356 (set-syntax-table current-syntax-table)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2357 ;; restore `intangible' overlays
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2358 (when (fboundp 'overlay-lists)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2359 (while overlay-intangible-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2360 (overlay-put (car overlay-intangible-list) 'intangible t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2361 (setq overlay-intangible-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2362 (cdr overlay-intangible-list)))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2363 ;; use extended syntax table
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2364 (set-syntax-table vhdl-mode-ext-syntax-table)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2365 ;; remove `intangible' overlays
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2366 (when (fboundp 'overlay-lists)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2367 (setq overlay-all-list (overlay-lists))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2368 (setq overlay-all-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2369 (append (car overlay-all-list) (cdr overlay-all-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2370 (while overlay-all-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2371 (setq overlay (car overlay-all-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2372 (when (memq 'intangible (overlay-properties overlay))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2373 (setq overlay-intangible-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2374 (cons overlay overlay-intangible-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2375 (overlay-put overlay 'intangible nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2376 (setq overlay-all-list (cdr overlay-all-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2377 ;; execute BODY safely
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2378 (setq result
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2379 (condition-case info
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2380 (progn ,@body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2381 (error (eval restore-prog) ; restore environment on error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2382 (error (cadr info))))) ; pass error up
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2383 ;; restore environment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2384 (eval restore-prog)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2385 result))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2386
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2387 (defmacro vhdl-visit-file (file-name issue-error &rest body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2388 "Visit file FILE-NAME and execute BODY."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2389 `(if (null ,file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2390 (progn ,@body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2391 (unless (file-directory-p ,file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2392 (let ((source-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2393 (visiting-buffer (find-buffer-visiting ,file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2394 file-opened)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2395 (when (or (and visiting-buffer (set-buffer visiting-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2396 (condition-case ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2397 (progn (set-buffer (create-file-buffer ,file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2398 (setq file-opened t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2399 (vhdl-insert-file-contents ,file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2400 (modify-syntax-entry ?\- ". 12" (syntax-table))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2401 (modify-syntax-entry ?\n ">" (syntax-table))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2402 (modify-syntax-entry ?\^M ">" (syntax-table))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2403 (modify-syntax-entry ?_ "w" (syntax-table))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2404 t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2405 (error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2406 (if ,issue-error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2407 (progn
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2408 (when file-opened (kill-buffer (current-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2409 (set-buffer source-buffer)
63490
65b21147737a (zone-mode-update-serial): Don't use `format' on `error' arguments.
Juanma Barranquero <lekktu@gmail.com>
parents: 63456
diff changeset
2410 (error "ERROR: File cannot be opened: \"%s\"" ,file-name))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2411 (vhdl-warning (format "File cannot be opened: \"%s\"" ,file-name) t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2412 nil))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2413 (condition-case info
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2414 (progn ,@body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2415 (error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2416 (if ,issue-error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2417 (progn
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2418 (when file-opened (kill-buffer (current-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2419 (set-buffer source-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2420 (error (cadr info)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2421 (vhdl-warning (cadr info))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2422 (when file-opened (kill-buffer (current-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2423 (set-buffer source-buffer)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2424
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2425 (defun vhdl-insert-file-contents (filename)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2426 "Nicked from `insert-file-contents-literally', but allow coding system
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2427 conversion."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2428 (let ((format-alist nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2429 (after-insert-file-functions nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2430 (jka-compr-compression-info-list nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2431 (insert-file-contents filename t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2432
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2433 (defun vhdl-sort-alist (alist)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
2434 "Sort ALIST."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2435 (sort alist (function (lambda (a b) (string< (car a) (car b))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2436
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2437 (defun vhdl-get-subdirs (directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2438 "Recursively get subdirectories of DIRECTORY."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2439 (let ((dir-list (list (file-name-as-directory directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2440 file-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2441 (setq file-list (vhdl-directory-files directory t "\\w.*"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2442 (while file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2443 (when (file-directory-p (car file-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2444 (setq dir-list (append dir-list (vhdl-get-subdirs (car file-list)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2445 (setq file-list (cdr file-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2446 dir-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2447
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2448 (defun vhdl-aput (alist-symbol key &optional value)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2449 "As `aput', but delete key-value pair if VALUE is nil."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2450 (if value
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2451 (aput alist-symbol key value)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2452 (adelete alist-symbol key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2453
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2454 (defun vhdl-delete (elt list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2455 "Delete by side effect the first occurrence of ELT as a member of LIST."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2456 (setq list (cons nil list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2457 (let ((list1 list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2458 (while (and (cdr list1) (not (equal elt (cadr list1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2459 (setq list1 (cdr list1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2460 (when list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2461 (setcdr list1 (cddr list1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2462 (cdr list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2463
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2464 (defun vhdl-speedbar-refresh (&optional key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2465 "Refresh directory or project with name KEY."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2466 (when (and (boundp 'speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2467 (frame-live-p speedbar-frame))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2468 (let ((pos (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2469 (last-frame (selected-frame)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2470 (if (null key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2471 (speedbar-refresh)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2472 (select-frame speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2473 (when (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2474 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2475 (re-search-forward (concat "^\\([0-9]+:\\s-*<\\)->\\s-+" key "$") nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2476 (goto-char (match-end 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2477 (speedbar-do-function-pointer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2478 (backward-char 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2479 (speedbar-do-function-pointer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2480 (message "Refreshing speedbar...done"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2481 (select-frame last-frame)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2482
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2483 (defun vhdl-show-messages ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2484 "Get *Messages* buffer to show recent messages."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2485 (interactive)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
2486 (display-buffer (if (featurep 'xemacs) " *Message-Log*" "*Messages*")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2487
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2488 (defun vhdl-use-direct-instantiation ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2489 "Return whether direct instantiation is used."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2490 (or (eq vhdl-use-direct-instantiation 'always)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2491 (and (eq vhdl-use-direct-instantiation 'standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2492 (not (vhdl-standard-p '87)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2493
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2494 (defun vhdl-max-marker (marker1 marker2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2495 "Return larger marker."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2496 (if (> marker1 marker2) marker1 marker2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2497
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2498 (defun vhdl-goto-marker (marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2499 "Goto marker in appropriate buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2500 (when (markerp marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2501 (set-buffer (marker-buffer marker)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2502 (goto-char marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2503
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2504 (defun vhdl-menu-split (list title)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2505 "Split menu LIST into several submenues, if number of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2506 elements > `vhdl-menu-max-size'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2507 (if (> (length list) vhdl-menu-max-size)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2508 (let ((remain list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2509 (result '())
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2510 (sublist '())
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2511 (menuno 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2512 (i 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2513 (while remain
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2514 (setq sublist (cons (car remain) sublist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2515 (setq remain (cdr remain))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2516 (setq i (+ i 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2517 (if (= i vhdl-menu-max-size)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2518 (progn
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2519 (setq result (cons (cons (format "%s %s" title menuno)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2520 (nreverse sublist)) result))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2521 (setq i 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2522 (setq menuno (+ menuno 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2523 (setq sublist '()))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2524 (and sublist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2525 (setq result (cons (cons (format "%s %s" title menuno)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2526 (nreverse sublist)) result)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2527 (nreverse result))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2528 list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2529
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2530
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2531 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2532 ;;; Bindings
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2533 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2534
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2535 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2536 ;; Key bindings
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2537
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2538 (defvar vhdl-template-map nil
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2539 "Keymap for VHDL templates.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2540
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2541 (defun vhdl-template-map-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2542 "Initialize `vhdl-template-map'."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2543 (setq vhdl-template-map (make-sparse-keymap))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2544 ;; key bindings for VHDL templates
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2545 (define-key vhdl-template-map "al" 'vhdl-template-alias)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2546 (define-key vhdl-template-map "ar" 'vhdl-template-architecture)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2547 (define-key vhdl-template-map "at" 'vhdl-template-assert)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2548 (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
2549 (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
2550 (define-key vhdl-template-map "bl" 'vhdl-template-block)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2551 (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
2552 (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
2553 (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
2554 (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
2555 (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
2556 (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
2557 (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
2558 (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
2559 (define-key vhdl-template-map "co" 'vhdl-template-constant)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2560 (define-key vhdl-template-map "di" 'vhdl-template-disconnect)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2561 (define-key vhdl-template-map "el" 'vhdl-template-else)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2562 (define-key vhdl-template-map "ei" 'vhdl-template-elsif)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2563 (define-key vhdl-template-map "en" 'vhdl-template-entity)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2564 (define-key vhdl-template-map "ex" 'vhdl-template-exit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2565 (define-key vhdl-template-map "fi" 'vhdl-template-file)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2566 (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
2567 (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
2568 (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
2569 (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
2570 (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
2571 (define-key vhdl-template-map "ge" 'vhdl-template-generic)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2572 (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
2573 (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
2574 (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
2575 (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
2576 (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
2577 (define-key vhdl-template-map "li" 'vhdl-template-library)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2578 (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
2579 (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
2580 (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
2581 (define-key vhdl-template-map "ma" 'vhdl-template-map)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2582 (define-key vhdl-template-map "ne" 'vhdl-template-next)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2583 (define-key vhdl-template-map "ot" 'vhdl-template-others)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2584 (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
2585 (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
2586 (define-key vhdl-template-map "(" 'vhdl-template-paired-parens)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2587 (define-key vhdl-template-map "po" 'vhdl-template-port)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2588 (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
2589 (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
2590 (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
2591 (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
2592 (define-key vhdl-template-map "rp" 'vhdl-template-report)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2593 (define-key vhdl-template-map "rt" 'vhdl-template-return)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2594 (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
2595 (define-key vhdl-template-map "si" 'vhdl-template-signal)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2596 (define-key vhdl-template-map "su" 'vhdl-template-subtype)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2597 (define-key vhdl-template-map "ty" 'vhdl-template-type)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2598 (define-key vhdl-template-map "us" 'vhdl-template-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2599 (define-key vhdl-template-map "va" 'vhdl-template-variable)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2600 (define-key vhdl-template-map "wa" 'vhdl-template-wait)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2601 (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
2602 (define-key vhdl-template-map "wi" 'vhdl-template-with)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2603 (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
2604 (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
2605 (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
2606 (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
2607 (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
2608 (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
2609 (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
2610 (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
2611 (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
2612 (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
2613 (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
2614 (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
2615 (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
2616 (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
2617 (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
2618 (when (vhdl-standard-p 'ams)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2619 (define-key vhdl-template-map "br" 'vhdl-template-break)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2620 (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
2621 (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
2622 (define-key vhdl-template-map "lm" 'vhdl-template-limit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2623 (define-key vhdl-template-map "na" 'vhdl-template-nature)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2624 (define-key vhdl-template-map "pa" 'vhdl-template-procedural)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2625 (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
2626 (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
2627 (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
2628 (define-key vhdl-template-map "sn" 'vhdl-template-subnature)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2629 (define-key vhdl-template-map "te" 'vhdl-template-terminal)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2630 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2631 (when (vhdl-standard-p 'math)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2632 (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
2633 (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
2634 ))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2635
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2636 ;; initialize template map for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2637 (vhdl-template-map-init)
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 (defun vhdl-function-name (prefix string &optional postfix)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2640 "Generate a Lisp function name.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2641 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
2642 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
2643 (let ((name prefix))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2644 (while (string-match "\\(\\w+\\)\\s-*\\(.*\\)" string)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2645 (setq name
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2646 (concat name "-" (downcase (substring string 0 (match-end 1)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2647 (setq string (substring string (match-beginning 2))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2648 (when postfix (setq name (concat name "-" postfix)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2649 (intern name)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2650
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2651 (defvar vhdl-model-map nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2652 "Keymap for VHDL models.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2653
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2654 (defun vhdl-model-map-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2655 "Initialize `vhdl-model-map'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2656 (setq vhdl-model-map (make-sparse-keymap))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2657 ;; key bindings for VHDL models
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2658 (let ((model-alist vhdl-model-alist) model)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2659 (while model-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2660 (setq model (car model-alist))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2661 (define-key vhdl-model-map (nth 2 model)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2662 (vhdl-function-name "vhdl-model" (nth 0 model)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2663 (setq model-alist (cdr model-alist)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2664
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2665 ;; initialize user model map for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2666 (vhdl-model-map-init)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2667
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2668 (defvar vhdl-mode-map nil
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2669 "Keymap for VHDL Mode.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2670
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2671 (defun vhdl-mode-map-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2672 "Initialize `vhdl-mode-map'."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2673 (setq vhdl-mode-map (make-sparse-keymap))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2674 ;; template key bindings
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2675 (define-key vhdl-mode-map "\C-c\C-t" vhdl-template-map)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2676 ;; model key bindings
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2677 (define-key vhdl-mode-map "\C-c\C-m" vhdl-model-map)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2678 ;; standard key bindings
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2679 (define-key vhdl-mode-map "\M-a" 'vhdl-beginning-of-statement)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2680 (define-key vhdl-mode-map "\M-e" 'vhdl-end-of-statement)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2681 (define-key vhdl-mode-map "\M-\C-f" 'vhdl-forward-sexp)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2682 (define-key vhdl-mode-map "\M-\C-b" 'vhdl-backward-sexp)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2683 (define-key vhdl-mode-map "\M-\C-u" 'vhdl-backward-up-list)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2684 (define-key vhdl-mode-map "\M-\C-a" 'vhdl-backward-same-indent)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2685 (define-key vhdl-mode-map "\M-\C-e" 'vhdl-forward-same-indent)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
2686 (unless (featurep 'xemacs) ; would override `M-backspace' in XEmacs
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2687 (define-key vhdl-mode-map "\M-\C-h" 'vhdl-mark-defun))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2688 (define-key vhdl-mode-map "\M-\C-q" 'vhdl-indent-sexp)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2689 (define-key vhdl-mode-map "\M-^" 'vhdl-delete-indentation)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2690 ;; backspace/delete key bindings
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2691 (define-key vhdl-mode-map [backspace] 'backward-delete-char-untabify)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2692 (unless (boundp 'delete-key-deletes-forward) ; XEmacs variable
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2693 (define-key vhdl-mode-map [delete] 'delete-char)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2694 (define-key vhdl-mode-map [(meta delete)] 'kill-word))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2695 ;; mode specific key bindings
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2696 (define-key vhdl-mode-map "\C-c\C-m\C-e" 'vhdl-electric-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2697 (define-key vhdl-mode-map "\C-c\C-m\C-s" 'vhdl-stutter-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2698 (define-key vhdl-mode-map "\C-c\C-s\C-p" 'vhdl-set-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2699 (define-key vhdl-mode-map "\C-c\C-p\C-d" 'vhdl-duplicate-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2700 (define-key vhdl-mode-map "\C-c\C-p\C-m" 'vhdl-import-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2701 (define-key vhdl-mode-map "\C-c\C-p\C-x" 'vhdl-export-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2702 (define-key vhdl-mode-map "\C-c\C-s\C-k" 'vhdl-set-compiler)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2703 (define-key vhdl-mode-map "\C-c\C-k" 'vhdl-compile)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2704 (define-key vhdl-mode-map "\C-c\M-\C-k" 'vhdl-make)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2705 (define-key vhdl-mode-map "\C-c\M-k" 'vhdl-generate-makefile)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2706 (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
2707 (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
2708 (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
2709 (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
2710 (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
2711 (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
2712 (define-key vhdl-mode-map "\C-c\C-p\M-c" 'vhdl-port-paste-constants)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
2713 (if (featurep 'xemacs) ; `... C-g' not allowed in XEmacs
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2714 (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
2715 (define-key vhdl-mode-map "\C-c\C-p\C-g" 'vhdl-port-paste-generic-map))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2716 (define-key vhdl-mode-map "\C-c\C-p\C-z" 'vhdl-port-paste-initializations)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2717 (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
2718 (define-key vhdl-mode-map "\C-c\C-p\C-f" 'vhdl-port-flatten)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2719 (define-key vhdl-mode-map "\C-c\C-p\C-r" 'vhdl-port-reverse-direction)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2720 (define-key vhdl-mode-map "\C-c\C-s\C-w" 'vhdl-subprog-copy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2721 (define-key vhdl-mode-map "\C-c\C-s\M-w" 'vhdl-subprog-copy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2722 (define-key vhdl-mode-map "\C-c\C-s\C-d" 'vhdl-subprog-paste-declaration)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2723 (define-key vhdl-mode-map "\C-c\C-s\C-b" 'vhdl-subprog-paste-body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2724 (define-key vhdl-mode-map "\C-c\C-s\C-c" 'vhdl-subprog-paste-call)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2725 (define-key vhdl-mode-map "\C-c\C-s\C-f" 'vhdl-subprog-flatten)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2726 (define-key vhdl-mode-map "\C-c\C-c\C-n" 'vhdl-compose-new-component)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2727 (define-key vhdl-mode-map "\C-c\C-c\C-p" 'vhdl-compose-place-component)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2728 (define-key vhdl-mode-map "\C-c\C-c\C-w" 'vhdl-compose-wire-components)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2729 (define-key vhdl-mode-map "\C-c\C-c\C-f" 'vhdl-compose-configuration)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2730 (define-key vhdl-mode-map "\C-c\C-c\C-k" 'vhdl-compose-components-package)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2731 (define-key vhdl-mode-map "\C-cc" 'vhdl-comment-uncomment-region)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2732 (define-key vhdl-mode-map "\C-c-" 'vhdl-comment-append-inline)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2733 (define-key vhdl-mode-map "\C-c\M--" 'vhdl-comment-display-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2734 (define-key vhdl-mode-map "\C-c\C-i\C-l" 'indent-according-to-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2735 (define-key vhdl-mode-map "\C-c\C-i\C-g" 'vhdl-indent-group)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2736 (define-key vhdl-mode-map "\M-\C-\\" 'vhdl-indent-region)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2737 (define-key vhdl-mode-map "\C-c\C-i\C-b" 'vhdl-indent-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2738 (define-key vhdl-mode-map "\C-c\C-a\C-g" 'vhdl-align-group)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2739 (define-key vhdl-mode-map "\C-c\C-a\C-a" 'vhdl-align-group)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2740 (define-key vhdl-mode-map "\C-c\C-a\C-i" 'vhdl-align-same-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2741 (define-key vhdl-mode-map "\C-c\C-a\C-l" 'vhdl-align-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2742 (define-key vhdl-mode-map "\C-c\C-a\C-d" 'vhdl-align-declarations)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2743 (define-key vhdl-mode-map "\C-c\C-a\M-a" 'vhdl-align-region)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2744 (define-key vhdl-mode-map "\C-c\C-a\C-b" 'vhdl-align-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2745 (define-key vhdl-mode-map "\C-c\C-a\C-c" 'vhdl-align-inline-comment-group)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2746 (define-key vhdl-mode-map "\C-c\C-a\M-c" 'vhdl-align-inline-comment-region)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2747 (define-key vhdl-mode-map "\C-c\C-f\C-l" 'vhdl-fill-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2748 (define-key vhdl-mode-map "\C-c\C-f\C-f" 'vhdl-fill-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2749 (define-key vhdl-mode-map "\C-c\C-f\C-g" 'vhdl-fill-group)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2750 (define-key vhdl-mode-map "\C-c\C-f\C-i" 'vhdl-fill-same-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2751 (define-key vhdl-mode-map "\C-c\C-f\M-f" 'vhdl-fill-region)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2752 (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
2753 (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
2754 (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
2755 (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
2756 (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
2757 (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
2758 (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
2759 (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
2760 (define-key vhdl-mode-map "\C-c\C-l\C-c" 'vhdl-comment-uncomment-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2761 (define-key vhdl-mode-map "\C-c\C-x\C-p" 'vhdl-fix-clause)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2762 (define-key vhdl-mode-map "\C-c\C-x\M-c" 'vhdl-fix-case-region)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2763 (define-key vhdl-mode-map "\C-c\C-x\C-c" 'vhdl-fix-case-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2764 (define-key vhdl-mode-map "\C-c\C-x\M-w" 'vhdl-fixup-whitespace-region)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2765 (define-key vhdl-mode-map "\C-c\C-x\C-w" 'vhdl-fixup-whitespace-buffer)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2766 (define-key vhdl-mode-map "\C-c\M-b" 'vhdl-beautify-region)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2767 (define-key vhdl-mode-map "\C-c\C-b" 'vhdl-beautify-buffer)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2768 (define-key vhdl-mode-map "\C-c\C-u\C-s" 'vhdl-update-sensitivity-list-process)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2769 (define-key vhdl-mode-map "\C-c\C-u\M-s" 'vhdl-update-sensitivity-list-buffer)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2770 (define-key vhdl-mode-map "\C-cf" 'vhdl-fontify-buffer)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2771 (define-key vhdl-mode-map "\C-cs" 'vhdl-statistics-buffer)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2772 (define-key vhdl-mode-map "\C-c\M-m" 'vhdl-show-messages)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2773 (define-key vhdl-mode-map "\C-c\C-h" 'vhdl-doc-mode)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2774 (define-key vhdl-mode-map "\C-c\C-v" 'vhdl-version)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2775 (define-key vhdl-mode-map "\M-\t" 'insert-tab)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2776 ;; insert commands bindings
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2777 (define-key vhdl-mode-map "\C-c\C-i\C-t" 'vhdl-template-insert-construct)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2778 (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
2779 (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
2780 (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
2781 ;; electric key bindings
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2782 (define-key vhdl-mode-map " " 'vhdl-electric-space)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2783 (when vhdl-intelligent-tab
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2784 (define-key vhdl-mode-map "\t" 'vhdl-electric-tab))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2785 (define-key vhdl-mode-map "\r" 'vhdl-electric-return)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2786 (define-key vhdl-mode-map "-" 'vhdl-electric-dash)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2787 (define-key vhdl-mode-map "[" 'vhdl-electric-open-bracket)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2788 (define-key vhdl-mode-map "]" 'vhdl-electric-close-bracket)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2789 (define-key vhdl-mode-map "'" 'vhdl-electric-quote)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2790 (define-key vhdl-mode-map ";" 'vhdl-electric-semicolon)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2791 (define-key vhdl-mode-map "," 'vhdl-electric-comma)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2792 (define-key vhdl-mode-map "." 'vhdl-electric-period)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2793 (when (vhdl-standard-p 'ams)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2794 (define-key vhdl-mode-map "=" 'vhdl-electric-equal)))
24732
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 ;; initialize mode map for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2797 (vhdl-mode-map-init)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2798
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2799 ;; define special minibuffer keymap for enabling word completion in minibuffer
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2800 ;; (useful in template generator prompts)
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
2801 (defvar vhdl-minibuffer-local-map
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
2802 (let ((map (make-sparse-keymap)))
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
2803 (set-keymap-parent map minibuffer-local-map)
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
2804 (when vhdl-word-completion-in-minibuffer
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
2805 (define-key map "\t" 'vhdl-minibuffer-tab))
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
2806 map)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2807 "Keymap for minibuffer used in VHDL Mode.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2808
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2809 ;; set up electric character functions to work with
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2810 ;; `delete-selection-mode' (Emacs) and `pending-delete-mode' (XEmacs)
84923
85483f68777e (vhdl-set-style, vhdl-regress-line): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 78544
diff changeset
2811 (mapc
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2812 (function
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2813 (lambda (sym)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2814 (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
2815 (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
2816 '(vhdl-electric-space
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2817 vhdl-electric-tab
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2818 vhdl-electric-return
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2819 vhdl-electric-dash
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2820 vhdl-electric-open-bracket
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2821 vhdl-electric-close-bracket
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2822 vhdl-electric-quote
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2823 vhdl-electric-semicolon
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2824 vhdl-electric-comma
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2825 vhdl-electric-period
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2826 vhdl-electric-equal))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2827
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2828 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2829 ;; Syntax table
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2830
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2831 (defvar vhdl-mode-syntax-table nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2832 "Syntax table used in `vhdl-mode' buffers.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2833
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2834 (defvar vhdl-mode-ext-syntax-table nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2835 "Syntax table extended by `_' used in `vhdl-mode' buffers.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2836
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2837 (defun vhdl-mode-syntax-table-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2838 "Initialize `vhdl-mode-syntax-table'."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2839 (setq vhdl-mode-syntax-table (make-syntax-table))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2840 ;; define punctuation
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2841 (modify-syntax-entry ?\# "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2842 (modify-syntax-entry ?\$ "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2843 (modify-syntax-entry ?\% "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2844 (modify-syntax-entry ?\& "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2845 (modify-syntax-entry ?\' "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2846 (modify-syntax-entry ?\* "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2847 (modify-syntax-entry ?\+ "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2848 (modify-syntax-entry ?\. "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2849 (modify-syntax-entry ?\/ "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2850 (modify-syntax-entry ?\: "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2851 (modify-syntax-entry ?\; "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2852 (modify-syntax-entry ?\< "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2853 (modify-syntax-entry ?\= "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2854 (modify-syntax-entry ?\> "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2855 (modify-syntax-entry ?\\ "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2856 (modify-syntax-entry ?\| "." vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2857 ;; define string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2858 (modify-syntax-entry ?\" "\"" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2859 ;; define underscore
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2860 (when vhdl-underscore-is-part-of-word
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2861 (modify-syntax-entry ?\_ "w" vhdl-mode-syntax-table))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2862 ;; 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
2863 (modify-syntax-entry ?\- ". 12" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2864 ;; and \n and \^M end a comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2865 (modify-syntax-entry ?\n ">" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2866 (modify-syntax-entry ?\^M ">" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2867 ;; define parentheses to match
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2868 (modify-syntax-entry ?\( "()" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2869 (modify-syntax-entry ?\) ")(" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2870 (modify-syntax-entry ?\[ "(]" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2871 (modify-syntax-entry ?\] ")[" vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2872 (modify-syntax-entry ?\{ "(}" vhdl-mode-syntax-table)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2873 (modify-syntax-entry ?\} "){" vhdl-mode-syntax-table)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2874 ;; extended syntax table including '_' (for simpler search regexps)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2875 (setq vhdl-mode-ext-syntax-table (copy-syntax-table vhdl-mode-syntax-table))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2876 (modify-syntax-entry ?_ "w" vhdl-mode-ext-syntax-table))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2877
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2878 ;; initialize syntax table for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2879 (vhdl-mode-syntax-table-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2880
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2881 (defvar vhdl-syntactic-context nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2882 "Buffer local variable containing syntactic analysis list.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2883 (make-variable-buffer-local 'vhdl-syntactic-context)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2884
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2885 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
2886 ;; Abbrev ook bindings
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2887
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2888 (defvar vhdl-mode-abbrev-table nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2889 "Abbrev table to use in `vhdl-mode' buffers.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2890
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2891 (defun vhdl-mode-abbrev-table-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2892 "Initialize `vhdl-mode-abbrev-table'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2893 (define-abbrev-table 'vhdl-mode-abbrev-table
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2894 (append
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2895 (when (memq 'vhdl vhdl-electric-keywords)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2896 ;; VHDL'93 keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
2897 '(
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2898 ("--" "" vhdl-template-display-comment-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2899 ("abs" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2900 ("access" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2901 ("after" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2902 ("alias" "" vhdl-template-alias-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2903 ("all" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2904 ("and" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2905 ("arch" "" vhdl-template-architecture-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2906 ("architecture" "" vhdl-template-architecture-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2907 ("array" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2908 ("assert" "" vhdl-template-assert-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2909 ("attr" "" vhdl-template-attribute-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2910 ("attribute" "" vhdl-template-attribute-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2911 ("begin" "" vhdl-template-default-indent-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2912 ("block" "" vhdl-template-block-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2913 ("body" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2914 ("buffer" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2915 ("bus" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2916 ("case" "" vhdl-template-case-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2917 ("comp" "" vhdl-template-component-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2918 ("component" "" vhdl-template-component-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2919 ("cond" "" vhdl-template-conditional-signal-asst-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2920 ("conditional" "" vhdl-template-conditional-signal-asst-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2921 ("conf" "" vhdl-template-configuration-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2922 ("configuration" "" vhdl-template-configuration-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2923 ("cons" "" vhdl-template-constant-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2924 ("constant" "" vhdl-template-constant-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2925 ("disconnect" "" vhdl-template-disconnect-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2926 ("downto" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2927 ("else" "" vhdl-template-else-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2928 ("elseif" "" vhdl-template-elsif-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2929 ("elsif" "" vhdl-template-elsif-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2930 ("end" "" vhdl-template-default-indent-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2931 ("entity" "" vhdl-template-entity-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2932 ("exit" "" vhdl-template-exit-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2933 ("file" "" vhdl-template-file-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2934 ("for" "" vhdl-template-for-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2935 ("func" "" vhdl-template-function-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2936 ("function" "" vhdl-template-function-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2937 ("generic" "" vhdl-template-generic-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2938 ("group" "" vhdl-template-group-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2939 ("guarded" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2940 ("if" "" vhdl-template-if-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2941 ("impure" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2942 ("in" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2943 ("inertial" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2944 ("inout" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2945 ("inst" "" vhdl-template-instance-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2946 ("instance" "" vhdl-template-instance-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2947 ("is" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2948 ("label" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2949 ("library" "" vhdl-template-library-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2950 ("linkage" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2951 ("literal" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2952 ("loop" "" vhdl-template-bare-loop-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2953 ("map" "" vhdl-template-map-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2954 ("mod" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2955 ("nand" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2956 ("new" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2957 ("next" "" vhdl-template-next-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2958 ("nor" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2959 ("not" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2960 ("null" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2961 ("of" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2962 ("on" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2963 ("open" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2964 ("or" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2965 ("others" "" vhdl-template-others-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2966 ("out" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2967 ("pack" "" vhdl-template-package-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2968 ("package" "" vhdl-template-package-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2969 ("port" "" vhdl-template-port-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2970 ("postponed" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2971 ("procedure" "" vhdl-template-procedure-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2972 ("process" "" vhdl-template-process-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2973 ("pure" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2974 ("range" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2975 ("record" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2976 ("register" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2977 ("reject" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2978 ("rem" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2979 ("report" "" vhdl-template-report-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2980 ("return" "" vhdl-template-return-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2981 ("rol" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2982 ("ror" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2983 ("select" "" vhdl-template-selected-signal-asst-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2984 ("severity" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2985 ("shared" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2986 ("sig" "" vhdl-template-signal-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2987 ("signal" "" vhdl-template-signal-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2988 ("sla" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2989 ("sll" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2990 ("sra" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2991 ("srl" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2992 ("subtype" "" vhdl-template-subtype-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2993 ("then" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2994 ("to" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2995 ("transport" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2996 ("type" "" vhdl-template-type-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2997 ("unaffected" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2998 ("units" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
2999 ("until" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3000 ("use" "" vhdl-template-use-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3001 ("var" "" vhdl-template-variable-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3002 ("variable" "" vhdl-template-variable-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3003 ("wait" "" vhdl-template-wait-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3004 ("when" "" vhdl-template-when-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3005 ("while" "" vhdl-template-while-loop-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3006 ("with" "" vhdl-template-with-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3007 ("xnor" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3008 ("xor" "" vhdl-template-default-hook 0)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3009 ))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3010 ;; VHDL-AMS keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3011 (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
3012 '(
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3013 ("across" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3014 ("break" "" vhdl-template-break-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3015 ("limit" "" vhdl-template-limit-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3016 ("nature" "" vhdl-template-nature-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3017 ("noise" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3018 ("procedural" "" vhdl-template-procedural-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3019 ("quantity" "" vhdl-template-quantity-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3020 ("reference" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3021 ("spectrum" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3022 ("subnature" "" vhdl-template-subnature-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3023 ("terminal" "" vhdl-template-terminal-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3024 ("through" "" vhdl-template-default-hook 0)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3025 ("tolerance" "" vhdl-template-default-hook 0)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3026 ))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3027 ;; user model keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3028 (when (memq 'user vhdl-electric-keywords)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3029 (let ((alist vhdl-model-alist)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3030 abbrev-list keyword)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3031 (while alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3032 (setq keyword (nth 3 (car alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3033 (unless (equal keyword "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3034 (setq abbrev-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3035 (cons (list keyword ""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3036 (vhdl-function-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3037 "vhdl-model" (nth 0 (car alist)) "hook") 0)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3038 abbrev-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3039 (setq alist (cdr alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3040 abbrev-list)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3041
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3042 ;; initialize abbrev table for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3043 (vhdl-mode-abbrev-table-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3044
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3045 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3046 ;; Template completion lists
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3047
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3048 (defvar vhdl-template-construct-alist nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3049 "List of built-in construct templates.")
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 (defun vhdl-template-construct-alist-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3052 "Initialize `vhdl-template-construct-alist'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3053 (setq
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3054 vhdl-template-construct-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3055 (append
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3056 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3057 ("alias declaration" vhdl-template-alias)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3058 ("architecture body" vhdl-template-architecture)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3059 ("assertion" vhdl-template-assert)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3060 ("attribute declaration" vhdl-template-attribute-decl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3061 ("attribute specification" vhdl-template-attribute-spec)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3062 ("block configuration" vhdl-template-block-configuration)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3063 ("block statement" vhdl-template-block)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3064 ("case statement" vhdl-template-case-is)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3065 ("component configuration" vhdl-template-component-conf)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3066 ("component declaration" vhdl-template-component-decl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3067 ("component instantiation statement" vhdl-template-component-inst)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3068 ("conditional signal assignment" vhdl-template-conditional-signal-asst)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3069 ("configuration declaration" vhdl-template-configuration-decl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3070 ("configuration specification" vhdl-template-configuration-spec)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3071 ("constant declaration" vhdl-template-constant)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3072 ("disconnection specification" vhdl-template-disconnect)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3073 ("entity declaration" vhdl-template-entity)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3074 ("exit statement" vhdl-template-exit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3075 ("file declaration" vhdl-template-file)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3076 ("generate statement" vhdl-template-generate)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3077 ("generic clause" vhdl-template-generic)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3078 ("group declaration" vhdl-template-group-decl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3079 ("group template declaration" vhdl-template-group-template)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3080 ("if statement" vhdl-template-if-then)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3081 ("library clause" vhdl-template-library)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3082 ("loop statement" vhdl-template-loop)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3083 ("next statement" vhdl-template-next)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3084 ("package declaration" vhdl-template-package-decl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3085 ("package body" vhdl-template-package-body)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3086 ("port clause" vhdl-template-port)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3087 ("process statement" vhdl-template-process)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3088 ("report statement" vhdl-template-report)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3089 ("return statement" vhdl-template-return)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3090 ("selected signal assignment" vhdl-template-selected-signal-asst)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3091 ("signal declaration" vhdl-template-signal)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3092 ("subprogram declaration" vhdl-template-subprogram-decl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3093 ("subprogram body" vhdl-template-subprogram-body)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3094 ("subtype declaration" vhdl-template-subtype)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3095 ("type declaration" vhdl-template-type)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3096 ("use clause" vhdl-template-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3097 ("variable declaration" vhdl-template-variable)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3098 ("wait statement" vhdl-template-wait)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3099 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3100 (when (vhdl-standard-p 'ams)
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 ("break statement" vhdl-template-break)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3103 ("nature declaration" vhdl-template-nature)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3104 ("quantity declaration" vhdl-template-quantity)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3105 ("simultaneous case statement" vhdl-template-case-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3106 ("simultaneous if statement" vhdl-template-if-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3107 ("simultaneous procedural statement" vhdl-template-procedural)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3108 ("step limit specification" vhdl-template-limit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3109 ("subnature declaration" vhdl-template-subnature)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3110 ("terminal declaration" vhdl-template-terminal)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3111 )))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3112
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3113 ;; initialize for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3114 (vhdl-template-construct-alist-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3115
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3116 (defvar vhdl-template-package-alist nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3117 "List of built-in package templates.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3118
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3119 (defun vhdl-template-package-alist-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3120 "Initialize `vhdl-template-package-alist'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3121 (setq
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3122 vhdl-template-package-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3123 (append
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3124 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3125 ("numeric_bit" vhdl-template-package-numeric-bit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3126 ("numeric_std" vhdl-template-package-numeric-std)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3127 ("std_logic_1164" vhdl-template-package-std-logic-1164)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3128 ("std_logic_arith" vhdl-template-package-std-logic-arith)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3129 ("std_logic_misc" vhdl-template-package-std-logic-misc)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3130 ("std_logic_signed" vhdl-template-package-std-logic-signed)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3131 ("std_logic_textio" vhdl-template-package-std-logic-textio)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3132 ("std_logic_unsigned" vhdl-template-package-std-logic-unsigned)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3133 ("textio" vhdl-template-package-textio)
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 (when (vhdl-standard-p 'math)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3136 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3137 ("math_complex" vhdl-template-package-math-complex)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3138 ("math_real" vhdl-template-package-math-real)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3139 )))))
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 ;; initialize for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3142 (vhdl-template-package-alist-init)
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 (defvar vhdl-template-directive-alist
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3145 '(
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3146 ("translate_on" vhdl-template-directive-translate-on)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3147 ("translate_off" vhdl-template-directive-translate-off)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3148 ("synthesis_on" vhdl-template-directive-synthesis-on)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3149 ("synthesis_off" vhdl-template-directive-synthesis-off)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3150 )
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3151 "List of built-in directive templates.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3152
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3153
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3154 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3155 ;;; Menues
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3156 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3157
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3158 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
3159 ;; VHDL menu (using `easy-menu.el')
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
3160
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3161 (defun vhdl-customize ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3162 "Call the customize function with `vhdl' as argument."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3163 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3164 (customize-browse 'vhdl))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3165
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3166 (defun vhdl-create-mode-menu ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3167 "Create VHDL Mode menu."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3168 `("VHDL"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3169 ,(append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3170 '("Project"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3171 ["None" (vhdl-set-project "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3172 :style radio :selected (null vhdl-project)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3173 "--")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3174 ;; add menu entries for defined projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3175 (let ((project-alist vhdl-project-alist) menu-list name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3176 (while project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3177 (setq name (caar project-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3178 (setq menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3179 (cons `[,name (vhdl-set-project ,name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3180 :style radio :selected (equal ,name vhdl-project)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3181 menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3182 (setq project-alist (cdr project-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3183 (setq menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3184 (if vhdl-project-sort
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3185 (sort menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3186 (function (lambda (a b) (string< (elt a 0) (elt b 0)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3187 (nreverse menu-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3188 (vhdl-menu-split menu-list "Project"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3189 '("--" "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3190 ["Select Project..." vhdl-set-project t]
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3191 ["Set As Default Project" vhdl-set-default-project t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3192 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3193 ["Duplicate Project" vhdl-duplicate-project vhdl-project]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3194 ["Import Project..." vhdl-import-project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3195 :keys "C-c C-p C-m" :active t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3196 ["Export Project" vhdl-export-project vhdl-project]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3197 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3198 ["Customize Project..." (customize-option 'vhdl-project-alist) t]))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3199 "--"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3200 ("Compile"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3201 ["Compile Buffer" vhdl-compile t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3202 ["Stop Compilation" kill-compilation t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3203 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3204 ["Make" vhdl-make t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3205 ["Generate Makefile" vhdl-generate-makefile t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3206 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3207 ["Next Error" next-error t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3208 ["Previous Error" previous-error t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3209 ["First Error" first-error t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3210 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3211 ,(append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3212 '("Compiler")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3213 ;; add menu entries for defined compilers
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3214 (let ((comp-alist vhdl-compiler-alist) menu-list name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3215 (while comp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3216 (setq name (caar comp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3217 (setq menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3218 (cons `[,name (setq vhdl-compiler ,name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3219 :style radio :selected (equal ,name vhdl-compiler)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3220 menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3221 (setq comp-alist (cdr comp-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3222 (setq menu-list (nreverse menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3223 (vhdl-menu-split menu-list "Compiler"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3224 '("--" "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3225 ["Select Compiler..." vhdl-set-compiler t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3226 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3227 ["Customize Compiler..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3228 (customize-option 'vhdl-compiler-alist) t])))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3229 "--"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3230 ,(append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3231 '("Template"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3232 ("VHDL Construct 1"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3233 ["Alias" vhdl-template-alias t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3234 ["Architecture" vhdl-template-architecture t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3235 ["Assert" vhdl-template-assert t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3236 ["Attribute (Decl)" vhdl-template-attribute-decl t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3237 ["Attribute (Spec)" vhdl-template-attribute-spec t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3238 ["Block" vhdl-template-block t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3239 ["Case" vhdl-template-case-is t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3240 ["Component (Decl)" vhdl-template-component-decl t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3241 ["(Component) Instance" vhdl-template-component-inst t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3242 ["Conditional (Signal Asst)" vhdl-template-conditional-signal-asst t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3243 ["Configuration (Block)" vhdl-template-block-configuration t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3244 ["Configuration (Comp)" vhdl-template-component-conf t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3245 ["Configuration (Decl)" vhdl-template-configuration-decl t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3246 ["Configuration (Spec)" vhdl-template-configuration-spec t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3247 ["Constant" vhdl-template-constant t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3248 ["Disconnect" vhdl-template-disconnect t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3249 ["Else" vhdl-template-else t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3250 ["Elsif" vhdl-template-elsif t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3251 ["Entity" vhdl-template-entity t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3252 ["Exit" vhdl-template-exit t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3253 ["File" vhdl-template-file t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3254 ["For (Generate)" vhdl-template-for-generate t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3255 ["For (Loop)" vhdl-template-for-loop t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3256 ["Function (Body)" vhdl-template-function-body t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3257 ["Function (Decl)" vhdl-template-function-decl t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3258 ["Generic" vhdl-template-generic t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3259 ["Group (Decl)" vhdl-template-group-decl t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3260 ["Group (Template)" vhdl-template-group-template t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3261 ("VHDL Construct 2"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3262 ["If (Generate)" vhdl-template-if-generate t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3263 ["If (Then)" vhdl-template-if-then t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3264 ["Library" vhdl-template-library t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3265 ["Loop" vhdl-template-bare-loop t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3266 ["Map" vhdl-template-map t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3267 ["Next" vhdl-template-next t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3268 ["Others (Aggregate)" vhdl-template-others t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3269 ["Package (Decl)" vhdl-template-package-decl t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3270 ["Package (Body)" vhdl-template-package-body t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3271 ["Port" vhdl-template-port t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3272 ["Procedure (Body)" vhdl-template-procedure-body t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3273 ["Procedure (Decl)" vhdl-template-procedure-decl t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3274 ["Process (Comb)" vhdl-template-process-comb t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3275 ["Process (Seq)" vhdl-template-process-seq t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3276 ["Report" vhdl-template-report t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3277 ["Return" vhdl-template-return t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3278 ["Select" vhdl-template-selected-signal-asst t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3279 ["Signal" vhdl-template-signal t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3280 ["Subtype" vhdl-template-subtype t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3281 ["Type" vhdl-template-type t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3282 ["Use" vhdl-template-use t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3283 ["Variable" vhdl-template-variable t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3284 ["Wait" vhdl-template-wait t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3285 ["(Clocked Wait)" vhdl-template-clocked-wait t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3286 ["When" vhdl-template-when t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3287 ["While (Loop)" vhdl-template-while-loop t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3288 ["With" vhdl-template-with t]))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3289 (when (vhdl-standard-p 'ams)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3290 '(("VHDL-AMS Construct"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3291 ["Break" vhdl-template-break t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3292 ["Case (Use)" vhdl-template-case-use t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3293 ["If (Use)" vhdl-template-if-use t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3294 ["Limit" vhdl-template-limit t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3295 ["Nature" vhdl-template-nature t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3296 ["Procedural" vhdl-template-procedural t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3297 ["Quantity (Free)" vhdl-template-quantity-free t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3298 ["Quantity (Branch)" vhdl-template-quantity-branch t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3299 ["Quantity (Source)" vhdl-template-quantity-source t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3300 ["Subnature" vhdl-template-subnature t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3301 ["Terminal" vhdl-template-terminal t])))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3302 '(["Insert Construct..." vhdl-template-insert-construct
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3303 :keys "C-c C-i C-t"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3304 "--")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3305 (list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3306 (append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3307 '("Package")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3308 (when (vhdl-standard-p 'math)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3309 '(["math_complex" vhdl-template-package-math-complex t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3310 ["math_real" vhdl-template-package-math-real t]))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3311 '(["numeric_bit" vhdl-template-package-numeric-bit t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3312 ["numeric_std" vhdl-template-package-numeric-std t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3313 ["std_logic_1164" vhdl-template-package-std-logic-1164 t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3314 ["textio" vhdl-template-package-textio t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3315 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3316 ["std_logic_arith" vhdl-template-package-std-logic-arith t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3317 ["std_logic_signed" vhdl-template-package-std-logic-signed t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3318 ["std_logic_unsigned" vhdl-template-package-std-logic-unsigned t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3319 ["std_logic_misc" vhdl-template-package-std-logic-misc t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3320 ["std_logic_textio" vhdl-template-package-std-logic-textio t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3321 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3322 ["Insert Package..." vhdl-template-insert-package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3323 :keys "C-c C-i C-p"])))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3324 '(("Directive"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3325 ["translate_on" vhdl-template-directive-translate-on t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3326 ["translate_off" vhdl-template-directive-translate-off t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3327 ["synthesis_on" vhdl-template-directive-synthesis-on t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3328 ["synthesis_off" vhdl-template-directive-synthesis-off t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3329 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3330 ["Insert Directive..." vhdl-template-insert-directive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3331 :keys "C-c C-i C-d"])
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3332 "--"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3333 ["Insert Header" vhdl-template-header :keys "C-c C-t C-h"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3334 ["Insert Footer" vhdl-template-footer t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3335 ["Insert Date" vhdl-template-insert-date t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3336 ["Modify Date" vhdl-template-modify :keys "C-c C-t C-m"]
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3337 "--"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3338 ["Query Next Prompt" vhdl-template-search-prompt t]))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3339 ,(append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3340 '("Model")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3341 ;; add menu entries for defined models
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3342 (let ((model-alist vhdl-model-alist) menu-list model)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3343 (while model-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3344 (setq model (car model-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3345 (setq menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3346 (cons
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3347 (vector
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3348 (nth 0 model)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3349 (vhdl-function-name "vhdl-model" (nth 0 model))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3350 :keys (concat "C-c C-m " (key-description (nth 2 model))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3351 menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3352 (setq model-alist (cdr model-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3353 (setq menu-list (nreverse menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3354 (vhdl-menu-split menu-list "Model"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3355 '("--" "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3356 ["Insert Model..." vhdl-model-insert :keys "C-c C-i C-m"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3357 ["Customize Model..." (customize-option 'vhdl-model-alist) t]))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3358 ("Port"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3359 ["Copy" vhdl-port-copy t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3360 "--"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3361 ["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
3362 ["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
3363 ["Paste As Instance" vhdl-port-paste-instance
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3364 :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
3365 ["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
3366 ["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
3367 ["Paste As Generic Map" vhdl-port-paste-generic-map vhdl-port-list]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3368 ["Paste As Initializations" vhdl-port-paste-initializations vhdl-port-list]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3369 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3370 ["Paste As Testbench" vhdl-port-paste-testbench vhdl-port-list]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3371 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3372 ["Flatten" vhdl-port-flatten
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3373 :style toggle :selected vhdl-port-flattened :active vhdl-port-list]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3374 ["Reverse Direction" vhdl-port-reverse-direction
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3375 :style toggle :selected vhdl-port-reversed-direction :active vhdl-port-list])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3376 ("Compose"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3377 ["New Component" vhdl-compose-new-component t]
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3378 ["Copy Component" vhdl-port-copy t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3379 ["Place Component" vhdl-compose-place-component vhdl-port-list]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3380 ["Wire Components" vhdl-compose-wire-components t]
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3381 "--"
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3382 ["Generate Configuration" vhdl-compose-configuration t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3383 ["Generate Components Package" vhdl-compose-components-package t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3384 ("Subprogram"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3385 ["Copy" vhdl-subprog-copy t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3386 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3387 ["Paste As Declaration" vhdl-subprog-paste-declaration vhdl-subprog-list]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3388 ["Paste As Body" vhdl-subprog-paste-body vhdl-subprog-list]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3389 ["Paste As Call" vhdl-subprog-paste-call vhdl-subprog-list]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3390 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3391 ["Flatten" vhdl-subprog-flatten
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3392 :style toggle :selected vhdl-subprog-flattened :active vhdl-subprog-list])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3393 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3394 ("Comment"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3395 ["(Un)Comment Out Region" vhdl-comment-uncomment-region (mark)]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3396 "--"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3397 ["Insert Inline Comment" vhdl-comment-append-inline t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3398 ["Insert Horizontal Line" vhdl-comment-display-line t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3399 ["Insert Display Comment" vhdl-comment-display t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3400 "--"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3401 ["Fill Comment" fill-paragraph t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3402 ["Fill Comment Region" fill-region (mark)]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3403 ["Kill Comment Region" vhdl-comment-kill-region (mark)]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3404 ["Kill Inline Comment Region" vhdl-comment-kill-inline-region (mark)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3405 ("Line"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3406 ["Kill" vhdl-line-kill t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3407 ["Copy" vhdl-line-copy t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3408 ["Yank" vhdl-line-yank t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3409 ["Expand" vhdl-line-expand t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3410 "--"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3411 ["Transpose Next" vhdl-line-transpose-next t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3412 ["Transpose Prev" vhdl-line-transpose-previous t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3413 ["Open" vhdl-line-open t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3414 ["Join" vhdl-delete-indentation t]
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3415 "--"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3416 ["Goto" goto-line t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3417 ["(Un)Comment Out" vhdl-comment-uncomment-line t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3418 ("Move"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3419 ["Forward Statement" vhdl-end-of-statement t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3420 ["Backward Statement" vhdl-beginning-of-statement t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3421 ["Forward Expression" vhdl-forward-sexp t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3422 ["Backward Expression" vhdl-backward-sexp t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3423 ["Forward Same Indent" vhdl-forward-same-indent t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3424 ["Backward Same Indent" vhdl-backward-same-indent t]
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3425 ["Forward Function" vhdl-end-of-defun t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3426 ["Backward Function" vhdl-beginning-of-defun t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3427 ["Mark Function" vhdl-mark-defun t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3428 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3429 ("Indent"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3430 ["Line" indent-according-to-mode :keys "C-c C-i C-l"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3431 ["Group" vhdl-indent-group :keys "C-c C-i C-g"]
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3432 ["Region" vhdl-indent-region (mark)]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3433 ["Buffer" vhdl-indent-buffer :keys "C-c C-i C-b"])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3434 ("Align"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3435 ["Group" vhdl-align-group t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3436 ["Same Indent" vhdl-align-same-indent :keys "C-c C-a C-i"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3437 ["List" vhdl-align-list t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3438 ["Declarations" vhdl-align-declarations t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3439 ["Region" vhdl-align-region (mark)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3440 ["Buffer" vhdl-align-buffer t]
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3441 "--"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3442 ["Inline Comment Group" vhdl-align-inline-comment-group t]
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3443 ["Inline Comment Region" vhdl-align-inline-comment-region (mark)]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3444 ["Inline Comment Buffer" vhdl-align-inline-comment-buffer t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3445 ("Fill"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3446 ["List" vhdl-fill-list t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3447 ["Group" vhdl-fill-group t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3448 ["Same Indent" vhdl-fill-same-indent :keys "C-c C-f C-i"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3449 ["Region" vhdl-fill-region (mark)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3450 ("Beautify"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3451 ["Region" vhdl-beautify-region (mark)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3452 ["Buffer" vhdl-beautify-buffer t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3453 ("Fix"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3454 ["Generic/Port Clause" vhdl-fix-clause t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3455 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3456 ["Case Region" vhdl-fix-case-region (mark)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3457 ["Case Buffer" vhdl-fix-case-buffer t]
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
3458 "--"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3459 ["Whitespace Region" vhdl-fixup-whitespace-region (mark)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3460 ["Whitespace Buffer" vhdl-fixup-whitespace-buffer t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3461 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3462 ["Trailing Spaces Buffer" vhdl-remove-trailing-spaces t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3463 ("Update"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3464 ["Sensitivity List" vhdl-update-sensitivity-list-process t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3465 ["Sensitivity List Buffer" vhdl-update-sensitivity-list-buffer t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3466 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3467 ["Fontify Buffer" vhdl-fontify-buffer t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3468 ["Statistics Buffer" vhdl-statistics-buffer t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3469 ["Show Messages" vhdl-show-messages t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3470 ["Syntactic Info" vhdl-show-syntactic-information t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3471 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3472 ["Speedbar" vhdl-speedbar t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3473 ["Hide/Show" vhdl-hs-minor-mode t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3474 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3475 ("Documentation"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3476 ["VHDL Mode" vhdl-doc-mode :keys "C-c C-h"]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3477 ["Release Notes" (vhdl-doc-variable 'vhdl-doc-release-notes) t]
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
3478 ["Reserved Words" (vhdl-doc-variable 'vhdl-doc-keywords) t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3479 ["Coding Style" (vhdl-doc-variable 'vhdl-doc-coding-style) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3480 ["Version" vhdl-version t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3481 ["Bug Report..." vhdl-submit-bug-report t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3482 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3483 ("Options"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3484 ("Mode"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3485 ["Electric Mode"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3486 (progn (customize-set-variable 'vhdl-electric-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3487 (not vhdl-electric-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3488 (vhdl-mode-line-update))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3489 :style toggle :selected vhdl-electric-mode :keys "C-c C-m C-e"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3490 ["Stutter Mode"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3491 (progn (customize-set-variable 'vhdl-stutter-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3492 (not vhdl-stutter-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3493 (vhdl-mode-line-update))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3494 :style toggle :selected vhdl-stutter-mode :keys "C-c C-m C-s"]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3495 ["Indent Tabs Mode"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3496 (progn (customize-set-variable 'vhdl-indent-tabs-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3497 (not vhdl-indent-tabs-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3498 (setq indent-tabs-mode vhdl-indent-tabs-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3499 :style toggle :selected vhdl-indent-tabs-mode]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3500 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3501 ["Customize Group..." (customize-group 'vhdl-mode) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3502 ("Project"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3503 ["Project Setup..." (customize-option 'vhdl-project-alist) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3504 ,(append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3505 '("Selected Project at Startup"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3506 ["None" (progn (customize-set-variable 'vhdl-project nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3507 (vhdl-set-project ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3508 :style radio :selected (null vhdl-project)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3509 "--")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3510 ;; add menu entries for defined projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3511 (let ((project-alist vhdl-project-alist) menu-list name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3512 (while project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3513 (setq name (caar project-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3514 (setq menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3515 (cons `[,name (progn (customize-set-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3516 'vhdl-project ,name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3517 (vhdl-set-project ,name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3518 :style radio :selected (equal ,name vhdl-project)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3519 menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3520 (setq project-alist (cdr project-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3521 (setq menu-list (nreverse menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3522 (vhdl-menu-split menu-list "Project")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3523 ["Setup File Name..." (customize-option 'vhdl-project-file-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3524 ("Auto Load Setup File"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3525 ["At Startup"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3526 (customize-set-variable 'vhdl-project-auto-load
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3527 (if (memq 'startup vhdl-project-auto-load)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3528 (delq 'startup vhdl-project-auto-load)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3529 (cons 'startup vhdl-project-auto-load)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3530 :style toggle :selected (memq 'startup vhdl-project-auto-load)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3531 ["Sort Projects"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3532 (customize-set-variable 'vhdl-project-sort (not vhdl-project-sort))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3533 :style toggle :selected vhdl-project-sort]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3534 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3535 ["Customize Group..." (customize-group 'vhdl-project) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3536 ("Compiler"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3537 ["Compiler Setup..." (customize-option 'vhdl-compiler-alist) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3538 ,(append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3539 '("Selected Compiler at Startup")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3540 ;; add menu entries for defined compilers
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3541 (let ((comp-alist vhdl-compiler-alist) menu-list name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3542 (while comp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3543 (setq name (caar comp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3544 (setq menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3545 (cons `[,name (customize-set-variable 'vhdl-compiler ,name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3546 :style radio :selected (equal ,name vhdl-compiler)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3547 menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3548 (setq comp-alist (cdr comp-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3549 (setq menu-list (nreverse menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3550 (vhdl-menu-split menu-list "Compler")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3551 ["Use Local Error Regexp"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3552 (customize-set-variable 'vhdl-compile-use-local-error-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3553 (not vhdl-compile-use-local-error-regexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3554 :style toggle :selected vhdl-compile-use-local-error-regexp]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3555 ["Makefile Generation Hook..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3556 (customize-option 'vhdl-makefile-generation-hook) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3557 ["Default Library Name" (customize-option 'vhdl-default-library) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3558 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3559 ["Customize Group..." (customize-group 'vhdl-compiler) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3560 ("Style"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3561 ("VHDL Standard"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3562 ["VHDL'87"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3563 (progn (customize-set-variable 'vhdl-standard
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3564 (list '87 (cadr vhdl-standard)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3565 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3566 :style radio :selected (eq '87 (car vhdl-standard))]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3567 ["VHDL'93"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3568 (progn (customize-set-variable 'vhdl-standard
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3569 (list '93 (cadr vhdl-standard)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3570 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3571 :style radio :selected (eq '93 (car vhdl-standard))]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3572 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3573 ["VHDL-AMS"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3574 (progn (customize-set-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3575 'vhdl-standard (list (car vhdl-standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3576 (if (memq 'ams (cadr vhdl-standard))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3577 (delq 'ams (cadr vhdl-standard))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3578 (cons 'ams (cadr vhdl-standard)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3579 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3580 :style toggle :selected (memq 'ams (cadr vhdl-standard))]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3581 ["Math Packages"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3582 (progn (customize-set-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3583 'vhdl-standard (list (car vhdl-standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3584 (if (memq 'math (cadr vhdl-standard))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3585 (delq 'math (cadr vhdl-standard))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3586 (cons 'math (cadr vhdl-standard)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3587 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3588 :style toggle :selected (memq 'math (cadr vhdl-standard))])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3589 ["Indentation Offset..." (customize-option 'vhdl-basic-offset) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3590 ["Upper Case Keywords"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3591 (customize-set-variable 'vhdl-upper-case-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3592 (not vhdl-upper-case-keywords))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3593 :style toggle :selected vhdl-upper-case-keywords]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3594 ["Upper Case Types"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3595 (customize-set-variable 'vhdl-upper-case-types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3596 (not vhdl-upper-case-types))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3597 :style toggle :selected vhdl-upper-case-types]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3598 ["Upper Case Attributes"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3599 (customize-set-variable 'vhdl-upper-case-attributes
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3600 (not vhdl-upper-case-attributes))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3601 :style toggle :selected vhdl-upper-case-attributes]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3602 ["Upper Case Enumeration Values"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3603 (customize-set-variable 'vhdl-upper-case-enum-values
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3604 (not vhdl-upper-case-enum-values))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3605 :style toggle :selected vhdl-upper-case-enum-values]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3606 ["Upper Case Constants"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3607 (customize-set-variable 'vhdl-upper-case-constants
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3608 (not vhdl-upper-case-constants))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3609 :style toggle :selected vhdl-upper-case-constants]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3610 ("Use Direct Instantiation"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3611 ["Never"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3612 (customize-set-variable 'vhdl-use-direct-instantiation 'never)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3613 :style radio :selected (eq 'never vhdl-use-direct-instantiation)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3614 ["Standard"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3615 (customize-set-variable 'vhdl-use-direct-instantiation 'standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3616 :style radio :selected (eq 'standard vhdl-use-direct-instantiation)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3617 ["Always"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3618 (customize-set-variable 'vhdl-use-direct-instantiation 'always)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3619 :style radio :selected (eq 'always vhdl-use-direct-instantiation)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3620 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3621 ["Customize Group..." (customize-group 'vhdl-style) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3622 ("Naming"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3623 ["Entity File Name..." (customize-option 'vhdl-entity-file-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3624 ["Architecture File Name..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3625 (customize-option 'vhdl-architecture-file-name) t]
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3626 ["Configuration File Name..."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3627 (customize-option 'vhdl-configuration-file-name) t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3628 ["Package File Name..." (customize-option 'vhdl-package-file-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3629 ("File Name Case"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3630 ["As Is"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3631 (customize-set-variable 'vhdl-file-name-case 'identity)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3632 :style radio :selected (eq 'identity vhdl-file-name-case)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3633 ["Lower Case"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3634 (customize-set-variable 'vhdl-file-name-case 'downcase)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3635 :style radio :selected (eq 'downcase vhdl-file-name-case)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3636 ["Upper Case"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3637 (customize-set-variable 'vhdl-file-name-case 'upcase)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3638 :style radio :selected (eq 'upcase vhdl-file-name-case)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3639 ["Capitalize"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3640 (customize-set-variable 'vhdl-file-name-case 'capitalize)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3641 :style radio :selected (eq 'capitalize vhdl-file-name-case)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3642 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3643 ["Customize Group..." (customize-group 'vhdl-naming) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3644 ("Template"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3645 ("Electric Keywords"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3646 ["VHDL Keywords"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3647 (customize-set-variable 'vhdl-electric-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3648 (if (memq 'vhdl vhdl-electric-keywords)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3649 (delq 'vhdl vhdl-electric-keywords)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3650 (cons 'vhdl vhdl-electric-keywords)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3651 :style toggle :selected (memq 'vhdl vhdl-electric-keywords)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3652 ["User Model Keywords"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3653 (customize-set-variable 'vhdl-electric-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3654 (if (memq 'user vhdl-electric-keywords)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3655 (delq 'user vhdl-electric-keywords)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3656 (cons 'user vhdl-electric-keywords)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3657 :style toggle :selected (memq 'user vhdl-electric-keywords)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3658 ("Insert Optional Labels"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3659 ["None"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3660 (customize-set-variable 'vhdl-optional-labels 'none)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3661 :style radio :selected (eq 'none vhdl-optional-labels)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3662 ["Processes Only"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3663 (customize-set-variable 'vhdl-optional-labels 'process)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3664 :style radio :selected (eq 'process vhdl-optional-labels)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3665 ["All Constructs"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3666 (customize-set-variable 'vhdl-optional-labels 'all)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3667 :style radio :selected (eq 'all vhdl-optional-labels)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3668 ("Insert Empty Lines"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3669 ["None"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3670 (customize-set-variable 'vhdl-insert-empty-lines 'none)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3671 :style radio :selected (eq 'none vhdl-insert-empty-lines)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3672 ["Design Units Only"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3673 (customize-set-variable 'vhdl-insert-empty-lines 'unit)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3674 :style radio :selected (eq 'unit vhdl-insert-empty-lines)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3675 ["All Constructs"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3676 (customize-set-variable 'vhdl-insert-empty-lines 'all)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3677 :style radio :selected (eq 'all vhdl-insert-empty-lines)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3678 ["Argument List Indent"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3679 (customize-set-variable 'vhdl-argument-list-indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3680 (not vhdl-argument-list-indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3681 :style toggle :selected vhdl-argument-list-indent]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3682 ["Association List with Formals"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3683 (customize-set-variable 'vhdl-association-list-with-formals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3684 (not vhdl-association-list-with-formals))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3685 :style toggle :selected vhdl-association-list-with-formals]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3686 ["Conditions in Parenthesis"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3687 (customize-set-variable 'vhdl-conditions-in-parenthesis
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3688 (not vhdl-conditions-in-parenthesis))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3689 :style toggle :selected vhdl-conditions-in-parenthesis]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3690 ["Zero String..." (customize-option 'vhdl-zero-string) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3691 ["One String..." (customize-option 'vhdl-one-string) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3692 ("File Header"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3693 ["Header String..." (customize-option 'vhdl-file-header) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3694 ["Footer String..." (customize-option 'vhdl-file-footer) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3695 ["Company Name..." (customize-option 'vhdl-company-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3696 ["Copyright String..." (customize-option 'vhdl-copyright-string) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3697 ["Platform Specification..." (customize-option 'vhdl-platform-spec) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3698 ["Date Format..." (customize-option 'vhdl-date-format) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3699 ["Modify Date Prefix String..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3700 (customize-option 'vhdl-modify-date-prefix-string) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3701 ["Modify Date on Saving"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3702 (progn (customize-set-variable 'vhdl-modify-date-on-saving
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3703 (not vhdl-modify-date-on-saving))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3704 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3705 :style toggle :selected vhdl-modify-date-on-saving])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3706 ("Sequential Process"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3707 ("Kind of Reset"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3708 ["None"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3709 (customize-set-variable 'vhdl-reset-kind 'none)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3710 :style radio :selected (eq 'none vhdl-reset-kind)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3711 ["Synchronous"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3712 (customize-set-variable 'vhdl-reset-kind 'sync)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3713 :style radio :selected (eq 'sync vhdl-reset-kind)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3714 ["Asynchronous"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3715 (customize-set-variable 'vhdl-reset-kind 'async)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3716 :style radio :selected (eq 'async vhdl-reset-kind)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3717 ["Reset is Active High"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3718 (customize-set-variable 'vhdl-reset-active-high
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3719 (not vhdl-reset-active-high))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3720 :style toggle :selected vhdl-reset-active-high]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3721 ["Use Rising Clock Edge"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3722 (customize-set-variable 'vhdl-clock-rising-edge
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3723 (not vhdl-clock-rising-edge))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3724 :style toggle :selected vhdl-clock-rising-edge]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3725 ("Clock Edge Condition"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3726 ["Standard"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3727 (customize-set-variable 'vhdl-clock-edge-condition 'standard)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3728 :style radio :selected (eq 'standard vhdl-clock-edge-condition)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3729 ["Function \"rising_edge\""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3730 (customize-set-variable 'vhdl-clock-edge-condition 'function)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3731 :style radio :selected (eq 'function vhdl-clock-edge-condition)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3732 ["Clock Name..." (customize-option 'vhdl-clock-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3733 ["Reset Name..." (customize-option 'vhdl-reset-name) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3734 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3735 ["Customize Group..." (customize-group 'vhdl-template) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3736 ("Model"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3737 ["Model Definition..." (customize-option 'vhdl-model-alist) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3738 ("Port"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3739 ["Include Port Comments"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3740 (customize-set-variable 'vhdl-include-port-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3741 (not vhdl-include-port-comments))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3742 :style toggle :selected vhdl-include-port-comments]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3743 ["Include Direction Comments"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3744 (customize-set-variable 'vhdl-include-direction-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3745 (not vhdl-include-direction-comments))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3746 :style toggle :selected vhdl-include-direction-comments]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3747 ["Include Type Comments"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3748 (customize-set-variable 'vhdl-include-type-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3749 (not vhdl-include-type-comments))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3750 :style toggle :selected vhdl-include-type-comments]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3751 ("Include Group Comments"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3752 ["Never"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3753 (customize-set-variable 'vhdl-include-group-comments 'never)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3754 :style radio :selected (eq 'never vhdl-include-group-comments)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3755 ["Declarations"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3756 (customize-set-variable 'vhdl-include-group-comments 'decl)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3757 :style radio :selected (eq 'decl vhdl-include-group-comments)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3758 ["Always"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3759 (customize-set-variable 'vhdl-include-group-comments 'always)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3760 :style radio :selected (eq 'always vhdl-include-group-comments)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3761 ["Actual Port Name..." (customize-option 'vhdl-actual-port-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3762 ["Instance Name..." (customize-option 'vhdl-instance-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3763 ("Testbench"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3764 ["Entity Name..." (customize-option 'vhdl-testbench-entity-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3765 ["Architecture Name..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3766 (customize-option 'vhdl-testbench-architecture-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3767 ["Configuration Name..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3768 (customize-option 'vhdl-testbench-configuration-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3769 ["DUT Name..." (customize-option 'vhdl-testbench-dut-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3770 ["Include Header"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3771 (customize-set-variable 'vhdl-testbench-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3772 (not vhdl-testbench-include-header))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3773 :style toggle :selected vhdl-testbench-include-header]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3774 ["Declarations..." (customize-option 'vhdl-testbench-declarations) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3775 ["Statements..." (customize-option 'vhdl-testbench-statements) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3776 ["Initialize Signals"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3777 (customize-set-variable 'vhdl-testbench-initialize-signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3778 (not vhdl-testbench-initialize-signals))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3779 :style toggle :selected vhdl-testbench-initialize-signals]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3780 ["Include Library Clause"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3781 (customize-set-variable 'vhdl-testbench-include-library
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3782 (not vhdl-testbench-include-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3783 :style toggle :selected vhdl-testbench-include-library]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3784 ["Include Configuration"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3785 (customize-set-variable 'vhdl-testbench-include-configuration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3786 (not vhdl-testbench-include-configuration))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3787 :style toggle :selected vhdl-testbench-include-configuration]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3788 ("Create Files"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3789 ["None"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3790 (customize-set-variable 'vhdl-testbench-create-files 'none)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3791 :style radio :selected (eq 'none vhdl-testbench-create-files)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3792 ["Single"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3793 (customize-set-variable 'vhdl-testbench-create-files 'single)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3794 :style radio :selected (eq 'single vhdl-testbench-create-files)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3795 ["Separate"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3796 (customize-set-variable 'vhdl-testbench-create-files 'separate)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3797 :style radio :selected (eq 'separate vhdl-testbench-create-files)])
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3798 ["Testbench Entity File Name..."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3799 (customize-option 'vhdl-testbench-entity-file-name) t]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3800 ["Testbench Architecture File Name..."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3801 (customize-option 'vhdl-testbench-architecture-file-name) t])
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3802 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3803 ["Customize Group..." (customize-group 'vhdl-port) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3804 ("Compose"
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3805 ["Architecture Name..."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3806 (customize-option 'vhdl-compose-architecture-name) t]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3807 ["Configuration Name..."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3808 (customize-option 'vhdl-compose-configuration-name) t]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3809 ["Components Package Name..."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3810 (customize-option 'vhdl-components-package-name) t]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3811 ["Use Components Package"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3812 (customize-set-variable 'vhdl-use-components-package
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3813 (not vhdl-use-components-package))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3814 :style toggle :selected vhdl-use-components-package]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3815 ["Include Header"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3816 (customize-set-variable 'vhdl-compose-include-header
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3817 (not vhdl-compose-include-header))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3818 :style toggle :selected vhdl-compose-include-header]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3819 ("Create Entity/Architecture Files"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3820 ["None"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3821 (customize-set-variable 'vhdl-compose-create-files 'none)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3822 :style radio :selected (eq 'none vhdl-compose-create-files)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3823 ["Single"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3824 (customize-set-variable 'vhdl-compose-create-files 'single)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3825 :style radio :selected (eq 'single vhdl-compose-create-files)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3826 ["Separate"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3827 (customize-set-variable 'vhdl-compose-create-files 'separate)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3828 :style radio :selected (eq 'separate vhdl-compose-create-files)])
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3829 ["Create Configuration File"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3830 (customize-set-variable 'vhdl-compose-configuration-create-file
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3831 (not vhdl-compose-configuration-create-file))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3832 :style toggle :selected vhdl-compose-configuration-create-file]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3833 ["Hierarchical Configuration"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3834 (customize-set-variable 'vhdl-compose-configuration-hierarchical
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3835 (not vhdl-compose-configuration-hierarchical))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3836 :style toggle :selected vhdl-compose-configuration-hierarchical]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3837 ["Use Subconfiguration"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3838 (customize-set-variable 'vhdl-compose-configuration-use-subconfiguration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3839 (not vhdl-compose-configuration-use-subconfiguration))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
3840 :style toggle :selected vhdl-compose-configuration-use-subconfiguration]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3841 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3842 ["Customize Group..." (customize-group 'vhdl-compose) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3843 ("Comment"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3844 ["Self Insert Comments"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3845 (customize-set-variable 'vhdl-self-insert-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3846 (not vhdl-self-insert-comments))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3847 :style toggle :selected vhdl-self-insert-comments]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3848 ["Prompt for Comments"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3849 (customize-set-variable 'vhdl-prompt-for-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3850 (not vhdl-prompt-for-comments))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3851 :style toggle :selected vhdl-prompt-for-comments]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3852 ["Inline Comment Column..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3853 (customize-option 'vhdl-inline-comment-column) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3854 ["End Comment Column..." (customize-option 'vhdl-end-comment-column) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3855 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3856 ["Customize Group..." (customize-group 'vhdl-comment) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3857 ("Align"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3858 ["Auto Align Templates"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3859 (customize-set-variable 'vhdl-auto-align (not vhdl-auto-align))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3860 :style toggle :selected vhdl-auto-align]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3861 ["Align Line Groups"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3862 (customize-set-variable 'vhdl-align-groups (not vhdl-align-groups))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3863 :style toggle :selected vhdl-align-groups]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3864 ["Group Separation String..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3865 (customize-set-variable 'vhdl-align-group-separate) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3866 ["Align Lines with Same Indent"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3867 (customize-set-variable 'vhdl-align-same-indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3868 (not vhdl-align-same-indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3869 :style toggle :selected vhdl-align-same-indent]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3870 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3871 ["Customize Group..." (customize-group 'vhdl-align) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3872 ("Highlight"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3873 ["Highlighting On/Off..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3874 (customize-option
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
3875 (if (fboundp 'global-font-lock-mode)
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
3876 'global-font-lock-mode 'font-lock-auto-fontify)) t]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3877 ["Highlight Keywords"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3878 (progn (customize-set-variable 'vhdl-highlight-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3879 (not vhdl-highlight-keywords))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3880 (vhdl-fontify-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3881 :style toggle :selected vhdl-highlight-keywords]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3882 ["Highlight Names"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3883 (progn (customize-set-variable 'vhdl-highlight-names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3884 (not vhdl-highlight-names))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3885 (vhdl-fontify-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3886 :style toggle :selected vhdl-highlight-names]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3887 ["Highlight Special Words"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3888 (progn (customize-set-variable 'vhdl-highlight-special-words
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3889 (not vhdl-highlight-special-words))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3890 (vhdl-fontify-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3891 :style toggle :selected vhdl-highlight-special-words]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3892 ["Highlight Forbidden Words"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3893 (progn (customize-set-variable 'vhdl-highlight-forbidden-words
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3894 (not vhdl-highlight-forbidden-words))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3895 (vhdl-fontify-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3896 :style toggle :selected vhdl-highlight-forbidden-words]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3897 ["Highlight Verilog Keywords"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3898 (progn (customize-set-variable 'vhdl-highlight-verilog-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3899 (not vhdl-highlight-verilog-keywords))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3900 (vhdl-fontify-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3901 :style toggle :selected vhdl-highlight-verilog-keywords]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3902 ["Highlight \"translate_off\""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3903 (progn (customize-set-variable 'vhdl-highlight-translate-off
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3904 (not vhdl-highlight-translate-off))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3905 (vhdl-fontify-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3906 :style toggle :selected vhdl-highlight-translate-off]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3907 ["Case Sensitive Highlighting"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3908 (progn (customize-set-variable 'vhdl-highlight-case-sensitive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3909 (not vhdl-highlight-case-sensitive))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3910 (vhdl-fontify-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3911 :style toggle :selected vhdl-highlight-case-sensitive]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3912 ["Special Syntax Definition..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3913 (customize-option 'vhdl-special-syntax-alist) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3914 ["Forbidden Words..." (customize-option 'vhdl-forbidden-words) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3915 ["Forbidden Syntax..." (customize-option 'vhdl-forbidden-syntax) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3916 ["Directive Keywords..." (customize-option 'vhdl-directive-keywords) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3917 ["Colors..." (customize-group 'vhdl-highlight-faces) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3918 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3919 ["Customize Group..." (customize-group 'vhdl-highlight) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3920 ("Speedbar"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3921 ["Auto Open at Startup"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3922 (customize-set-variable 'vhdl-speedbar-auto-open
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3923 (not vhdl-speedbar-auto-open))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3924 :style toggle :selected vhdl-speedbar-auto-open]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3925 ("Default Displaying Mode"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3926 ["Files"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3927 (customize-set-variable 'vhdl-speedbar-display-mode 'files)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3928 :style radio :selected (eq 'files vhdl-speedbar-display-mode)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3929 ["Directory Hierarchy"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3930 (customize-set-variable 'vhdl-speedbar-display-mode 'directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3931 :style radio :selected (eq 'directory vhdl-speedbar-display-mode)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3932 ["Project Hierarchy"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3933 (customize-set-variable 'vhdl-speedbar-display-mode 'project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3934 :style radio :selected (eq 'project vhdl-speedbar-display-mode)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3935 ["Indentation Offset..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3936 (customize-option 'speedbar-indentation-width) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3937 ["Scan Size Limits..." (customize-option 'vhdl-speedbar-scan-limit) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3938 ["Jump to Unit when Opening"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3939 (customize-set-variable 'vhdl-speedbar-jump-to-unit
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3940 (not vhdl-speedbar-jump-to-unit))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3941 :style toggle :selected vhdl-speedbar-jump-to-unit]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3942 ["Update Hierarchy on File Saving"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3943 (customize-set-variable 'vhdl-speedbar-update-on-saving
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3944 (not vhdl-speedbar-update-on-saving))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3945 :style toggle :selected vhdl-speedbar-update-on-saving]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3946 ("Save in Cache File"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3947 ["Hierarchy Information"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3948 (customize-set-variable 'vhdl-speedbar-save-cache
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3949 (if (memq 'hierarchy vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3950 (delq 'hierarchy vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3951 (cons 'hierarchy vhdl-speedbar-save-cache)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3952 :style toggle :selected (memq 'hierarchy vhdl-speedbar-save-cache)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3953 ["Displaying Status"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3954 (customize-set-variable 'vhdl-speedbar-save-cache
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3955 (if (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3956 (delq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3957 (cons 'display vhdl-speedbar-save-cache)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3958 :style toggle :selected (memq 'display vhdl-speedbar-save-cache)])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3959 ["Cache File Name..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3960 (customize-option 'vhdl-speedbar-cache-file-name) t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3961 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3962 ["Customize Group..." (customize-group 'vhdl-speedbar) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3963 ("Menu"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3964 ["Add Index Menu when Loading File"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3965 (progn (customize-set-variable 'vhdl-index-menu (not vhdl-index-menu))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3966 (vhdl-index-menu-init))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3967 :style toggle :selected vhdl-index-menu]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3968 ["Add Source File Menu when Loading File"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3969 (progn (customize-set-variable 'vhdl-source-file-menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3970 (not vhdl-source-file-menu))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3971 (vhdl-add-source-files-menu))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3972 :style toggle :selected vhdl-source-file-menu]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3973 ["Add Hideshow Menu at Startup"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3974 (progn (customize-set-variable 'vhdl-hideshow-menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3975 (not vhdl-hideshow-menu))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3976 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3977 :style toggle :selected vhdl-hideshow-menu]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3978 ["Hide Everything Initially"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3979 (customize-set-variable 'vhdl-hide-all-init (not vhdl-hide-all-init))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3980 :style toggle :selected vhdl-hide-all-init]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3981 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3982 ["Customize Group..." (customize-group 'vhdl-menu) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3983 ("Print"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3984 ["In Two Column Format"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3985 (progn (customize-set-variable 'vhdl-print-two-column
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3986 (not vhdl-print-two-column))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3987 (message "Activate new setting by saving options and restarting Emacs"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3988 :style toggle :selected vhdl-print-two-column]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3989 ["Use Customized Faces"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3990 (progn (customize-set-variable 'vhdl-print-customize-faces
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3991 (not vhdl-print-customize-faces))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3992 (message "Activate new setting by saving options and restarting Emacs"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3993 :style toggle :selected vhdl-print-customize-faces]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3994 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3995 ["Customize Group..." (customize-group 'vhdl-print) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3996 ("Miscellaneous"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3997 ["Use Intelligent Tab"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3998 (progn (customize-set-variable 'vhdl-intelligent-tab
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
3999 (not vhdl-intelligent-tab))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4000 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4001 :style toggle :selected vhdl-intelligent-tab]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4002 ["Indent Syntax-Based"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4003 (customize-set-variable 'vhdl-indent-syntax-based
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4004 (not vhdl-indent-syntax-based))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4005 :style toggle :selected vhdl-indent-syntax-based]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4006 ["Word Completion is Case Sensitive"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4007 (customize-set-variable 'vhdl-word-completion-case-sensitive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4008 (not vhdl-word-completion-case-sensitive))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4009 :style toggle :selected vhdl-word-completion-case-sensitive]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4010 ["Word Completion in Minibuffer"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4011 (progn (customize-set-variable 'vhdl-word-completion-in-minibuffer
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4012 (not vhdl-word-completion-in-minibuffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4013 (message "Activate new setting by saving options and restarting Emacs"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4014 :style toggle :selected vhdl-word-completion-in-minibuffer]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4015 ["Underscore is Part of Word"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4016 (progn (customize-set-variable 'vhdl-underscore-is-part-of-word
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4017 (not vhdl-underscore-is-part-of-word))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4018 (vhdl-activate-customizations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4019 :style toggle :selected vhdl-underscore-is-part-of-word]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4020 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4021 ["Customize Group..." (customize-group 'vhdl-misc) t])
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4022 ["Related..." (customize-browse 'vhdl-related) t]
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4023 "--"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4024 ["Save Options" customize-save-customized t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4025 ["Activate Options" vhdl-activate-customizations t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4026 ["Browse Options..." vhdl-customize t])))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4027
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4028 (defvar vhdl-mode-menu-list (vhdl-create-mode-menu)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4029 "VHDL Mode menu.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4030
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4031 (defun vhdl-update-mode-menu ()
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4032 "Update VHDL Mode menu."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4033 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4034 (easy-menu-remove vhdl-mode-menu-list) ; for XEmacs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4035 (setq vhdl-mode-menu-list (vhdl-create-mode-menu))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4036 (easy-menu-add vhdl-mode-menu-list) ; for XEmacs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4037 (easy-menu-define vhdl-mode-menu vhdl-mode-map
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4038 "Menu keymap for VHDL Mode." vhdl-mode-menu-list))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4039
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4040 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4041 ;; Index menu (using `imenu.el'), also used for speedbar (using `speedbar.el')
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4042
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4043 (defconst vhdl-imenu-generic-expression
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4044 '(
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4045 ("Subprogram"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4046 "^\\s-*\\(\\(\\(impure\\|pure\\)\\s-+\\|\\)function\\|procedure\\)\\s-+\\(\"?\\(\\w\\|\\s_\\)+\"?\\)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4047 4)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4048 ("Instance"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4049 "^\\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
4050 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4051 ("Component"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4052 "^\\s-*\\(component\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4053 2)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4054 ("Procedural"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4055 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\)\\s-*:\\(\\s-\\|\n\\)*\\(procedural\\)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4056 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4057 ("Process"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4058 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\)\\s-*:\\(\\s-\\|\n\\)*\\(\\(postponed\\s-+\\|\\)process\\)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4059 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4060 ("Block"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4061 "^\\s-*\\(\\(\\w\\|\\s_\\)+\\)\\s-*:\\(\\s-\\|\n\\)*\\(block\\)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4062 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4063 ("Package"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4064 "^\\s-*\\(package\\( body\\|\\)\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4065 3)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4066 ("Configuration"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4067 "^\\s-*\\(configuration\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\s-+of\\s-+\\(\\w\\|\\s_\\)+\\)"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4068 2)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4069 ("Architecture"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4070 "^\\s-*\\(architecture\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\s-+of\\s-+\\(\\w\\|\\s_\\)+\\)"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4071 2)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4072 ("Entity"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4073 "^\\s-*\\(entity\\)\\s-+\\(\\(\\w\\|\\s_\\)+\\)"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4074 2)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4075 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4076 "Imenu generic expression for VHDL Mode. See `imenu-generic-expression'.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4077
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4078 (defun vhdl-index-menu-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4079 "Initialize index menu."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4080 (set (make-local-variable 'imenu-case-fold-search) t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4081 (set (make-local-variable 'imenu-generic-expression)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4082 vhdl-imenu-generic-expression)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4083 (when (and vhdl-index-menu (fboundp 'imenu))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4084 (if (or (not (boundp 'font-lock-maximum-size))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4085 (> font-lock-maximum-size (buffer-size)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4086 (imenu-add-to-menubar "Index")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4087 (message "Scanning buffer for index...buffer too big"))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4088
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4089 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4090 ;; Source file menu (using `easy-menu.el')
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4091
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4092 (defvar vhdl-sources-menu nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4093
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4094 (defun vhdl-directory-files (directory &optional full match)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4095 "Call `directory-files' if DIRECTORY exists, otherwise generate error
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4096 message."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4097 (if (not (file-directory-p directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4098 (vhdl-warning-when-idle "No such directory: \"%s\"" directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4099 (let ((dir (directory-files directory full match)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4100 (setq dir (delete "." dir))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4101 (setq dir (delete ".." dir))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4102 dir)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4103
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4104 (defun vhdl-get-source-files (&optional full directory)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4105 "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
4106 (let ((mode-alist auto-mode-alist)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4107 filename-regexp)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4108 ;; create regular expressions for matching file names
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4109 (setq filename-regexp "\\`[^.].*\\(")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4110 (while mode-alist
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4111 (when (eq (cdar mode-alist) 'vhdl-mode)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4112 (setq filename-regexp
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4113 (concat filename-regexp (caar mode-alist) "\\|")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4114 (setq mode-alist (cdr mode-alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4115 (setq filename-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4116 (concat (substring filename-regexp 0
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4117 (string-match "\\\\|$" filename-regexp)) "\\)"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4118 ;; find files
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4119 (vhdl-directory-files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4120 (or directory default-directory) full filename-regexp)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4121
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4122 (defun vhdl-add-source-files-menu ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4123 "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
4124 The directory of the current source file is scanned."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4125 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4126 (message "Scanning directory for source files ...")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4127 (let ((newmap (current-local-map))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4128 (file-list (vhdl-get-source-files))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4129 menu-list found)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4130 ;; Create list for menu
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4131 (setq found nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4132 (while file-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4133 (setq found t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4134 (setq menu-list (cons (vector (car file-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4135 (list 'find-file (car file-list)) t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4136 menu-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4137 (setq file-list (cdr file-list)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4138 (setq menu-list (vhdl-menu-split menu-list "Sources"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4139 (when found (setq menu-list (cons "--" menu-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4140 (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
4141 (setq menu-list (cons "Sources" menu-list))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4142 ;; Create menu
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4143 (easy-menu-add menu-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4144 (easy-menu-define vhdl-sources-menu newmap
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4145 "VHDL source files menu" menu-list))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4146 (message ""))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4147
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4148
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4149 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4150 ;;; Mode definition
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4151 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4152 ;; performs all buffer local initializations
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4153
21446
830023d4cec6 *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 20665
diff changeset
4154 ;;;###autoload
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4155 (defun vhdl-mode ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4156 "Major mode for editing VHDL code.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4157
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4158 Usage:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4159 ------
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4160
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4161 TEMPLATE INSERTION (electrification):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4162 After typing a VHDL keyword and entering `SPC', you are prompted for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4163 arguments while a template is generated for that VHDL construct. Typing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4164 `RET' or `C-g' at the first \(mandatory) prompt aborts the current
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4165 template generation. Optional arguments are indicated by square
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4166 brackets and removed if the queried string is left empty. Prompts for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4167 mandatory arguments remain in the code if the queried string is left
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4168 empty. They can be queried again by `C-c C-t C-q'. Enabled
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4169 electrification is indicated by `/e' in the modeline.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4170
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4171 Typing `M-SPC' after a keyword inserts a space without calling the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4172 template generator. Automatic template generation (i.e.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4173 electrification) can be disabled (enabled) by typing `C-c C-m C-e' or by
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4174 setting option `vhdl-electric-mode' (see OPTIONS).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4175
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4176 Template generators can be invoked from the VHDL menu, by key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4177 bindings, by typing `C-c C-i C-c' and choosing a construct, or by typing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4178 the keyword (i.e. first word of menu entry not in parenthesis) and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4179 `SPC'. The following abbreviations can also be used: arch, attr, cond,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4180 conf, comp, cons, func, inst, pack, sig, var.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4181
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4182 Template styles can be customized in customization group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4183 `vhdl-template' \(see OPTIONS).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4184
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4185
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4186 HEADER INSERTION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4187 A file header can be inserted by `C-c C-t C-h'. A file footer
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4188 (template at the end of the file) can be inserted by `C-c C-t C-f'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4189 See customization group `vhdl-header'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4190
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4191
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4192 STUTTERING:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4193 Double striking of some keys inserts cumbersome VHDL syntax elements.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4194 Stuttering can be disabled (enabled) by typing `C-c C-m C-s' or by
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4195 option `vhdl-stutter-mode'. Enabled stuttering is indicated by `/s' in
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4196 the modeline. The stuttering keys and their effects are:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4197
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4198 ;; --> \" : \" [ --> ( -- --> comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4199 ;;; --> \" := \" [[ --> [ --CR --> comment-out code
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4200 .. --> \" => \" ] --> ) --- --> horizontal line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4201 ,, --> \" <= \" ]] --> ] ---- --> display comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4202 == --> \" == \" '' --> \\\"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4203
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4204
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4205 WORD COMPLETION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4206 Typing `TAB' after a (not completed) word looks for a VHDL keyword or a
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4207 word in the buffer that starts alike, inserts it and adjusts case.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4208 Re-typing `TAB' toggles through alternative word completions. This also
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4209 works in the minibuffer (i.e. in template generator prompts).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4210
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4211 Typing `TAB' after `(' looks for and inserts complete parenthesized
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4212 expressions (e.g. for array index ranges). All keywords as well as
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4213 standard types and subprograms of VHDL have predefined abbreviations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4214 \(e.g. type \"std\" and `TAB' will toggle through all standard types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4215 beginning with \"std\").
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4216
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4217 Typing `TAB' after a non-word character indents the line if at the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4218 beginning of a line (i.e. no preceding non-blank characters), and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4219 inserts a tabulator stop otherwise. `M-TAB' always inserts a tabulator
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4220 stop.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4221
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4222
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4223 COMMENTS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4224 `--' puts a single comment.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4225 `---' draws a horizontal line for separating code segments.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4226 `----' inserts a display comment, i.e. two horizontal lines
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4227 with a comment in between.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4228 `--CR' comments out code on that line. Re-hitting CR comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4229 out following lines.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4230 `C-c c' comments out a region if not commented out,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4231 uncomments a region if already commented out.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4232
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4233 You are prompted for comments after object definitions (i.e. signals,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4234 variables, constants, ports) and after subprogram and process
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4235 specifications if option `vhdl-prompt-for-comments' is non-nil.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4236 Comments are automatically inserted as additional labels (e.g. after
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4237 begin statements) and as help comments if `vhdl-self-insert-comments' is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4238 non-nil.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4239
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4240 Inline comments (i.e. comments after a piece of code on the same line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4241 are indented at least to `vhdl-inline-comment-column'. Comments go at
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4242 maximum to `vhdl-end-comment-column'. `RET' after a space in a comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4243 will open a new comment line. Typing beyond `vhdl-end-comment-column'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4244 in a comment automatically opens a new comment line. `M-q' re-fills
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4245 multi-line comments.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4246
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4247
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4248 INDENTATION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4249 `TAB' indents a line if at the beginning of the line. The amount of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4250 indentation is specified by option `vhdl-basic-offset'. `C-c C-i C-l'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4251 always indents the current line (is bound to `TAB' if option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4252 `vhdl-intelligent-tab' is nil).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4253
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4254 Indentation can be done for a group of lines (`C-c C-i C-g'), a region
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4255 \(`M-C-\\') or the entire buffer (menu). Argument and port lists are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4256 indented normally (nil) or relative to the opening parenthesis (non-nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4257 according to option `vhdl-argument-list-indent'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4258
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4259 If option `vhdl-indent-tabs-mode' is nil, spaces are used instead of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4260 tabs. `M-x tabify' and `M-x untabify' allow to convert spaces to tabs
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4261 and vice versa.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4262
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4263 Syntax-based indentation can be very slow in large files. Option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4264 `vhdl-indent-syntax-based' allows to use faster but simpler indentation.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4265
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4266
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4267 ALIGNMENT:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4268 The alignment functions align operators, keywords, and inline comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4269 to beautify the code. `C-c C-a C-a' aligns a group of consecutive lines
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4270 separated by blank lines, `C-c C-a C-i' a block of lines with same
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4271 indent. `C-c C-a C-l' aligns all lines belonging to a list enclosed by
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4272 a pair of parentheses (e.g. port clause/map, argument list), and `C-c
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4273 C-a C-d' all lines within the declarative part of a design unit. `C-c
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4274 C-a M-a' aligns an entire region. `C-c C-a C-c' aligns inline comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4275 for a group of lines, and `C-c C-a M-c' for a region.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4276
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4277 If option `vhdl-align-groups' is non-nil, groups of code lines
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4278 separated by special lines (see option `vhdl-align-group-separate') are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4279 aligned individually. If option `vhdl-align-same-indent' is non-nil,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4280 blocks of lines with same indent are aligned separately. Some templates
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4281 are automatically aligned after generation if option `vhdl-auto-align'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4282 is non-nil.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4283
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4284 Alignment tries to align inline comments at
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4285 `vhdl-inline-comment-column' and tries inline comment not to exceed
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4286 `vhdl-end-comment-column'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4287
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4288 `C-c C-x M-w' fixes up whitespace in a region. That is, operator
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4289 symbols are surrounded by one space, and multiple spaces are eliminated.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4290
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4291
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4292 CODE FILLING:
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4293 Code filling allows to condense code (e.g. sensitivity lists or port
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4294 maps) by removing comments and newlines and re-wrapping so that all
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4295 lines are maximally filled (block filling). `C-c C-f C-f' fills a list
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4296 enclosed by parenthesis, `C-c C-f C-g' a group of lines separated by
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4297 blank lines, `C-c C-f C-i' a block of lines with same indent, and
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4298 `C-c C-f M-f' an entire region.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4299
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4300
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4301 CODE BEAUTIFICATION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4302 `C-c M-b' and `C-c C-b' beautify the code of a region or of the entire
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4303 buffer respectively. This inludes indentation, alignment, and case
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4304 fixing. Code beautification can also be run non-interactively using the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4305 command:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4306
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4307 emacs -batch -l ~/.emacs filename.vhd -f vhdl-beautify-buffer
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4308
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4309
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4310 PORT TRANSLATION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4311 Generic and port clauses from entity or component declarations can be
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4312 copied (`C-c C-p C-w') and pasted as entity and component declarations,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4313 as component instantiations and corresponding internal constants and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4314 signals, as a generic map with constants as actual generics, and as
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4315 internal signal initializations (menu).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4316
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4317 To include formals in component instantiations, see option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4318 `vhdl-association-list-with-formals'. To include comments in pasting,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4319 see options `vhdl-include-...-comments'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4320
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4321 A clause with several generic/port names on the same line can be
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4322 flattened (`C-c C-p C-f') so that only one name per line exists. The
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4323 direction of ports can be reversed (`C-c C-p C-r'), i.e., inputs become
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4324 outputs and vice versa, which can be useful in testbenches. (This
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4325 reversion is done on the internal data structure and is only reflected
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4326 in subsequent paste operations.)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4327
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4328 Names for actual ports, instances, testbenches, and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4329 design-under-test instances can be derived from existing names according
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4330 to options `vhdl-...-name'. See customization group `vhdl-port'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4331
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4332
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4333 SUBPROGRAM TRANSLATION:
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4334 Similar functionality exists for copying/pasting the interface of
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4335 subprograms (function/procedure). A subprogram interface can be copied
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4336 and then pasted as a subprogram declaration, body or call (uses
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4337 association list with formals).
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4338
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4339
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4340 TESTBENCH GENERATION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4341 A copied port can also be pasted as a testbench. The generated
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4342 testbench includes an entity, an architecture, and an optional
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4343 configuration. The architecture contains the component declaration and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4344 instantiation of the DUT as well as internal constant and signal
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4345 declarations. Additional user-defined templates can be inserted. The
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4346 names used for entity/architecture/configuration/DUT as well as the file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4347 structure to be generated can be customized. See customization group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4348 `vhdl-testbench'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4349
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4350
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4351 KEY BINDINGS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4352 Key bindings (`C-c ...') exist for most commands (see in menu).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4353
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4354
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4355 VHDL MENU:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4356 All commands can be found in the VHDL menu including their key bindings.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4357
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4358
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4359 FILE BROWSER:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4360 The speedbar allows browsing of directories and file contents. It can
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4361 be accessed from the VHDL menu and is automatically opened if option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4362 `vhdl-speedbar-auto-open' is non-nil.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4363
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4364 In speedbar, open files and directories with `mouse-2' on the name and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4365 browse/rescan their contents with `mouse-2'/`S-mouse-2' on the `+'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4366
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4367
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4368 DESIGN HIERARCHY BROWSER:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4369 The speedbar can also be used for browsing the hierarchy of design units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4370 contained in the source files of the current directory or the specified
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4371 projects (see option `vhdl-project-alist').
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4372
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4373 The speedbar can be switched between file, directory hierarchy and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4374 project hierarchy browsing mode in the speedbar menu or by typing `f',
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4375 `h' or `H' in speedbar.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4376
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4377 In speedbar, open design units with `mouse-2' on the name and browse
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4378 their hierarchy with `mouse-2' on the `+'. Ports can directly be copied
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4379 from entities and components (in packages). Individual design units and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4380 complete designs can directly be compiled (\"Make\" menu entry).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4381
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4382 The hierarchy is automatically updated upon saving a modified source
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4383 file when option `vhdl-speedbar-update-on-saving' is non-nil. The
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4384 hierarchy is only updated for projects that have been opened once in the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4385 speedbar. The hierarchy is cached between Emacs sessions in a file (see
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4386 options in group `vhdl-speedbar').
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4387
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4388 Simple design consistency checks are done during scanning, such as
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4389 multiple declarations of the same unit or missing primary units that are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4390 required by secondary units.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4391
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4392
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4393 STRUCTURAL COMPOSITION:
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4394 Enables simple structural composition. `C-c C-c C-n' creates a skeleton
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4395 for a new component. Subcomponents (i.e. component declaration and
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4396 instantiation) can be automatically placed from a previously read port
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4397 \(`C-c C-c C-p') or directly from the hierarchy browser (`P'). Finally,
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4398 all subcomponents can be automatically connected using internal signals
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4399 and ports (`C-c C-c C-w') following these rules:
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4400 - subcomponent actual ports with same name are considered to be
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4401 connected by a signal (internal signal or port)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4402 - signals that are only inputs to subcomponents are considered as
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4403 inputs to this component -> input port created
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4404 - signals that are only outputs from subcomponents are considered as
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4405 outputs from this component -> output port created
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4406 - signals that are inputs to AND outputs from subcomponents are
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4407 considered as internal connections -> internal signal created
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
4408
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4409 Purpose: With appropriate naming conventions it is possible to
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4410 create higher design levels with only a few mouse clicks or key
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4411 strokes. A new design level can be created by simply generating a new
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4412 component, placing the required subcomponents from the hierarchy
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4413 browser, and wiring everything automatically.
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
4414
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4415 Note: Automatic wiring only works reliably on templates of new
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4416 components and component instantiations that were created by VHDL mode.
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
4417
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4418 Component declarations can be placed in a components package (option
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4419 `vhdl-use-components-package') which can be automatically generated for
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4420 an entire directory or project (`C-c C-c M-p'). The VHDL'93 direct
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4421 component instantiation is also supported (option
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4422 `vhdl-use-direct-instantiation').
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4423
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4424 | Configuration declarations can automatically be generated either from
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4425 | the menu (`C-c C-c C-f') (for the architecture the cursor is in) or from
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4426 | the speedbar menu (for the architecture under the cursor). The
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4427 | configurations can optionally be hierarchical (i.e. include all
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4428 | component levels of a hierarchical design, option
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4429 | `vhdl-compose-configuration-hierarchical') or include subconfigurations
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4430 | (option `vhdl-compose-configuration-use-subconfiguration'). For
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4431 | subcomponents in hierarchical configurations, the most-recently-analyzed
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4432 | (mra) architecture is selected. If another architecture is desired, it
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4433 | can be marked as most-recently-analyzed (speedbar menu) before
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4434 | generating the configuration.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4435 |
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4436 | Note: Configurations of subcomponents (i.e. hierarchical configuration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4437 | declarations) are currently not considered when displaying
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4438 | configurations in speedbar.
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
4439
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4440 See the options group `vhdl-compose' for all relevant user options.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4441
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4442
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4443 SOURCE FILE COMPILATION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4444 The syntax of the current buffer can be analyzed by calling a VHDL
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4445 compiler (menu, `C-c C-k'). The compiler to be used is specified by
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4446 option `vhdl-compiler'. The available compilers are listed in option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4447 `vhdl-compiler-alist' including all required compilation command,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4448 command options, compilation directory, and error message syntax
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4449 information. New compilers can be added.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4450
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4451 All the source files of an entire design can be compiled by the `make'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4452 command (menu, `C-c M-C-k') if an appropriate Makefile exists.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4453
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4454
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4455 MAKEFILE GENERATION:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4456 Makefiles can be generated automatically by an internal generation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4457 routine (`C-c M-k'). The library unit dependency information is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4458 obtained from the hierarchy browser. Makefile generation can be
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4459 customized for each compiler in option `vhdl-compiler-alist'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4460
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4461 Makefile generation can also be run non-interactively using the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4462 command:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4463
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4464 emacs -batch -l ~/.emacs -l vhdl-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4465 [-compiler compilername] [-project projectname]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4466 -f vhdl-generate-makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4467
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4468 The Makefile's default target \"all\" compiles the entire design, the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4469 target \"clean\" removes it and the target \"library\" creates the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4470 library directory if not existent. The Makefile also includes a target
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4471 for each primary library unit which allows selective compilation of this
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4472 unit, its secondary units and its subhierarchy (example: compilation of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4473 a design specified by a configuration). User specific parts can be
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4474 inserted into a Makefile with option `vhdl-makefile-generation-hook'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4475
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4476 Limitations:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4477 - Only library units and dependencies within the current library are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4478 considered. Makefiles for designs that span multiple libraries are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4479 not (yet) supported.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4480 - Only one-level configurations are supported (also hierarchical),
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4481 but configurations that go down several levels are not.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4482 - The \"others\" keyword in configurations is not supported.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4483
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4484
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4485 PROJECTS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4486 Projects can be defined in option `vhdl-project-alist' and a current
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4487 project be selected using option `vhdl-project' (permanently) or from
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4488 the menu or speedbar (temporarily). For each project, title and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4489 description strings (for the file headers), source files/directories
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4490 (for the hierarchy browser and Makefile generation), library name, and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4491 compiler-dependent options, exceptions and compilation directory can be
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4492 specified. Compilation settings overwrite the settings of option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4493 `vhdl-compiler-alist'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4494
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4495 Project setups can be exported (i.e. written to a file) and imported.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4496 Imported setups are not automatically saved in `vhdl-project-alist' but
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4497 can be saved afterwards in its customization buffer. When starting
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4498 Emacs with VHDL Mode (i.e. load a VHDL file or use \"emacs -l
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4499 vhdl-mode\") in a directory with an existing project setup file, it is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4500 automatically loaded and its project activated if option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4501 `vhdl-project-auto-load' is non-nil. Names/paths of the project setup
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4502 files can be specified in option `vhdl-project-file-name'. Multiple
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4503 project setups can be automatically loaded from global directories.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4504 This is an alternative to specifying project setups with option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4505 `vhdl-project-alist'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4506
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4507
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4508 SPECIAL MENUES:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4509 As an alternative to the speedbar, an index menu can be added (set
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4510 option `vhdl-index-menu' to non-nil) or made accessible as a mouse menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4511 (e.g. add \"(global-set-key '[S-down-mouse-3] 'imenu)\" to your start-up
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4512 file) for browsing the file contents (is not populated if buffer is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4513 larger than `font-lock-maximum-size'). Also, a source file menu can be
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4514 added (set option `vhdl-source-file-menu' to non-nil) for browsing the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4515 current directory for VHDL source files.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4516
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4517
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4518 VHDL STANDARDS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4519 The VHDL standards to be used are specified in option `vhdl-standard'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4520 Available standards are: VHDL'87/'93, VHDL-AMS, and Math Packages.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4521
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4522
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4523 KEYWORD CASE:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4524 Lower and upper case for keywords and standardized types, attributes,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4525 and enumeration values is supported. If the option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4526 `vhdl-upper-case-keywords' is set to non-nil, keywords can be typed in
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4527 lower case and are converted into upper case automatically (not for
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4528 types, attributes, and enumeration values). The case of keywords,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4529 types, attributes,and enumeration values can be fixed for an entire
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4530 region (menu) or buffer (`C-c C-x C-c') according to the options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4531 `vhdl-upper-case-{keywords,types,attributes,enum-values}'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4532
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4533
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4534 HIGHLIGHTING (fontification):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4535 Keywords and standardized types, attributes, enumeration values, and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4536 function names (controlled by option `vhdl-highlight-keywords'), as well
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4537 as comments, strings, and template prompts are highlighted using
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4538 different colors. Unit, subprogram, signal, variable, constant,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4539 parameter and generic/port names in declarations as well as labels are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4540 highlighted if option `vhdl-highlight-names' is non-nil.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4541
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4542 Additional reserved words or words with a forbidden syntax (e.g. words
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4543 that should be avoided) can be specified in option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4544 `vhdl-forbidden-words' or `vhdl-forbidden-syntax' and be highlighted in
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4545 a warning color (option `vhdl-highlight-forbidden-words'). Verilog
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4546 keywords are highlighted as forbidden words if option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4547 `vhdl-highlight-verilog-keywords' is non-nil.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4548
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4549 Words with special syntax can be highlighted by specifying their
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4550 syntax and color in option `vhdl-special-syntax-alist' and by setting
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4551 option `vhdl-highlight-special-words' to non-nil. This allows to
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4552 establish some naming conventions (e.g. to distinguish different kinds
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4553 of signals or other objects by using name suffices) and to support them
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4554 visually.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4555
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4556 Option `vhdl-highlight-case-sensitive' can be set to non-nil in order
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4557 to support case-sensitive highlighting. However, keywords are then only
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4558 highlighted if written in lower case.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4559
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4560 Code between \"translate_off\" and \"translate_on\" pragmas is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4561 highlighted using a different background color if option
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4562 `vhdl-highlight-translate-off' is non-nil.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4563
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4564 For documentation and customization of the used colors see
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4565 customization group `vhdl-highlight-faces' (`M-x customize-group'). For
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4566 highlighting of matching parenthesis, see customization group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4567 `paren-showing'. Automatic buffer highlighting is turned on/off by
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4568 option `global-font-lock-mode' (`font-lock-auto-fontify' in XEmacs).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4569
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4570
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4571 USER MODELS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4572 VHDL models (templates) can be specified by the user and made accessible
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4573 in the menu, through key bindings (`C-c C-m ...'), or by keyword
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4574 electrification. See option `vhdl-model-alist'.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4575
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4576
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4577 HIDE/SHOW:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4578 The code of blocks, processes, subprograms, component declarations and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4579 instantiations, generic/port clauses, and configuration declarations can
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4580 be hidden using the `Hide/Show' menu or by pressing `S-mouse-2' within
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4581 the code (see customization group `vhdl-menu'). XEmacs: limited
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4582 functionality due to old `hideshow.el' package.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4583
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4584
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4585 CODE UPDATING:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4586 - Sensitivity List: `C-c C-u C-s' updates the sensitivity list of the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4587 current process, `C-c C-u M-s' of all processes in the current buffer.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4588 Limitations:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4589 - Only declared local signals (ports, signals declared in
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4590 architecture and blocks) are automatically inserted.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4591 - Global signals declared in packages are not automatically inserted.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4592 Insert them once manually (will be kept afterwards).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4593 - Out parameters of procedures are considered to be read.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4594 Use option `vhdl-entity-file-name' to specify the entity file name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4595 \(used to obtain the port names).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4596
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4597
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4598 CODE FIXING:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4599 `C-c C-x C-p' fixes the closing parenthesis of a generic/port clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4600 \(e.g. if the closing parenthesis is on the wrong line or is missing).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4601
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4602
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4603 PRINTING:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4604 Postscript printing with different faces (an optimized set of faces is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4605 used if `vhdl-print-customize-faces' is non-nil) or colors \(if
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4606 `ps-print-color-p' is non-nil) is possible using the standard Emacs
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4607 postscript printing commands. Option `vhdl-print-two-column' defines
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4608 appropriate default settings for nice landscape two-column printing.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4609 The paper format can be set by option `ps-paper-type'. Do not forget to
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4610 switch `ps-print-color-p' to nil for printing on black-and-white
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4611 printers.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4612
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4613
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4614 OPTIONS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4615 User options allow customization of VHDL Mode. All options are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4616 accessible from the \"Options\" menu entry. Simple options (switches
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4617 and choices) can directly be changed, while for complex options a
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4618 customization buffer is opened. Changed options can be saved for future
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4619 sessions using the \"Save Options\" menu entry.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4620
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4621 Options and their detailed descriptions can also be accessed by using
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4622 the \"Customize\" menu entry or the command `M-x customize-option' (`M-x
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4623 customize-group' for groups). Some customizations only take effect
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4624 after some action (read the NOTE in the option documentation).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4625 Customization can also be done globally (i.e. site-wide, read the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4626 INSTALL file).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4627
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4628 Not all options are described in this documentation, so go and see
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4629 what other useful user options there are (`M-x vhdl-customize' or menu)!
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4630
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4631
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4632 FILE EXTENSIONS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4633 As default, files with extensions \".vhd\" and \".vhdl\" are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4634 automatically recognized as VHDL source files. To add an extension
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4635 \".xxx\", add the following line to your Emacs start-up file (`.emacs'):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4636
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4637 \(setq auto-mode-alist (cons '(\"\\\\.xxx\\\\'\" . vhdl-mode) auto-mode-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4638
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4639
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4640 HINTS:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4641 - To start Emacs with open VHDL hierarchy browser without having to load
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4642 a VHDL file first, use the command:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4643
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4644 emacs -l vhdl-mode -f speedbar-frame-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4645
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4646 - Type `C-g C-g' to interrupt long operations or if Emacs hangs.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4647
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4648 - Some features only work on properly indented code.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4649
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4650
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4651 RELEASE NOTES:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4652 See also the release notes (menu) for added features in new releases.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4653
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4654
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4655 Maintenance:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4656 ------------
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4657
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4658 To submit a bug report, enter `M-x vhdl-submit-bug-report' within VHDL Mode.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4659 Add a description of the problem and include a reproducible test case.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4660
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4661 Questions and enhancement requests can be sent to <reto@gnu.org>.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4662
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4663 The `vhdl-mode-announce' mailing list informs about new VHDL Mode releases.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4664 The `vhdl-mode-victims' mailing list informs about new VHDL Mode beta
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4665 releases. You are kindly invited to participate in beta testing. Subscribe
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4666 to above mailing lists by sending an email to <reto@gnu.org>.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4667
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4668 VHDL Mode is officially distributed at
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4669 http://opensource.ethz.ch/emacs/vhdl-mode.html
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4670 where the latest version can be found.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4671
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4672
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4673 Known problems:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4674 ---------------
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4675
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4676 - Indentation bug in simultaneous if- and case-statements (VHDL-AMS).
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4677 - XEmacs: Incorrect start-up when automatically opening speedbar.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4678 - XEmacs: Indentation in XEmacs 21.4 (and higher).
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4679
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4680
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4681 The VHDL Mode Authors
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4682 Reto Zimmermann and Rod Whitby
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4683
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4684 Key bindings:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4685 -------------
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4686
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4687 \\{vhdl-mode-map}"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4688 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4689 (kill-all-local-variables)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4690 (setq major-mode 'vhdl-mode)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4691 (setq mode-name "VHDL")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4692
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4693 ;; set maps and tables
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4694 (use-local-map vhdl-mode-map)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4695 (set-syntax-table vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4696 (setq local-abbrev-table vhdl-mode-abbrev-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4697
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4698 ;; set local variables
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4699 (set (make-local-variable 'paragraph-start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4700 "\\s-*\\(--+\\s-*$\\|[^ -]\\|$\\)")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4701 (set (make-local-variable 'paragraph-separate) paragraph-start)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4702 (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
59253
eb98fdac5466 (vhdl-mode): Use mode-require-final-newline.
Richard M. Stallman <rms@gnu.org>
parents: 57820
diff changeset
4703 (set (make-local-variable 'require-final-newline)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4704 (if vhdl-emacs-22 mode-require-final-newline t))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4705 (set (make-local-variable 'parse-sexp-ignore-comments) t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4706 (set (make-local-variable 'indent-line-function) 'vhdl-indent-line)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4707 (set (make-local-variable 'comment-start) "--")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4708 (set (make-local-variable 'comment-end) "")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4709 (when vhdl-emacs-21
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4710 (set (make-local-variable 'comment-padding) ""))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4711 (set (make-local-variable 'comment-column) vhdl-inline-comment-column)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4712 (set (make-local-variable 'end-comment-column) vhdl-end-comment-column)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4713 (set (make-local-variable 'comment-start-skip) "--+\\s-*")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4714 (set (make-local-variable 'comment-multi-line) nil)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4715 (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
4716 (set (make-local-variable 'hippie-expand-verbose) nil)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4717
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4718 ;; setup the comment indent variable in a Emacs version portable way
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4719 ;; 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
4720 (when (boundp 'comment-indent-function)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4721 (make-local-variable 'comment-indent-function)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4722 (setq comment-indent-function 'vhdl-comment-indent))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4723
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4724 ;; initialize font locking
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4725 (set (make-local-variable 'font-lock-defaults)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4726 (list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4727 '(nil vhdl-font-lock-keywords) nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4728 (not vhdl-highlight-case-sensitive) '((?\_ . "w")) 'beginning-of-line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4729 '(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4730 (unless vhdl-emacs-21
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4731 (set (make-local-variable 'font-lock-support-mode) 'lazy-lock-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4732 (set (make-local-variable 'lazy-lock-defer-contextually) nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4733 (set (make-local-variable 'lazy-lock-defer-on-the-fly) t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4734 ; (set (make-local-variable 'lazy-lock-defer-time) 0.1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4735 (set (make-local-variable 'lazy-lock-defer-on-scrolling) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4736 ; (turn-on-font-lock)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4737
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4738 ;; variables for source file compilation
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4739 (when vhdl-compile-use-local-error-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4740 (set (make-local-variable 'compilation-error-regexp-alist) nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4741 (set (make-local-variable 'compilation-file-regexp-alist) nil))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4742
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4743 ;; add index menu
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4744 (vhdl-index-menu-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4745 ;; add source file menu
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4746 (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
4747 ;; add VHDL menu
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4748 (easy-menu-add vhdl-mode-menu-list) ; for XEmacs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4749 (easy-menu-define vhdl-mode-menu vhdl-mode-map
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4750 "Menu keymap for VHDL Mode." vhdl-mode-menu-list)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4751 ;; initialize hideshow and add menu
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4752 (vhdl-hideshow-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4753 (run-hooks 'menu-bar-update-hook)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4754
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4755 ;; miscellaneous
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4756 (vhdl-ps-print-init)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4757 (vhdl-write-file-hooks-init)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4758 (vhdl-mode-line-update)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4759 (message "VHDL Mode %s.%s" vhdl-version
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4760 (if noninteractive "" " See menu for documentation and release notes."))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4761
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4762 ;; run hooks
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4763 (if vhdl-emacs-22
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4764 (run-mode-hooks 'vhdl-mode-hook)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
4765 (run-hooks 'vhdl-mode-hook)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4766
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4767 (defun vhdl-activate-customizations ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4768 "Activate all customizations on local variables."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4769 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4770 (vhdl-mode-map-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4771 (use-local-map vhdl-mode-map)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4772 (set-syntax-table vhdl-mode-syntax-table)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4773 (setq comment-column vhdl-inline-comment-column)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4774 (setq end-comment-column vhdl-end-comment-column)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4775 (vhdl-write-file-hooks-init)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4776 (vhdl-update-mode-menu)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4777 (vhdl-hideshow-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4778 (run-hooks 'menu-bar-update-hook)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4779 (vhdl-mode-line-update))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4780
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4781 (defun vhdl-write-file-hooks-init ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4782 "Add/remove hooks when buffer is saved."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4783 (if vhdl-modify-date-on-saving
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4784 (add-hook 'local-write-file-hooks 'vhdl-template-modify-noerror)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4785 (remove-hook 'local-write-file-hooks 'vhdl-template-modify-noerror))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4786 (make-local-variable 'after-save-hook)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4787 (add-hook 'after-save-hook 'vhdl-add-modified-file))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4788
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4789 (defun vhdl-process-command-line-option (option)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4790 "Process command line options for VHDL Mode."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4791 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4792 ;; set compiler
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4793 ((equal option "-compiler")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4794 (vhdl-set-compiler (car command-line-args-left))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4795 (setq command-line-args-left (cdr command-line-args-left)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4796 ;; set project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4797 ((equal option "-project")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4798 (vhdl-set-project (car command-line-args-left))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4799 (setq command-line-args-left (cdr command-line-args-left)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4800
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4801 ;; make Emacs process VHDL Mode options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4802 (setq command-switch-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4803 (append command-switch-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4804 '(("-compiler" . vhdl-process-command-line-option)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4805 ("-project" . vhdl-process-command-line-option))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4806
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4807
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4808 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4809 ;;; Keywords and standardized words
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4810 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4811
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4812 (defconst vhdl-93-keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4813 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4814 "abs" "access" "after" "alias" "all" "and" "architecture" "array"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4815 "assert" "attribute"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4816 "begin" "block" "body" "buffer" "bus"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4817 "case" "component" "configuration" "constant"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4818 "disconnect" "downto"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4819 "else" "elsif" "end" "entity" "exit"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4820 "file" "for" "function"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4821 "generate" "generic" "group" "guarded"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4822 "if" "impure" "in" "inertial" "inout" "is"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4823 "label" "library" "linkage" "literal" "loop"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4824 "map" "mod"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4825 "nand" "new" "next" "nor" "not" "null"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4826 "of" "on" "open" "or" "others" "out"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4827 "package" "port" "postponed" "procedure" "process" "pure"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4828 "range" "record" "register" "reject" "rem" "report" "return"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4829 "rol" "ror"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4830 "select" "severity" "shared" "signal" "sla" "sll" "sra" "srl" "subtype"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4831 "then" "to" "transport" "type"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4832 "unaffected" "units" "until" "use"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4833 "variable"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4834 "wait" "when" "while" "with"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4835 "xnor" "xor"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4836 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4837 "List of VHDL'93 keywords.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4838
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4839 (defconst vhdl-ams-keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4840 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4841 "across" "break" "limit" "nature" "noise" "procedural" "quantity"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4842 "reference" "spectrum" "subnature" "terminal" "through"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4843 "tolerance"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4844 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4845 "List of VHDL-AMS keywords.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4846
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4847 (defconst vhdl-verilog-keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4848 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4849 "`define" "`else" "`endif" "`ifdef" "`include" "`timescale" "`undef"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4850 "always" "and" "assign" "begin" "buf" "bufif0" "bufif1"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4851 "case" "casex" "casez" "cmos" "deassign" "default" "defparam" "disable"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4852 "edge" "else" "end" "endattribute" "endcase" "endfunction" "endmodule"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4853 "endprimitive" "endspecify" "endtable" "endtask" "event"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4854 "for" "force" "forever" "fork" "function"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4855 "highz0" "highz1" "if" "initial" "inout" "input" "integer" "join" "large"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4856 "macromodule" "makefile" "medium" "module"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4857 "nand" "negedge" "nmos" "nor" "not" "notif0" "notif1" "or" "output"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4858 "parameter" "pmos" "posedge" "primitive" "pull0" "pull1" "pulldown"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4859 "pullup"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4860 "rcmos" "real" "realtime" "reg" "release" "repeat" "rnmos" "rpmos" "rtran"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4861 "rtranif0" "rtranif1"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4862 "scalared" "signed" "small" "specify" "specparam" "strength" "strong0"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4863 "strong1" "supply" "supply0" "supply1"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4864 "table" "task" "time" "tran" "tranif0" "tranif1" "tri" "tri0" "tri1"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4865 "triand" "trior" "trireg"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4866 "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
4867 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4868 "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
4869
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4870 (defconst vhdl-93-types
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4871 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4872 "boolean" "bit" "bit_vector" "character" "severity_level" "integer"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4873 "real" "time" "natural" "positive" "string" "line" "text" "side"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4874 "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
4875 "std_logic" "std_logic_vector"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4876 "std_ulogic" "std_ulogic_vector"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4877 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4878 "List of VHDL'93 standardized types.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4879
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4880 (defconst vhdl-ams-types
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4881 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4882 "domain_type" "real_vector"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4883 ;; from `nature_pkg' package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4884 "voltage" "current" "electrical" "position" "velocity" "force"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4885 "mechanical_vf" "mechanical_pf" "rotvel" "torque" "rotational"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4886 "pressure" "flowrate" "fluid"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4887 )
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4888 "List of VHDL-AMS standardized types.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4889
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4890 (defconst vhdl-math-types
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4891 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4892 "complex" "complex_polar"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4893 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4894 "List of Math Packages standardized types.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4895
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4896 (defconst vhdl-93-attributes
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4897 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4898 "base" "left" "right" "high" "low" "pos" "val" "succ"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4899 "pred" "leftof" "rightof" "range" "reverse_range"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4900 "length" "delayed" "stable" "quiet" "transaction"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4901 "event" "active" "last_event" "last_active" "last_value"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4902 "driving" "driving_value" "ascending" "value" "image"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4903 "simple_name" "instance_name" "path_name"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4904 "foreign"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4905 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4906 "List of VHDL'93 standardized attributes.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4907
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4908 (defconst vhdl-ams-attributes
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4909 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4910 "across" "through"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4911 "reference" "contribution" "tolerance"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4912 "dot" "integ" "delayed" "above" "zoh" "ltf" "ztf"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4913 "ramp" "slew"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4914 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4915 "List of VHDL-AMS standardized attributes.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4916
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4917 (defconst vhdl-93-enum-values
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4918 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4919 "true" "false"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4920 "note" "warning" "error" "failure"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4921 "read_mode" "write_mode" "append_mode"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4922 "open_ok" "status_error" "name_error" "mode_error"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4923 "fs" "ps" "ns" "us" "ms" "sec" "min" "hr"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4924 "right" "left"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4925 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4926 "List of VHDL'93 standardized enumeration values.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4927
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4928 (defconst vhdl-ams-enum-values
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4929 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4930 "quiescent_domain" "time_domain" "frequency_domain"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4931 ;; from `nature_pkg' package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4932 "eps0" "mu0" "ground" "mecvf_gnd" "mecpf_gnd" "rot_gnd" "fld_gnd"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4933 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4934 "List of VHDL-AMS standardized enumeration values.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4935
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4936 (defconst vhdl-math-constants
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4937 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4938 "math_e" "math_1_over_e"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4939 "math_pi" "math_two_pi" "math_1_over_pi"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4940 "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
4941 "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
4942 "math_sqrt2" "math_sqrt1_2" "math_sqrt_pi"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4943 "math_deg_to_rad" "math_rad_to_deg"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4944 "cbase_1" "cbase_j" "czero"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4945 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4946 "List of Math Packages standardized constants.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4947
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4948 (defconst vhdl-93-functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4949 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4950 "now" "resolved" "rising_edge" "falling_edge"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4951 "read" "readline" "write" "writeline" "endfile"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4952 "resize" "is_X" "std_match"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4953 "shift_left" "shift_right" "rotate_left" "rotate_right"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4954 "to_unsigned" "to_signed" "to_integer"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4955 "to_stdLogicVector" "to_stdULogic" "to_stdULogicVector"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4956 "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
4957 "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
4958 "shl" "shr" "ext" "sxt"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4959 "deallocate"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4960 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4961 "List of VHDL'93 standardized functions.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4962
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4963 (defconst vhdl-ams-functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4964 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4965 "frequency"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4966 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4967 "List of VHDL-AMS standardized functions.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4968
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4969 (defconst vhdl-math-functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4970 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4971 "sign" "ceil" "floor" "round" "trunc" "fmax" "fmin" "uniform"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4972 "sqrt" "cbrt" "exp" "log"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4973 "sin" "cos" "tan" "arcsin" "arccos" "arctan"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4974 "sinh" "cosh" "tanh" "arcsinh" "arccosh" "arctanh"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4975 "cmplx" "complex_to_polar" "polar_to_complex" "arg" "conj"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4976 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4977 "List of Math Packages standardized functions.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4978
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4979 (defconst vhdl-93-packages
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4980 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4981 "std_logic_1164" "numeric_std" "numeric_bit"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4982 "standard" "textio"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4983 "std_logic_arith" "std_logic_signed" "std_logic_unsigned"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4984 "std_logic_misc" "std_logic_textio"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4985 "ieee" "std" "work"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4986 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4987 "List of VHDL'93 standardized packages and libraries.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4988
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4989 (defconst vhdl-ams-packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4990 '(
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4991 ;; from `nature_pkg' package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4992 "nature_pkg"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4993 )
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4994 "List of VHDL-AMS standardized packages and libraries.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
4995
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4996 (defconst vhdl-math-packages
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4997 '(
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4998 "math_real" "math_complex"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
4999 )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5000 "List of Math Packages standardized packages and libraries.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5001
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5002 (defvar vhdl-keywords nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5003 "List of VHDL keywords.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5004
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5005 (defvar vhdl-types nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5006 "List of VHDL standardized types.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5007
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5008 (defvar vhdl-attributes nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5009 "List of VHDL standardized attributes.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5010
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5011 (defvar vhdl-enum-values nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5012 "List of VHDL standardized enumeration values.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5013
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5014 (defvar vhdl-constants nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5015 "List of VHDL standardized constants.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5016
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5017 (defvar vhdl-functions nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5018 "List of VHDL standardized functions.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5019
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5020 (defvar vhdl-packages nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5021 "List of VHDL standardized packages and libraries.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5022
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5023 (defvar vhdl-reserved-words nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5024 "List of additional reserved words.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5025
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5026 (defvar vhdl-keywords-regexp nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5027 "Regexp for VHDL keywords.")
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 (defvar vhdl-types-regexp nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5030 "Regexp for VHDL standardized types.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5031
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5032 (defvar vhdl-attributes-regexp nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5033 "Regexp for VHDL standardized attributes.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5034
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5035 (defvar vhdl-enum-values-regexp nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5036 "Regexp for VHDL standardized enumeration values.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5037
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5038 (defvar vhdl-functions-regexp nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5039 "Regexp for VHDL standardized functions.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5040
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5041 (defvar vhdl-packages-regexp nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5042 "Regexp for VHDL standardized packages and libraries.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5043
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5044 (defvar vhdl-reserved-words-regexp nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5045 "Regexp for additional reserved words.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5046
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5047 (defvar vhdl-directive-keywords-regexp nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5048 "Regexp for compiler directive keywords.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5049
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5050 (defun vhdl-words-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5051 "Initialize reserved words."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5052 (setq vhdl-keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5053 (append vhdl-93-keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5054 (when (vhdl-standard-p 'ams) vhdl-ams-keywords)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5055 (setq vhdl-types
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5056 (append vhdl-93-types
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5057 (when (vhdl-standard-p 'ams) vhdl-ams-types)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5058 (when (vhdl-standard-p 'math) vhdl-math-types)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5059 (setq vhdl-attributes
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5060 (append vhdl-93-attributes
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5061 (when (vhdl-standard-p 'ams) vhdl-ams-attributes)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5062 (setq vhdl-enum-values
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5063 (append vhdl-93-enum-values
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5064 (when (vhdl-standard-p 'ams) vhdl-ams-enum-values)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5065 (setq vhdl-constants
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5066 (append (when (vhdl-standard-p 'math) vhdl-math-constants)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5067 (setq vhdl-functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5068 (append vhdl-93-functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5069 (when (vhdl-standard-p 'ams) vhdl-ams-functions)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5070 (when (vhdl-standard-p 'math) vhdl-math-functions)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5071 (setq vhdl-packages
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5072 (append vhdl-93-packages
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5073 (when (vhdl-standard-p 'ams) vhdl-ams-packages)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5074 (when (vhdl-standard-p 'math) vhdl-math-packages)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5075 (setq vhdl-reserved-words
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5076 (append (when vhdl-highlight-forbidden-words vhdl-forbidden-words)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5077 (when vhdl-highlight-verilog-keywords vhdl-verilog-keywords)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5078 '("")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5079 (setq vhdl-keywords-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5080 (concat "\\<\\(" (regexp-opt vhdl-keywords) "\\)\\>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5081 (setq vhdl-types-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5082 (concat "\\<\\(" (regexp-opt vhdl-types) "\\)\\>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5083 (setq vhdl-attributes-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5084 (concat "\\<\\(" (regexp-opt vhdl-attributes) "\\)\\>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5085 (setq vhdl-enum-values-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5086 (concat "\\<\\(" (regexp-opt vhdl-enum-values) "\\)\\>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5087 (setq vhdl-functions-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5088 (concat "\\<\\(" (regexp-opt vhdl-functions) "\\)\\>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5089 (setq vhdl-packages-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5090 (concat "\\<\\(" (regexp-opt vhdl-packages) "\\)\\>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5091 (setq vhdl-reserved-words-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5092 (concat "\\<\\("
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5093 (unless (equal vhdl-forbidden-syntax "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5094 (concat vhdl-forbidden-syntax "\\|"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5095 (regexp-opt vhdl-reserved-words)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5096 "\\)\\>"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5097 (setq vhdl-directive-keywords-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5098 (concat "\\<\\(" (mapconcat 'regexp-quote
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5099 vhdl-directive-keywords "\\|") "\\)\\>"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5100 (vhdl-abbrev-list-init))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5101
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5102 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5103 ;; Words to expand
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5104
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5105 (defvar vhdl-abbrev-list nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5106 "Predefined abbreviations for VHDL.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5107
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5108 (defun vhdl-abbrev-list-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5109 (setq vhdl-abbrev-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5110 (append
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5111 (list vhdl-upper-case-keywords) vhdl-keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5112 (list vhdl-upper-case-types) vhdl-types
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5113 (list vhdl-upper-case-attributes) vhdl-attributes
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5114 (list vhdl-upper-case-enum-values) vhdl-enum-values
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5115 (list vhdl-upper-case-constants) vhdl-constants
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5116 (list nil) vhdl-functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5117 (list nil) vhdl-packages)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5118
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5119 ;; initialize reserved words for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5120 (vhdl-words-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5121
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5122
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5123 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5124 ;;; Indentation
24732
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
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5127 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5128 ;; Syntax analysis
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5129
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5130 ;; constant regular expressions for looking at various constructs
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5131
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5132 (defconst vhdl-symbol-key "\\(\\w\\|\\s_\\)+"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5133 "Regexp describing a VHDL symbol.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5134 We cannot use just `word' syntax class since `_' cannot be in word
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5135 class. Putting underscore in word class breaks forward word movement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5136 behavior that users are familiar with.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5137
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5138 (defconst vhdl-case-header-key "case[( \t\n][^;=>]+[) \t\n]is"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5139 "Regexp describing a case statement header key.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5140
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5141 (defconst vhdl-label-key
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5142 (concat "\\(" vhdl-symbol-key "\\s-*:\\)[^=]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5143 "Regexp describing a VHDL label.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5144
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5145 ;; Macro definitions:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5146
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5147 (defmacro vhdl-point (position)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5148 "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
5149 POSITION can be one of the following symbols:
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5150
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5151 bol -- beginning of line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5152 eol -- end of line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5153 bod -- beginning of defun
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5154 boi -- back to indentation
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5155 eoi -- last whitespace on line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5156 ionl -- indentation of next line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5157 iopl -- indentation of previous line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5158 bonl -- beginning of next line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5159 bopl -- beginning of previous line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5160
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5161 This function does not modify point or mark."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5162 (or (and (eq 'quote (car-safe position))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5163 (null (cddr position)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5164 (error "ERROR: Bad buffer position requested: %s" position))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5165 (setq position (nth 1 position))
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5166 `(let ((here (point)))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5167 ,@(cond
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5168 ((eq position 'bol) '((beginning-of-line)))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5169 ((eq position 'eol) '((end-of-line)))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5170 ((eq position 'bod) '((save-match-data
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5171 (vhdl-beginning-of-defun))))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5172 ((eq position 'boi) '((back-to-indentation)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5173 ((eq position 'eoi) '((end-of-line) (skip-chars-backward " \t")))
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5174 ((eq position 'bonl) '((forward-line 1)))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5175 ((eq position 'bopl) '((forward-line -1)))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5176 ((eq position 'iopl)
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5177 '((forward-line -1)
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5178 (back-to-indentation)))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5179 ((eq position 'ionl)
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5180 '((forward-line 1)
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5181 (back-to-indentation)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5182 (t (error "ERROR: Unknown buffer position requested: %s" position))
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5183 )
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5184 (prog1
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5185 (point)
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5186 (goto-char here))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5187 ;; workaround for an Emacs18 bug -- blech! Well, at least it
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5188 ;; doesn't hurt for v19
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5189 ,@nil
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5190 ))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5191
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5192 (defmacro vhdl-safe (&rest body)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5193 "Safely execute BODY, return nil if an error occurred."
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5194 `(condition-case nil
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5195 (progn ,@body)
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5196 (error nil)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5197
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5198 (defmacro vhdl-add-syntax (symbol &optional relpos)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5199 "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
5200 Try to increase performance by using this macro."
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5201 `(setq vhdl-syntactic-context
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5202 (cons (cons ,symbol ,relpos) vhdl-syntactic-context)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5203
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5204 (defmacro vhdl-has-syntax (symbol)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5205 "A simple macro to return check the syntax list.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5206 Try to increase performance by using this macro."
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
5207 `(assoc ,symbol vhdl-syntactic-context))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5208
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5209 ;; Syntactic element offset manipulation:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5210
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5211 (defun vhdl-read-offset (langelem)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5212 "Read new offset value for LANGELEM from minibuffer.
60925
a9c571ede913 * progmodes/cperl-mode.el, progmodes/idlw-shell.el,
Werner LEMBERG <wl@gnu.org>
parents: 59253
diff changeset
5213 Return a valid value only."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5214 (let ((oldoff (format "%s" (cdr-safe (assq langelem vhdl-offsets-alist))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5215 (errmsg "Offset must be int, func, var, or one of +, -, ++, --: ")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5216 (prompt "Offset: ")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5217 offset input interned)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5218 (while (not offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5219 (setq input (read-string prompt oldoff)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5220 offset (cond ((string-equal "+" input) '+)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5221 ((string-equal "-" input) '-)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5222 ((string-equal "++" input) '++)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5223 ((string-equal "--" input) '--)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5224 ((string-match "^-?[0-9]+$" input)
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61431
diff changeset
5225 (string-to-number input))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5226 ((fboundp (setq interned (intern input)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5227 interned)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5228 ((boundp interned) interned)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5229 ;; error, but don't signal one, keep trying
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5230 ;; to read an input value
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5231 (t (ding)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5232 (setq prompt errmsg)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5233 nil))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5234 offset))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5235
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5236 (defun vhdl-set-offset (symbol offset &optional add-p)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5237 "Change the value of a syntactic element symbol in `vhdl-offsets-alist'.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5238 SYMBOL is the syntactic element symbol to change and OFFSET is the new
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
5239 offset for that syntactic element. Optional ADD-P says to add SYMBOL to
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5240 `vhdl-offsets-alist' if it doesn't already appear there."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5241 (interactive
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5242 (let* ((langelem
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5243 (intern (completing-read
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5244 (concat "Syntactic symbol to change"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5245 (if current-prefix-arg " or add" "")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5246 ": ")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5247 (mapcar
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5248 (function
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5249 (lambda (langelem)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5250 (cons (format "%s" (car langelem)) nil)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5251 vhdl-offsets-alist)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5252 nil (not current-prefix-arg)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5253 ;; initial contents tries to be the last element
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5254 ;; on the syntactic analysis list for the current
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5255 ;; line
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5256 (let* ((syntax (vhdl-get-syntactic-context))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5257 (len (length syntax))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5258 (ic (format "%s" (car (nth (1- len) syntax)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5259 ic)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5260 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5261 (offset (vhdl-read-offset langelem)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5262 (list langelem offset current-prefix-arg)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5263 ;; sanity check offset
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5264 (or (eq offset '+)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5265 (eq offset '-)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5266 (eq offset '++)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5267 (eq offset '--)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5268 (integerp offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5269 (fboundp offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5270 (boundp offset)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5271 (error "ERROR: Offset must be int, func, var, or one of +, -, ++, --: %s"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5272 offset))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5273 (let ((entry (assq symbol vhdl-offsets-alist)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5274 (if entry
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5275 (setcdr entry offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5276 (if add-p
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5277 (setq vhdl-offsets-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5278 (cons (cons symbol offset) vhdl-offsets-alist))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5279 (error "ERROR: %s is not a valid syntactic symbol" symbol))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5280 (vhdl-keep-region-active))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5281
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5282 (defun vhdl-set-style (style &optional local)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5283 "Set `vhdl-mode' variables to use one of several different indentation styles.
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5284 STYLE is a string representing the desired style and optional LOCAL is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5285 a flag which, if non-nil, means to make the style variables being
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5286 changed buffer local, instead of the default, which is to set the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5287 global variables. Interactively, the flag comes from the prefix
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5288 argument. The styles are chosen from the `vhdl-style-alist' variable."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5289 (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
5290 vhdl-style-alist nil t)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5291 current-prefix-arg))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5292 (let ((vars (cdr (assoc style vhdl-style-alist))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5293 (or vars
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5294 (error "ERROR: Invalid VHDL indentation style `%s'" style))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5295 ;; set all the variables
84923
85483f68777e (vhdl-set-style, vhdl-regress-line): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 78544
diff changeset
5296 (mapc
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5297 (function
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5298 (lambda (varentry)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5299 (let ((var (car varentry))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5300 (val (cdr varentry)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5301 (and local
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5302 (make-local-variable var))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5303 ;; special case for vhdl-offsets-alist
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5304 (if (not (eq var 'vhdl-offsets-alist))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5305 (set var val)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5306 ;; reset vhdl-offsets-alist to the default value first
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5307 (setq vhdl-offsets-alist (copy-alist vhdl-offsets-alist-default))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5308 ;; now set the langelems that are different
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5309 (mapcar
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5310 (function
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5311 (lambda (langentry)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5312 (let ((langelem (car langentry))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5313 (offset (cdr langentry)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5314 (vhdl-set-offset langelem offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5315 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5316 val))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5317 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5318 vars))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5319 (vhdl-keep-region-active))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5320
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5321 (defun vhdl-get-offset (langelem)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5322 "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
5323 \(SYMBOL . RELPOS). The symbol is matched against
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5324 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
5325 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
5326 the offset is simply returned."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5327 (let* ((symbol (car langelem))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5328 (relpos (cdr langelem))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5329 (match (assq symbol vhdl-offsets-alist))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5330 (offset (cdr-safe match)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5331 ;; offset can be a number, a function, a variable, or one of the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5332 ;; symbols + or -
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5333 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5334 ((not match)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5335 (if vhdl-strict-syntax-p
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5336 (error "ERROR: Don't know how to indent a %s" symbol)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5337 (setq offset 0
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5338 relpos 0)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5339 ((eq offset '+) (setq offset vhdl-basic-offset))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5340 ((eq offset '-) (setq offset (- vhdl-basic-offset)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5341 ((eq offset '++) (setq offset (* 2 vhdl-basic-offset)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5342 ((eq offset '--) (setq offset (* 2 (- vhdl-basic-offset))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5343 ((and (not (numberp offset))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5344 (fboundp offset))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5345 (setq offset (funcall offset langelem)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5346 ((not (numberp offset))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5347 (setq offset (eval offset)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5348 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5349 (+ (if (and relpos
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5350 (< relpos (vhdl-point 'bol)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5351 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5352 (goto-char relpos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5353 (current-column))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5354 0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5355 offset)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5356
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5357 ;; Syntactic support functions:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5358
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5359 (defun vhdl-in-comment-p ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5360 "Check if point is in a comment."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5361 (eq (vhdl-in-literal) 'comment))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5362
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5363 (defun vhdl-in-string-p ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5364 "Check if point is in a string."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5365 (eq (vhdl-in-literal) 'string))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5366
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5367 (defun vhdl-in-literal ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5368 "Determine if point is in a VHDL literal."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5369 (save-excursion
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5370 (let ((state (parse-partial-sexp (vhdl-point 'bol) (point))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5371 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5372 ((nth 3 state) 'string)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5373 ((nth 4 state) 'comment)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5374 ((vhdl-beginning-of-macro) 'pound)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5375 (t nil)))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5376
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5377 (defun vhdl-forward-comment (&optional direction)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5378 "Skip all comments (including whitespace). Skip backwards if DIRECTION is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5379 negative, skip forward otherwise."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5380 (interactive "p")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5381 (if (and direction (< direction 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5382 ;; skip backwards
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5383 (progn
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5384 (skip-chars-backward " \t\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5385 (while (re-search-backward "^[^\"-]*\\(\\(-?\"[^\"]*\"\\|-[^\"-]\\)[^\"-]*\\)*\\(--\\)" (vhdl-point 'bol) t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5386 (goto-char (match-beginning 3))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5387 (skip-chars-backward " \t\n")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5388 ;; skip forwards
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5389 (skip-chars-forward " \t\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5390 (while (looking-at "--.*")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5391 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5392 (skip-chars-forward " \t\n"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5393
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5394 ;; XEmacs hack: work around buggy `forward-comment' in XEmacs 21.4+
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
5395 (unless (and (featurep 'xemacs) (string< "21.2" emacs-version))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5396 (defalias 'vhdl-forward-comment 'forward-comment))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5397
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5398 ;; This is the best we can do in Win-Emacs.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5399 (defun vhdl-win-il (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5400 "Determine if point is in a VHDL literal."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5401 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5402 (let* ((here (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5403 (state nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5404 (match nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5405 (lim (or lim (vhdl-point 'bod))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5406 (goto-char lim )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5407 (while (< (point) here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5408 (setq match
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5409 (and (re-search-forward "--\\|[\"']"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5410 here 'move)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5411 (buffer-substring (match-beginning 0) (match-end 0))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5412 (setq state
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5413 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5414 ;; no match
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5415 ((null match) nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5416 ;; looking at the opening of a VHDL style comment
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5417 ((string= "--" match)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5418 (if (<= here (progn (end-of-line) (point))) 'comment))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5419 ;; looking at the opening of a double quote string
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5420 ((string= "\"" match)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5421 (if (not (save-restriction
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5422 ;; this seems to be necessary since the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5423 ;; re-search-forward will not work without it
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5424 (narrow-to-region (point) here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5425 (re-search-forward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5426 ;; this regexp matches a double quote
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5427 ;; which is preceded by an even number
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5428 ;; of backslashes, including zero
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5429 "\\([^\\]\\|^\\)\\(\\\\\\\\\\)*\"" here 'move)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5430 'string))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5431 ;; looking at the opening of a single quote string
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5432 ((string= "'" match)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5433 (if (not (save-restriction
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5434 ;; see comments from above
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5435 (narrow-to-region (point) here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5436 (re-search-forward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5437 ;; this matches a single quote which is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5438 ;; preceded by zero or two backslashes.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5439 "\\([^\\]\\|^\\)\\(\\\\\\\\\\)?'"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5440 here 'move)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5441 'string))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5442 (t nil)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5443 ) ; end-while
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5444 state)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5445
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5446 (and (string-match "Win-Emacs" emacs-version)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5447 (fset 'vhdl-in-literal 'vhdl-win-il))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5448
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5449 ;; Skipping of "syntactic whitespace". Syntactic whitespace is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5450 ;; defined as lexical whitespace or comments. Search no farther back
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5451 ;; or forward than optional LIM. If LIM is omitted, (point-min) is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5452 ;; used for backward skipping, (point-max) is used for forward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5453 ;; skipping.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5454
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5455 (defun vhdl-forward-syntactic-ws (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5456 "Forward skip of syntactic whitespace."
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5457 (let* ((here (point-max))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5458 (hugenum (point-max)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5459 (while (/= here (point))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5460 (setq here (point))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5461 (vhdl-forward-comment hugenum)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5462 ;; skip preprocessor directives
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5463 (when (and (eq (char-after) ?#)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5464 (= (vhdl-point 'boi) (point)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5465 (while (and (eq (char-before (vhdl-point 'eol)) ?\\)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5466 (= (forward-line 1) 0)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5467 (end-of-line)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5468 (if lim (goto-char (min (point) lim)))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5469
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5470
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5471 ;; This is the best we can do in Win-Emacs.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5472 (defun vhdl-win-fsws (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5473 "Forward skip syntactic whitespace for Win-Emacs."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5474 (let ((lim (or lim (point-max)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5475 stop)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5476 (while (not stop)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5477 (skip-chars-forward " \t\n\r\f" lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5478 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5479 ;; vhdl comment
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5480 ((looking-at "--") (end-of-line))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5481 ;; none of the above
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5482 (t (setq stop t))))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5483
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5484 (and (string-match "Win-Emacs" emacs-version)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5485 (fset 'vhdl-forward-syntactic-ws 'vhdl-win-fsws))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5486
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5487 (defun vhdl-beginning-of-macro (&optional lim)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5488 "Go to the beginning of a cpp macro definition (nicked from `cc-engine')."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5489 (let ((here (point)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5490 (beginning-of-line)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5491 (while (eq (char-before (1- (point))) ?\\)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5492 (forward-line -1))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5493 (back-to-indentation)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5494 (if (and (<= (point) here)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5495 (eq (char-after) ?#))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5496 t
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5497 (goto-char here)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5498 nil)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5499
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5500 (defun vhdl-backward-syntactic-ws (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5501 "Backward skip over syntactic whitespace."
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5502 (let* ((here (point-min))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5503 (hugenum (- (point-max))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5504 (while (/= here (point))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5505 (setq here (point))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5506 (vhdl-forward-comment hugenum)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5507 (vhdl-beginning-of-macro))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5508 (if lim (goto-char (max (point) lim)))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5509
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5510 ;; This is the best we can do in Win-Emacs.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5511 (defun vhdl-win-bsws (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5512 "Backward skip syntactic whitespace for Win-Emacs."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5513 (let ((lim (or lim (vhdl-point 'bod)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5514 stop)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5515 (while (not stop)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5516 (skip-chars-backward " \t\n\r\f" lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5517 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5518 ;; vhdl comment
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5519 ((eq (vhdl-in-literal) 'comment)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5520 (skip-chars-backward "^-" lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5521 (skip-chars-backward "-" lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5522 (while (not (or (and (= (following-char) ?-)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5523 (= (char-after (1+ (point))) ?-))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5524 (<= (point) lim)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5525 (skip-chars-backward "^-" lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5526 (skip-chars-backward "-" lim)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5527 ;; none of the above
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5528 (t (setq stop t))))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5529
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5530 (and (string-match "Win-Emacs" emacs-version)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5531 (fset 'vhdl-backward-syntactic-ws 'vhdl-win-bsws))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5532
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5533 ;; Functions to help finding the correct indentation column:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5534
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5535 (defun vhdl-first-word (point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5536 "If the keyword at POINT is at boi, then return (current-column) at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5537 that point, else nil."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5538 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5539 (and (goto-char point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5540 (eq (point) (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5541 (current-column))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5542
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5543 (defun vhdl-last-word (point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5544 "If the keyword at POINT is at eoi, then return (current-column) at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5545 that point, else nil."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5546 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5547 (and (goto-char point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5548 (save-excursion (or (eq (progn (forward-sexp) (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5549 (vhdl-point 'eoi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5550 (looking-at "\\s-*\\(--\\)?")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5551 (current-column))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5552
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5553 ;; Core syntactic evaluation functions:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5554
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5555 (defconst vhdl-libunit-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5556 "\\b\\(architecture\\|configuration\\|entity\\|package\\)\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5557
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5558 (defun vhdl-libunit-p ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5559 (and
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5560 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5561 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5562 (skip-chars-forward " \t\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5563 (not (looking-at "is\\b[^_]")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5564 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5565 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5566 (and (not (looking-at "use\\b[^_]"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5567 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5568 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5569 (vhdl-forward-syntactic-ws)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5570 (/= (following-char) ?:))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5571 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5572
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5573 (defconst vhdl-defun-re
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5574 "\\b\\(architecture\\|block\\|configuration\\|entity\\|package\\|process\\|procedural\\|procedure\\|function\\)\\b[^_]")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5575
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5576 (defun vhdl-defun-p ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5577 (save-excursion
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5578 (if (looking-at "block\\|process\\|procedural")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5579 ;; "block", "process", "procedural":
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5580 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5581 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5582 (not (looking-at "end\\s-+\\w")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5583 ;; "architecture", "configuration", "entity",
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5584 ;; "package", "procedure", "function":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5585 t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5586
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5587 (defun vhdl-corresponding-defun ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5588 "If the word at the current position corresponds to a \"defun\"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5589 keyword, then return a string that can be used to find the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5590 corresponding \"begin\" keyword, else return nil."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5591 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5592 (and (looking-at vhdl-defun-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5593 (vhdl-defun-p)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5594 (if (looking-at "block\\|process\\|procedural")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5595 ;; "block", "process". "procedural:
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5596 (buffer-substring (match-beginning 0) (match-end 0))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5597 ;; "architecture", "configuration", "entity", "package",
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5598 ;; "procedure", "function":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5599 "is"))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5600
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5601 (defconst vhdl-begin-fwd-re
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5602 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\|units\\|record\\|for\\)\\b\\([^_]\\|\\'\\)"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5603 "A regular expression for searching forward that matches all known
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5604 \"begin\" keywords.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5605
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5606 (defconst vhdl-begin-bwd-re
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5607 "\\b\\(is\\|begin\\|block\\|component\\|generate\\|then\\|else\\|loop\\|process\\|procedural\\|units\\|record\\|for\\)\\b[^_]"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5608 "A regular expression for searching backward that matches all known
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5609 \"begin\" keywords.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5610
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5611 (defun vhdl-begin-p (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5612 "Return t if we are looking at a real \"begin\" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5613 Assumes that the caller will make sure that we are looking at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5614 vhdl-begin-fwd-re, and are not inside a literal, and that we are not in
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5615 the middle of an identifier that just happens to contain a \"begin\"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5616 keyword."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5617 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5618 ;; "[architecture|case|configuration|entity|package|
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5619 ;; procedure|function] ... is":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5620 ((and (looking-at "i")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5621 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5622 ;; Skip backward over first sexp (needed to skip over a
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5623 ;; procedure interface list, and is harmless in other
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5624 ;; situations). Note that we need "return" in the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5625 ;; following search list so that we don't run into
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5626 ;; semicolons in the function interface list.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5627 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5628 (let (foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5629 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5630 (re-search-backward
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5631 ";\\|\\b\\(architecture\\|case\\|configuration\\|entity\\|package\\|procedure\\|return\\|is\\|begin\\|process\\|procedural\\|block\\)\\b[^_]"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5632 lim 'move))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5633 (if (or (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5634 (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5635 (backward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5636 (setq foundp t))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5637 (and (/= (following-char) ?\;)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5638 (not (looking-at "is\\|begin\\|process\\|procedural\\|block")))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5639 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5640 ;; "begin", "then":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5641 ((looking-at "be\\|t")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5642 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5643 ;; "else":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5644 ((and (looking-at "e")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5645 ;; make sure that the "else" isn't inside a
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5646 ;; conditional signal assignment.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5647 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5648 (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5649 (or (eq (following-char) ?\;)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5650 (eq (point) lim))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5651 t)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5652 ;; "block", "generate", "loop", "process", "procedural",
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5653 ;; "units", "record":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5654 ((and (looking-at "bl\\|[glpur]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5655 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5656 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5657 (not (looking-at "end\\s-+\\w"))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5658 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5659 ;; "component":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5660 ((and (looking-at "c")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5661 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5662 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5663 (not (looking-at "end\\s-+\\w")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5664 ;; look out for the dreaded entity class in an attribute
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5665 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5666 (vhdl-backward-syntactic-ws lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5667 (/= (preceding-char) ?:)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5668 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5669 ;; "for" (inside configuration declaration):
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5670 ((and (looking-at "f")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5671 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5672 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5673 (not (looking-at "end\\s-+\\w")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5674 (vhdl-has-syntax 'configuration))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5675 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5676 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5677
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5678 (defun vhdl-corresponding-mid (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5679 (cond
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5680 ((looking-at "is\\|block\\|generate\\|process\\|procedural")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5681 "begin")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5682 ((looking-at "then")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5683 "<else>")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5684 (t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5685 "end")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5686
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5687 (defun vhdl-corresponding-end (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5688 "If the word at the current position corresponds to a \"begin\"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5689 keyword, then return a vector containing enough information to find
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5690 the corresponding \"end\" keyword, else return nil. The keyword to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5691 search forward for is aref 0. The column in which the keyword must
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5692 appear is aref 1 or nil if any column is suitable.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5693 Assumes that the caller will make sure that we are not in the middle
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5694 of an identifier that just happens to contain a \"begin\" keyword."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5695 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5696 (and (looking-at vhdl-begin-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5697 (/= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5698 (not (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5699 (vhdl-begin-p lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5700 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5701 ;; "is", "generate", "loop":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5702 ((looking-at "[igl]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5703 (vector "end"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5704 (and (vhdl-last-word (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5705 (or (vhdl-first-word (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5706 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5707 (vhdl-beginning-of-statement-1 lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5708 (vhdl-backward-skip-label lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5709 (vhdl-first-word (point)))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5710 ;; "begin", "else", "for":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5711 ((looking-at "be\\|[ef]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5712 (vector "end"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5713 (and (vhdl-last-word (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5714 (or (vhdl-first-word (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5715 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5716 (vhdl-beginning-of-statement-1 lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5717 (vhdl-backward-skip-label lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5718 (vhdl-first-word (point)))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5719 ;; "component", "units", "record":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5720 ((looking-at "[cur]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5721 ;; The first end found will close the block
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5722 (vector "end" nil))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5723 ;; "block", "process", "procedural":
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5724 ((looking-at "bl\\|p")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5725 (vector "end"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5726 (or (vhdl-first-word (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5727 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5728 (vhdl-beginning-of-statement-1 lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5729 (vhdl-backward-skip-label lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5730 (vhdl-first-word (point))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5731 ;; "then":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5732 ((looking-at "t")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5733 (vector "elsif\\|else\\|end\\s-+if"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5734 (and (vhdl-last-word (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5735 (or (vhdl-first-word (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5736 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5737 (vhdl-beginning-of-statement-1 lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5738 (vhdl-backward-skip-label lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5739 (vhdl-first-word (point)))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5740 ))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5741
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5742 (defconst vhdl-end-fwd-re "\\b\\(end\\|else\\|elsif\\)\\b\\([^_]\\|\\'\\)")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5743
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5744 (defconst vhdl-end-bwd-re "\\b\\(end\\|else\\|elsif\\)\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5745
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5746 (defun vhdl-end-p (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5747 "Return t if we are looking at a real \"end\" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5748 Assumes that the caller will make sure that we are looking at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5749 vhdl-end-fwd-re, and are not inside a literal, and that we are not in
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5750 the middle of an identifier that just happens to contain an \"end\"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5751 keyword."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5752 (or (not (looking-at "else"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5753 ;; make sure that the "else" isn't inside a conditional signal
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5754 ;; assignment.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5755 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5756 (re-search-backward ";\\|\\bwhen\\b[^_]" lim 'move)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5757 (or (eq (following-char) ?\;)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5758 (eq (point) lim)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5759 (vhdl-in-literal)))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5760
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5761 (defun vhdl-corresponding-begin (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5762 "If the word at the current position corresponds to an \"end\"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5763 keyword, then return a vector containing enough information to find
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5764 the corresponding \"begin\" keyword, else return nil. The keyword to
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
5765 search backward for is aref 0. The column in which the keyword must
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5766 appear is aref 1 or nil if any column is suitable. The supplementary
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5767 keyword to search forward for is aref 2 or nil if this is not
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5768 required. If aref 3 is t, then the \"begin\" keyword may be found in
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5769 the middle of a statement.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5770 Assumes that the caller will make sure that we are not in the middle
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5771 of an identifier that just happens to contain an \"end\" keyword."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5772 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5773 (let (pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5774 (if (and (looking-at vhdl-end-fwd-re)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5775 (not (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5776 (vhdl-end-p lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5777 (if (looking-at "el")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5778 ;; "else", "elsif":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5779 (vector "if\\|elsif" (vhdl-first-word (point)) "then" nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5780 ;; "end ...":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5781 (setq pos (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5782 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5783 (skip-chars-forward " \t\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5784 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5785 ;; "end if":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5786 ((looking-at "if\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5787 (vector "else\\|elsif\\|if"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5788 (vhdl-first-word pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5789 "else\\|then" nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5790 ;; "end component":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5791 ((looking-at "component\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5792 (vector (buffer-substring (match-beginning 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5793 (match-end 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5794 (vhdl-first-word pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5795 nil nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5796 ;; "end units", "end record":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5797 ((looking-at "\\(units\\|record\\)\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5798 (vector (buffer-substring (match-beginning 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5799 (match-end 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5800 (vhdl-first-word pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5801 nil t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5802 ;; "end block", "end process", "end procedural":
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5803 ((looking-at "\\(block\\|process\\|procedural\\)\\b[^_]")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5804 (vector "begin" (vhdl-first-word pos) nil nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5805 ;; "end case":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5806 ((looking-at "case\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5807 (vector "case" (vhdl-first-word pos) "is" nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5808 ;; "end generate":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5809 ((looking-at "generate\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5810 (vector "generate\\|for\\|if"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5811 (vhdl-first-word pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5812 "generate" nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5813 ;; "end loop":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5814 ((looking-at "loop\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5815 (vector "loop\\|while\\|for"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5816 (vhdl-first-word pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5817 "loop" nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5818 ;; "end for" (inside configuration declaration):
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5819 ((looking-at "for\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5820 (vector "for" (vhdl-first-word pos) nil nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5821 ;; "end [id]":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5822 (t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5823 (vector "begin\\|architecture\\|configuration\\|entity\\|package\\|procedure\\|function"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5824 (vhdl-first-word pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5825 ;; return an alist of (statement . keyword) mappings
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5826 '(
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5827 ;; "begin ... end [id]":
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5828 ("begin" . nil)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5829 ;; "architecture ... is ... begin ... end [id]":
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5830 ("architecture" . "is")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5831 ;; "configuration ... is ... end [id]":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5832 ("configuration" . "is")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5833 ;; "entity ... is ... end [id]":
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5834 ("entity" . "is")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5835 ;; "package ... is ... end [id]":
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5836 ("package" . "is")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5837 ;; "procedure ... is ... begin ... end [id]":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5838 ("procedure" . "is")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5839 ;; "function ... is ... begin ... end [id]":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5840 ("function" . "is")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5841 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5842 nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5843 ))) ; "end ..."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5844 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5845
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5846 (defconst vhdl-leader-re
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5847 "\\b\\(block\\|component\\|process\\|procedural\\|for\\)\\b[^_]")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5848
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5849 (defun vhdl-end-of-leader ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5850 (save-excursion
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
5851 (cond ((looking-at "block\\|process\\|procedural")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5852 (if (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5853 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5854 (skip-chars-forward " \t\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5855 (= (following-char) ?\())
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5856 (forward-sexp 2)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5857 (forward-sexp))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5858 (when (looking-at "[ \t\n]*is")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5859 (goto-char (match-end 0)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5860 (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5861 ((looking-at "component")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5862 (forward-sexp 2)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5863 (when (looking-at "[ \t\n]*is")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5864 (goto-char (match-end 0)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5865 (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5866 ((looking-at "for")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5867 (forward-sexp 2)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5868 (skip-chars-forward " \t\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5869 (while (looking-at "[,:(]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5870 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5871 (skip-chars-forward " \t\n"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5872 (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5873 (t nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5874 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5875
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5876 (defconst vhdl-trailer-re
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
5877 "\\b\\(is\\|then\\|generate\\|loop\\|record\\)\\b[^_]")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5878
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5879 (defconst vhdl-statement-fwd-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5880 "\\b\\(if\\|for\\|while\\)\\b\\([^_]\\|\\'\\)"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5881 "A regular expression for searching forward that matches all known
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5882 \"statement\" keywords.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5883
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5884 (defconst vhdl-statement-bwd-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5885 "\\b\\(if\\|for\\|while\\)\\b[^_]"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5886 "A regular expression for searching backward that matches all known
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5887 \"statement\" keywords.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5888
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5889 (defun vhdl-statement-p (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5890 "Return t if we are looking at a real \"statement\" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5891 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
5892 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
5893 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
5894 \"statement\" keyword."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5895 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5896 ;; "for" ... "generate":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5897 ((and (looking-at "f")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5898 ;; Make sure it's the start of a parameter specification.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5899 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5900 (forward-sexp 2)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5901 (skip-chars-forward " \t\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5902 (looking-at "in\\b[^_]"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5903 ;; Make sure it's not an "end for".
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5904 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5905 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5906 (not (looking-at "end\\s-+\\w"))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5907 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5908 ;; "if" ... "then", "if" ... "generate", "if" ... "loop":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5909 ((and (looking-at "i")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5910 ;; Make sure it's not an "end if".
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5911 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5912 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5913 (not (looking-at "end\\s-+\\w"))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5914 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5915 ;; "while" ... "loop":
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5916 ((looking-at "w")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5917 t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5918 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5919
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5920 (defconst vhdl-case-alternative-re "when[( \t\n][^;=>]+=>"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5921 "Regexp describing a case statement alternative key.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5922
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5923 (defun vhdl-case-alternative-p (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5924 "Return t if we are looking at a real case alternative.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5925 Assumes that the caller will make sure that we are looking at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5926 vhdl-case-alternative-re, and are not inside a literal, and that
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5927 we are not in the middle of an identifier that just happens to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5928 contain a \"when\" keyword."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5929 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5930 (let (foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5931 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5932 (re-search-backward ";\\|<=" lim 'move))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5933 (if (or (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5934 (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5935 (backward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5936 (setq foundp t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5937 (or (eq (following-char) ?\;)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5938 (eq (point) lim)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5939 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5940
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5941 ;; Core syntactic movement functions:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5942
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5943 (defconst vhdl-b-t-b-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5944 (concat vhdl-begin-bwd-re "\\|" vhdl-end-bwd-re))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5945
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5946 (defun vhdl-backward-to-block (&optional lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5947 "Move backward to the previous \"begin\" or \"end\" keyword."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5948 (let (foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5949 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5950 (re-search-backward vhdl-b-t-b-re lim 'move))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5951 (if (or (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5952 (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5953 (backward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5954 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5955 ;; "begin" keyword:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5956 ((and (looking-at vhdl-begin-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5957 (/= (preceding-char) ?_)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5958 (vhdl-begin-p lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5959 (setq foundp 'begin))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5960 ;; "end" keyword:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5961 ((and (looking-at vhdl-end-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5962 (/= (preceding-char) ?_)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5963 (vhdl-end-p lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5964 (setq foundp 'end))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5965 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5966 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5967 foundp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5968 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5969
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5970 (defun vhdl-forward-sexp (&optional count lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5971 "Move forward across one balanced expression (sexp).
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5972 With COUNT, do it that many times."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5973 (interactive "p")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5974 (let ((count (or count 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5975 (case-fold-search t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5976 end-vec target)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5977 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5978 (while (> count 0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5979 ;; skip whitespace
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5980 (skip-chars-forward " \t\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5981 ;; Check for an unbalanced "end" keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5982 (if (and (looking-at vhdl-end-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5983 (/= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5984 (not (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5985 (vhdl-end-p lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5986 (not (looking-at "else")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5987 (error
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
5988 "ERROR: Containing expression ends prematurely in vhdl-forward-sexp"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5989 ;; If the current keyword is a "begin" keyword, then find the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5990 ;; corresponding "end" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5991 (if (setq end-vec (vhdl-corresponding-end lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5992 (let (
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5993 ;; end-re is the statement keyword to search for
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5994 (end-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5995 (concat "\\b\\(" (aref end-vec 0) "\\)\\b\\([^_]\\|\\'\\)"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5996 ;; column is either the statement keyword target column
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5997 ;; or nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5998 (column (aref end-vec 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5999 (eol (vhdl-point 'eol))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6000 foundp literal placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6001 ;; Look for the statement keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6002 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6003 (re-search-forward end-re nil t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6004 (setq placeholder (match-end 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6005 (goto-char (match-beginning 0)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6006 ;; If we are in a literal, or not in the right target
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6007 ;; column and not on the same line as the begin, then
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6008 ;; try again.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6009 (if (or (and column
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6010 (/= (current-indentation) column)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6011 (> (point) eol))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6012 (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6013 (setq literal (vhdl-in-literal)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6014 (if (eq literal 'comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6015 (end-of-line)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6016 (forward-char))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6017 ;; An "else" keyword corresponds to both the opening brace
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6018 ;; of the following sexp and the closing brace of the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6019 ;; previous sexp.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6020 (if (not (looking-at "else"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6021 (goto-char placeholder))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6022 (setq foundp t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6023 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6024 (if (not foundp)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6025 (error "ERROR: Unbalanced keywords in vhdl-forward-sexp"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6026 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6027 ;; If the current keyword is not a "begin" keyword, then just
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6028 ;; perform the normal forward-sexp.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6029 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6030 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6031 (setq count (1- count))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6032 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6033 (setq target (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6034 (goto-char target)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6035 nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6036
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6037 (defun vhdl-backward-sexp (&optional count lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6038 "Move backward across one balanced expression (sexp).
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6039 With COUNT, do it that many times. LIM bounds any required backward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6040 searches."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6041 (interactive "p")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6042 (let ((count (or count 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6043 (case-fold-search t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6044 begin-vec target)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6045 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6046 (while (> count 0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6047 ;; Perform the normal backward-sexp, unless we are looking at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6048 ;; "else" - an "else" keyword corresponds to both the opening brace
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6049 ;; of the following sexp and the closing brace of the previous sexp.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6050 (if (and (looking-at "else\\b\\([^_]\\|\\'\\)")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6051 (/= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6052 (not (vhdl-in-literal)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6053 nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6054 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6055 (if (and (looking-at vhdl-begin-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6056 (/= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6057 (not (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6058 (vhdl-begin-p lim))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6059 (error "ERROR: Containing expression ends prematurely in vhdl-backward-sexp")))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6060 ;; If the current keyword is an "end" keyword, then find the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6061 ;; corresponding "begin" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6062 (if (and (setq begin-vec (vhdl-corresponding-begin lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6063 (/= (preceding-char) ?_))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6064 (let (
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6065 ;; begin-re is the statement keyword to search for
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6066 (begin-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6067 (concat "\\b\\(" (aref begin-vec 0) "\\)\\b[^_]"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6068 ;; column is either the statement keyword target column
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6069 ;; or nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6070 (column (aref begin-vec 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6071 ;; internal-p controls where the statement keyword can
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6072 ;; be found.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6073 (internal-p (aref begin-vec 3))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6074 (last-backward (point)) last-forward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6075 foundp literal keyword)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6076 ;; Look for the statement keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6077 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6078 (re-search-backward begin-re lim t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6079 (setq keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6080 (buffer-substring (match-beginning 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6081 (match-end 1))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6082 ;; If we are in a literal or in the wrong column,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6083 ;; then try again.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6084 (if (or (and column
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6085 (and (/= (current-indentation) column)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6086 ;; possibly accept current-column as
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6087 ;; well as current-indentation.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6088 (or (not internal-p)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6089 (/= (current-column) column))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6090 (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6091 (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6092 (backward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6093 ;; If there is a supplementary keyword, then
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6094 ;; search forward for it.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6095 (if (and (setq begin-re (aref begin-vec 2))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6096 (or (not (listp begin-re))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6097 ;; If begin-re is an alist, then find the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6098 ;; element corresponding to the actual
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6099 ;; keyword that we found.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6100 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6101 (setq begin-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6102 (assoc keyword begin-re))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6103 (and begin-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6104 (setq begin-re (cdr begin-re))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6105 (and
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6106 (setq begin-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6107 (concat "\\b\\(" begin-re "\\)\\b[^_]"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6108 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6109 (setq last-forward (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6110 ;; Look for the supplementary keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6111 ;; (bounded by the backward search start
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6112 ;; point).
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6113 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6114 (re-search-forward begin-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6115 last-backward t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6116 (goto-char (match-beginning 1)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6117 ;; If we are in a literal, then try again.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6118 (if (or (= (preceding-char) ?_)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6119 (setq literal
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6120 (vhdl-in-literal)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6121 (if (eq literal 'comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6122 (goto-char
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6123 (min (vhdl-point 'eol) last-backward))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6124 (forward-char))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6125 ;; We have found the supplementary keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6126 ;; Save the position of the keyword in foundp.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6127 (setq foundp (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6128 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6129 foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6130 ;; If the supplementary keyword was found, then
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6131 ;; move point to the supplementary keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6132 (goto-char foundp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6133 ;; If there was no supplementary keyword, then
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6134 ;; point is already at the statement keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6135 (setq foundp t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6136 ) ; end of the search for the statement keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6137 (if (not foundp)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6138 (error "ERROR: Unbalanced keywords in vhdl-backward-sexp"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6139 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6140 (setq count (1- count))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6141 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6142 (setq target (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6143 (goto-char target)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6144 nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6145
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6146 (defun vhdl-backward-up-list (&optional count limit)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6147 "Move backward out of one level of blocks.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6148 With argument, do this that many times."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6149 (interactive "p")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6150 (let ((count (or count 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6151 target)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6152 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6153 (while (> count 0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6154 (if (looking-at vhdl-defun-re)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6155 (error "ERROR: Unbalanced blocks"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6156 (vhdl-backward-to-block limit)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6157 (setq count (1- count)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6158 (setq target (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6159 (goto-char target)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6160
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6161 (defun vhdl-end-of-defun (&optional count)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6162 "Move forward to the end of a VHDL defun."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6163 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6164 (let ((case-fold-search t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6165 (vhdl-beginning-of-defun)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6166 (if (not (looking-at "block\\|process\\|procedural"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6167 (re-search-forward "\\bis\\b"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6168 (vhdl-forward-sexp)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6169
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6170 (defun vhdl-mark-defun ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6171 "Put mark at end of this \"defun\", point at beginning."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6172 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6173 (let ((case-fold-search t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6174 (push-mark)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6175 (vhdl-beginning-of-defun)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6176 (push-mark)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6177 (if (not (looking-at "block\\|process\\|procedural"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6178 (re-search-forward "\\bis\\b"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6179 (vhdl-forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6180 (exchange-point-and-mark)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6181
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6182 (defun vhdl-beginning-of-libunit ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6183 "Move backward to the beginning of a VHDL library unit.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6184 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
6185 stops due to beginning or end of buffer.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6186 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
6187 corresponding \"begin\" keyword, then that libunit will not be
63520
ba5c73889cbc (vhdl-beginning-of-libunit): Fix spelling in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 63490
diff changeset
6188 recognized, and the search will continue backwards. If point is
ba5c73889cbc (vhdl-beginning-of-libunit): Fix spelling in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 63490
diff changeset
6189 at the \"begin\" keyword, then the defun will be recognized. The
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6190 returned point is at the first character of the \"libunit\" keyword."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6191 (let ((last-forward (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6192 (last-backward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6193 ;; Just in case we are actually sitting on the "begin"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6194 ;; keyword, allow for the keyword and an extra character,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6195 ;; as this will be used when looking forward for the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6196 ;; "begin" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6197 (save-excursion (forward-word 1) (1+ (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6198 foundp literal placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6199 ;; Find the "libunit" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6200 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6201 (re-search-backward vhdl-libunit-re nil 'move))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6202 ;; If we are in a literal, or not at a real libunit, then try again.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6203 (if (or (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6204 (vhdl-in-literal)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6205 (not (vhdl-libunit-p)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6206 (backward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6207 ;; Find the corresponding "begin" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6208 (setq last-forward (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6209 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6210 (re-search-forward "\\bis\\b[^_]" last-backward t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6211 (setq placeholder (match-beginning 0)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6212 (if (or (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6213 (setq literal (vhdl-in-literal)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6214 ;; It wasn't a real keyword, so keep searching.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6215 (if (eq literal 'comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6216 (goto-char
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6217 (min (vhdl-point 'eol) last-backward))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6218 (forward-char))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6219 ;; We have found the begin keyword, loop will exit.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6220 (setq foundp placeholder)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6221 ;; Go back to the libunit keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6222 (goto-char last-forward)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6223 foundp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6224
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6225 (defun vhdl-beginning-of-defun (&optional count)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6226 "Move backward to the beginning of a VHDL defun.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6227 With argument, do it that many times.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6228 Returns the location of the corresponding begin keyword, unless search
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6229 stops due to beginning or end of buffer."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6230 ;; Note that if point is between the "defun" keyword and the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6231 ;; corresponding "begin" keyword, then that defun will not be
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
6232 ;; recognized, and the search will continue backwards. If point is
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
6233 ;; at the "begin" keyword, then the defun will be recognized. The
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6234 ;; returned point is at the first character of the "defun" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6235 (interactive "p")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6236 (let ((count (or count 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6237 (case-fold-search t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6238 (last-forward (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6239 foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6240 (while (> count 0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6241 (setq foundp nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6242 (goto-char last-forward)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6243 (let ((last-backward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6244 ;; Just in case we are actually sitting on the "begin"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6245 ;; keyword, allow for the keyword and an extra character,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6246 ;; as this will be used when looking forward for the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6247 ;; "begin" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6248 (save-excursion (forward-word 1) (1+ (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6249 begin-string literal)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6250 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6251 (re-search-backward vhdl-defun-re nil 'move))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6252 ;; If we are in a literal, then try again.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6253 (if (or (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6254 (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6255 (backward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6256 (if (setq begin-string (vhdl-corresponding-defun))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6257 ;; This is a real defun keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6258 ;; Find the corresponding "begin" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6259 ;; Look for the begin keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6260 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6261 ;; Save the search start point.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6262 (setq last-forward (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6263 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6264 (search-forward begin-string last-backward t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6265 (if (or (= (preceding-char) ?_)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6266 (save-match-data
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6267 (setq literal (vhdl-in-literal))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6268 ;; It wasn't a real keyword, so keep searching.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6269 (if (eq literal 'comment)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6270 (goto-char
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6271 (min (vhdl-point 'eol) last-backward))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6272 (forward-char))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6273 ;; We have found the begin keyword, loop will exit.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6274 (setq foundp (match-beginning 0)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6275 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6276 ;; Go back to the defun keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6277 (goto-char last-forward)) ; end search for begin keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6278 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6279 ) ; end of the search for the defun keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6280 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6281 (setq count (1- count))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6282 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6283 (vhdl-keep-region-active)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6284 foundp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6285
57820
5d471cc0eaab (vhdl-fill-region, vhdl-beginning-of-statement): Don't use interactive-p.
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
6286 (defun vhdl-beginning-of-statement (&optional count lim interactive)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6287 "Go to the beginning of the innermost VHDL statement.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6288 With prefix arg, go back N - 1 statements. If already at the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6289 beginning of a statement then go to the beginning of the preceding
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6290 one. If within a string or comment, or next to a comment (only
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6291 whitespace between), move by sentences instead of statements.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6292
57820
5d471cc0eaab (vhdl-fill-region, vhdl-beginning-of-statement): Don't use interactive-p.
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
6293 When called from a program, this function takes 3 optional args: the
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
6294 prefix arg, a buffer position limit which is the farthest back to
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
6295 search, and an argument indicating an interactive call."
57820
5d471cc0eaab (vhdl-fill-region, vhdl-beginning-of-statement): Don't use interactive-p.
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
6296 (interactive "p\np")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6297 (let ((count (or count 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6298 (case-fold-search t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6299 (lim (or lim (point-min)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6300 (here (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6301 state)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6302 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6303 (goto-char lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6304 (setq state (parse-partial-sexp (point) here nil nil)))
57820
5d471cc0eaab (vhdl-fill-region, vhdl-beginning-of-statement): Don't use interactive-p.
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
6305 (if (and interactive
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6306 (or (nth 3 state)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6307 (nth 4 state)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6308 (looking-at (concat "[ \t]*" comment-start-skip))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6309 (forward-sentence (- count))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6310 (while (> count 0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6311 (vhdl-beginning-of-statement-1 lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6312 (setq count (1- count))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6313 ;; its possible we've been left up-buf of lim
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6314 (goto-char (max (point) lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6315 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6316 (vhdl-keep-region-active))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6317
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6318 (defconst vhdl-e-o-s-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6319 (concat ";\\|" vhdl-begin-fwd-re "\\|" vhdl-statement-fwd-re))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6320
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6321 (defun vhdl-end-of-statement ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6322 "Very simple implementation."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6323 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6324 (re-search-forward vhdl-e-o-s-re))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6325
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6326 (defconst vhdl-b-o-s-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6327 (concat ";\\|\(\\|\)\\|\\bwhen\\b[^_]\\|"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6328 vhdl-begin-bwd-re "\\|" vhdl-statement-bwd-re))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6329
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6330 (defun vhdl-beginning-of-statement-1 (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6331 "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
6332 statement if already at the beginning of one."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6333 (let ((lim (or lim (point-min)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6334 (here (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6335 (pos (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6336 donep)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6337 ;; go backwards one balanced expression, but be careful of
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6338 ;; unbalanced paren being reached
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6339 (if (not (vhdl-safe (progn (backward-sexp) t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6340 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6341 (backward-up-list 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6342 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6343 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6344 (setq donep t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6345 (while (and (not donep)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6346 (not (bobp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6347 ;; look backwards for a statement boundary
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6348 (re-search-backward vhdl-b-o-s-re lim 'move))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6349 (if (or (= (preceding-char) ?_)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6350 (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6351 (backward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6352 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6353 ;; If we are looking at an open paren, then stop after it
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6354 ((eq (following-char) ?\()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6355 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6356 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6357 (setq donep t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6358 ;; If we are looking at a close paren, then skip it
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6359 ((eq (following-char) ?\))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6360 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6361 (setq pos (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6362 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6363 (if (< (point) lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6364 (progn (goto-char pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6365 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6366 (setq donep t))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6367 ;; If we are looking at a semicolon, then stop
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6368 ((eq (following-char) ?\;)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6369 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6370 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6371 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6372 (setq donep t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6373 ;; If we are looking at a "begin", then stop
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6374 ((and (looking-at vhdl-begin-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6375 (/= (preceding-char) ?_)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6376 (vhdl-begin-p nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6377 ;; If it's a leader "begin", then find the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6378 ;; right place
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6379 (if (looking-at vhdl-leader-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6380 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6381 ;; set a default stop point at the begin
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6382 (setq pos (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6383 ;; is the start point inside the leader area ?
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6384 (goto-char (vhdl-end-of-leader))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6385 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6386 (if (< (point) here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6387 ;; start point was not inside leader area
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6388 ;; set stop point at word after leader
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6389 (setq pos (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6390 (forward-word 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6391 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6392 (setq pos (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6393 (goto-char pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6394 (setq donep t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6395 ;; If we are looking at a "statement", then stop
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6396 ((and (looking-at vhdl-statement-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6397 (/= (preceding-char) ?_)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6398 (vhdl-statement-p nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6399 (setq donep t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6400 ;; 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
6401 ((and (looking-at vhdl-case-alternative-re)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6402 (vhdl-case-alternative-p lim))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6403 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6404 ;; set a default stop point at the when
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6405 (setq pos (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6406 ;; is the start point inside the case alternative key ?
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6407 (looking-at vhdl-case-alternative-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6408 (goto-char (match-end 0))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6409 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6410 (if (< (point) here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6411 ;; start point was not inside the case alternative key
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6412 ;; set stop point at word after case alternative keyleader
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6413 (setq pos (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6414 (goto-char pos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6415 (setq donep t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6416 ;; Bogus find, continue
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6417 (t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6418 (backward-char)))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6419 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6420
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6421 ;; Defuns for calculating the current syntactic state:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6422
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6423 (defun vhdl-get-library-unit (bod placeholder)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
6424 "If there is an enclosing library unit at BOD, with its \"begin\"
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
6425 keyword at PLACEHOLDER, then return the library unit type."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6426 (let ((here (vhdl-point 'bol)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6427 (if (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6428 (goto-char placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6429 (vhdl-safe (vhdl-forward-sexp 1 bod))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6430 (<= here (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6431 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6432 (goto-char bod)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6433 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6434 ((looking-at "e") 'entity)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6435 ((looking-at "a") 'architecture)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6436 ((looking-at "c") 'configuration)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6437 ((looking-at "p")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6438 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6439 (goto-char bod)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6440 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6441 (vhdl-forward-syntactic-ws here)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6442 (if (looking-at "body\\b[^_]")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6443 'package-body 'package))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6444 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6445
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6446 (defun vhdl-get-block-state (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6447 "Finds and records all the closest opens.
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
6448 LIM is the furthest back we need to search (it should be the
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6449 previous libunit keyword)."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6450 (let ((here (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6451 (lim (or lim (point-min)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6452 keyword sexp-start sexp-mid sexp-end
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6453 preceding-sexp containing-sexp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6454 containing-begin containing-mid containing-paren)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6455 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6456 ;; Find the containing-paren, and use that as the limit
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6457 (if (setq containing-paren
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6458 (save-restriction
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6459 (narrow-to-region lim (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6460 (vhdl-safe (scan-lists (point) -1 1))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6461 (setq lim containing-paren))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6462 ;; Look backwards for "begin" and "end" keywords.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6463 (while (and (> (point) lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6464 (not containing-sexp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6465 (setq keyword (vhdl-backward-to-block lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6466 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6467 ((eq keyword 'begin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6468 ;; Found a "begin" keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6469 (setq sexp-start (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6470 (setq sexp-mid (vhdl-corresponding-mid lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6471 (setq sexp-end (vhdl-safe
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6472 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6473 (vhdl-forward-sexp 1 lim) (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6474 (if (and sexp-end (<= sexp-end here))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6475 ;; we want to record this sexp, but we only want to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6476 ;; record the last-most of any of them before here
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6477 (or preceding-sexp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6478 (setq preceding-sexp sexp-start))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6479 ;; we're contained in this sexp so put sexp-start on
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6480 ;; front of list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6481 (setq containing-sexp sexp-start)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6482 (setq containing-mid sexp-mid)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6483 (setq containing-begin t)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6484 ((eq keyword 'end)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6485 ;; Found an "end" keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6486 (forward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6487 (setq sexp-end (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6488 (setq sexp-mid nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6489 (setq sexp-start
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6490 (or (vhdl-safe (vhdl-backward-sexp 1 lim) (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6491 (progn (backward-sexp) (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6492 ;; we want to record this sexp, but we only want to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6493 ;; record the last-most of any of them before here
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6494 (or preceding-sexp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6495 (setq preceding-sexp sexp-start)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6496 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6497 ;; Check if the containing-paren should be the containing-sexp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6498 (if (and containing-paren
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6499 (or (null containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6500 (< containing-sexp containing-paren)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6501 (setq containing-sexp containing-paren
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6502 preceding-sexp nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6503 containing-begin nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6504 containing-mid nil))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6505 (vector containing-sexp preceding-sexp containing-begin containing-mid)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6506 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6507
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6508
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6509 (defconst vhdl-s-c-a-re
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6510 (concat vhdl-case-alternative-re "\\|" vhdl-case-header-key))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6511
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6512 (defun vhdl-skip-case-alternative (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6513 "Skip forward over case/when bodies, with optional maximal
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
6514 limit. If no next case alternative is found, nil is returned and
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
6515 point is not moved."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6516 (let ((lim (or lim (point-max)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6517 (here (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6518 donep foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6519 (while (and (< (point) lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6520 (not donep))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6521 (if (and (re-search-forward vhdl-s-c-a-re lim 'move)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6522 (save-match-data
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6523 (not (vhdl-in-literal)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6524 (/= (match-beginning 0) here))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6525 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6526 (goto-char (match-beginning 0))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6527 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6528 ((and (looking-at "case")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6529 (re-search-forward "\\bis[^_]" lim t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6530 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6531 (vhdl-forward-sexp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6532 (t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6533 (setq donep t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6534 foundp t))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6535 (if (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6536 (goto-char here))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6537 foundp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6538
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6539 (defun vhdl-backward-skip-label (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6540 "Skip backward over a label, with optional maximal
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
6541 limit. If label is not found, nil is returned and point
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6542 is not moved."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6543 (let ((lim (or lim (point-min)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6544 placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6545 (if (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6546 (vhdl-backward-syntactic-ws lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6547 (and (eq (preceding-char) ?:)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6548 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6549 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6550 (setq placeholder (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6551 (looking-at vhdl-label-key))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6552 (goto-char placeholder))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6553 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6554
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6555 (defun vhdl-forward-skip-label (&optional lim)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6556 "Skip forward over a label, with optional maximal
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6557 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
6558 is not moved."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6559 (let ((lim (or lim (point-max))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6560 (if (looking-at vhdl-label-key)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6561 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6562 (goto-char (match-end 0))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6563 (vhdl-forward-syntactic-ws lim)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6564 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6565
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6566 (defun vhdl-get-syntactic-context ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6567 "Guess the syntactic description of the current line of VHDL code."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6568 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6569 (save-restriction
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6570 (beginning-of-line)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6571 (let* ((indent-point (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6572 (case-fold-search t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6573 vec literal containing-sexp preceding-sexp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6574 containing-begin containing-mid containing-leader
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6575 char-before-ip char-after-ip begin-after-ip end-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6576 placeholder lim library-unit
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6577 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6578
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6579 ;; Reset the syntactic context
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6580 (setq vhdl-syntactic-context nil)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6581
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6582 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6583 ;; Move to the start of the previous library unit, and
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6584 ;; record the position of the "begin" keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6585 (setq placeholder (vhdl-beginning-of-libunit))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6586 ;; The position of the "libunit" keyword gives us a gross
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6587 ;; limit point.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6588 (setq lim (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6589 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6590
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6591 ;; If there is a previous library unit, and we are enclosed by
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6592 ;; it, then set the syntax accordingly.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6593 (and placeholder
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6594 (setq library-unit (vhdl-get-library-unit lim placeholder))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6595 (vhdl-add-syntax library-unit lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6596
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6597 ;; Find the surrounding state.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6598 (if (setq vec (vhdl-get-block-state lim))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6599 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6600 (setq containing-sexp (aref vec 0))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6601 (setq preceding-sexp (aref vec 1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6602 (setq containing-begin (aref vec 2))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6603 (setq containing-mid (aref vec 3))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6604 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6605
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6606 ;; set the limit on the farthest back we need to search
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6607 (setq lim (if containing-sexp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6608 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6609 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6610 ;; set containing-leader if required
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6611 (if (looking-at vhdl-leader-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6612 (setq containing-leader (vhdl-end-of-leader)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6613 (vhdl-point 'bol))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6614 (point-min)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6615
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6616 ;; cache char before and after indent point, and move point to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6617 ;; the most likely position to perform the majority of tests
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6618 (goto-char indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6619 (skip-chars-forward " \t")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6620 (setq literal (vhdl-in-literal))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6621 (setq char-after-ip (following-char))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6622 (setq begin-after-ip (and
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6623 (not literal)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6624 (looking-at vhdl-begin-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6625 (vhdl-begin-p)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6626 (setq end-after-ip (and
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6627 (not literal)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6628 (looking-at vhdl-end-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6629 (vhdl-end-p)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6630 (vhdl-backward-syntactic-ws lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6631 (setq char-before-ip (preceding-char))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6632 (goto-char indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6633 (skip-chars-forward " \t")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6634
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6635 ;; now figure out syntactic qualities of the current line
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6636 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6637 ;; CASE 1: in a string or comment.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6638 ((memq literal '(string comment))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6639 (vhdl-add-syntax literal (vhdl-point 'bopl)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6640 ;; CASE 2: Line is at top level.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6641 ((null containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6642 ;; Find the point to which indentation will be relative
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6643 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6644 (if (null preceding-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6645 ;; CASE 2X.1
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6646 ;; no preceding-sexp -> use the preceding statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6647 (vhdl-beginning-of-statement-1 lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6648 ;; CASE 2X.2
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6649 ;; if there is a preceding-sexp then indent relative to it
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6650 (goto-char preceding-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6651 ;; if not at boi, then the block-opening keyword is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6652 ;; probably following a label, so we need a different
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6653 ;; relpos
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6654 (if (/= (point) (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6655 ;; CASE 2X.3
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6656 (vhdl-beginning-of-statement-1 lim)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6657 ;; v-b-o-s could have left us at point-min
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6658 (and (bobp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6659 ;; CASE 2X.4
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6660 (vhdl-forward-syntactic-ws indent-point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6661 (setq placeholder (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6662 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6663 ;; CASE 2A : we are looking at a block-open
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6664 (begin-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6665 (vhdl-add-syntax 'block-open placeholder))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6666 ;; CASE 2B: we are looking at a block-close
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6667 (end-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6668 (vhdl-add-syntax 'block-close placeholder))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6669 ;; CASE 2C: we are looking at a top-level statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6670 ((progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6671 (vhdl-backward-syntactic-ws lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6672 (or (bobp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6673 (= (preceding-char) ?\;)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6674 (vhdl-add-syntax 'statement placeholder))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6675 ;; CASE 2D: we are looking at a top-level statement-cont
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6676 (t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6677 (vhdl-beginning-of-statement-1 lim)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6678 ;; v-b-o-s could have left us at point-min
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6679 (and (bobp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6680 ;; CASE 2D.1
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6681 (vhdl-forward-syntactic-ws indent-point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6682 (vhdl-add-syntax 'statement-cont (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6683 )) ; end CASE 2
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6684 ;; CASE 3: line is inside parentheses. Most likely we are
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6685 ;; either in a subprogram argument (interface) list, or a
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6686 ;; continued expression containing parentheses.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6687 ((null containing-begin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6688 (vhdl-backward-syntactic-ws containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6689 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6690 ;; CASE 3A: we are looking at the arglist closing paren
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6691 ((eq char-after-ip ?\))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6692 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6693 (vhdl-add-syntax 'arglist-close (vhdl-point 'boi)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6694 ;; CASE 3B: we are looking at the first argument in an empty
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6695 ;; argument list.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6696 ((eq char-before-ip ?\()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6697 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6698 (vhdl-add-syntax 'arglist-intro (vhdl-point 'boi)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6699 ;; CASE 3C: we are looking at an arglist continuation line,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6700 ;; but the preceding argument is on the same line as the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6701 ;; opening paren. This case includes multi-line
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6702 ;; expression paren groupings.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6703 ((and (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6704 (goto-char (1+ containing-sexp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6705 (skip-chars-forward " \t")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6706 (not (eolp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6707 (not (looking-at "--")))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6708 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6709 (vhdl-beginning-of-statement-1 containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6710 (skip-chars-backward " \t(")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6711 (<= (point) containing-sexp)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6712 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6713 (vhdl-add-syntax 'arglist-cont-nonempty (vhdl-point 'boi)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6714 ;; CASE 3D: we are looking at just a normal arglist
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6715 ;; continuation line
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6716 (t (vhdl-beginning-of-statement-1 containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6717 (vhdl-forward-syntactic-ws indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6718 (vhdl-add-syntax 'arglist-cont (vhdl-point 'boi)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6719 ))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6720 ;; CASE 4: A block mid open
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6721 ((and begin-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6722 (looking-at containing-mid))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6723 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6724 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6725 (if (looking-at vhdl-trailer-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6726 ;; CASE 4.1
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6727 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6728 (vhdl-backward-skip-label (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6729 (vhdl-add-syntax 'block-open (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6730 ;; CASE 5: block close brace
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6731 (end-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6732 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6733 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6734 (if (looking-at vhdl-trailer-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6735 ;; CASE 5.1
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6736 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6737 (vhdl-backward-skip-label (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6738 (vhdl-add-syntax 'block-close (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6739 ;; CASE 6: A continued statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6740 ((and (/= char-before-ip ?\;)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6741 ;; check it's not a trailer begin keyword, or a begin
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6742 ;; keyword immediately following a label.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6743 (not (and begin-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6744 (or (looking-at vhdl-trailer-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6745 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6746 (vhdl-backward-skip-label containing-sexp)))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6747 ;; check it's not a statement keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6748 (not (and (looking-at vhdl-statement-fwd-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6749 (vhdl-statement-p)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6750 ;; see if the b-o-s is before the indent point
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6751 (> indent-point
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6752 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6753 (vhdl-beginning-of-statement-1 containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6754 ;; If we ended up after a leader, then this will
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6755 ;; move us forward to the start of the first
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6756 ;; statement. Note that a containing sexp here is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6757 ;; always a keyword, not a paren, so this will
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6758 ;; have no effect if we hit the containing-sexp.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6759 (vhdl-forward-syntactic-ws indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6760 (setq placeholder (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6761 ;; check it's not a block-intro
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6762 (/= placeholder containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6763 ;; check it's not a case block-intro
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6764 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6765 (goto-char placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6766 (or (not (looking-at vhdl-case-alternative-re))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6767 (> (match-end 0) indent-point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6768 ;; Make placeholder skip a label, but only if it puts us
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6769 ;; before the indent point at the start of a line.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6770 (let ((new placeholder))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6771 (if (and (> indent-point
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6772 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6773 (goto-char placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6774 (vhdl-forward-skip-label indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6775 (setq new (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6776 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6777 (goto-char new)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6778 (eq new (progn (back-to-indentation) (point)))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6779 (setq placeholder new)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6780 (vhdl-add-syntax 'statement-cont placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6781 (if begin-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6782 (vhdl-add-syntax 'block-open)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6783 ;; Statement. But what kind?
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6784 ;; CASE 7: A case alternative key
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6785 ((and (looking-at vhdl-case-alternative-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6786 (vhdl-case-alternative-p containing-sexp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6787 ;; for a case alternative key, we set relpos to the first
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6788 ;; non-whitespace char on the line containing the "case"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6789 ;; keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6790 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6791 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6792 (if (looking-at vhdl-trailer-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6793 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6794 (vhdl-add-syntax 'case-alternative (vhdl-point 'boi)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6795 ;; CASE 8: statement catchall
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6796 (t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6797 ;; we know its a statement, but we need to find out if it is
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6798 ;; the first statement in a block
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6799 (if containing-leader
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6800 (goto-char containing-leader)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6801 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6802 ;; Note that a containing sexp here is always a keyword,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6803 ;; not a paren, so skip over the keyword.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6804 (forward-sexp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6805 ;; move to the start of the first statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6806 (vhdl-forward-syntactic-ws indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6807 (setq placeholder (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6808 ;; we want to ignore case alternatives keys when skipping forward
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6809 (let (incase-p)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6810 (while (looking-at vhdl-case-alternative-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6811 (setq incase-p (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6812 ;; we also want to skip over the body of the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6813 ;; case/when statement if that doesn't put us at
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6814 ;; after the indent-point
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6815 (while (vhdl-skip-case-alternative indent-point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6816 ;; set up the match end
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6817 (looking-at vhdl-case-alternative-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6818 (goto-char (match-end 0))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6819 ;; move to the start of the first case alternative statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6820 (vhdl-forward-syntactic-ws indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6821 (setq placeholder (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6822 (cond
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6823 ;; CASE 8A: we saw a case/when statement so we must be
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6824 ;; in a switch statement. find out if we are at the
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6825 ;; statement just after a case alternative key
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6826 ((and incase-p
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6827 (= (point) indent-point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6828 ;; relpos is the "when" keyword
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6829 (vhdl-add-syntax 'statement-case-intro incase-p))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6830 ;; CASE 8B: any old statement
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6831 ((< (point) indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6832 ;; relpos is the first statement of the block
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6833 (vhdl-add-syntax 'statement placeholder)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6834 (if begin-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6835 (vhdl-add-syntax 'block-open)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6836 ;; CASE 8C: first statement in a block
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6837 (t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6838 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6839 ;; If the \"begin\" keyword is a trailer, then find v-b-o-s
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6840 (if (looking-at vhdl-trailer-re)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6841 (progn (forward-sexp) (vhdl-beginning-of-statement-1 nil)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6842 (vhdl-backward-skip-label (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6843 (vhdl-add-syntax 'statement-block-intro (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6844 (if begin-after-ip
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6845 (vhdl-add-syntax 'block-open)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6846 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6847 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6848
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6849 ;; now we need to look at any modifiers
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6850 (goto-char indent-point)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6851 (skip-chars-forward " \t")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6852 (if (looking-at "--")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6853 (vhdl-add-syntax 'comment))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
6854 (if (eq literal 'pound)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
6855 (vhdl-add-syntax 'cpp-macro))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6856 ;; return the syntax
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6857 vhdl-syntactic-context))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6858
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6859 ;; Standard indentation line-ups:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6860
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6861 (defun vhdl-lineup-arglist (langelem)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6862 "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
6863 after the containing paren which starts the arglist."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6864 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6865 (let* ((containing-sexp
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6866 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6867 ;; arglist-cont-nonempty gives relpos ==
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6868 ;; to boi of containing-sexp paren. This
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6869 ;; is good when offset is +, but bad
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6870 ;; when it is vhdl-lineup-arglist, so we
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6871 ;; have to special case a kludge here.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6872 (if (memq (car langelem) '(arglist-intro arglist-cont-nonempty))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6873 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6874 (beginning-of-line)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6875 (backward-up-list 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6876 (skip-chars-forward " \t" (vhdl-point 'eol)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6877 (goto-char (cdr langelem)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6878 (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6879 (cs-curcol (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6880 (goto-char (cdr langelem))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6881 (current-column))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6882 (if (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6883 (beginning-of-line)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6884 (looking-at "[ \t]*)"))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6885 (progn (goto-char (match-end 0))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6886 (backward-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6887 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6888 (vhdl-forward-syntactic-ws)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6889 (- (current-column) cs-curcol))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6890 (goto-char containing-sexp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6891 (or (eolp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6892 (let ((eol (vhdl-point 'eol))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6893 (here (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6894 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6895 (skip-chars-forward " \t")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6896 (point))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6897 (vhdl-forward-syntactic-ws)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6898 (if (< (point) eol)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6899 (goto-char here))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6900 (- (current-column) cs-curcol)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6901 ))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6902
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6903 (defun vhdl-lineup-arglist-intro (langelem)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6904 "Lineup an arglist-intro line to just after the open paren."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6905 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6906 (let ((cs-curcol (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6907 (goto-char (cdr langelem))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6908 (current-column)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6909 (ce-curcol (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6910 (beginning-of-line)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6911 (backward-up-list 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6912 (skip-chars-forward " \t" (vhdl-point 'eol))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6913 (current-column))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6914 (- ce-curcol cs-curcol -1))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6915
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6916 (defun vhdl-lineup-comment (langelem)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6917 "Support old behavior for comment indentation. We look at
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6918 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
6919 only-lines."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6920 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6921 (back-to-indentation)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6922 ;; at or to the right of comment-column
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6923 (if (>= (current-column) comment-column)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6924 (vhdl-comment-indent)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6925 ;; otherwise, indent as specified by vhdl-comment-only-line-offset
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6926 (if (not (bolp))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6927 (or (car-safe vhdl-comment-only-line-offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6928 vhdl-comment-only-line-offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6929 (or (cdr-safe vhdl-comment-only-line-offset)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6930 (car-safe vhdl-comment-only-line-offset)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
6931 -1000 ;jam it against the left side
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6932 )))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6933
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6934 (defun vhdl-lineup-statement-cont (langelem)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6935 "Line up statement-cont after the assignment operator."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6936 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6937 (let* ((relpos (cdr langelem))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6938 (assignp (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6939 (goto-char (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6940 (and (re-search-forward "\\(<\\|:\\)="
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6941 (vhdl-point 'eol) t)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6942 (- (point) (vhdl-point 'boi)))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6943 (curcol (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6944 (goto-char relpos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6945 (current-column)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6946 foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6947 (while (and (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6948 (< (point) (vhdl-point 'eol)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6949 (re-search-forward "\\(<\\|:\\)=\\|(" (vhdl-point 'eol) 'move)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6950 (if (vhdl-in-literal)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6951 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6952 (if (= (preceding-char) ?\()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6953 ;; skip over any parenthesized expressions
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6954 (goto-char (min (vhdl-point 'eol)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6955 (scan-lists (point) 1 1)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6956 ;; found an assignment operator (not at eol)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6957 (setq foundp (not (looking-at "\\s-*$"))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6958 (if (not foundp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6959 ;; there's no assignment operator on the line
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6960 vhdl-basic-offset
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6961 ;; calculate indentation column after assign and ws, unless
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6962 ;; our line contains an assignment operator
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6963 (if (not assignp)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6964 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6965 (forward-char)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6966 (skip-chars-forward " \t")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6967 (setq assignp 0)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6968 (- (current-column) assignp curcol))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6969 )))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6970
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6971 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6972 ;; Progress reporting
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6973
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6974 (defvar vhdl-progress-info nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6975 "Array variable for progress information: 0 begin, 1 end, 2 time.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6976
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6977 (defun vhdl-update-progress-info (string pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6978 "Update progress information."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6979 (when (and vhdl-progress-info (not noninteractive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6980 (< vhdl-progress-interval
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6981 (- (nth 1 (current-time)) (aref vhdl-progress-info 2))))
78544
4af36cf4d2db (vhdl-update-progress-info): Avoid divide by zero error.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
6982 (let ((delta (- (aref vhdl-progress-info 1)
4af36cf4d2db (vhdl-update-progress-info): Avoid divide by zero error.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
6983 (aref vhdl-progress-info 0))))
4af36cf4d2db (vhdl-update-progress-info): Avoid divide by zero error.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
6984 (if (= 0 delta)
4af36cf4d2db (vhdl-update-progress-info): Avoid divide by zero error.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
6985 (message (concat string "... (100%s)") "%")
4af36cf4d2db (vhdl-update-progress-info): Avoid divide by zero error.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
6986 (message (concat string "... (%2d%s)")
4af36cf4d2db (vhdl-update-progress-info): Avoid divide by zero error.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
6987 (/ (* 100 (- pos (aref vhdl-progress-info 0)))
4af36cf4d2db (vhdl-update-progress-info): Avoid divide by zero error.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
6988 delta) "%")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6989 (aset vhdl-progress-info 2 (nth 1 (current-time)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6990
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6991 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6992 ;; Indentation commands
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6993
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6994 (defun vhdl-electric-tab (&optional prefix-arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
6995 "If preceeding character is part of a word or a paren then hippie-expand,
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6996 else if right of non whitespace on line then insert tab,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6997 else if last command was a tab or return then dedent one step or if a comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
6998 toggle between normal indent and inline comment indent,
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6999 else indent `correctly'."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7000 (interactive "*P")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7001 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7002 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7003 ;; expand word
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7004 ((= (char-syntax (preceding-char)) ?w)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7005 (let ((case-fold-search (not vhdl-word-completion-case-sensitive))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7006 (case-replace nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7007 (hippie-expand-only-buffers
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7008 (or (and (boundp 'hippie-expand-only-buffers)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7009 hippie-expand-only-buffers)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7010 '(vhdl-mode))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7011 (vhdl-expand-abbrev prefix-arg)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7012 ;; expand parenthesis
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7013 ((or (= (preceding-char) ?\() (= (preceding-char) ?\)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7014 (let ((case-fold-search (not vhdl-word-completion-case-sensitive))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7015 (case-replace nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7016 (vhdl-expand-paren prefix-arg)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7017 ;; insert tab
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7018 ((> (current-column) (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7019 (insert-tab))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7020 ;; toggle comment indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7021 ((and (looking-at "--")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7022 (or (eq last-command 'vhdl-electric-tab)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7023 (eq last-command 'vhdl-electric-return)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7024 (cond ((= (current-indentation) 0) ; no indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7025 (indent-to 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7026 (indent-according-to-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7027 ((< (current-indentation) comment-column) ; normal indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7028 (indent-to comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7029 (indent-according-to-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7030 (t ; inline comment indent
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
7031 (delete-region (line-beginning-position) (point)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7032 ;; dedent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7033 ((and (>= (current-indentation) vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7034 (or (eq last-command 'vhdl-electric-tab)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7035 (eq last-command 'vhdl-electric-return)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7036 (backward-delete-char-untabify vhdl-basic-offset nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7037 ;; indent line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7038 (t (indent-according-to-mode)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7039 (setq this-command 'vhdl-electric-tab)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7040
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7041 (defun vhdl-electric-return ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7042 "newline-and-indent or indent-new-comment-line if in comment and preceding
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7043 character is a space."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7044 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7045 (if (and (= (preceding-char) ? ) (vhdl-in-comment-p))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7046 (indent-new-comment-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7047 (when (and (>= (preceding-char) ?a) (<= (preceding-char) ?z))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7048 (vhdl-fix-case-word -1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7049 (newline-and-indent)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7050
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7051 (defun vhdl-indent-line ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7052 "Indent the current line as VHDL code. Returns the amount of
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7053 indentation change."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7054 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7055 (let* ((syntax (and vhdl-indent-syntax-based (vhdl-get-syntactic-context)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7056 (pos (- (point-max) (point)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7057 (indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7058 (if syntax
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7059 ;; indent syntax-based
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7060 (if (and (eq (caar syntax) 'comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7061 (>= (vhdl-get-offset (car syntax)) comment-column))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7062 ;; special case: comments at or right of comment-column
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7063 (vhdl-get-offset (car syntax))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7064 (apply '+ (mapcar 'vhdl-get-offset syntax)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7065 ;; indent like previous nonblank line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7066 (save-excursion (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7067 (re-search-backward "^[^\n]" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7068 (current-indentation))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7069 (shift-amt (- indent (current-indentation))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7070 (and vhdl-echo-syntactic-information-p
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7071 (message "syntax: %s, indent= %d" syntax indent))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7072 (unless (zerop shift-amt)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7073 (delete-region (vhdl-point 'bol) (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7074 (beginning-of-line)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7075 (indent-to indent))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7076 (if (< (point) (vhdl-point 'boi))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7077 (back-to-indentation)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7078 ;; If initial point was within line's indentation, position after
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7079 ;; 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
7080 (when (> (- (point-max) pos) (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7081 (goto-char (- (point-max) pos))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7082 (run-hooks 'vhdl-special-indent-hook)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7083 (vhdl-update-progress-info "Indenting" (vhdl-current-line))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7084 shift-amt))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7085
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7086 (defun vhdl-indent-region (beg end column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7087 "Indent region as VHDL code.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7088 Adds progress reporting to `indent-region'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7089 (interactive "r\nP")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7090 (when vhdl-progress-interval
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7091 (setq vhdl-progress-info (vector (count-lines (point-min) beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7092 (count-lines (point-min) end) 0)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7093 (indent-region beg end column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7094 (when vhdl-progress-interval (message "Indenting...done"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7095 (setq vhdl-progress-info nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7096
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7097 (defun vhdl-indent-buffer ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7098 "Indent whole buffer as VHDL code.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7099 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
7100 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7101 (vhdl-indent-region (point-min) (point-max) nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7102
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7103 (defun vhdl-indent-group ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7104 "Indent group of lines between empty lines."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7105 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7106 (let ((beg (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7107 (if (re-search-backward vhdl-align-group-separate nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7108 (point-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7109 (point-min-marker))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7110 (end (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7111 (if (re-search-forward vhdl-align-group-separate nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7112 (point-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7113 (point-max-marker)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7114 (vhdl-indent-region beg end nil)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7115
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7116 (defun vhdl-indent-sexp (&optional endpos)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7117 "Indent each line of the list starting just after point.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7118 If optional arg ENDPOS is given, indent each line, stopping when
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7119 ENDPOS is encountered."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7120 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7121 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7122 (let ((beg (point))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7123 (end (progn (vhdl-forward-sexp nil endpos) (point))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7124 (indent-region beg end nil))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7125
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7126 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7127 ;; Miscellaneous commands
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7128
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7129 (defun vhdl-show-syntactic-information ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7130 "Show syntactic information for current line."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7131 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7132 (message "Syntactic analysis: %s" (vhdl-get-syntactic-context))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7133 (vhdl-keep-region-active))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7134
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7135 ;; Verification and regression functions:
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7136
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7137 (defun vhdl-regress-line (&optional arg)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7138 "Check syntactic information for current line."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7139 (interactive "P")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7140 (let ((expected (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7141 (end-of-line)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7142 (when (search-backward " -- ((" (vhdl-point 'bol) t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7143 (forward-char 4)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7144 (read (current-buffer)))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7145 (actual (vhdl-get-syntactic-context))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7146 (expurgated))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7147 ;; remove the library unit symbols
84923
85483f68777e (vhdl-set-style, vhdl-regress-line): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 78544
diff changeset
7148 (mapc
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7149 (function
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7150 (lambda (elt)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7151 (if (memq (car elt) '(entity configuration package
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7152 package-body architecture))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7153 nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7154 (setq expurgated (append expurgated (list elt))))))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7155 actual)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7156 (if (and (not arg) expected (listp expected))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7157 (if (not (equal expected expurgated))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7158 (error "ERROR: Should be: %s, is: %s" expected expurgated))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7159 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7160 (beginning-of-line)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7161 (when (not (looking-at "^\\s-*\\(--.*\\)?$"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7162 (end-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7163 (if (search-backward " -- ((" (vhdl-point 'bol) t)
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
7164 (delete-region (point) (line-end-position)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7165 (insert " -- ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7166 (insert (format "%s" expurgated))))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7167 (vhdl-keep-region-active))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7168
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7169
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7170 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7171 ;;; Alignment, whitespace fixup, beautifying
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7172 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7173
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7174 (defconst vhdl-align-alist
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7175 '(
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7176 ;; after some keywords
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7177 (vhdl-mode "^\\s-*\\(constant\\|quantity\\|signal\\|subtype\\|terminal\\|type\\|variable\\)[ \t]"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7178 "^\\s-*\\(constant\\|quantity\\|signal\\|subtype\\|terminal\\|type\\|variable\\)\\([ \t]+\\)" 2)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7179 ;; before ':'
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7180 (vhdl-mode ":[^=]" "\\([ \t]*\\):[^=]")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7181 ;; after direction specifications
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7182 (vhdl-mode ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\>"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7183 ":[ \t]*\\(in\\|out\\|inout\\|buffer\\|\\)\\([ \t]+\\)" 2)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7184 ;; before "==", ":=", "=>", and "<="
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7185 (vhdl-mode "[<:=]=" "\\([ \t]*\\)[<:=]=" 1) ; since "<= ... =>" can occur
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7186 (vhdl-mode "=>" "\\([ \t]*\\)=>" 1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7187 (vhdl-mode "[<:=]=" "\\([ \t]*\\)[<:=]=" 1) ; since "=> ... <=" can occur
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7188 ;; before some keywords
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7189 (vhdl-mode "[ \t]after\\>" "[^ \t]\\([ \t]+\\)after\\>" 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7190 (vhdl-mode "[ \t]when\\>" "[^ \t]\\([ \t]+\\)when\\>" 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7191 (vhdl-mode "[ \t]else\\>" "[^ \t]\\([ \t]+\\)else\\>" 1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7192 ;; before "=>" since "when/else ... =>" can occur
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7193 (vhdl-mode "=>" "\\([ \t]*\\)=>" 1)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7194 )
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7195 "The format of this alist is (MODES [or MODE] REGEXP ALIGN-PATTERN SUBEXP).
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7196 It is searched in order. If REGEXP is found anywhere in the first
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7197 line of a region to be aligned, ALIGN-PATTERN will be used for that
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7198 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
7199 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
7200 whitespace. SUBEXP specifies which sub-expression of
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7201 ALIGN-PATTERN matches the white space to be expanded/contracted.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7202
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7203 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7204 ;; Align code
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7205
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7206 (defvar vhdl-align-try-all-clauses t
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7207 "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
7208 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
7209
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7210 (defun vhdl-do-group (function &optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7211 "Apply FUNCTION on group of lines between empty lines."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7212 (let
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7213 ;; search for group beginning
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7214 ((beg (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7215 (if (re-search-backward vhdl-align-group-separate nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7216 (progn (beginning-of-line 2) (back-to-indentation) (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7217 (point-min))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7218 ;; search for group end
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7219 (end (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7220 (if (re-search-forward vhdl-align-group-separate nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7221 (progn (beginning-of-line) (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7222 (point-max)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7223 ;; run FUNCTION
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7224 (funcall function beg end spacing)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7225
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7226 (defun vhdl-do-list (function &optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7227 "Apply FUNCTION to the lines of a list surrounded by a balanced group of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7228 parentheses."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7229 (let (beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7230 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7231 ;; search for beginning of balanced group of parentheses
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7232 (setq beg (vhdl-re-search-backward "[()]" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7233 (while (looking-at ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7234 (forward-char) (backward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7235 (setq beg (vhdl-re-search-backward "[()]" nil t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7236 ;; search for end of balanced group of parentheses
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7237 (when beg
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7238 (forward-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7239 (setq end (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7240 (goto-char (1+ beg))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7241 (skip-chars-forward " \t\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7242 (setq beg (point))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7243 ;; run FUNCTION
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7244 (if beg
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7245 (funcall function beg end spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7246 (error "ERROR: Not within a list enclosed by a pair of parentheses"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7247
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7248 (defun vhdl-do-same-indent (function &optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7249 "Apply FUNCTION to block of lines with same indent."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7250 (let ((indent (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7251 beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7252 ;; search for first line with same indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7253 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7254 (while (and (not (bobp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7255 (or (looking-at "^\\s-*\\(--.*\\)?$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7256 (= (current-indentation) indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7257 (unless (looking-at "^\\s-*$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7258 (back-to-indentation) (setq beg (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7259 (beginning-of-line -0)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7260 ;; search for last line with same indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7261 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7262 (while (and (not (eobp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7263 (or (looking-at "^\\s-*\\(--.*\\)?$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7264 (= (current-indentation) indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7265 (if (looking-at "^\\s-*$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7266 (beginning-of-line 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7267 (beginning-of-line 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7268 (setq end (point)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7269 ;; run FUNCTION
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7270 (funcall function beg end spacing)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7271
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7272 (defun vhdl-align-region-1 (begin end &optional spacing alignment-list indent)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7273 "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
7274 lines. The definition of `alignment-list' determines the matching
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7275 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
7276 is not specified `vhdl-align-alist' is used. If INDENT is non-nil,
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7277 indentation is done before aligning."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7278 (interactive "r\np")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7279 (setq alignment-list (or alignment-list vhdl-align-alist))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7280 (setq spacing (or spacing 1))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7281 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7282 (let (bol indent)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7283 (goto-char end)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7284 (setq end (point-marker))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7285 (goto-char begin)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7286 (setq bol (setq begin (progn (beginning-of-line) (point))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7287 ; (untabify bol end)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7288 (when indent
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7289 (indent-region bol end nil))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7290 (let ((copy (copy-alist alignment-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7291 (vhdl-prepare-search-2
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7292 (while copy
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7293 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7294 (goto-char begin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7295 (let (element
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7296 (eol (save-excursion (progn (end-of-line) (point)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7297 (setq element (nth 0 copy))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7298 (when (and (or (and (listp (car element))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7299 (memq major-mode (car element)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7300 (eq major-mode (car element)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7301 (or vhdl-align-try-all-clauses
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7302 (re-search-forward (car (cdr element)) eol t)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7303 (vhdl-align-region-2 begin end (car (cdr (cdr element)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7304 (car (cdr (cdr (cdr element)))) spacing))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7305 (setq copy (cdr copy))))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7306
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7307 (defun vhdl-align-region-2 (begin end match &optional substr spacing)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7308 "Align a range of lines from BEGIN to END. The regular expression
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
7309 MATCH must match exactly one field: the whitespace to be
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7310 contracted/expanded. The alignment column will equal the
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
7311 rightmost column of the widest whitespace block. SPACING is
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7312 the amount of extra spaces to add to the calculated maximum required.
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7313 SPACING defaults to 1 so that at least one space is inserted after
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7314 the token in MATCH."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7315 (setq spacing (or spacing 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7316 (setq substr (or substr 1))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7317 (save-excursion
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7318 (let (distance (max 0) (lines 0) bol eol width)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7319 ;; Determine the greatest whitespace distance to the alignment
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7320 ;; character
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7321 (goto-char begin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7322 (setq eol (progn (end-of-line) (point))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7323 bol (setq begin (progn (beginning-of-line) (point))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7324 (while (< bol end)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7325 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7326 (when (and (re-search-forward match eol t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7327 (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7328 (setq distance (- (match-beginning substr) bol))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7329 (when (> distance max)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7330 (setq max distance))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7331 (forward-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7332 (setq bol (point)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7333 eol (save-excursion (end-of-line) (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7334 (setq lines (1+ lines)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7335 ;; Now insert enough maxs to push each assignment operator to
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7336 ;; the same column. We need to use 'lines' as a counter, since
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7337 ;; the location of the mark may change
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7338 (goto-char (setq bol begin))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7339 (setq eol (save-excursion (end-of-line) (point)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7340 (while (> lines 0)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7341 (when (and (re-search-forward match eol t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7342 (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7343 (setq width (- (match-end substr) (match-beginning substr)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7344 (setq distance (- (match-beginning substr) bol))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7345 (goto-char (match-beginning substr))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7346 (delete-char width)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7347 (insert-char ? (+ (- max distance) spacing)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7348 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7349 (forward-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7350 (setq bol (point)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7351 eol (save-excursion (end-of-line) (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7352 (setq lines (1- lines))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7353
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7354 (defun vhdl-align-region-groups (beg end &optional spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7355 no-message no-comments)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7356 "Align region, treat groups of lines separately."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7357 (interactive "r\nP")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7358 (save-excursion
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7359 (let (orig pos)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7360 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7361 (beginning-of-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7362 (setq orig (point-marker))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7363 (setq beg (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7364 (goto-char end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7365 (setq end (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7366 (untabify beg end)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7367 (unless no-message
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7368 (when vhdl-progress-interval
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7369 (setq vhdl-progress-info (vector (count-lines (point-min) beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7370 (count-lines (point-min) end) 0))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7371 (vhdl-fixup-whitespace-region beg end t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7372 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7373 (if (not vhdl-align-groups)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7374 ;; align entire region
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7375 (progn (vhdl-align-region-1 beg end spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7376 (unless no-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7377 (vhdl-align-inline-comment-region-1 beg end)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7378 ;; align groups
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7379 (while (and (< beg end)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7380 (re-search-forward vhdl-align-group-separate end t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7381 (setq pos (point-marker))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7382 (vhdl-align-region-1 beg pos spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7383 (unless no-comments (vhdl-align-inline-comment-region-1 beg pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7384 (vhdl-update-progress-info "Aligning" (vhdl-current-line))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7385 (setq beg (1+ pos))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7386 (goto-char beg))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7387 ;; align last group
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7388 (when (< beg end)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7389 (vhdl-align-region-1 beg end spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7390 (unless no-comments (vhdl-align-inline-comment-region-1 beg end))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7391 (vhdl-update-progress-info "Aligning" (vhdl-current-line))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7392 (when vhdl-indent-tabs-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7393 (tabify orig end))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7394 (unless no-message
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7395 (when vhdl-progress-interval (message "Aligning...done"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7396 (setq vhdl-progress-info nil)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7397
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7398 (defun vhdl-align-region (beg end &optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7399 "Align region, treat blocks with same indent and argument lists separately."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7400 (interactive "r\nP")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7401 (if (not vhdl-align-same-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7402 ;; align entire region
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7403 (vhdl-align-region-groups beg end spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7404 ;; align blocks with same indent and argument lists
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7405 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7406 (let ((cur-beg beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7407 indent cur-end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7408 (when vhdl-progress-interval
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7409 (setq vhdl-progress-info (vector (count-lines (point-min) beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7410 (count-lines (point-min) end) 0)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7411 (goto-char end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7412 (setq end (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7413 (goto-char cur-beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7414 (while (< (point) end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7415 ;; is argument list opening?
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7416 (if (setq cur-beg (nth 1 (save-excursion (parse-partial-sexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7417 (point) (vhdl-point 'eol)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7418 ;; determine region for argument list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7419 (progn (goto-char cur-beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7420 (forward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7421 (setq cur-end (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7422 (beginning-of-line 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7423 ;; determine region with same indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7424 (setq indent (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7425 (setq cur-beg (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7426 (setq cur-end (vhdl-point 'bonl))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7427 (beginning-of-line 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7428 (while (and (< (point) end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7429 (or (looking-at "^\\s-*\\(--.*\\)?$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7430 (= (current-indentation) indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7431 (<= (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7432 (nth 0 (parse-partial-sexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7433 (point) (vhdl-point 'eol)))) 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7434 (unless (looking-at "^\\s-*$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7435 (setq cur-end (vhdl-point 'bonl)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7436 (beginning-of-line 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7437 ;; align region
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7438 (vhdl-align-region-groups cur-beg cur-end spacing t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7439 (vhdl-align-inline-comment-region beg end spacing noninteractive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7440 (when vhdl-progress-interval (message "Aligning...done"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7441 (setq vhdl-progress-info nil)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7442
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7443 (defun vhdl-align-group (&optional spacing)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7444 "Align group of lines between empty lines."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7445 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7446 (vhdl-do-group 'vhdl-align-region spacing))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7447
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7448 (defun vhdl-align-list (&optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7449 "Align the lines of a list surrounded by a balanced group of parentheses."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7450 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7451 (vhdl-do-list 'vhdl-align-region-groups spacing))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7452
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7453 (defun vhdl-align-same-indent (&optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7454 "Align block of lines with same indent."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7455 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7456 (vhdl-do-same-indent 'vhdl-align-region-groups spacing))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7457
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7458 (defun vhdl-align-declarations (&optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7459 "Align the lines within the declarative part of a design unit."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7460 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7461 (let (beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7462 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7463 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7464 ;; search for declarative part
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7465 (when (and (re-search-backward "^\\(architecture\\|begin\\|configuration\\|end\\|entity\\|package\\)\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7466 (not (member (upcase (match-string 1)) '("BEGIN" "END"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7467 (setq beg (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7468 (re-search-forward "^\\(begin\\|end\\)\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7469 (setq end (point)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7470 (if beg
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7471 (vhdl-align-region-groups beg end spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7472 (error "ERROR: Not within the declarative part of a design unit"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7473
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7474 (defun vhdl-align-buffer ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7475 "Align buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7476 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7477 (vhdl-align-region (point-min) (point-max)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7478
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7479 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7480 ;; Align inline comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7481
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7482 (defun vhdl-align-inline-comment-region-1 (beg end &optional spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7483 "Align inline comments in region."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7484 (save-excursion
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7485 (let ((start-max comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7486 (length-max 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7487 comment-list start-list tmp-list start length
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7488 cur-start prev-start no-code)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7489 (setq spacing (or spacing 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7490 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7491 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7492 ;; search for comment start positions and lengths
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7493 (while (< (point) end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7494 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7495 (looking-at "^\\(.*[^ \t\n-]+\\)\\s-*\\(--.*\\)$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7496 (not (save-excursion (goto-char (match-beginning 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7497 (vhdl-in-literal))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7498 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7499 (setq length (- (match-end 2) (match-beginning 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7500 (setq start-max (max start start-max))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7501 (setq length-max (max length length-max))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7502 (setq comment-list (cons (cons start length) comment-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7503 (beginning-of-line 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7504 (setq comment-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7505 (sort comment-list (function (lambda (a b) (> (car a) (car b))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7506 ;; reduce start positions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7507 (setq start-list (list (caar comment-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7508 (setq comment-list (cdr comment-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7509 (while comment-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7510 (unless (or (= (caar comment-list) (car start-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7511 (<= (+ (car start-list) (cdar comment-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7512 end-comment-column))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7513 (setq start-list (cons (caar comment-list) start-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7514 (setq comment-list (cdr comment-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7515 ;; align lines as nicely as possible
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7516 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7517 (while (< (point) end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7518 (setq cur-start nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7519 (when (and (not (looking-at "^\\s-*\\(begin\\|end\\)\\>"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7520 (or (and (looking-at "^\\(.*[^ \t\n-]+\\)\\(\\s-*\\)\\(--.*\\)$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7521 (not (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7522 (goto-char (match-beginning 3))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7523 (vhdl-in-literal))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7524 (and (looking-at "^\\(\\)\\(\\s-*\\)\\(--.*\\)$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7525 (>= (- (match-end 2) (match-beginning 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7526 comment-column))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7527 (setq start (+ (- (match-end 1) (match-beginning 1)) spacing))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7528 (setq length (- (match-end 3) (match-beginning 3)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7529 (setq no-code (= (match-beginning 1) (match-end 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7530 ;; insert minimum whitespace
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7531 (goto-char (match-end 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7532 (delete-region (match-beginning 2) (match-end 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7533 (insert-char ?\ spacing)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7534 (setq tmp-list start-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7535 ;; insert additional whitespace to align
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7536 (setq cur-start
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7537 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7538 ;; align comment-only line to inline comment of previous line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7539 ((and no-code prev-start
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7540 (<= length (- end-comment-column prev-start)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7541 prev-start)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7542 ;; align all comments at `start-max' if this is possible
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7543 ((<= (+ start-max length-max) end-comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7544 start-max)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7545 ;; align at `comment-column' if possible
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7546 ((and (<= start comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7547 (<= length (- end-comment-column comment-column)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7548 comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7549 ;; align at left-most possible start position otherwise
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7550 (t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7551 (while (and tmp-list (< (car tmp-list) start))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7552 (setq tmp-list (cdr tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7553 (car tmp-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7554 (indent-to cur-start))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7555 (setq prev-start cur-start)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7556 (beginning-of-line 2))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7557
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7558 (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
7559 "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
7560 empty lines are aligned individually, if `vhdl-align-groups' is non-nil."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7561 (interactive "r\nP")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7562 (save-excursion
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7563 (let (orig pos)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7564 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7565 (beginning-of-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7566 (setq orig (point-marker))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7567 (setq beg (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7568 (goto-char end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7569 (setq end (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7570 (untabify beg end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7571 (unless no-message (message "Aligning inline comments..."))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7572 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7573 (if (not vhdl-align-groups)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7574 ;; align entire region
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7575 (vhdl-align-inline-comment-region-1 beg end spacing)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7576 ;; align groups
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7577 (while (and (< beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7578 (re-search-forward vhdl-align-group-separate end t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7579 (setq pos (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7580 (vhdl-align-inline-comment-region-1 beg pos spacing)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7581 (setq beg (1+ pos))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7582 (goto-char beg))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7583 ;; align last group
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7584 (when (< beg end)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7585 (vhdl-align-inline-comment-region-1 beg end spacing)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7586 (when vhdl-indent-tabs-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7587 (tabify orig end))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7588 (unless no-message (message "Aligning inline comments...done")))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7589
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7590 (defun vhdl-align-inline-comment-group (&optional spacing)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7591 "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
7592 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7593 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7594 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7595 beg end)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7596 (setq end (if (re-search-forward vhdl-align-group-separate nil t)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7597 (point-marker) (point-max)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7598 (goto-char start)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7599 (setq beg (if (re-search-backward vhdl-align-group-separate nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7600 (point) (point-min)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7601 (untabify beg end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7602 (message "Aligning inline comments...")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7603 (vhdl-align-inline-comment-region-1 beg end)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7604 (when vhdl-indent-tabs-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7605 (tabify beg end))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7606 (message "Aligning inline comments...done"))))
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 (defun vhdl-align-inline-comment-buffer ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7609 "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
7610 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
7611 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7612 (vhdl-align-inline-comment-region (point-min) (point-max)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7613
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7614 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7615 ;; Fixup whitespace
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7616
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7617 (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
7618 "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
7619 eliminate multiple spaces (except at beginning of line), eliminate spaces at
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7620 end of line, do nothing in comments and strings."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7621 (interactive "r")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7622 (unless no-message (message "Fixing up whitespace..."))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7623 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7624 (goto-char end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7625 (setq end (point-marker))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7626 ;; have no space before and one space after `,' and ';'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7627 (goto-char beg)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7628 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\(\\s-*\\([,;]\\)\\)" end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7629 (if (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7630 (goto-char (match-end 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7631 (replace-match "\\3 " nil nil nil 3)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7632 ;; have no space after `('
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7633 (goto-char beg)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7634 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\((\\)\\s-+" end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7635 (if (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7636 (goto-char (match-end 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7637 (replace-match "\\2")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7638 ;; have no space before `)'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7639 (goto-char beg)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7640 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\|^\\s-+\\)\\|\\s-+\\()\\)" end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7641 (if (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7642 (goto-char (match-end 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7643 (replace-match "\\2")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7644 ;; surround operator symbols by one space
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7645 (goto-char beg)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7646 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\|\'.\'\\)\\|\\(\\([^/:<>=]\\)\\(:\\|=\\|<\\|>\\|:=\\|<=\\|>=\\|=>\\|/=\\)\\([^=>]\\|$\\)\\)" end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7647 (if (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7648 (goto-char (match-end 1))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7649 (replace-match "\\3 \\4 \\5")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7650 (goto-char (match-end 2))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7651 ;; eliminate multiple spaces and spaces at end of line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7652 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7653 (while (or (and (looking-at "--.*\n") (re-search-forward "--.*\n" end t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7654 (and (looking-at "\"") (re-search-forward "\"[^\"\n]*[\"\n]" end t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7655 (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
7656 (progn (replace-match "" nil nil) t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7657 (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
7658 (progn (replace-match ";" nil nil) t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7659 (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
7660 (and (looking-at "\\s-+--") (re-search-forward "\\s-+" end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7661 (progn (replace-match " " nil nil) t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7662 (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7663 (progn (replace-match " " nil nil) t))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7664 ; (re-search-forward "[^ \t-]+" end t))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7665 (re-search-forward "[^ \t\"-]+" end t))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7666 (unless no-message (message "Fixing up whitespace...done")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7667
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7668 (defun vhdl-fixup-whitespace-buffer ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7669 "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
7670 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
7671 end of line, do nothing in comments."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7672 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7673 (vhdl-fixup-whitespace-region (point-min) (point-max)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7674
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7675 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7676 ;; Beautify
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7677
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7678 (defun vhdl-beautify-region (beg end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7679 "Beautify region by applying indentation, whitespace fixup, alignment, and
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7680 case fixing to a region. Calls functions `vhdl-indent-buffer',
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7681 `vhdl-align-buffer' (option `vhdl-align-groups' set to non-nil), and
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7682 `vhdl-fix-case-buffer'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7683 (interactive "r")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7684 (setq end (save-excursion (goto-char end) (point-marker)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7685 (vhdl-indent-region beg end nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7686 (let ((vhdl-align-groups t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7687 (vhdl-align-region beg end))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7688 (vhdl-fix-case-region beg end))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7689
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7690 (defun vhdl-beautify-buffer ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7691 "Beautify buffer by applying indentation, whitespace fixup, alignment, and
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7692 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
7693 buffer."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
7694 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7695 (vhdl-beautify-region (point-min) (point-max))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7696 (when noninteractive (save-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7697
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7698 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7699 ;; Code filling
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7700
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7701 (defun vhdl-fill-region (beg end &optional arg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7702 "Fill lines for a region of code."
57820
5d471cc0eaab (vhdl-fill-region, vhdl-beginning-of-statement): Don't use interactive-p.
Richard M. Stallman <rms@gnu.org>
parents: 54770
diff changeset
7703 (interactive "r\np")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7704 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7705 (goto-char beg)
62917
e66c3159d2a4 (vhdl-fill-region): Test ARG, not INTERACTIVE.
Richard M. Stallman <rms@gnu.org>
parents: 62772
diff changeset
7706 (let ((margin (if arg (current-indentation) (current-column))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7707 (goto-char end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7708 (setq end (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7709 ;; remove inline comments, newlines and whitespace
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7710 (vhdl-comment-kill-region beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7711 (vhdl-comment-kill-inline-region beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7712 (subst-char-in-region beg (1- end) ?\n ?\ )
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7713 (vhdl-fixup-whitespace-region beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7714 ;; wrap and end-comment-column
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7715 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7716 (while (re-search-forward "\\s-" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7717 (when(> (current-column) vhdl-end-comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7718 (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7719 (when (re-search-backward "\\s-" beg t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7720 (replace-match "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7721 (indent-to margin)))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7722
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7723 (defun vhdl-fill-group ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7724 "Fill group of lines between empty lines."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7725 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7726 (vhdl-do-group 'vhdl-fill-region))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7727
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7728 (defun vhdl-fill-list ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7729 "Fill the lines of a list surrounded by a balanced group of parentheses."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7730 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7731 (vhdl-do-list 'vhdl-fill-region))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7732
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7733 (defun vhdl-fill-same-indent ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7734 "Fill the lines of block of lines with same indent."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7735 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7736 (vhdl-do-same-indent 'vhdl-fill-region))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7737
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7738
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7739 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7740 ;;; Code updating/fixing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7741 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7742
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7743 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7744 ;; Sensitivity list update
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7745
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7746 ;; Strategy:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7747 ;; - no sensitivity list is generated for processes with wait statements
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7748 ;; - otherwise, do the following:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7749 ;; 1. scan for all local signals (ports, signals declared in arch./blocks)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7750 ;; 2. scan for all signals already in the sensitivity list (in order to catch
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7751 ;; manually entered global signals)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7752 ;; 3. signals from 1. and 2. form the list of visible signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7753 ;; 4. search for if/elsif conditions containing an event (sequential code)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7754 ;; 5. scan for strings that are within syntactical regions where signals are
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7755 ;; read but not within sequential code, and that correspond to visible
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7756 ;; signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7757 ;; 6. replace sensitivity list by list of signals from 5.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7758
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7759 (defun vhdl-update-sensitivity-list-process ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7760 "Update sensitivity list of current process."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7761 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7762 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7763 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7764 (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7765 ;; look whether in process
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7766 (if (not (and (re-search-backward "^\\s-*\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(process\\|end\\s-+process\\)\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7767 (equal (upcase (match-string 2)) "PROCESS")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7768 (save-excursion (re-search-forward "^\\s-*end\\s-+process\\>" nil t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7769 (error "ERROR: Not within a process")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7770 (message "Updating sensitivity list...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7771 (vhdl-update-sensitivity-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7772 (message "Updating sensitivity list...done")))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7773
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7774 (defun vhdl-update-sensitivity-list-buffer ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7775 "Update sensitivity list of all processes in current buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7776 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7777 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7778 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7779 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7780 (message "Updating sensitivity lists...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7781 (while (re-search-forward "^\\s-*\\(\\w+[ \t\n]*:[ \t\n]*\\)?process\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7782 (goto-char (match-beginning 0))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7783 (condition-case nil (vhdl-update-sensitivity-list) (error "")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7784 (message "Updating sensitivity lists...done"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7785
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7786 (defun vhdl-update-sensitivity-list ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7787 "Update sensitivity list."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7788 (let ((proc-beg (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7789 (proc-end (re-search-forward "^\\s-*end\\s-+process\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7790 (proc-mid (re-search-backward "^\\s-*begin\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7791 seq-region-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7792 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7793 ;; search for wait statement (no sensitivity list allowed)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7794 ((progn (goto-char proc-mid)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7795 (vhdl-re-search-forward "\\<wait\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7796 (error "ERROR: Process with wait statement, sensitivity list not generated"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7797 ;; combinational process (update sensitivity list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7798 (t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7799 (let
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7800 ;; scan for visible signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7801 ((visible-list (vhdl-get-visible-signals))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7802 ;; define syntactic regions where signals are read
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7803 (scan-regions-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7804 '(;; right-hand side of signal/variable assignment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7805 ;; (special case: "<=" is relational operator in a condition)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7806 ((re-search-forward "[<:]=" proc-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7807 (re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7808 ;; if condition
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7809 ((re-search-forward "^\\s-*if\\>" proc-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7810 (re-search-forward "\\<then\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7811 ;; elsif condition
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7812 ((re-search-forward "\\<elsif\\>" proc-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7813 (re-search-forward "\\<then\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7814 ;; while loop condition
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7815 ((re-search-forward "^\\s-*while\\>" proc-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7816 (re-search-forward "\\<loop\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7817 ;; exit/next condition
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7818 ((re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7819 (re-search-forward ";" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7820 ;; assert condition
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7821 ((re-search-forward "\\<assert\\>" proc-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7822 (re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7823 ;; case expression
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7824 ((re-search-forward "^\\s-*case\\>" proc-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7825 (re-search-forward "\\<is\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7826 ;; parameter list of procedure call
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7827 ((and (re-search-forward "^\\s-*\\w+[ \t\n]*(" proc-end t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7828 (1- (point)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7829 (progn (backward-char) (forward-sexp)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7830 (while (looking-at "(") (forward-sexp)) (point)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7831 name read-list sens-list signal-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7832 sens-beg sens-end beg end margin)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7833 ;; scan for signals in old sensitivity list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7834 (goto-char proc-beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7835 (re-search-forward "\\<process\\>" proc-mid t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7836 (if (not (looking-at "[ \t\n]*("))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7837 (setq sens-beg (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7838 (setq sens-beg (re-search-forward "\\([ \t\n]*\\)([ \t\n]*" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7839 (goto-char (match-end 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7840 (forward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7841 (setq sens-end (1- (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7842 (goto-char sens-beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7843 (while (and (re-search-forward "\\(\\w+\\)" sens-end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7844 (setq sens-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7845 (cons (downcase (match-string 0)) sens-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7846 (re-search-forward "\\s-*,\\s-*" sens-end t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7847 (setq signal-list (append visible-list sens-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7848 ;; search for sequential parts
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7849 (goto-char proc-mid)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7850 (while (setq beg (re-search-forward "^\\s-*\\(els\\)?if\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7851 (setq end (re-search-forward "\\<then\\>" proc-end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7852 (when (re-search-backward "\\('event\\|\\<\\(falling\\|rising\\)_edge\\)\\>" beg t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7853 (goto-char end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7854 (backward-word 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7855 (vhdl-forward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7856 (setq seq-region-list (cons (cons end (point)) seq-region-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7857 (beginning-of-line)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7858 ;; scan for signals read in process
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7859 (while scan-regions-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7860 (goto-char proc-mid)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7861 (while (and (setq beg (eval (nth 0 (car scan-regions-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7862 (setq end (eval (nth 1 (car scan-regions-list)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7863 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7864 (unless (or (vhdl-in-literal)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7865 (and seq-region-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7866 (let ((tmp-list seq-region-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7867 (while (and tmp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7868 (< (point) (caar tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7869 (setq tmp-list (cdr tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7870 (and tmp-list (< (point) (cdar tmp-list))))))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7871 (while (vhdl-re-search-forward "[^'\"]\\<\\([a-zA-Z]\\w*\\)\\>[ \t\n]*\\('\\(\\w+\\)\\|\\(=>\\)\\)?" end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7872 (setq name (match-string 1))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7873 (when (and (not (match-string 4)) ; not when formal parameter
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7874 (not (and (match-string 3) ; not event attribute
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7875 (not (member (downcase (match-string 3))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7876 '("event" "last_event" "transaction")))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7877 (member (downcase name) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7878 (unless (member-ignore-case name read-list)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7879 (setq read-list (cons name read-list))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7880 (goto-char (match-end 1)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7881 (setq scan-regions-list (cdr scan-regions-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7882 ;; update sensitivity list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7883 (goto-char sens-beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7884 (if sens-end
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7885 (delete-region sens-beg sens-end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7886 (when read-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7887 (insert " ()") (backward-char)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7888 (setq read-list (sort read-list 'string<))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7889 (when read-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7890 (setq margin (current-column))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7891 (insert (car read-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7892 (setq read-list (cdr read-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7893 (while read-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7894 (insert ",")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7895 (if (<= (+ (current-column) (length (car read-list)) 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7896 end-comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7897 (insert " ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7898 (insert "\n") (indent-to margin))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7899 (insert (car read-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7900 (setq read-list (cdr read-list)))))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7901
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7902 (defun vhdl-get-visible-signals ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7903 "Get all signals visible in the current block."
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7904 (let (beg end signal-list entity-name file-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7905 (vhdl-prepare-search-2
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7906 ;; get entity name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7907 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7908 (unless (and (re-search-backward "^\\(architecture\\s-+\\w+\\s-+of\\s-+\\(\\w+\\)\\|end\\)\\>" nil t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7909 (not (equal "END" (upcase (match-string 1))))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7910 (setq entity-name (match-string 2)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7911 (error "ERROR: Not within an architecture")))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7912 ;; search for signals declared in entity port clause
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7913 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7914 (goto-char (point-min))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7915 (unless (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7916 (setq file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7917 (concat (vhdl-replace-string vhdl-entity-file-name entity-name t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7918 "." (file-name-extension (buffer-file-name)))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7919 (vhdl-visit-file
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7920 file-name t
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7921 (vhdl-prepare-search-2
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7922 (goto-char (point-min))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7923 (if (not (re-search-forward (concat "^entity\\s-+" entity-name "\\>") nil t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7924 (error "ERROR: Entity \"%s\" not found:\n --> see option `vhdl-entity-file-name'" entity-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7925 (when (setq beg (re-search-forward
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7926 "^\\s-*port[ \t\n]*("
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7927 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7928 (re-search-forward "^end\\>" nil t)) t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7929 (setq end (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7930 (backward-char) (forward-sexp) (point)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7931 (vhdl-forward-syntactic-ws)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7932 (while (< (point) end)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7933 (when (looking-at "signal[ \t\n]+")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7934 (goto-char (match-end 0)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7935 (while (looking-at "\\(\\w+\\)[ \t\n,]+")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7936 (setq signal-list
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7937 (cons (downcase (match-string 1)) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7938 (goto-char (match-end 0))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7939 (vhdl-forward-syntactic-ws))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7940 (re-search-forward ";" end 1)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7941 (vhdl-forward-syntactic-ws)))))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7942 ;; search for signals declared in architecture declarative part
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7943 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7944 (if (not (and (setq beg (re-search-backward "^\\(architecture\\s-+\\w+\\s-+of\\s-+\\(\\w+\\)\\|end\\)\\>" nil t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7945 (not (equal "END" (upcase (match-string 1))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7946 (setq end (re-search-forward "^begin\\>" nil t))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7947 (error "ERROR: No architecture declarative part found")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7948 ;; scan for all declared signal and alias names
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7949 (goto-char beg)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7950 (while (re-search-forward "^\\s-*\\(\\(signal\\)\\|alias\\)\\>" end t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7951 (when (= 0 (nth 0 (parse-partial-sexp beg (point))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7952 (if (match-string 2)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7953 ;; scan signal name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7954 (while (looking-at "[ \t\n,]+\\(\\w+\\)")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7955 (setq signal-list
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7956 (cons (downcase (match-string 1)) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7957 (goto-char (match-end 0)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7958 ;; scan alias name, check is alias of (declared) signal
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7959 (when (and (looking-at "[ \t\n]+\\(\\w+\\)[^;]*\\<is[ \t\n]+\\(\\w+\\)")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7960 (member (downcase (match-string 2)) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7961 (setq signal-list
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7962 (cons (downcase (match-string 1)) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7963 (goto-char (match-end 0))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7964 (setq beg (point))))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7965 ;; search for signals declared in surrounding block declarative parts
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7966 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7967 (while (and (progn (while (and (setq beg (re-search-backward "^\\s-*\\(\\w+\\s-*:\\s-*block\\|\\(end\\)\\s-+block\\)\\>" nil t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7968 (match-string 2))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7969 (goto-char (match-end 2))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7970 (vhdl-backward-sexp)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7971 (re-search-backward "^\\s-*\\w+\\s-*:\\s-*block\\>" nil t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7972 beg)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7973 (setq end (re-search-forward "^\\s-*begin\\>" nil t)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7974 ;; scan for all declared signal names
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7975 (goto-char beg)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7976 (while (re-search-forward "^\\s-*\\(\\(signal\\)\\|alias\\)\\>" end t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7977 (when (= 0 (nth 0 (parse-partial-sexp beg (point))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7978 (if (match-string 2)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7979 ;; scan signal name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7980 (while (looking-at "[ \t\n,]+\\(\\w+\\)")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7981 (setq signal-list
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7982 (cons (downcase (match-string 1)) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7983 (goto-char (match-end 0)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7984 ;; scan alias name, check is alias of (declared) signal
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7985 (when (and (looking-at "[ \t\n]+\\(\\w+\\)[^;]*\\<is[ \t\n]+\\(\\w+\\)")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7986 (member (downcase (match-string 2)) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7987 (setq signal-list
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7988 (cons (downcase (match-string 1)) signal-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7989 (goto-char (match-end 0))))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7990 (goto-char beg)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
7991 signal-list)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7992
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7993 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7994 ;; Generic/port clause fixing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7995
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7996 (defun vhdl-fix-clause ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7997 "Fix closing parenthesis within generic/port clause."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7998 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
7999 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8000 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8001 (let ((pos (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8002 beg end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8003 (if (not (re-search-backward "^\\s-*\\(generic\\|port\\)[ \t\n]*(" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8004 (error "ERROR: Not within a generic/port clause")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8005 ;; search for end of clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8006 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8007 (setq beg (1- (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8008 (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8009 (while (looking-at "\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*[ \t\n]*:[ \t\n]*\\w+[^;]*;")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8010 (goto-char (1- (match-end 0)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8011 (setq end (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8012 (forward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8013 (vhdl-forward-syntactic-ws))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8014 (goto-char end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8015 (when (> pos (save-excursion (end-of-line) (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8016 (error "ERROR: Not within a generic/port clause"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8017 ;; delete closing parenthesis on separate line (not supported style)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8018 (when (save-excursion (beginning-of-line) (looking-at "^\\s-*);"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8019 (vhdl-line-kill)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8020 (vhdl-backward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8021 (setq end (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8022 (insert ";"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8023 ;; delete superfluous parentheses
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8024 (while (progn (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8025 (condition-case () (forward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8026 (error (goto-char (point-max))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8027 (< (point) end))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8028 (delete-backward-char 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8029 ;; add closing parenthesis
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8030 (when (> (point) end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8031 (goto-char end)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8032 (insert ")")))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8033
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8034 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8035 ;; Miscellaneous
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8036
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8037 (defun vhdl-remove-trailing-spaces ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8038 "Remove trailing spaces in the whole buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8039 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8040 (save-match-data
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8041 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8042 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8043 (while (re-search-forward "[ \t]+$" (point-max) t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8044 (unless (vhdl-in-literal)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8045 (replace-match "" nil nil))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8046
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8047
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8048 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8049 ;;; Electrification
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8050 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8051
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8052 (defconst vhdl-template-prompt-syntax "[^ =<>][^<>@.\n]*[^ =<>]"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8053 "Syntax of prompt inserted by template generators.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8054
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8055 (defvar vhdl-template-invoked-by-hook nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8056 "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
8057 Used for undoing after template abortion.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8058
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8059 ;; correct different behavior of function `unread-command-events' in XEmacs
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8060 (defun vhdl-character-to-event (arg))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8061 (defalias 'vhdl-character-to-event
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
8062 (if (fboundp 'character-to-event) 'character-to-event 'identity))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8063
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8064 (defun vhdl-work-library ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8065 "Return the working library name of the current project or \"work\" if no
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8066 project is defined."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8067 (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8068 (or (nth 6 (aget vhdl-project-alist vhdl-project)) vhdl-default-library)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8069
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8070 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8071 ;; Enabling/disabling
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8072
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8073 (defun vhdl-mode-line-update ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8074 "Update the modeline string for VHDL major mode."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8075 (setq mode-name (concat "VHDL"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8076 (and (or vhdl-electric-mode vhdl-stutter-mode) "/")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8077 (and vhdl-electric-mode "e")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8078 (and vhdl-stutter-mode "s")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8079 (force-mode-line-update t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8080
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8081 (defun vhdl-electric-mode (arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8082 "Toggle VHDL electric mode.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8083 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
8084 (interactive "P")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8085 (setq vhdl-electric-mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8086 (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
8087 ((> arg 0) t) (t nil)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8088 (vhdl-mode-line-update))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8089
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8090 (defun vhdl-stutter-mode (arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8091 "Toggle VHDL stuttering mode.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8092 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
8093 (interactive "P")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8094 (setq vhdl-stutter-mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8095 (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
8096 ((> arg 0) t) (t nil)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8097 (vhdl-mode-line-update))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8098
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8099 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8100 ;; Stuttering
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8101
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8102 (defun vhdl-electric-dash (count)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8103 "-- starts a comment, --- draws a horizontal line,
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
8104 ---- starts a display comment."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8105 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8106 (if (and vhdl-stutter-mode (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8107 (cond
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8108 ((and abbrev-start-location (= abbrev-start-location (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8109 (setq abbrev-start-location nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8110 (goto-char last-abbrev-location)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8111 (beginning-of-line nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8112 (vhdl-comment-display))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8113 ((/= (preceding-char) ?-) ; standard dash (minus)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8114 (self-insert-command count))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8115 (t (self-insert-command count)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8116 (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
8117 (let ((next-input (read-char)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8118 (if (= next-input ?-) ; triple dash
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8119 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8120 (vhdl-comment-display-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8121 (message
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8122 "Enter '-' for display comment, else continue coding")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8123 (let ((next-input (read-char)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8124 (if (= next-input ?-) ; four dashes
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8125 (vhdl-comment-display t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8126 (setq unread-command-events ; pushback the char
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8127 (list (vhdl-character-to-event next-input))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8128 (setq unread-command-events ; pushback the char
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8129 (list (vhdl-character-to-event next-input)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8130 (vhdl-comment-insert)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8131 (self-insert-command count)))
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-electric-open-bracket (count) "'[' --> '(', '([' --> '['"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8134 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8135 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8136 (if (= (preceding-char) ?\()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8137 (progn (delete-char -1) (insert-char ?\[ 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8138 (insert-char ?\( 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8139 (self-insert-command count)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8140
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8141 (defun vhdl-electric-close-bracket (count) "']' --> ')', ')]' --> ']'"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8142 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8143 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8144 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8145 (if (= (preceding-char) ?\))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8146 (progn (delete-char -1) (insert-char ?\] 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8147 (insert-char ?\) 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8148 (blink-matching-open))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8149 (self-insert-command count)))
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 (defun vhdl-electric-quote (count) "'' --> \""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8152 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8153 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8154 (if (= (preceding-char) last-input-char)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8155 (progn (delete-backward-char 1) (insert-char ?\" 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8156 (insert-char ?\' 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8157 (self-insert-command count)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8158
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8159 (defun vhdl-electric-semicolon (count) "';;' --> ' : ', ': ;' --> ' := '"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8160 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8161 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8162 (cond ((= (preceding-char) last-input-char)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8163 (progn (delete-char -1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8164 (unless (eq (preceding-char) ? ) (insert " "))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8165 (insert ": ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8166 (setq this-command 'vhdl-electric-colon)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8167 ((and
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8168 (eq last-command 'vhdl-electric-colon) (= (preceding-char) ? ))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8169 (progn (delete-char -1) (insert "= ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8170 (t (insert-char ?\; 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8171 (self-insert-command count)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8172
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8173 (defun vhdl-electric-comma (count) "',,' --> ' <= '"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8174 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8175 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8176 (cond ((= (preceding-char) last-input-char)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8177 (progn (delete-char -1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8178 (unless (eq (preceding-char) ? ) (insert " "))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8179 (insert "<= ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8180 (t (insert-char ?\, 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8181 (self-insert-command count)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8182
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8183 (defun vhdl-electric-period (count) "'..' --> ' => '"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8184 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8185 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8186 (cond ((= (preceding-char) last-input-char)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8187 (progn (delete-char -1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8188 (unless (eq (preceding-char) ? ) (insert " "))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8189 (insert "=> ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8190 (t (insert-char ?\. 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8191 (self-insert-command count)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8192
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8193 (defun vhdl-electric-equal (count) "'==' --> ' == '"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8194 (interactive "p")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8195 (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8196 (cond ((= (preceding-char) last-input-char)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8197 (progn (delete-char -1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8198 (unless (eq (preceding-char) ? ) (insert " "))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8199 (insert "== ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8200 (t (insert-char ?\= 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8201 (self-insert-command count)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8202
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8203 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8204 ;; VHDL templates
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8205
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8206 (defun vhdl-template-paired-parens ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8207 "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
8208 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8209 (insert "()")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8210 (backward-char))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8211
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8212 (defun vhdl-template-alias ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8213 "Insert alias declaration."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8214 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8215 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8216 (vhdl-insert-keyword "ALIAS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8217 (when (vhdl-template-field "name" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8218 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8219 (unless (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8220 (concat "[type" (and (vhdl-standard-p 'ams) " or nature") "]")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8221 nil t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8222 (delete-backward-char 3))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8223 (vhdl-insert-keyword " IS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8224 (vhdl-template-field "name" ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8225 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8226
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8227 (defun vhdl-template-architecture ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8228 "Insert architecture."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8229 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8230 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8231 (start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8232 arch-name)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8233 (vhdl-insert-keyword "ARCHITECTURE ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8234 (when (setq arch-name
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8235 (vhdl-template-field "name" nil t start (point)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8236 (vhdl-insert-keyword " OF ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8237 (if (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8238 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8239 (vhdl-re-search-backward "\\<entity \\(\\w+\\) is\\>" nil t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8240 (insert (match-string 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8241 (vhdl-template-field "entity name"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8242 (vhdl-insert-keyword " IS\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8243 (vhdl-template-begin-end
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8244 (unless (vhdl-standard-p '87) "ARCHITECTURE") arch-name margin
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8245 (memq vhdl-insert-empty-lines '(unit all))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8246
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8247 (defun vhdl-template-array (kind &optional secondary)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8248 "Insert array type definition."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8249 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8250 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8251 (vhdl-insert-keyword "ARRAY (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8252 (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
8253 secondary)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8254 (vhdl-insert-keyword ") OF ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8255 (vhdl-template-field (if (eq kind 'type) "type" "nature"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8256 (vhdl-insert-keyword ";"))))
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-template-assert ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8259 "Insert an assertion statement."
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 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8262 (vhdl-insert-keyword "ASSERT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8263 (when vhdl-conditions-in-parenthesis (insert "("))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8264 (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
8265 (when vhdl-conditions-in-parenthesis (insert ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8266 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8267 (vhdl-insert-keyword " REPORT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8268 (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
8269 (delete-region start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8270 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8271 (vhdl-insert-keyword " SEVERITY ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8272 (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
8273 (delete-region start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8274 (insert ";"))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8275
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8276 (defun vhdl-template-attribute ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8277 "Insert an attribute declaration or specification."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8278 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8279 (if (eq (vhdl-decision-query
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8280 "attribute" "(d)eclaration or (s)pecification?" t) ?s)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8281 (vhdl-template-attribute-spec)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8282 (vhdl-template-attribute-decl)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8283
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8284 (defun vhdl-template-attribute-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8285 "Insert an attribute declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8286 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8287 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8288 (vhdl-insert-keyword "ATTRIBUTE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8289 (when (vhdl-template-field "name" " : " t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8290 (vhdl-template-field "type" ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8291 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8292
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8293 (defun vhdl-template-attribute-spec ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8294 "Insert an attribute specification."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8295 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8296 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8297 (vhdl-insert-keyword "ATTRIBUTE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8298 (when (vhdl-template-field "name" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8299 (vhdl-insert-keyword " OF ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8300 (vhdl-template-field "entity names | OTHERS | ALL" " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8301 (vhdl-template-field "entity class")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8302 (vhdl-insert-keyword " IS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8303 (vhdl-template-field "expression" ";"))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8304
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8305 (defun vhdl-template-block ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8306 "Insert a block."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8307 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8308 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8309 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8310 label)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8311 (vhdl-insert-keyword ": BLOCK ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8312 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8313 (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
8314 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8315 (forward-char 1)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8316 (insert "(")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8317 (if (vhdl-template-field "[guard expression]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8318 (insert ")")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8319 (delete-char -2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8320 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " IS"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8321 (insert "\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8322 (vhdl-template-begin-end "BLOCK" label margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8323 (vhdl-comment-block))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8324
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8325 (defun vhdl-template-block-configuration ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8326 "Insert a block configuration statement."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8327 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8328 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8329 (start (point)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8330 (vhdl-insert-keyword "FOR ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8331 (when (vhdl-template-field "block name" nil t start (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8332 (vhdl-insert-keyword "\n\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8333 (indent-to margin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8334 (vhdl-insert-keyword "END FOR;")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8335 (end-of-line 0)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8336 (indent-to (+ margin vhdl-basic-offset)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8337
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8338 (defun vhdl-template-break ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8339 "Insert a break statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8340 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8341 (let (position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8342 (vhdl-insert-keyword "BREAK")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8343 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8344 (insert " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8345 (while (or
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8346 (progn (vhdl-insert-keyword "FOR ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8347 (if (vhdl-template-field "[quantity name]" " USE " t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8348 (progn (vhdl-template-field "quantity name" " => ") t)
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
8349 (delete-region (point)
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
8350 (progn (forward-word -1) (point)))
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
8351 nil))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8352 (vhdl-template-field "[quantity name]" " => " t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8353 (vhdl-template-field "expression")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8354 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8355 (insert ", "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8356 (delete-region position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8357 (unless (vhdl-sequential-statement-p)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8358 (vhdl-insert-keyword " ON ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8359 (if (vhdl-template-field "[sensitivity list]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8360 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8361 (delete-region position (point))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8362 (vhdl-insert-keyword " WHEN ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8363 (when vhdl-conditions-in-parenthesis (insert "("))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8364 (if (vhdl-template-field "[condition]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8365 (when vhdl-conditions-in-parenthesis (insert ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8366 (delete-region position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8367 (insert ";")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8368
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8369 (defun vhdl-template-case (&optional kind)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8370 "Insert a case statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8371 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8372 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8373 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8374 label)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8375 (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
8376 (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
8377 (vhdl-insert-keyword "CASE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8378 (vhdl-insert-keyword ": CASE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8379 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8380 (setq label (vhdl-template-field "[label]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8381 (unless label (delete-char 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8382 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8383 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8384 (when (vhdl-template-field "expression" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8385 (vhdl-insert-keyword (concat " " (if (eq kind 'is) "IS" "USE") "\n\n"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8386 (indent-to margin)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8387 (vhdl-insert-keyword "END CASE")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8388 (when label (insert " " label))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8389 (insert ";")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8390 (forward-line -1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8391 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8392 (vhdl-insert-keyword "WHEN ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8393 (let ((position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8394 (insert " => ;\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8395 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8396 (vhdl-insert-keyword "WHEN OTHERS => null;")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8397 (goto-char position)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8398
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8399 (defun vhdl-template-case-is ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8400 "Insert a sequential case statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8401 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8402 (vhdl-template-case 'is))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8403
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8404 (defun vhdl-template-case-use ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8405 "Insert a simultaneous case statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8406 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8407 (vhdl-template-case 'use))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8408
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8409 (defun vhdl-template-component ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8410 "Insert a component declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8411 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8412 (vhdl-template-component-decl))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8413
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8414 (defun vhdl-template-component-conf ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8415 "Insert a component configuration (uses `vhdl-template-configuration-spec'
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8416 since these are almost equivalent)."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8417 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8418 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8419 (result (vhdl-template-configuration-spec t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8420 (when result
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8421 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8422 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8423 (vhdl-insert-keyword "END FOR;")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8424 (when (eq result 'no-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8425 (end-of-line -0)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8426
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8427 (defun vhdl-template-component-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8428 "Insert a component declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8429 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8430 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8431 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8432 name end-column)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8433 (vhdl-insert-keyword "COMPONENT ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8434 (when (setq name (vhdl-template-field "name" nil t start (point)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8435 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " IS"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8436 (insert "\n\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8437 (indent-to margin)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8438 (vhdl-insert-keyword "END COMPONENT")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8439 (unless (vhdl-standard-p '87) (insert " " name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8440 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8441 (setq end-column (current-column))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8442 (end-of-line -0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8443 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8444 (vhdl-template-generic-list t t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8445 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8446 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8447 (vhdl-template-port-list t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8448 (beginning-of-line 2)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8449 (forward-char end-column))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8450
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8451 (defun vhdl-template-component-inst ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8452 "Insert a component instantiation statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8453 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8454 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8455 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8456 unit position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8457 (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
8458 (insert ": ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8459 (if (not (vhdl-use-direct-instantiation))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8460 (vhdl-template-field "component name")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8461 ;; direct instantiation
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8462 (setq unit (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8463 "[COMPONENT | ENTITY | CONFIGURATION]" " " t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8464 (setq unit (upcase (or unit "")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8465 (cond ((equal unit "ENTITY")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8466 (vhdl-template-field "library name" "." nil nil nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8467 (vhdl-work-library))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8468 (vhdl-template-field "entity name" "(")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8469 (if (vhdl-template-field "[architecture name]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8470 (insert ")")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8471 (delete-char -1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8472 ((equal unit "CONFIGURATION")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8473 (vhdl-template-field "library name" "." nil nil nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8474 (vhdl-work-library))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8475 (vhdl-template-field "configuration name"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8476 (t (vhdl-template-field "component name"))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8477 (insert "\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8478 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8479 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8480 (vhdl-insert-keyword "GENERIC ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8481 (when (vhdl-template-map position t t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8482 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8483 (indent-to (+ margin vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8484 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8485 (vhdl-insert-keyword "PORT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8486 (unless (vhdl-template-map position t t)
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
8487 (delete-region (line-beginning-position) (point))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8488 (delete-char -1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8489 (insert ";"))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8490
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8491 (defun vhdl-template-conditional-signal-asst ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8492 "Insert a conditional signal assignment."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8493 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8494 (when (vhdl-template-field "target signal")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8495 (insert " <= ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8496 ; (if (not (equal (vhdl-template-field "[GUARDED] [TRANSPORT]") ""))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8497 ; (insert " "))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8498 (let ((margin (current-column))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8499 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8500 position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8501 (vhdl-template-field "waveform")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8502 (setq position (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8503 (vhdl-insert-keyword " WHEN ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8504 (when vhdl-conditions-in-parenthesis (insert "("))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8505 (while (and (vhdl-template-field "[condition]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8506 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8507 (when vhdl-conditions-in-parenthesis (insert ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8508 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8509 (vhdl-insert-keyword " ELSE")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8510 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8511 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8512 (vhdl-template-field "[waveform]" nil t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8513 (setq position (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8514 (vhdl-insert-keyword " WHEN ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8515 (when vhdl-conditions-in-parenthesis (insert "(")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8516 (delete-region position (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8517 (insert ";")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8518 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8519
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8520 (defun vhdl-template-configuration ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8521 "Insert a configuration specification if within an architecture,
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8522 a block or component configuration if within a configuration declaration,
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8523 a configuration declaration if not within a design unit."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8524 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8525 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8526 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8527 ((and (save-excursion ; architecture body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8528 (re-search-backward "^\\(architecture\\|end\\)\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8529 (equal "ARCHITECTURE" (upcase (match-string 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8530 (vhdl-template-configuration-spec))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8531 ((and (save-excursion ; configuration declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8532 (re-search-backward "^\\(configuration\\|end\\)\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8533 (equal "CONFIGURATION" (upcase (match-string 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8534 (if (eq (vhdl-decision-query
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8535 "configuration" "(b)lock or (c)omponent configuration?" t) ?c)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8536 (vhdl-template-component-conf)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8537 (vhdl-template-block-configuration)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8538 (t (vhdl-template-configuration-decl))))) ; otherwise
24732
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-template-configuration-spec (&optional optional-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8541 "Insert a configuration specification."
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 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8544 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8545 aspect position)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8546 (vhdl-insert-keyword "FOR ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8547 (when (vhdl-template-field "instance names | OTHERS | ALL" " : "
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8548 t start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8549 (vhdl-template-field "component name" "\n")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8550 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8551 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8552 (vhdl-insert-keyword "USE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8553 (if (and optional-use
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8554 (not (setq aspect (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8555 "[ENTITY | CONFIGURATION | OPEN]" " " t))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8556 (progn (delete-region start (point)) 'no-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8557 (unless optional-use
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8558 (setq aspect (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8559 "ENTITY | CONFIGURATION | OPEN" " ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8560 (setq aspect (upcase (or aspect "")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8561 (cond ((equal aspect "ENTITY")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8562 (vhdl-template-field "library name" "." nil nil nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8563 (vhdl-work-library))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8564 (vhdl-template-field "entity name" "(")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8565 (if (vhdl-template-field "[architecture name]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8566 (insert ")")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8567 (delete-char -1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8568 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8569 (indent-to (+ margin (* 2 vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8570 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8571 (vhdl-insert-keyword "GENERIC ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8572 (when (vhdl-template-map position t t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8573 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8574 (indent-to (+ margin (* 2 vhdl-basic-offset))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8575 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8576 (vhdl-insert-keyword "PORT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8577 (unless (vhdl-template-map position t t)
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
8578 (delete-region (line-beginning-position) (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8579 (delete-char -1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8580 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8581 t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8582 ((equal aspect "CONFIGURATION")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8583 (vhdl-template-field "library name" "." nil nil nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8584 (vhdl-work-library))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8585 (vhdl-template-field "configuration name" ";"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8586 (t (delete-backward-char 1) (insert ";") t))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8587
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8588
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8589 (defun vhdl-template-configuration-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8590 "Insert a configuration declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8591 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8592 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8593 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8594 entity-exists string name position)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8595 (vhdl-insert-keyword "CONFIGURATION ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8596 (when (setq name (vhdl-template-field "name" nil t start (point)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8597 (vhdl-insert-keyword " OF ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8598 (save-excursion
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8599 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8600 (setq entity-exists (vhdl-re-search-backward
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8601 "\\<entity \\(\\w*\\) is\\>" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8602 (setq string (match-string 1))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8603 (if (and entity-exists (not (equal string "")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8604 (insert string)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8605 (vhdl-template-field "entity name"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8606 (vhdl-insert-keyword " IS\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8607 (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
8608 (indent-to (+ margin vhdl-basic-offset))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8609 (setq position (point))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8610 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8611 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8612 (indent-to margin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8613 (vhdl-insert-keyword "END ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8614 (unless (vhdl-standard-p '87)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8615 (vhdl-insert-keyword "CONFIGURATION "))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8616 (insert name ";")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8617 (goto-char position))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8618
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8619 (defun vhdl-template-constant ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8620 "Insert a constant declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8621 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8622 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8623 (in-arglist (vhdl-in-argument-list-p)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8624 (vhdl-insert-keyword "CONSTANT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8625 (when (vhdl-template-field "name" nil t start (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8626 (insert " : ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8627 (when in-arglist (vhdl-insert-keyword "IN "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8628 (vhdl-template-field "type")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8629 (if in-arglist
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8630 (progn (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8631 (vhdl-comment-insert-inline))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8632 (let ((position (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8633 (insert " := ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8634 (unless (vhdl-template-field "[initialization]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8635 (delete-region position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8636 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8637 (vhdl-comment-insert-inline))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8638
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8639 (defun vhdl-template-default ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8640 "Insert nothing."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8641 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8642 (insert " ")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8643 (unexpand-abbrev)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8644 (backward-word 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8645 (vhdl-case-word 1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8646 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8647
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8648 (defun vhdl-template-default-indent ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8649 "Insert nothing and indent."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8650 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8651 (insert " ")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8652 (unexpand-abbrev)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8653 (backward-word 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8654 (vhdl-case-word 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8655 (forward-char 1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8656 (indent-according-to-mode))
24732
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-template-disconnect ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8659 "Insert a disconnect statement."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8660 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8661 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8662 (vhdl-insert-keyword "DISCONNECT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8663 (when (vhdl-template-field "signal names | OTHERS | ALL"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8664 " : " t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8665 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8666 (vhdl-insert-keyword " AFTER ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8667 (vhdl-template-field "time expression" ";"))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8668
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8669 (defun vhdl-template-else ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8670 "Insert an else statement."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8671 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8672 (let (margin)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8673 (vhdl-prepare-search-1
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8674 (vhdl-insert-keyword "ELSE")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8675 (if (and (save-excursion (vhdl-re-search-backward "\\(\\<when\\>\\|;\\)" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8676 (equal "WHEN" (upcase (match-string 1))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8677 (insert " ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8678 (indent-according-to-mode)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8679 (setq margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8680 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8681 (indent-to (+ margin vhdl-basic-offset))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8682
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8683 (defun vhdl-template-elsif ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8684 "Insert an elsif statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8685 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8686 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8687 margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8688 (vhdl-insert-keyword "ELSIF ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8689 (when (or (vhdl-sequential-statement-p) (vhdl-standard-p 'ams))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8690 (when vhdl-conditions-in-parenthesis (insert "("))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8691 (when (vhdl-template-field "condition" nil t start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8692 (when vhdl-conditions-in-parenthesis (insert ")"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8693 (indent-according-to-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8694 (setq margin (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8695 (vhdl-insert-keyword
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8696 (concat " " (if (vhdl-sequential-statement-p) "THEN" "USE") "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8697 (indent-to (+ margin vhdl-basic-offset))))))
24732
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-template-entity ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8700 "Insert an entity."
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 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8703 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8704 name end-column)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8705 (vhdl-insert-keyword "ENTITY ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8706 (when (setq name (vhdl-template-field "name" nil t start (point)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8707 (vhdl-insert-keyword " IS\n\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8708 (indent-to margin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8709 (vhdl-insert-keyword "END ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8710 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ENTITY "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8711 (insert name ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8712 (setq end-column (current-column))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8713 (end-of-line -0)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8714 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8715 (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
8716 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8717 (when (vhdl-template-generic-list t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8718 (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
8719 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8720 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8721 (when (vhdl-template-port-list t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8722 (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
8723 (beginning-of-line 2)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8724 (forward-char end-column))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8725
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8726 (defun vhdl-template-exit ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8727 "Insert an exit statement."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8728 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8729 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8730 (vhdl-insert-keyword "EXIT ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8731 (if (vhdl-template-field "[loop label]" nil t start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8732 (let ((position (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8733 (vhdl-insert-keyword " WHEN ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8734 (when vhdl-conditions-in-parenthesis (insert "("))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8735 (if (vhdl-template-field "[condition]" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8736 (when vhdl-conditions-in-parenthesis (insert ")"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8737 (delete-region position (point))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8738 (delete-char -1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8739 (insert ";")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8740
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8741 (defun vhdl-template-file ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8742 "Insert a file declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8743 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8744 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8745 (vhdl-insert-keyword "FILE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8746 (when (vhdl-template-field "name" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8747 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8748 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8749 (unless (vhdl-standard-p '87)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8750 (vhdl-insert-keyword " OPEN ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8751 (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
8752 nil t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8753 (delete-backward-char 6)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8754 (vhdl-insert-keyword " IS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8755 (when (vhdl-standard-p '87)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8756 (vhdl-template-field "[IN | OUT]" " " t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8757 (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
8758 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8759 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8760
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8761 (defun vhdl-template-for ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8762 "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
8763 declaration, a configuration specification if within an architecture
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8764 declarative part (and not within a subprogram), a for-loop if within a
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8765 sequential statement part (subprogram or process), and a for-generate
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8766 otherwise."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8767 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8768 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8769 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8770 ((vhdl-sequential-statement-p) ; sequential statement
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8771 (vhdl-template-for-loop))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8772 ((and (save-excursion ; configuration declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8773 (re-search-backward "^\\(configuration\\|end\\)\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8774 (equal "CONFIGURATION" (upcase (match-string 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8775 (if (eq (vhdl-decision-query
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8776 "for" "(b)lock or (c)omponent configuration?" t) ?c)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8777 (vhdl-template-component-conf)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8778 (vhdl-template-block-configuration)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8779 ((and (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8780 (re-search-backward ; architecture declarative part
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8781 "^\\(architecture\\|entity\\|begin\\|end\\)\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8782 (equal "ARCHITECTURE" (upcase (match-string 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8783 (vhdl-template-configuration-spec))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8784 (t (vhdl-template-for-generate))))) ; concurrent statement
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8785
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8786 (defun vhdl-template-for-generate ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8787 "Insert a for-generate."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8788 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8789 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8790 (start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8791 label position)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8792 (vhdl-insert-keyword ": FOR ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8793 (setq position (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8794 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8795 (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
8796 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8797 (vhdl-template-field "loop variable")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8798 (vhdl-insert-keyword " IN ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8799 (vhdl-template-field "range")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8800 (vhdl-template-generate-body margin label))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8801
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8802 (defun vhdl-template-for-loop ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8803 "Insert a for loop."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8804 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8805 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8806 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8807 label index)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8808 (if (not (eq vhdl-optional-labels 'all))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8809 (vhdl-insert-keyword "FOR ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8810 (vhdl-insert-keyword ": FOR ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8811 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8812 (setq label (vhdl-template-field "[label]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8813 (unless label (delete-char 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8814 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8815 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8816 (when (setq index (vhdl-template-field "loop variable"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8817 nil t start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8818 (vhdl-insert-keyword " IN ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8819 (vhdl-template-field "range")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8820 (vhdl-insert-keyword " LOOP\n\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8821 (indent-to margin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8822 (vhdl-insert-keyword "END LOOP")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8823 (if label
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8824 (insert " " label ";")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8825 (insert ";")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8826 (when vhdl-self-insert-comments (insert " -- " index)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8827 (forward-line -1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8828 (indent-to (+ margin vhdl-basic-offset)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8829
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8830 (defun vhdl-template-function (&optional kind)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8831 "Insert a function declaration or body."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8832 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8833 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8834 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8835 name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8836 (vhdl-insert-keyword "FUNCTION ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8837 (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
8838 (vhdl-template-argument-list t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8839 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8840 (end-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8841 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8842 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8843 (vhdl-insert-keyword "RETURN ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8844 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8845 (if (if kind (eq kind 'body)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8846 (eq (vhdl-decision-query nil "(d)eclaration or (b)ody?") ?b))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8847 (progn (vhdl-insert-keyword " IS\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8848 (vhdl-template-begin-end
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8849 (unless (vhdl-standard-p '87) "FUNCTION") name margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8850 (vhdl-comment-block))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8851 (insert ";")))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8852
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8853 (defun vhdl-template-function-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8854 "Insert a function declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8855 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8856 (vhdl-template-function 'decl))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8857
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8858 (defun vhdl-template-function-body ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8859 "Insert a function declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8860 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8861 (vhdl-template-function 'body))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8862
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8863 (defun vhdl-template-generate ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8864 "Insert a generation scheme."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8865 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8866 (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
8867 (vhdl-template-if-generate)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8868 (vhdl-template-for-generate)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8869
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8870 (defun vhdl-template-generic ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8871 "Insert generic declaration, or generic map in instantiation statements."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8872 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8873 (let ((start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8874 (vhdl-prepare-search-1
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8875 (cond
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8876 ((and (save-excursion ; entity declaration
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8877 (re-search-backward "^\\(entity\\|end\\)\\>" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8878 (equal "ENTITY" (upcase (match-string 1))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8879 (vhdl-template-generic-list nil))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8880 ((or (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8881 (or (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8882 (looking-at "^\\s-*\\w+\\s-*:\\s-*\\w+")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8883 (equal 'statement-cont (caar (vhdl-get-syntactic-context))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8884 (vhdl-insert-keyword "GENERIC ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8885 (vhdl-template-map start))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8886 (t (vhdl-template-generic-list nil t))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8887
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8888 (defun vhdl-template-group ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8889 "Insert group or group template declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8890 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8891 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8892 (if (eq (vhdl-decision-query
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8893 "group" "(d)eclaration or (t)emplate declaration?" t) ?t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8894 (vhdl-template-group-template)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8895 (vhdl-template-group-decl))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8896
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8897 (defun vhdl-template-group-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8898 "Insert group declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8899 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8900 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8901 (vhdl-insert-keyword "GROUP ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8902 (when (vhdl-template-field "name" " : " t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8903 (vhdl-template-field "template name" " (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8904 (vhdl-template-field "constituent list" ");")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8905 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8906
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8907 (defun vhdl-template-group-template ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8908 "Insert group template declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8909 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8910 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8911 (vhdl-insert-keyword "GROUP ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8912 (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
8913 (vhdl-insert-keyword " IS (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8914 (vhdl-template-field "entity class list" ");")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8915 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8916
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8917 (defun vhdl-template-if ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8918 "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
8919 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8920 (if (vhdl-sequential-statement-p)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8921 (vhdl-template-if-then)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8922 (if (and (vhdl-standard-p 'ams)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8923 (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
8924 (vhdl-template-if-use)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8925 (vhdl-template-if-generate))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8926
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8927 (defun vhdl-template-if-generate ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8928 "Insert an if-generate."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8929 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8930 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8931 (start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
8932 label position)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8933 (vhdl-insert-keyword ": IF ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8934 (setq position (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8935 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8936 (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
8937 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8938 (when vhdl-conditions-in-parenthesis (insert "("))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8939 (vhdl-template-field "condition")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8940 (when vhdl-conditions-in-parenthesis (insert ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8941 (vhdl-template-generate-body margin label))))
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-template-if-then-use (kind)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8944 "Insert a sequential if statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8945 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8946 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8947 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8948 label)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8949 (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
8950 (vhdl-insert-keyword "IF ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8951 (vhdl-insert-keyword ": IF ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8952 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8953 (setq label (vhdl-template-field "[label]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8954 (unless label (delete-char 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8955 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8956 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8957 (when vhdl-conditions-in-parenthesis (insert "("))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8958 (when (vhdl-template-field "condition" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8959 (when vhdl-conditions-in-parenthesis (insert ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8960 (vhdl-insert-keyword
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8961 (concat " " (if (eq kind 'then) "THEN" "USE") "\n\n"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8962 (indent-to margin)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8963 (vhdl-insert-keyword "END IF")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8964 (when label (insert " " label))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8965 (insert ";")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8966 (forward-line -1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8967 (indent-to (+ margin vhdl-basic-offset)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8968
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8969 (defun vhdl-template-if-then ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8970 "Insert a sequential if statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8971 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8972 (vhdl-template-if-then-use 'then))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8973
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8974 (defun vhdl-template-if-use ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8975 "Insert a simultaneous if statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8976 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8977 (vhdl-template-if-then-use 'use))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8978
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8979 (defun vhdl-template-instance ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8980 "Insert a component instantiation statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8981 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8982 (vhdl-template-component-inst))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8983
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8984 (defun vhdl-template-library ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8985 "Insert a library specification."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8986 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8987 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8988 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8989 name end-pos)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8990 (vhdl-insert-keyword "LIBRARY ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8991 (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
8992 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8993 (unless (string-match "," name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8994 (setq end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8995 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8996 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8997 (vhdl-insert-keyword "USE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8998 (insert name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
8999 (vhdl-insert-keyword "..ALL;")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9000 (backward-char 5)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9001 (if (vhdl-template-field "package name")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9002 (forward-char 5)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9003 (delete-region end-pos (+ (point) 5)))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9004
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9005 (defun vhdl-template-limit ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9006 "Insert a limit."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9007 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9008 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9009 (vhdl-insert-keyword "LIMIT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9010 (when (vhdl-template-field "quantity names | OTHERS | ALL" " : "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9011 t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9012 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9013 (vhdl-insert-keyword " WITH ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9014 (vhdl-template-field "real expression" ";"))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9015
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9016 (defun vhdl-template-loop ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9017 "Insert a loop."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9018 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9019 (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
9020 (cond ((eq char ?w)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9021 (vhdl-template-while-loop))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9022 ((eq char ?f)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9023 (vhdl-template-for-loop))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9024 (t (vhdl-template-bare-loop)))))
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-template-bare-loop ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9027 "Insert a loop."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9028 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9029 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9030 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9031 label)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9032 (if (not (eq vhdl-optional-labels 'all))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9033 (vhdl-insert-keyword "LOOP ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9034 (vhdl-insert-keyword ": LOOP ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9035 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9036 (setq label (vhdl-template-field "[label]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9037 (unless label (delete-char 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9038 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9039 (delete-char 1))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9040 (insert "\n\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9041 (indent-to margin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9042 (vhdl-insert-keyword "END LOOP")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9043 (insert (if label (concat " " label ";") ";"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9044 (forward-line -1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9045 (indent-to (+ margin vhdl-basic-offset))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9046
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9047 (defun vhdl-template-map (&optional start optional secondary)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9048 "Insert a map specification with association list."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9049 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9050 (let ((start (or start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9051 margin end-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9052 (vhdl-insert-keyword "MAP (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9053 (if (not vhdl-association-list-with-formals)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9054 (if (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9055 (concat (and optional "[") "association list" (and optional "]"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9056 ")" (or (not secondary) optional)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9057 (and (not secondary) start) (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9058 t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9059 (if (and optional secondary) (delete-region start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9060 nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9061 (if vhdl-argument-list-indent
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9062 (setq margin (current-column))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9063 (setq margin (+ (current-indentation) vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9064 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9065 (indent-to margin))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9066 (if (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9067 (concat (and optional "[") "formal" (and optional "]"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9068 " => " (or (not secondary) optional)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9069 (and (not secondary) start) (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9070 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9071 (vhdl-template-field "actual" ",")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9072 (setq end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9073 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9074 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9075 (while (vhdl-template-field "[formal]" " => " t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9076 (vhdl-template-field "actual" ",")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9077 (setq end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9078 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9079 (indent-to margin))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9080 (delete-region end-pos (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9081 (delete-backward-char 1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9082 (insert ")")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9083 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9084 t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9085 (when (and optional secondary) (delete-region start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9086 nil))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9087
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9088 (defun vhdl-template-modify (&optional noerror)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9089 "Actualize modification date."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9090 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9091 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9092 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9093 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9094 (if (re-search-forward vhdl-modify-date-prefix-string nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9095 (progn (delete-region (point) (progn (end-of-line) (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9096 (vhdl-template-insert-date))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9097 (unless noerror
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9098 (error (concat "ERROR: Modification date prefix string \""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9099 vhdl-modify-date-prefix-string "\" not found")))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9100
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9101 (defun vhdl-template-modify-noerror ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9102 "Call `vhdl-template-modify' with NOERROR non-nil."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9103 (vhdl-template-modify t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9104
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9105 (defun vhdl-template-nature ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9106 "Insert a nature declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9107 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9108 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9109 name mid-pos end-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9110 (vhdl-insert-keyword "NATURE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9111 (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
9112 (vhdl-insert-keyword " IS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9113 (let ((definition
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9114 (upcase
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9115 (or (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9116 "across type | ARRAY | RECORD")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9117 ""))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9118 (cond ((equal definition "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9119 (insert ";"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9120 ((equal definition "ARRAY")
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
9121 (delete-region (point) (progn (forward-word -1) (point)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9122 (vhdl-template-array 'nature t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9123 ((equal definition "RECORD")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9124 (setq mid-pos (point-marker))
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
9125 (delete-region (point) (progn (forward-word -1) (point)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9126 (vhdl-template-record 'nature name t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9127 (t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9128 (vhdl-insert-keyword " ACROSS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9129 (vhdl-template-field "through type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9130 (vhdl-insert-keyword " THROUGH ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9131 (vhdl-template-field "reference name")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9132 (vhdl-insert-keyword " REFERENCE;")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9133 (when mid-pos
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9134 (setq end-pos (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9135 (goto-char mid-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9136 (end-of-line))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9137 (vhdl-comment-insert-inline)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9138 (when end-pos (goto-char end-pos))))))
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 (defun vhdl-template-next ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9141 "Insert a next statement."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9142 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9143 (let ((start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9144 (vhdl-insert-keyword "NEXT ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9145 (if (vhdl-template-field "[loop label]" nil t start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9146 (let ((position (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9147 (vhdl-insert-keyword " WHEN ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9148 (when vhdl-conditions-in-parenthesis (insert "("))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9149 (if (vhdl-template-field "[condition]" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9150 (when vhdl-conditions-in-parenthesis (insert ")"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9151 (delete-region position (point))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9152 (delete-char -1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9153 (insert ";")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9154
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9155 (defun vhdl-template-others ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9156 "Insert an others aggregate."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9157 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9158 (let ((start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9159 (if (or (= (preceding-char) ?\() (not vhdl-template-invoked-by-hook))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9160 (progn (unless vhdl-template-invoked-by-hook (insert "("))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9161 (vhdl-insert-keyword "OTHERS => '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9162 (when (vhdl-template-field "value" nil t start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9163 (insert "')")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9164 (vhdl-insert-keyword "OTHERS "))))
24732
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-template-package (&optional kind)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9167 "Insert a package specification or body."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9168 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9169 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9170 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9171 name body position)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9172 (vhdl-insert-keyword "PACKAGE ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9173 (setq body (if kind (eq kind 'body)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9174 (eq (vhdl-decision-query nil "(d)eclaration or (b)ody?") ?b)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9175 (when body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9176 (vhdl-insert-keyword "BODY ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9177 (when (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9178 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9179 (vhdl-re-search-backward "\\<package \\(\\w+\\) is\\>" nil t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9180 (insert (setq name (match-string 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9181 (when (or name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9182 (setq name (vhdl-template-field "name" nil t start (point))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9183 (vhdl-insert-keyword " IS\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9184 (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
9185 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9186 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9187 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9188 (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
9189 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9190 (vhdl-insert-keyword "END ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9191 (unless (vhdl-standard-p '87)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9192 (vhdl-insert-keyword (concat "PACKAGE " (and body "BODY "))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9193 (insert (or name "") ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9194 (goto-char position))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9195
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9196 (defun vhdl-template-package-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9197 "Insert a package specification."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9198 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9199 (vhdl-template-package 'decl))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9200
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9201 (defun vhdl-template-package-body ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9202 "Insert a package body."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9203 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9204 (vhdl-template-package 'body))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9205
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9206 (defun vhdl-template-port ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9207 "Insert a port declaration, or port map in instantiation statements."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9208 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9209 (let ((start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9210 (vhdl-prepare-search-1
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9211 (cond
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9212 ((and (save-excursion ; entity declaration
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9213 (re-search-backward "^\\(entity\\|end\\)\\>" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9214 (equal "ENTITY" (upcase (match-string 1))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9215 (vhdl-template-port-list nil))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9216 ((or (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9217 (or (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9218 (looking-at "^\\s-*\\w+\\s-*:\\s-*\\w+")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9219 (equal 'statement-cont (caar (vhdl-get-syntactic-context))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9220 (vhdl-insert-keyword "PORT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9221 (vhdl-template-map start))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9222 (t (vhdl-template-port-list nil))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9223
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9224 (defun vhdl-template-procedural ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9225 "Insert a procedural."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9226 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9227 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9228 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9229 (case-fold-search t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9230 label)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9231 (vhdl-insert-keyword "PROCEDURAL ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9232 (when (memq vhdl-optional-labels '(process all))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9233 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9234 (insert ": ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9235 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9236 (setq label (vhdl-template-field "[label]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9237 (unless label (delete-char 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9238 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9239 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9240 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "IS"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9241 (insert "\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9242 (vhdl-template-begin-end "PROCEDURAL" label margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9243 (vhdl-comment-block)))
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 (defun vhdl-template-procedure (&optional kind)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9246 "Insert a procedure declaration or body."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9247 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9248 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9249 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9250 name)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9251 (vhdl-insert-keyword "PROCEDURE ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9252 (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
9253 (vhdl-template-argument-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9254 (if (if kind (eq kind 'body)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9255 (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
9256 (progn (vhdl-insert-keyword " IS")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9257 (when vhdl-auto-align
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9258 (vhdl-align-region-groups start (point) 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9259 (end-of-line) (insert "\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9260 (vhdl-template-begin-end
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9261 (unless (vhdl-standard-p '87) "PROCEDURE")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9262 name margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9263 (vhdl-comment-block))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9264 (insert ";")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9265 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9266 (end-of-line)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9267
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9268 (defun vhdl-template-procedure-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9269 "Insert a procedure declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9270 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9271 (vhdl-template-procedure 'decl))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9272
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9273 (defun vhdl-template-procedure-body ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9274 "Insert a procedure body."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9275 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9276 (vhdl-template-procedure 'body))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9277
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9278 (defun vhdl-template-process (&optional kind)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9279 "Insert a process."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9280 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9281 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9282 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9283 label seq input-signals clock reset final-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9284 (setq seq (if kind (eq kind 'seq)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9285 (eq (vhdl-decision-query
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9286 "process" "(c)ombinational or (s)equential?" t) ?s)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9287 (vhdl-insert-keyword "PROCESS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9288 (when (memq vhdl-optional-labels '(process all))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9289 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9290 (insert ": ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9291 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9292 (setq label (vhdl-template-field "[label]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9293 (unless label (delete-char 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9294 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9295 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9296 (insert "(")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9297 (if (not seq)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9298 (unless (setq input-signals
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9299 (vhdl-template-field "[sensitivity list]" ")" t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9300 (setq input-signals "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9301 (delete-char -2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9302 (setq clock (or (and (not (equal "" vhdl-clock-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9303 (progn (insert vhdl-clock-name) vhdl-clock-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9304 (vhdl-template-field "clock name") "<clock>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9305 (when (eq vhdl-reset-kind 'async)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9306 (insert ", ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9307 (setq reset (or (and (not (equal "" vhdl-reset-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9308 (progn (insert vhdl-reset-name) vhdl-reset-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9309 (vhdl-template-field "reset name") "<reset>")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9310 (insert ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9311 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " IS"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9312 (insert "\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9313 (vhdl-template-begin-end "PROCESS" label margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9314 (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
9315 (when vhdl-prompt-for-comments
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9316 (setq final-pos (point-marker))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9317 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9318 (when (and (vhdl-re-search-backward "\\<begin\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9319 (vhdl-re-search-backward "\\<process\\>" nil t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9320 (end-of-line -0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9321 (if (bobp)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9322 (progn (insert "\n") (forward-line -1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9323 (insert "\n"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9324 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9325 (insert "-- purpose: ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9326 (if (not (vhdl-template-field "[description]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9327 (vhdl-line-kill-entire)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9328 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9329 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9330 (insert "-- type : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9331 (insert (if seq "sequential" "combinational") "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9332 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9333 (insert "-- inputs : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9334 (if (not seq)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9335 (insert input-signals)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9336 (insert clock ", ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9337 (when reset (insert reset ", "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9338 (unless (vhdl-template-field "[signal names]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9339 (delete-char -2)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9340 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9341 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9342 (insert "-- outputs: ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9343 (vhdl-template-field "[signal names]" nil t))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9344 (goto-char final-pos))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9345
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9346 (defun vhdl-template-process-comb ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9347 "Insert a combinational process."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9348 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9349 (vhdl-template-process 'comb))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9350
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9351 (defun vhdl-template-process-seq ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9352 "Insert a sequential process."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9353 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9354 (vhdl-template-process 'seq))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9355
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9356 (defun vhdl-template-quantity ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9357 "Insert a quantity declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9358 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9359 (if (vhdl-in-argument-list-p)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9360 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9361 (vhdl-insert-keyword "QUANTITY ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9362 (when (vhdl-template-field "names" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9363 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9364 (vhdl-template-field "[IN | OUT]" " " t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9365 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9366 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9367 (vhdl-comment-insert-inline)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9368 (let ((char (vhdl-decision-query
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9369 "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
9370 (cond ((eq char ?f) (vhdl-template-quantity-free))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9371 ((eq char ?b) (vhdl-template-quantity-branch))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9372 ((eq char ?s) (vhdl-template-quantity-source))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9373 (t (vhdl-template-undo (point) (point)))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9374
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9375 (defun vhdl-template-quantity-free ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9376 "Insert a free quantity declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9377 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9378 (vhdl-insert-keyword "QUANTITY ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9379 (vhdl-template-field "names")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9380 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9381 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9382 (let ((position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9383 (insert " := ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9384 (unless (vhdl-template-field "[initialization]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9385 (delete-region position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9386 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9387 (vhdl-comment-insert-inline)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9388
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9389 (defun vhdl-template-quantity-branch ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9390 "Insert a branch quantity declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9391 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9392 (let (position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9393 (vhdl-insert-keyword "QUANTITY ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9394 (when (vhdl-template-field "[across names]" " " t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9395 (vhdl-insert-keyword "ACROSS "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9396 (when (vhdl-template-field "[through names]" " " t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9397 (vhdl-insert-keyword "THROUGH "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9398 (vhdl-template-field "plus terminal name")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9399 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9400 (vhdl-insert-keyword " TO ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9401 (unless (vhdl-template-field "[minus terminal name]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9402 (delete-region position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9403 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9404 (vhdl-comment-insert-inline)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9405
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9406 (defun vhdl-template-quantity-source ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9407 "Insert a source quantity declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9408 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9409 (vhdl-insert-keyword "QUANTITY ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9410 (vhdl-template-field "names")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9411 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9412 (vhdl-template-field "type" " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9413 (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
9414 (progn (vhdl-insert-keyword "NOISE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9415 (vhdl-template-field "power expression"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9416 (vhdl-insert-keyword "SPECTRUM ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9417 (vhdl-template-field "magnitude expression" ", ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9418 (vhdl-template-field "phase expression"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9419 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9420 (vhdl-comment-insert-inline))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9421
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9422 (defun vhdl-template-record (kind &optional name secondary)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9423 "Insert a record type declaration."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9424 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9425 (let ((margin (current-column))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9426 (start (point))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9427 (first t))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9428 (vhdl-insert-keyword "RECORD\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9429 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9430 (when (or (vhdl-template-field "element names"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9431 nil (not secondary) start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9432 secondary)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9433 (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
9434 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9435 (vhdl-template-field (if (eq kind 'type) "type" "nature") ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9436 (vhdl-comment-insert-inline)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9437 (insert "\n")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9438 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9439 (setq first nil))
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
9440 (delete-region (line-beginning-position) (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9441 (indent-to margin)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9442 (vhdl-insert-keyword "END RECORD")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9443 (unless (vhdl-standard-p '87) (and name (insert " " name)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9444 (insert ";")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9445 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9446
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9447 (defun vhdl-template-report ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9448 "Insert a report statement."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9449 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9450 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9451 (vhdl-insert-keyword "REPORT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9452 (if (equal "\"\"" (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9453 "string expression" nil t start (point) t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9454 (delete-backward-char 2)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9455 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9456 (vhdl-insert-keyword " SEVERITY ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9457 (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
9458 (delete-region start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9459 (insert ";"))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9460
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9461 (defun vhdl-template-return ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9462 "Insert a return statement."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9463 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9464 (let ((start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9465 (vhdl-insert-keyword "RETURN ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9466 (unless (vhdl-template-field "[expression]" nil t start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9467 (delete-char -1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9468 (insert ";")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9469
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9470 (defun vhdl-template-selected-signal-asst ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9471 "Insert a selected signal assignment."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9472 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9473 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9474 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9475 (choices t))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9476 (let ((position (point)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9477 (vhdl-insert-keyword " SELECT ")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9478 (goto-char position))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9479 (vhdl-insert-keyword "WITH ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9480 (when (vhdl-template-field "selector expression"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9481 nil t start (+ (point) 7))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9482 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9483 (delete-char 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9484 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9485 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9486 (vhdl-template-field "target signal" " <= ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9487 ; (vhdl-template-field "[GUARDED] [TRANSPORT]")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9488 (insert "\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9489 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9490 (vhdl-template-field "waveform")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9491 (vhdl-insert-keyword " WHEN ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9492 (vhdl-template-field "choices" ",")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9493 (insert "\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9494 (indent-to (+ margin vhdl-basic-offset))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9495 (while (and choices (vhdl-template-field "[waveform]" nil t))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9496 (vhdl-insert-keyword " WHEN ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9497 (if (setq choices (vhdl-template-field "[choices]" "," t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9498 (progn (insert "\n") (indent-to (+ margin vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9499 (vhdl-insert-keyword "OTHERS")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9500 (when choices
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9501 (fixup-whitespace)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9502 (delete-char -2))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9503 (insert ";")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9504 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9505
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9506 (defun vhdl-template-signal ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9507 "Insert a signal declaration."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9508 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9509 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9510 (in-arglist (vhdl-in-argument-list-p)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9511 (vhdl-insert-keyword "SIGNAL ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9512 (when (vhdl-template-field "names" nil t start (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9513 (insert " : ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9514 (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
9515 (vhdl-template-field "type")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9516 (if in-arglist
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9517 (progn (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9518 (vhdl-comment-insert-inline))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9519 (let ((position (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9520 (insert " := ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9521 (unless (vhdl-template-field "[initialization]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9522 (delete-region position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9523 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9524 (vhdl-comment-insert-inline))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9525
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9526 (defun vhdl-template-subnature ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9527 "Insert a subnature declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9528 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9529 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9530 position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9531 (vhdl-insert-keyword "SUBNATURE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9532 (when (vhdl-template-field "name" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9533 (vhdl-insert-keyword " IS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9534 (vhdl-template-field "nature" " (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9535 (if (vhdl-template-field "[index range]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9536 (insert ")")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9537 (delete-char -2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9538 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9539 (vhdl-insert-keyword " TOLERANCE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9540 (if (equal "\"\"" (vhdl-template-field "[string expression]"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9541 nil t nil nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9542 (delete-region position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9543 (vhdl-insert-keyword " ACROSS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9544 (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
9545 (vhdl-insert-keyword " THROUGH"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9546 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9547 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9548
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9549 (defun vhdl-template-subprogram-body ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9550 "Insert a subprogram body."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9551 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9552 (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
9553 (vhdl-template-function-body)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9554 (vhdl-template-procedure-body)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9555
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9556 (defun vhdl-template-subprogram-decl ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9557 "Insert a subprogram declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9558 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9559 (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
9560 (vhdl-template-function-decl)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9561 (vhdl-template-procedure-decl)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9562
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9563 (defun vhdl-template-subtype ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9564 "Insert a subtype declaration."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9565 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9566 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9567 (vhdl-insert-keyword "SUBTYPE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9568 (when (vhdl-template-field "name" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9569 (vhdl-insert-keyword " IS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9570 (vhdl-template-field "type" " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9571 (unless
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9572 (vhdl-template-field "[RANGE value range | ( index range )]" nil t)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9573 (delete-char -1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9574 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9575 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9576
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9577 (defun vhdl-template-terminal ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9578 "Insert a terminal declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9579 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9580 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9581 (vhdl-insert-keyword "TERMINAL ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9582 (when (vhdl-template-field "names" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9583 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9584 (vhdl-template-field "nature")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9585 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9586 (vhdl-comment-insert-inline))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9587
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9588 (defun vhdl-template-type ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9589 "Insert a type declaration."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9590 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9591 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9592 name mid-pos end-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9593 (vhdl-insert-keyword "TYPE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9594 (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
9595 (vhdl-insert-keyword " IS ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9596 (let ((definition
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9597 (upcase
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9598 (or (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9599 "[scalar type | ARRAY | RECORD | ACCESS | FILE]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9600 ""))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9601 (cond ((equal definition "")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9602 (delete-backward-char 4)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9603 (insert ";"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9604 ((equal definition "ARRAY")
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
9605 (delete-region (point) (progn (forward-word -1) (point)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9606 (vhdl-template-array 'type t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9607 ((equal definition "RECORD")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9608 (setq mid-pos (point-marker))
77371
819640d82c9f (vhdl-template-type)
Chong Yidong <cyd@stupidchicken.com>
parents: 75518
diff changeset
9609 (delete-region (point) (progn (forward-word -1) (point)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9610 (vhdl-template-record 'type name t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9611 ((equal definition "ACCESS")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9612 (insert " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9613 (vhdl-template-field "type" ";"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9614 ((equal definition "FILE")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9615 (vhdl-insert-keyword " OF ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9616 (vhdl-template-field "type" ";"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9617 (t (insert ";")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9618 (when mid-pos
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9619 (setq end-pos (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9620 (goto-char mid-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9621 (end-of-line))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9622 (vhdl-comment-insert-inline)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9623 (when end-pos (goto-char end-pos))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9624
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9625 (defun vhdl-template-use ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9626 "Insert a use clause."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9627 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9628 (let ((start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9629 (vhdl-prepare-search-1
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9630 (vhdl-insert-keyword "USE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9631 (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
9632 (vhdl-insert-keyword "..ALL;")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9633 (backward-char 6)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9634 (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
9635 (forward-char 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9636 (vhdl-template-field "package name")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9637 (forward-char 5))))))
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 (defun vhdl-template-variable ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9640 "Insert a variable declaration."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9641 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9642 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9643 (in-arglist (vhdl-in-argument-list-p)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9644 (vhdl-prepare-search-2
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9645 (if (or (save-excursion
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9646 (and (vhdl-re-search-backward
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9647 "\\<function\\|procedure\\|process\\|procedural\\|end\\>"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9648 nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9649 (not (progn (backward-word 1) (looking-at "\\<end\\>")))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9650 (save-excursion (backward-word 1) (looking-at "\\<shared\\>")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9651 (vhdl-insert-keyword "VARIABLE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9652 (vhdl-insert-keyword "SHARED VARIABLE ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9653 (when (vhdl-template-field "names" nil t start (point))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9654 (insert " : ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9655 (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
9656 (vhdl-template-field "type")
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9657 (if in-arglist
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9658 (progn (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9659 (vhdl-comment-insert-inline))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9660 (let ((position (point)))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9661 (insert " := ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9662 (unless (vhdl-template-field "[initialization]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9663 (delete-region position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9664 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9665 (vhdl-comment-insert-inline))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9666
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9667 (defun vhdl-template-wait ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9668 "Insert a wait statement."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9669 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9670 (vhdl-insert-keyword "WAIT ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9671 (unless (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9672 "[ON sensitivity list] [UNTIL condition] [FOR time expression]"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9673 nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9674 (delete-char -1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9675 (insert ";"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9676
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9677 (defun vhdl-template-when ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9678 "Indent correctly if within a case statement."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9679 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9680 (let ((position (point))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9681 margin)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9682 (vhdl-prepare-search-2
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9683 (if (and (= (current-column) (current-indentation))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9684 (vhdl-re-search-forward "\\<end\\>" nil t)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9685 (looking-at "\\s-*\\<case\\>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9686 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9687 (setq margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9688 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9689 (delete-horizontal-space)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9690 (indent-to (+ margin vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9691 (goto-char position)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9692 (vhdl-insert-keyword "WHEN ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9693
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9694 (defun vhdl-template-while-loop ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9695 "Insert a while loop."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9696 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9697 (let* ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9698 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9699 label)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9700 (if (not (eq vhdl-optional-labels 'all))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9701 (vhdl-insert-keyword "WHILE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9702 (vhdl-insert-keyword ": WHILE ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9703 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9704 (setq label (vhdl-template-field "[label]" nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9705 (unless label (delete-char 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9706 (forward-word 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9707 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9708 (when vhdl-conditions-in-parenthesis (insert "("))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9709 (when (vhdl-template-field "condition" nil t start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9710 (when vhdl-conditions-in-parenthesis (insert ")"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9711 (vhdl-insert-keyword " LOOP\n\n")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9712 (indent-to margin)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9713 (vhdl-insert-keyword "END LOOP")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9714 (insert (if label (concat " " label ";") ";"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9715 (forward-line -1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9716 (indent-to (+ margin vhdl-basic-offset)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9717
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9718 (defun vhdl-template-with ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9719 "Insert a with statement (i.e. selected signal assignment)."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9720 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9721 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9722 (if (and (save-excursion (vhdl-re-search-backward "\\(\\<limit\\>\\|;\\)"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9723 (equal ";" (match-string 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9724 (vhdl-template-selected-signal-asst)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9725 (vhdl-insert-keyword "WITH "))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9726
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9727 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9728 ;; Special templates
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9729
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9730 (defun vhdl-template-clocked-wait ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9731 "Insert a wait statement for rising/falling clock edge."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9732 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9733 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9734 clock)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9735 (vhdl-insert-keyword "WAIT UNTIL ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9736 (when (setq clock
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9737 (or (and (not (equal "" vhdl-clock-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9738 (progn (insert vhdl-clock-name) vhdl-clock-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9739 (vhdl-template-field "clock name" nil t start (point))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9740 (insert "'event")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9741 (vhdl-insert-keyword " AND ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9742 (insert clock)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9743 (insert
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9744 " = " (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
9745 (vhdl-comment-insert-inline
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9746 (concat (if vhdl-clock-rising-edge "rising" "falling")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9747 " clock edge")))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9748
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9749 (defun vhdl-template-seq-process (clock reset)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9750 "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
9751 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9752 position)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9753 (vhdl-insert-keyword "IF ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9754 (when (eq vhdl-reset-kind 'async)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9755 (insert reset " = "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9756 (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
9757 (vhdl-insert-keyword " THEN")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9758 (vhdl-comment-insert-inline
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9759 (concat "asynchronous reset (active "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9760 (if vhdl-reset-active-high "high" "low") ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9761 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9762 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9763 (insert "\n") (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9764 (vhdl-insert-keyword "ELSIF "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9765 (if (eq vhdl-clock-edge-condition 'function)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9766 (insert (if vhdl-clock-rising-edge "rising" "falling")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9767 "_edge(" clock ")")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9768 (insert clock "'event")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9769 (vhdl-insert-keyword " AND ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9770 (insert clock " = "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9771 (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
9772 (vhdl-insert-keyword " THEN")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9773 (vhdl-comment-insert-inline
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9774 (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
9775 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9776 (when (eq vhdl-reset-kind 'sync)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9777 (vhdl-insert-keyword "IF ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9778 (setq reset (or (and (not (equal "" vhdl-reset-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9779 (progn (insert vhdl-reset-name) vhdl-reset-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9780 (vhdl-template-field "reset name") "<reset>"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9781 (insert " = "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9782 (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
9783 (vhdl-insert-keyword " THEN")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9784 (vhdl-comment-insert-inline
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9785 (concat "synchronous reset (active "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9786 (if vhdl-reset-active-high "high" "low") ")"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9787 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9788 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9789 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9790 (vhdl-insert-keyword "ELSE")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9791 (insert "\n") (indent-to (+ margin (* 2 vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9792 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9793 (vhdl-insert-keyword "END IF;"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9794 (when (eq vhdl-reset-kind 'none)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9795 (setq position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9796 (insert "\n") (indent-to margin)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9797 (vhdl-insert-keyword "END IF;")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9798 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9799 reset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9800
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9801 (defun vhdl-template-standard-package (library package)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9802 "Insert specification of a standard package. Include a library
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9803 specification, if not already there."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9804 (let ((margin (current-indentation)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9805 (unless (equal library "std")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9806 (unless (or (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9807 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9808 (and (not (bobp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9809 (re-search-backward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9810 (concat "^\\s-*\\(\\(library\\)\\s-+\\(\\w+\\s-*,\\s-*\\)*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9811 library "\\|end\\)\\>") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9812 (match-string 2))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9813 (equal (downcase library) "work"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9814 (vhdl-insert-keyword "LIBRARY ")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9815 (insert library ";")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9816 (when package
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9817 (insert "\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9818 (indent-to margin)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9819 (when package
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9820 (vhdl-insert-keyword "USE ")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9821 (insert library "." package)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
9822 (vhdl-insert-keyword ".ALL;")))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9823
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9824 (defun vhdl-template-package-math-complex ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9825 "Insert specification of `math_complex' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9826 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9827 (vhdl-template-standard-package "ieee" "math_complex"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9828
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9829 (defun vhdl-template-package-math-real ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9830 "Insert specification of `math_real' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9831 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9832 (vhdl-template-standard-package "ieee" "math_real"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9833
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9834 (defun vhdl-template-package-numeric-bit ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9835 "Insert specification of `numeric_bit' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9836 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9837 (vhdl-template-standard-package "ieee" "numeric_bit"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9838
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9839 (defun vhdl-template-package-numeric-std ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9840 "Insert specification of `numeric_std' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9841 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9842 (vhdl-template-standard-package "ieee" "numeric_std"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9843
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9844 (defun vhdl-template-package-std-logic-1164 ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9845 "Insert specification of `std_logic_1164' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9846 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9847 (vhdl-template-standard-package "ieee" "std_logic_1164"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9848
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9849 (defun vhdl-template-package-std-logic-arith ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9850 "Insert specification of `std_logic_arith' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9851 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9852 (vhdl-template-standard-package "ieee" "std_logic_arith"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9853
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9854 (defun vhdl-template-package-std-logic-misc ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9855 "Insert specification of `std_logic_misc' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9856 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9857 (vhdl-template-standard-package "ieee" "std_logic_misc"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9858
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9859 (defun vhdl-template-package-std-logic-signed ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9860 "Insert specification of `std_logic_signed' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9861 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9862 (vhdl-template-standard-package "ieee" "std_logic_signed"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9863
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9864 (defun vhdl-template-package-std-logic-textio ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9865 "Insert specification of `std_logic_textio' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9866 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9867 (vhdl-template-standard-package "ieee" "std_logic_textio"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9868
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9869 (defun vhdl-template-package-std-logic-unsigned ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9870 "Insert specification of `std_logic_unsigned' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9871 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9872 (vhdl-template-standard-package "ieee" "std_logic_unsigned"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9873
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9874 (defun vhdl-template-package-textio ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9875 "Insert specification of `textio' package."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9876 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9877 (vhdl-template-standard-package "std" "textio"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9878
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9879 (defun vhdl-template-directive (directive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9880 "Insert directive."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9881 (unless (= (current-indentation) (current-column))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9882 (delete-horizontal-space)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9883 (insert " "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9884 (insert "-- pragma " directive))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9885
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9886 (defun vhdl-template-directive-translate-on ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9887 "Insert directive 'translate_on'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9888 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9889 (vhdl-template-directive "translate_on"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9890
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9891 (defun vhdl-template-directive-translate-off ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9892 "Insert directive 'translate_off'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9893 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9894 (vhdl-template-directive "translate_off"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9895
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9896 (defun vhdl-template-directive-synthesis-on ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9897 "Insert directive 'synthesis_on'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9898 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9899 (vhdl-template-directive "synthesis_on"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9900
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9901 (defun vhdl-template-directive-synthesis-off ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9902 "Insert directive 'synthesis_off'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9903 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9904 (vhdl-template-directive "synthesis_off"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9905
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
9906 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9907 ;; Header and footer templates
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9908
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9909 (defun vhdl-template-header (&optional file-title)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9910 "Insert a VHDL file header."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9911 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9912 (unless (equal vhdl-file-header "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9913 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9914 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9915 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9916 (vhdl-insert-string-or-file vhdl-file-header)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9917 (setq pos (point-marker)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9918 (vhdl-template-replace-header-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9919 (point-min-marker) pos file-title))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9920
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9921 (defun vhdl-template-footer ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9922 "Insert a VHDL file footer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9923 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9924 (unless (equal vhdl-file-footer "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9925 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9926 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9927 (goto-char (point-max))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9928 (setq pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9929 (vhdl-insert-string-or-file vhdl-file-footer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9930 (unless (= (preceding-char) ?\n)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9931 (insert "\n")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9932 (vhdl-template-replace-header-keywords pos (point-max-marker)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9933
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9934 (defun vhdl-template-replace-header-keywords (beg end &optional file-title
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9935 is-model)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9936 "Replace keywords in header and footer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9937 (let ((project-title (or (nth 0 (aget vhdl-project-alist vhdl-project)) ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9938 (project-desc (or (nth 9 (aget vhdl-project-alist vhdl-project)) ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9939 pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9940 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9941 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9942 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9943 (while (search-forward "<projectdesc>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9944 (replace-match project-desc t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9945 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9946 (while (search-forward "<filename>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9947 (replace-match (buffer-name) t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9948 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9949 (while (search-forward "<copyright>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9950 (replace-match vhdl-copyright-string t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9951 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9952 (while (search-forward "<author>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9953 (replace-match "" t t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9954 (insert (user-full-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9955 (when user-mail-address (insert " <" user-mail-address ">")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9956 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9957 (while (search-forward "<login>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9958 (replace-match (user-login-name) t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9959 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9960 (while (search-forward "<project>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9961 (replace-match project-title t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9962 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9963 (while (search-forward "<company>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9964 (replace-match vhdl-company-name t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9965 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9966 (while (search-forward "<platform>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9967 (replace-match vhdl-platform-spec t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9968 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9969 (while (search-forward "<standard>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9970 (replace-match
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9971 (concat "VHDL" (cond ((vhdl-standard-p '87) "'87")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9972 ((vhdl-standard-p '93) "'93"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9973 (when (vhdl-standard-p 'ams) ", VHDL-AMS")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9974 (when (vhdl-standard-p 'math) ", Math Packages")) t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9975 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9976 ;; Replace <RCS> with $, so that RCS for the source is
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9977 ;; not over-enthusiastic with replacements
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9978 (while (search-forward "<RCS>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9979 (replace-match "$" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9980 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9981 (while (search-forward "<date>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9982 (replace-match "" t t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9983 (vhdl-template-insert-date))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9984 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9985 (while (search-forward "<year>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9986 (replace-match (format-time-string "%Y" nil) t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9987 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9988 (when file-title
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9989 (while (search-forward "<title string>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9990 (replace-match file-title t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9991 (goto-char beg))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9992 (let (string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9993 (while
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9994 (re-search-forward "<\\(\\(\\w\\|\\s_\\)*\\) string>" end t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9995 (setq string (read-string (concat (match-string 1) ": ")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9996 (replace-match string t t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9997 (goto-char beg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9998 (when (and (not is-model) (search-forward "<cursor>" end t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
9999 (replace-match "" t t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10000 (setq pos (point))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10001 (when pos (goto-char pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10002 (unless is-model
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10003 (when (or (not project-title) (equal project-title ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10004 (message "You can specify a project title in user option `vhdl-project-alist'"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10005 (when (or (not project-desc) (equal project-desc ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10006 (message "You can specify a project description in user option `vhdl-project-alist'"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10007 (when (equal vhdl-platform-spec "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10008 (message "You can specify a platform in user option `vhdl-platform-spec'"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10009 (when (equal vhdl-company-name "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10010 (message "You can specify a company name in user option `vhdl-company-name'"))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10011
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10012 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10013 ;; Comment templates and functions
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10014
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10015 (defun vhdl-comment-indent ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10016 "Indent comments."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10017 (let* ((position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10018 (col
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10019 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10020 (forward-line -1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10021 (if (re-search-forward "--" position t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10022 (- (current-column) 2) ; existing comment at bol stays there
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10023 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10024 (skip-chars-backward " \t")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10025 (max comment-column ; else indent to comment column
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10026 (1+ (current-column))))))) ; except leave at least one space
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10027 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10028 col))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10029
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10030 (defun vhdl-comment-insert ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10031 "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
10032 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
10033 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
10034 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10035 (when (> (current-column) end-comment-column) (newline-and-indent))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10036 (if (or (looking-at "\\s-*$") ; end of line
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10037 (and (not unread-command-events) ; called with key binding or menu
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10038 (not (end-of-line))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10039 (let (margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10040 (while (= (preceding-char) ?-) (delete-char -1))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10041 (setq margin (current-column))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10042 (delete-horizontal-space)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10043 (if (bolp)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10044 (progn (indent-to margin) (insert "--"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10045 (insert " ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10046 (indent-to comment-column)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10047 (insert "--"))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10048 (if (not unread-command-events) (insert " ")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10049 ;; else code following current point implies commenting out code
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10050 (let (next-input code)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10051 (while (= (preceding-char) ?-) (delete-char -2))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10052 (while (= (setq next-input (read-char)) 13) ; CR
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10053 (insert "--") ; or have a space after it?
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10054 (forward-char -2)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10055 (forward-line 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10056 (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
10057 (setq code t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10058 (unless code
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10059 (insert "--")) ; hardwire to 1 space or use vhdl-basic-offset?
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10060 (setq unread-command-events
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10061 (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
10062
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10063 (defun vhdl-comment-display (&optional line-exists)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10064 "Add 2 comment lines at the current indent, making a display comment."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10065 (interactive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10066 (let ((margin (current-indentation)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10067 (unless line-exists (vhdl-comment-display-line))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10068 (insert "\n") (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10069 (insert "\n") (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10070 (vhdl-comment-display-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10071 (end-of-line -0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10072 (insert "-- ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10073
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10074 (defun vhdl-comment-display-line ()
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10075 "Displays one line of dashes."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10076 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10077 (while (= (preceding-char) ?-) (delete-char -2))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10078 (let* ((col (current-column))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10079 (len (- end-comment-column col)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10080 (insert-char ?- len)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10081
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10082 (defun vhdl-comment-append-inline ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10083 "Append empty inline comment to current line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10084 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10085 (end-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10086 (delete-horizontal-space)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10087 (insert " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10088 (indent-to comment-column)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10089 (insert "-- "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10090
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10091 (defun vhdl-comment-insert-inline (&optional string always-insert)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10092 "Insert inline comment."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10093 (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
10094 (and (not string) vhdl-prompt-for-comments))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10095 (let ((position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10096 (insert " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10097 (indent-to comment-column)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10098 (insert "-- ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10099 (if (not (or (and string (progn (insert string) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10100 (vhdl-template-field "[comment]" nil t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10101 (delete-region position (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10102 (while (= (preceding-char) ? ) (delete-backward-char 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10103 ; (when (> (current-column) end-comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10104 ; (setq position (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10105 ; (re-search-backward "-- ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10106 ; (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10107 ; (indent-to comment-column)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10108 ; (goto-char position))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10109 ))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10110
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10111 (defun vhdl-comment-block ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10112 "Insert comment for code block."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10113 (when vhdl-prompt-for-comments
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10114 (let ((final-pos (point-marker)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10115 (vhdl-prepare-search-2
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10116 (when (and (re-search-backward "^\\s-*begin\\>" nil t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10117 (re-search-backward "\\<\\(architecture\\|block\\|function\\|procedure\\|process\\|procedural\\)\\>" nil t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10118 (let (margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10119 (back-to-indentation)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10120 (setq margin (current-column))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10121 (end-of-line -0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10122 (if (bobp)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10123 (progn (insert "\n") (forward-line -1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10124 (insert "\n"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10125 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10126 (insert "-- purpose: ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10127 (unless (vhdl-template-field "[description]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10128 (vhdl-line-kill-entire)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10129 (goto-char final-pos))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10130
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10131 (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
10132 "Comment out region if not commented out, uncomment otherwise."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10133 (interactive "r\nP")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10134 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10135 (goto-char (1- end))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10136 (end-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10137 (setq end (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10138 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10139 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10140 (setq beg (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10141 (if (looking-at comment-start)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10142 (comment-region beg end '(4))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10143 (comment-region beg end))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10144
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10145 (defun vhdl-comment-uncomment-line (&optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10146 "Comment out line if not commented out, uncomment otherwise."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10147 (interactive "p")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10148 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10149 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10150 (let ((position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10151 (forward-line (or arg 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10152 (vhdl-comment-uncomment-region position (point)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10153
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10154 (defun vhdl-comment-kill-region (beg end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10155 "Kill comments in region."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10156 (interactive "r")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10157 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10158 (goto-char end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10159 (setq end (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10160 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10161 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10162 (while (< (point) end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10163 (if (looking-at "^\\(\\s-*--.*\n\\)")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10164 (progn (delete-region (match-beginning 1) (match-end 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10165 (beginning-of-line 2)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10166
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10167 (defun vhdl-comment-kill-inline-region (beg end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10168 "Kill inline comments in region."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10169 (interactive "r")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10170 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10171 (goto-char end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10172 (setq end (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10173 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10174 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10175 (while (< (point) end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10176 (when (looking-at "^.*[^ \t\n-]+\\(\\s-*--.*\\)$")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10177 (delete-region (match-beginning 1) (match-end 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10178 (beginning-of-line 2))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10179
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10180 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10181 ;; Subtemplates
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10182
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10183 (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
10184 "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
10185 Point is left between them."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10186 (let (position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10187 (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
10188 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10189 (vhdl-insert-keyword "BEGIN")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10190 (when (and (or construct name) vhdl-self-insert-comments)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10191 (insert " --")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10192 (when construct (insert " ") (vhdl-insert-keyword construct))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10193 (when name (insert " " name)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10194 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10195 (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
10196 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10197 (setq position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10198 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10199 (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
10200 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10201 (vhdl-insert-keyword "END")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10202 (when construct (insert " ") (vhdl-insert-keyword construct))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10203 (insert (if name (concat " " name) "") ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10204 (goto-char position)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10205
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10206 (defun vhdl-template-argument-list (&optional is-function)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10207 "Read from user a procedure or function argument list."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10208 (insert " (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10209 (let ((margin (current-column))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10210 (start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10211 (end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10212 not-empty interface semicolon-pos)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10213 (unless vhdl-argument-list-indent
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10214 (setq margin (+ (current-indentation) vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10215 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10216 (indent-to margin))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10217 (setq interface (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10218 (concat "[CONSTANT | SIGNAL"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10219 (unless is-function " | VARIABLE") "]") " " t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10220 (while (vhdl-template-field "[names]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10221 (setq not-empty t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10222 (insert " : ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10223 (unless is-function
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10224 (if (and interface (equal (upcase interface) "CONSTANT"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10225 (vhdl-insert-keyword "IN ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10226 (vhdl-template-field "[IN | OUT | INOUT]" " " t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10227 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10228 (setq semicolon-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10229 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10230 (vhdl-comment-insert-inline)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10231 (setq end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10232 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10233 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10234 (setq interface (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10235 (concat "[CONSTANT | SIGNAL"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10236 (unless is-function " | VARIABLE") "]") " " t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10237 (delete-region end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10238 (when semicolon-pos (goto-char semicolon-pos))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10239 (if not-empty
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10240 (progn (delete-char 1) (insert ")"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10241 (delete-backward-char 2))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10242
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10243 (defun vhdl-template-generic-list (optional &optional no-value)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10244 "Read from user a generic spec argument list."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10245 (let (margin
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10246 (start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10247 (vhdl-insert-keyword "GENERIC (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10248 (setq margin (current-column))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10249 (unless vhdl-argument-list-indent
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10250 (let ((position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10251 (back-to-indentation)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10252 (setq margin (+ (current-column) vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10253 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10254 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10255 (indent-to margin)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10256 (let ((vhdl-generics (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10257 (concat (and optional "[") "name"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10258 (and no-value "s") (and optional "]"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10259 nil optional)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10260 (if (not vhdl-generics)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10261 (if optional
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10262 (progn (vhdl-line-kill-entire) (end-of-line -0)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10263 (unless vhdl-argument-list-indent
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10264 (vhdl-line-kill-entire) (end-of-line -0)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10265 (vhdl-template-undo start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10266 nil )
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10267 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10268 (let (semicolon-pos end-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10269 (while vhdl-generics
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10270 (vhdl-template-field "type")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10271 (if no-value
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10272 (progn (setq semicolon-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10273 (insert ";"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10274 (insert " := ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10275 (unless (vhdl-template-field "[value]" nil t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10276 (delete-char -4))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10277 (setq semicolon-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10278 (insert ";"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10279 (vhdl-comment-insert-inline)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10280 (setq end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10281 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10282 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10283 (setq vhdl-generics (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10284 (concat "[name" (and no-value "s") "]")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10285 " : " t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10286 (delete-region end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10287 (goto-char semicolon-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10288 (insert ")")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10289 (end-of-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10290 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10291 t)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10292
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10293 (defun vhdl-template-port-list (optional)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10294 "Read from user a port spec argument list."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10295 (let ((start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10296 margin vhdl-ports object)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10297 (vhdl-insert-keyword "PORT (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10298 (setq margin (current-column))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10299 (unless vhdl-argument-list-indent
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10300 (let ((position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10301 (back-to-indentation)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10302 (setq margin (+ (current-column) vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10303 (goto-char position)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10304 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10305 (indent-to margin)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10306 (when (vhdl-standard-p 'ams)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10307 (setq object (vhdl-template-field "[SIGNAL | TERMINAL | QUANTITY]"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10308 " " t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10309 (setq vhdl-ports (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10310 (concat (and optional "[") "names" (and optional "]"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10311 nil optional))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10312 (if (not vhdl-ports)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10313 (if optional
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10314 (progn (vhdl-line-kill-entire) (end-of-line -0)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10315 (unless vhdl-argument-list-indent
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10316 (vhdl-line-kill-entire) (end-of-line -0)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10317 (vhdl-template-undo start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10318 nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10319 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10320 (let (semicolon-pos end-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10321 (while vhdl-ports
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10322 (cond ((or (null object) (equal "SIGNAL" (upcase object)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10323 (vhdl-template-field "IN | OUT | INOUT" " "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10324 ((equal "QUANTITY" (upcase object))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10325 (vhdl-template-field "[IN | OUT]" " " t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10326 (vhdl-template-field
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10327 (if (and object (equal "TERMINAL" (upcase object)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10328 "nature" "type"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10329 (setq semicolon-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10330 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10331 (vhdl-comment-insert-inline)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10332 (setq end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10333 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10334 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10335 (when (vhdl-standard-p 'ams)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10336 (setq object (vhdl-template-field "[SIGNAL | TERMINAL | QUANTITY]"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10337 " " t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10338 (setq vhdl-ports (vhdl-template-field "[names]" " : " t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10339 (delete-region end-pos (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10340 (goto-char semicolon-pos)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10341 (insert ")")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10342 (end-of-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10343 (when vhdl-auto-align (vhdl-align-region-groups start end-pos 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10344 t))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10345
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10346 (defun vhdl-template-generate-body (margin label)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10347 "Insert body for generate template."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10348 (vhdl-insert-keyword " GENERATE")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10349 ; (if (not (vhdl-standard-p '87))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10350 ; (vhdl-template-begin-end "GENERATE" label margin)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10351 (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10352 (indent-to margin)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10353 (vhdl-insert-keyword "END GENERATE ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10354 (insert label ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10355 (end-of-line 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10356 (indent-to (+ margin vhdl-basic-offset)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10357
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10358 (defun vhdl-template-insert-date ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10359 "Insert date in appropriate format."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10360 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10361 (insert
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10362 (cond
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10363 ;; 'american, 'european, 'scientific kept for backward compatibility
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10364 ((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
10365 ((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
10366 ((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
10367 (t (format-time-string vhdl-date-format nil)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10368
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10369 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10370 ;; Help functions
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10371
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10372 (defun vhdl-electric-space (count)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10373 "Expand abbreviations and self-insert space(s), do indent-new-comment-line
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10374 if in comment and past end-comment-column."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10375 (interactive "p")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10376 (cond ((vhdl-in-comment-p)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10377 (self-insert-command count)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10378 (cond ((>= (current-column) (+ 2 end-comment-column))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10379 (backward-char 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10380 (skip-chars-backward "^ \t\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10381 (indent-new-comment-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10382 (skip-chars-forward "^ \t\n")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10383 (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10384 ((>= (current-column) end-comment-column)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10385 (indent-new-comment-line))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10386 (t nil)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10387 ((or (and (>= (preceding-char) ?a) (<= (preceding-char) ?z))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10388 (and (>= (preceding-char) ?A) (<= (preceding-char) ?Z)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10389 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10390 (or (expand-abbrev) (vhdl-fix-case-word -1)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10391 (self-insert-command count))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10392 (t (self-insert-command count))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10393
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10394 (defun vhdl-template-field (prompt &optional follow-string optional
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10395 begin end is-string default)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10396 "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
10397 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
10398 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
10399 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
10400 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
10401 (let ((position (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10402 string)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10403 (insert "<" prompt ">")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10404 (setq string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10405 (condition-case ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10406 (read-from-minibuffer (concat prompt ": ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10407 (or (and is-string '("\"\"" . 2)) default)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10408 vhdl-minibuffer-local-map)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10409 (quit (if (and optional begin end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10410 (progn (beep) "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10411 (keyboard-quit)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10412 (when (or (not (equal string "")) optional)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10413 (delete-region position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10414 (when (and (equal string "") optional begin end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10415 (vhdl-template-undo begin end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10416 (message "Template aborted"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10417 (unless (equal string "")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10418 (insert string)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10419 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-keywords
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10420 vhdl-keywords-regexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10421 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10422 vhdl-types-regexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10423 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-attributes
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10424 (concat "'" vhdl-attributes-regexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10425 (vhdl-fix-case-region-1 position (point) vhdl-upper-case-enum-values
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10426 vhdl-enum-values-regexp))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10427 (when (or (not (equal string "")) (not optional))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10428 (insert (or follow-string "")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10429 (if (equal string "") nil string)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10430
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10431 (defun vhdl-decision-query (string prompt &optional optional)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10432 "Query a decision from the user."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10433 (let ((start (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10434 (when string (vhdl-insert-keyword (concat string " ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10435 (message prompt)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10436 (let ((char (read-char)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10437 (delete-region start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10438 (if (and optional (eq char ?\r))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10439 (progn (insert " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10440 (unexpand-abbrev)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10441 (throw 'abort "ERROR: Template aborted"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10442 char))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10443
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10444 (defun vhdl-insert-keyword (keyword)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10445 "Insert KEYWORD and adjust case."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10446 (insert (if vhdl-upper-case-keywords (upcase keyword) (downcase keyword))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10447
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10448 (defun vhdl-case-keyword (keyword)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10449 "Adjust case of KEYWORD."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10450 (if vhdl-upper-case-keywords (upcase keyword) (downcase keyword)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10451
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10452 (defun vhdl-case-word (num)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
10453 "Adjust case of following NUM words."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10454 (if vhdl-upper-case-keywords (upcase-word num) (downcase-word num)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10455
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10456 (defun vhdl-minibuffer-tab (&optional prefix-arg)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10457 "If preceeding character is part of a word or a paren then hippie-expand,
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10458 else insert tab (used for word completion in VHDL minibuffer)."
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10459 (interactive "P")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10460 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10461 ;; expand word
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10462 ((= (char-syntax (preceding-char)) ?w)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10463 (let ((case-fold-search (not vhdl-word-completion-case-sensitive))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10464 (case-replace nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10465 (hippie-expand-only-buffers
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10466 (or (and (boundp 'hippie-expand-only-buffers)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10467 hippie-expand-only-buffers)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10468 '(vhdl-mode))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10469 (vhdl-expand-abbrev prefix-arg)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10470 ;; expand parenthesis
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10471 ((or (= (preceding-char) ?\() (= (preceding-char) ?\)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10472 (let ((case-fold-search (not vhdl-word-completion-case-sensitive))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10473 (case-replace nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10474 (vhdl-expand-paren prefix-arg)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10475 ;; insert tab
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10476 (t (insert-tab))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10477
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10478 (defun vhdl-template-search-prompt ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10479 "Search for left out template prompts and query again."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10480 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10481 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10482 (when (or (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10483 (concat "<\\(" vhdl-template-prompt-syntax "\\)>") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10484 (re-search-backward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10485 (concat "<\\(" vhdl-template-prompt-syntax "\\)>") nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10486 (let ((string (match-string 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10487 (replace-match "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10488 (vhdl-template-field string)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10489
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10490 (defun vhdl-template-undo (begin end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10491 "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
10492 (cond (vhdl-template-invoked-by-hook
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10493 (goto-char end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10494 (insert " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10495 (delete-region begin end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10496 (unexpand-abbrev))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10497 (t (delete-region begin end))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10498
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10499 (defun vhdl-insert-string-or-file (string)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10500 "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
10501 (unless (equal string "")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10502 (let ((file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10503 (progn (string-match "^\\([^\n]+\\)" string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10504 (vhdl-resolve-env-variable (match-string 1 string)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10505 (if (file-exists-p file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10506 (forward-char (cadr (insert-file-contents file-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10507 (insert string)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10508
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10509 (defun vhdl-beginning-of-block ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10510 "Move cursor to the beginning of the enclosing block."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10511 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10512 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10513 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10514 ;; search backward for block beginning or end
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10515 (while (or (while (and (setq pos (re-search-backward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\|record\\|units\\)\\|\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(postponed[ \t\n]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\)\\)\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10516 ;; not consider subprogram declarations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10517 (or (and (match-string 5)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10518 (save-match-data
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10519 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10520 (goto-char (match-end 5))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10521 (forward-word 1)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10522 (vhdl-forward-syntactic-ws)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10523 (when (looking-at "(")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10524 (forward-sexp))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10525 (re-search-forward "\\<is\\>\\|\\(;\\)" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10526 (match-string 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10527 ;; not consider configuration specifications
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10528 (and (match-string 6)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10529 (save-match-data
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10530 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10531 (vhdl-end-of-block)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10532 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10533 (not (looking-at "^\\s-*end\\s-+\\(for\\|generate\\|loop\\)\\>"))))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10534 (match-string 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10535 ;; skip subblock if block end found
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10536 (vhdl-beginning-of-block)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10537 (when pos (goto-char pos))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10538
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10539 (defun vhdl-end-of-block ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10540 "Move cursor to the end of the enclosing block."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10541 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10542 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10543 (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10544 ;; search forward for block beginning or end
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10545 (while (or (while (and (setq pos (re-search-forward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|entity\\|package\\|record\\|units\\)\\|\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(postponed[ \t\n]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\)\\)\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10546 ;; not consider subprogram declarations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10547 (or (and (match-string 5)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10548 (save-match-data
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10549 (save-excursion (re-search-forward "\\<is\\>\\|\\(;\\)" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10550 (match-string 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10551 ;; not consider configuration specifications
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10552 (and (match-string 6)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10553 (save-match-data
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10554 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10555 (vhdl-end-of-block)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10556 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10557 (not (looking-at "^\\s-*end\\s-+\\(for\\|generate\\|loop\\)\\>"))))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10558 (not (match-string 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10559 ;; skip subblock if block beginning found
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10560 (vhdl-end-of-block)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10561 (when pos (goto-char pos))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10562
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10563 (defun vhdl-sequential-statement-p ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10564 "Check if point is within sequential statement part."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10565 (let ((start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10566 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10567 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10568 ;; is sequential statement if ...
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10569 (and (re-search-backward "^\\s-*begin\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10570 ;; ... point is between "begin" and "end" of ...
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10571 (progn (vhdl-end-of-block)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10572 (< start (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10573 ;; ... a sequential block
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10574 (progn (vhdl-beginning-of-block)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10575 (looking-at "^\\s-*\\(\\(\\w+[ \t\n]+\\)?\\(function\\|procedure\\)\\|\\(\\w+[ \t\n]*:[ \t\n]*\\)?\\(\\w+[ \t\n]+\\)?\\(procedural\\|process\\)\\)\\>")))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10576
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10577 (defun vhdl-in-argument-list-p ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10578 "Check if within an argument list."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10579 (save-excursion
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10580 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10581 (or (string-match "arglist"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10582 (format "%s" (caar (vhdl-get-syntactic-context))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10583 (progn (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10584 (looking-at "^\\s-*\\(generic\\|port\\|\\(\\(impure\\|pure\\)\\s-+\\|\\)function\\|procedure\\)\\>\\s-*\\(\\w+\\s-*\\)?("))))))
24732
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10587 ;; Abbrev hooks
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10588
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10589 (defun vhdl-hooked-abbrev (func)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10590 "Do function, if syntax says abbrev is a keyword, invoked by hooked abbrev,
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
10591 but not if inside a comment or quote."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10592 (if (or (vhdl-in-literal)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10593 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10594 (forward-word -1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10595 (and (looking-at "\\<end\\>") (not (looking-at "\\<end;")))))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10596 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10597 (insert " ")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10598 (unexpand-abbrev)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10599 (delete-char -1))
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10600 (if (not vhdl-electric-mode)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10601 (progn
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10602 (insert " ")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10603 (unexpand-abbrev)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10604 (backward-word 1)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10605 (vhdl-case-word 1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10606 (delete-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10607 (let ((invoke-char last-command-char)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10608 (abbrev-mode -1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10609 (vhdl-template-invoked-by-hook t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10610 (let ((caught (catch 'abort
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10611 (funcall func))))
65584
6dbba0bd58df Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents: 65491
diff changeset
10612 (when (stringp caught) (message "%s" caught)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10613 (when (= invoke-char ?-) (setq abbrev-start-location (point)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10614 ;; delete CR which is still in event queue
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
10615 (if (fboundp 'enqueue-eval-event)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10616 (enqueue-eval-event 'delete-char -1)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10617 (setq unread-command-events ; push back a delete char
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10618 (list (vhdl-character-to-event ?\177))))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10619
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10620 (defun vhdl-template-alias-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10621 (vhdl-hooked-abbrev 'vhdl-template-alias))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10622 (defun vhdl-template-architecture-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10623 (vhdl-hooked-abbrev 'vhdl-template-architecture))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10624 (defun vhdl-template-assert-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10625 (vhdl-hooked-abbrev 'vhdl-template-assert))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10626 (defun vhdl-template-attribute-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10627 (vhdl-hooked-abbrev 'vhdl-template-attribute))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10628 (defun vhdl-template-block-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10629 (vhdl-hooked-abbrev 'vhdl-template-block))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10630 (defun vhdl-template-break-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10631 (vhdl-hooked-abbrev 'vhdl-template-break))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10632 (defun vhdl-template-case-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10633 (vhdl-hooked-abbrev 'vhdl-template-case))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10634 (defun vhdl-template-component-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10635 (vhdl-hooked-abbrev 'vhdl-template-component))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10636 (defun vhdl-template-instance-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10637 (vhdl-hooked-abbrev 'vhdl-template-instance))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10638 (defun vhdl-template-conditional-signal-asst-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10639 (vhdl-hooked-abbrev 'vhdl-template-conditional-signal-asst))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10640 (defun vhdl-template-configuration-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10641 (vhdl-hooked-abbrev 'vhdl-template-configuration))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10642 (defun vhdl-template-constant-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10643 (vhdl-hooked-abbrev 'vhdl-template-constant))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10644 (defun vhdl-template-disconnect-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10645 (vhdl-hooked-abbrev 'vhdl-template-disconnect))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10646 (defun vhdl-template-display-comment-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10647 (vhdl-hooked-abbrev 'vhdl-comment-display))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10648 (defun vhdl-template-else-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10649 (vhdl-hooked-abbrev 'vhdl-template-else))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10650 (defun vhdl-template-elsif-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10651 (vhdl-hooked-abbrev 'vhdl-template-elsif))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10652 (defun vhdl-template-entity-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10653 (vhdl-hooked-abbrev 'vhdl-template-entity))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10654 (defun vhdl-template-exit-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10655 (vhdl-hooked-abbrev 'vhdl-template-exit))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10656 (defun vhdl-template-file-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10657 (vhdl-hooked-abbrev 'vhdl-template-file))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10658 (defun vhdl-template-for-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10659 (vhdl-hooked-abbrev 'vhdl-template-for))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10660 (defun vhdl-template-function-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10661 (vhdl-hooked-abbrev 'vhdl-template-function))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10662 (defun vhdl-template-generic-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10663 (vhdl-hooked-abbrev 'vhdl-template-generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10664 (defun vhdl-template-group-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10665 (vhdl-hooked-abbrev 'vhdl-template-group))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10666 (defun vhdl-template-library-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10667 (vhdl-hooked-abbrev 'vhdl-template-library))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10668 (defun vhdl-template-limit-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10669 (vhdl-hooked-abbrev 'vhdl-template-limit))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10670 (defun vhdl-template-if-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10671 (vhdl-hooked-abbrev 'vhdl-template-if))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10672 (defun vhdl-template-bare-loop-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10673 (vhdl-hooked-abbrev 'vhdl-template-bare-loop))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10674 (defun vhdl-template-map-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10675 (vhdl-hooked-abbrev 'vhdl-template-map))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10676 (defun vhdl-template-nature-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10677 (vhdl-hooked-abbrev 'vhdl-template-nature))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10678 (defun vhdl-template-next-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10679 (vhdl-hooked-abbrev 'vhdl-template-next))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10680 (defun vhdl-template-others-hook ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10681 (vhdl-hooked-abbrev 'vhdl-template-others))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10682 (defun vhdl-template-package-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10683 (vhdl-hooked-abbrev 'vhdl-template-package))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10684 (defun vhdl-template-port-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10685 (vhdl-hooked-abbrev 'vhdl-template-port))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10686 (defun vhdl-template-procedural-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10687 (vhdl-hooked-abbrev 'vhdl-template-procedural))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10688 (defun vhdl-template-procedure-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10689 (vhdl-hooked-abbrev 'vhdl-template-procedure))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10690 (defun vhdl-template-process-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10691 (vhdl-hooked-abbrev 'vhdl-template-process))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10692 (defun vhdl-template-quantity-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10693 (vhdl-hooked-abbrev 'vhdl-template-quantity))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10694 (defun vhdl-template-report-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10695 (vhdl-hooked-abbrev 'vhdl-template-report))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10696 (defun vhdl-template-return-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10697 (vhdl-hooked-abbrev 'vhdl-template-return))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10698 (defun vhdl-template-selected-signal-asst-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10699 (vhdl-hooked-abbrev 'vhdl-template-selected-signal-asst))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10700 (defun vhdl-template-signal-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10701 (vhdl-hooked-abbrev 'vhdl-template-signal))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10702 (defun vhdl-template-subnature-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10703 (vhdl-hooked-abbrev 'vhdl-template-subnature))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10704 (defun vhdl-template-subtype-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10705 (vhdl-hooked-abbrev 'vhdl-template-subtype))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10706 (defun vhdl-template-terminal-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10707 (vhdl-hooked-abbrev 'vhdl-template-terminal))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10708 (defun vhdl-template-type-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10709 (vhdl-hooked-abbrev 'vhdl-template-type))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10710 (defun vhdl-template-use-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10711 (vhdl-hooked-abbrev 'vhdl-template-use))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10712 (defun vhdl-template-variable-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10713 (vhdl-hooked-abbrev 'vhdl-template-variable))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10714 (defun vhdl-template-wait-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10715 (vhdl-hooked-abbrev 'vhdl-template-wait))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10716 (defun vhdl-template-when-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10717 (vhdl-hooked-abbrev 'vhdl-template-when))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10718 (defun vhdl-template-while-loop-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10719 (vhdl-hooked-abbrev 'vhdl-template-while-loop))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10720 (defun vhdl-template-with-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10721 (vhdl-hooked-abbrev 'vhdl-template-with))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10722 (defun vhdl-template-and-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10723 (vhdl-hooked-abbrev 'vhdl-template-and))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10724 (defun vhdl-template-or-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10725 (vhdl-hooked-abbrev 'vhdl-template-or))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10726 (defun vhdl-template-nand-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10727 (vhdl-hooked-abbrev 'vhdl-template-nand))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10728 (defun vhdl-template-nor-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10729 (vhdl-hooked-abbrev 'vhdl-template-nor))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10730 (defun vhdl-template-xor-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10731 (vhdl-hooked-abbrev 'vhdl-template-xor))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10732 (defun vhdl-template-xnor-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10733 (vhdl-hooked-abbrev 'vhdl-template-xnor))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10734 (defun vhdl-template-not-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10735 (vhdl-hooked-abbrev 'vhdl-template-not))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10736
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10737 (defun vhdl-template-default-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10738 (vhdl-hooked-abbrev 'vhdl-template-default))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10739 (defun vhdl-template-default-indent-hook ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10740 (vhdl-hooked-abbrev 'vhdl-template-default-indent))
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10743 ;; Template insertion from completion list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10744
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10745 (defun vhdl-template-insert-construct (name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10746 "Insert the built-in construct template with NAME."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10747 (interactive
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10748 (list (let ((completion-ignore-case t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10749 (completing-read "Construct name: "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10750 vhdl-template-construct-alist nil t))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10751 (vhdl-template-insert-fun
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10752 (cadr (assoc name vhdl-template-construct-alist))))
24732
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 (defun vhdl-template-insert-package (name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10755 "Insert the built-in package template with NAME."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10756 (interactive
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10757 (list (let ((completion-ignore-case t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10758 (completing-read "Package name: "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10759 vhdl-template-package-alist nil t))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10760 (vhdl-template-insert-fun
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10761 (cadr (assoc name vhdl-template-package-alist))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10762
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10763 (defun vhdl-template-insert-directive (name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10764 "Insert the built-in directive template with NAME."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10765 (interactive
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10766 (list (let ((completion-ignore-case t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10767 (completing-read "Directive name: "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10768 vhdl-template-directive-alist nil t))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10769 (vhdl-template-insert-fun
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10770 (cadr (assoc name vhdl-template-directive-alist))))
24732
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 (defun vhdl-template-insert-fun (fun)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10773 "Call FUN to insert a built-in template."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10774 (let ((caught (catch 'abort (when fun (funcall fun)))))
65584
6dbba0bd58df Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents: 65491
diff changeset
10775 (when (stringp caught) (message "%s" caught))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10776
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10777
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10778 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10779 ;;; Models
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10780 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10781
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10782 (defun vhdl-model-insert (model-name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10783 "Insert the user model with name MODEL-NAME."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10784 (interactive
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10785 (let ((completion-ignore-case t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10786 (list (completing-read "Model name: " vhdl-model-alist))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10787 (indent-according-to-mode)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10788 (let ((start (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10789 (margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10790 model position prompt string end)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10791 (vhdl-prepare-search-2
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10792 (when (setq model (assoc model-name vhdl-model-alist))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10793 ;; insert model
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10794 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10795 (delete-horizontal-space)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10796 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10797 (vhdl-insert-string-or-file (nth 1 model))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10798 (setq end (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10799 ;; indent code
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10800 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10801 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10802 (while (< (point) end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10803 (unless (looking-at "^$")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10804 (insert-char ? margin))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10805 (beginning-of-line 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10806 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10807 ;; insert clock
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10808 (unless (equal "" vhdl-clock-name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10809 (while (re-search-forward "<clock>" end t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10810 (replace-match vhdl-clock-name)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10811 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10812 ;; insert reset
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10813 (unless (equal "" vhdl-reset-name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10814 (while (re-search-forward "<reset>" end t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10815 (replace-match vhdl-reset-name)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10816 ;; replace header prompts
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10817 (vhdl-template-replace-header-keywords start end nil t)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10818 (goto-char start)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10819 ;; query other prompts
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10820 (while (re-search-forward
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10821 (concat "<\\(" vhdl-template-prompt-syntax "\\)>") end t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10822 (unless (equal "cursor" (match-string 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10823 (setq position (match-beginning 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10824 (setq prompt (match-string 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10825 (replace-match "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10826 (setq string (vhdl-template-field prompt nil t))
42942
048fa049ccba Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 42455
diff changeset
10827 ;; replace occurrences of same prompt
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10828 (while (re-search-forward (concat "<\\(" prompt "\\)>") end t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10829 (replace-match (or string "")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10830 (goto-char position)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10831 (goto-char start)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10832 ;; goto final position
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10833 (if (re-search-forward "<cursor>" end t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10834 (replace-match "")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10835 (goto-char end))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10836
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10837 (defun vhdl-model-defun ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10838 "Define help and hook functions for user models."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10839 (let ((model-alist vhdl-model-alist)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10840 model-name model-keyword)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10841 (while model-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10842 ;; 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
10843 ;; 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
10844 ;; name as argument
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10845 (setq model-name (nth 0 (car model-alist)))
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10846 (eval `(defun ,(vhdl-function-name "vhdl-model" model-name) ()
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10847 ,(concat "Insert model for \"" model-name "\".")
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10848 (interactive)
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10849 (vhdl-model-insert ,model-name)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10850 ;; 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
10851 (setq model-keyword (nth 3 (car model-alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10852 (unless (equal model-keyword "")
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10853 (eval `(defun
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10854 ,(vhdl-function-name
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10855 "vhdl-model" model-name "hook") ()
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10856 (vhdl-hooked-abbrev
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
10857 ',(vhdl-function-name "vhdl-model" model-name)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10858 (setq model-alist (cdr model-alist)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10859
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10860 (vhdl-model-defun)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10861
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10862
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10863 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10864 ;;; Port translation
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10865 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10866
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10867 (defvar vhdl-port-list nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10868 "Variable to hold last port map parsed.")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10869 ;; structure: (parenthesised expression means list of such entries)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10870 ;; (ent-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10871 ;; ((generic-names) generic-type generic-init generic-comment group-comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10872 ;; ((port-names) port-object port-direct port-type port-comment group-comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10873 ;; (lib-name pack-key))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10874
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10875 (defun vhdl-parse-string (string &optional optional)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10876 "Check that the text following point matches the regexp in STRING."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10877 (if (looking-at string)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10878 (goto-char (match-end 0))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10879 (unless optional
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10880 (throw 'parse (format "ERROR: Syntax error near line %s, expecting \"%s\""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10881 (vhdl-current-line) string)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10882 nil))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10883
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10884 (defun vhdl-replace-string (regexp-cons string &optional adjust-case)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10885 "Replace STRING from car of REGEXP-CONS to cdr of REGEXP-CONS."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10886 (vhdl-prepare-search-1
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10887 (if (string-match (car regexp-cons) string)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10888 (if adjust-case
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10889 (funcall vhdl-file-name-case
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10890 (replace-match (cdr regexp-cons) t nil string))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10891 (replace-match (cdr regexp-cons) t nil string))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10892 string)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10893
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10894 (defun vhdl-parse-group-comment ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10895 "Parse comment and empty lines between groups of lines."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10896 (let ((start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10897 string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10898 (vhdl-forward-comment (point-max))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10899 (setq string (buffer-substring-no-properties start (point)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10900 (vhdl-forward-syntactic-ws)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10901 ;; strip off leading blanks and first newline
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10902 (while (string-match "^\\(\\s-+\\)" string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10903 (setq string (concat (substring string 0 (match-beginning 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10904 (substring string (match-end 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10905 (if (and (not (equal string "")) (equal (substring string 0 1) "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10906 (substring string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10907 string)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10908
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10909 (defun vhdl-paste-group-comment (string indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10910 "Paste comment and empty lines from STRING between groups of lines
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10911 with INDENT."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10912 (let ((pos (point-marker)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10913 (when (> indent 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10914 (while (string-match "^\\(--\\)" string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10915 (setq string (concat (substring string 0 (match-beginning 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10916 (make-string indent ? )
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10917 (substring string (match-beginning 1))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10918 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10919 (insert string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10920 (goto-char pos)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10921
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10922 (defvar vhdl-port-flattened nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10923 "Indicates whether a port has been flattened.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10924
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10925 (defun vhdl-port-flatten (&optional as-alist)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10926 "Flatten port list so that only one generic/port exists per line.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10927 This operation is performed on an internally stored port and is only
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10928 reflected in a subsequent paste operation."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10929 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10930 (if (not vhdl-port-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10931 (error "ERROR: No port has been read")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10932 (message "Flattening port for next paste...")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10933 (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
10934 (old-vhdl-port-list (cdr vhdl-port-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10935 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
10936 ;; traverse port list and flatten entries
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10937 (while (cdr old-vhdl-port-list)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10938 (setq old-port-list (car old-vhdl-port-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10939 (setq new-port-list nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10940 (while old-port-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10941 (setq old-port (car old-port-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10942 (setq names (car old-port))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10943 (while names
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10944 (setq new-port (cons (if as-alist (car names) (list (car names)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10945 (cdr old-port)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10946 (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
10947 (setq names (cdr names)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10948 (setq old-port-list (cdr old-port-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10949 (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
10950 (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
10951 (list new-port-list))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10952 (setq vhdl-port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10953 (append new-vhdl-port-list (list old-vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10954 vhdl-port-flattened t)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10955 (message "Flattening port for next paste...done"))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10956
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10957 (defvar vhdl-port-reversed-direction nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10958 "Indicates whether port directions are reversed.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10959
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10960 (defun vhdl-port-reverse-direction ()
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10961 "Reverse direction for all ports (useful in testbenches).
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10962 This operation is performed on an internally stored port and is only
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10963 reflected in a subsequent paste operation."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10964 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10965 (if (not vhdl-port-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10966 (error "ERROR: No port has been read")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10967 (message "Reversing port directions for next paste...")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10968 (let ((port-list (nth 2 vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10969 port-dir-car port-dir)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10970 ;; traverse port list and reverse directions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10971 (while port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10972 (setq port-dir-car (cddr (car port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10973 port-dir (car port-dir-car))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10974 (setcar port-dir-car
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10975 (cond ((equal port-dir "in") "out")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10976 ((equal port-dir "out") "in")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10977 (t port-dir)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10978 (setq port-list (cdr port-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10979 (setq vhdl-port-reversed-direction (not vhdl-port-reversed-direction))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
10980 (message "Reversing port directions for next paste...done"))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10981
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10982 (defun vhdl-port-copy ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10983 "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
10984 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10985 (save-excursion
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10986 (let (parse-error end-of-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10987 decl-type name generic-list port-list context-clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10988 object names direct type init comment group-comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10989 (vhdl-prepare-search-2
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10990 (setq
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10991 parse-error
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10992 (catch 'parse
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10993 ;; check if within entity or component declaration
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10994 (end-of-line)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10995 (when (or (not (re-search-backward
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
10996 "^\\s-*\\(component\\|entity\\|end\\)\\>" nil t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10997 (equal "END" (upcase (match-string 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10998 (throw 'parse "ERROR: Not within an entity or component declaration"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
10999 (setq decl-type (downcase (match-string-no-properties 1)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11000 (forward-word 1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11001 (vhdl-parse-string "\\s-+\\(\\w+\\)\\(\\s-+is\\>\\)?")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11002 (setq name (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11003 (message "Reading port of %s \"%s\"..." decl-type name)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11004 (vhdl-forward-syntactic-ws)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11005 ;; parse generic clause
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11006 (when (vhdl-parse-string "generic[ \t\n]*(" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11007 ;; parse group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11008 (setq group-comment (vhdl-parse-group-comment))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11009 (setq end-of-list (vhdl-parse-string ")[ \t\n]*;[ \t\n]*" t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11010 (while (not end-of-list)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11011 ;; parse names (accept extended identifiers)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11012 (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11013 (setq names (list (match-string-no-properties 1)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11014 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\)[ \t\n]*" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11015 (setq names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11016 (append names (list (match-string-no-properties 1)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11017 ;; parse type
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11018 (vhdl-parse-string ":[ \t\n]*\\([^():;\n]+\\)")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11019 (setq type (match-string-no-properties 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11020 (setq comment nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11021 (while (looking-at "(")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11022 (setq type
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11023 (concat type
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11024 (buffer-substring-no-properties
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11025 (point) (progn (forward-sexp) (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11026 (and (vhdl-parse-string "\\([^():;\n]*\\)" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11027 (match-string-no-properties 1)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11028 ;; special case: closing parenthesis is on separate line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11029 (when (and type (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" type))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11030 (setq comment (substring type (match-beginning 2)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11031 (setq type (substring type 0 (match-beginning 1))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11032 ;; strip of trailing group-comment
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11033 (string-match "\\(\\(\\s-*\\S-+\\)+\\)\\s-*" type)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11034 (setq type (substring type 0 (match-end 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11035 ;; parse initialization expression
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11036 (setq init nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11037 (when (vhdl-parse-string ":=[ \t\n]*" t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11038 (vhdl-parse-string "\\([^();\n]*\\)")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11039 (setq init (match-string-no-properties 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11040 (while (looking-at "(")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11041 (setq init
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11042 (concat init
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11043 (buffer-substring-no-properties
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11044 (point) (progn (forward-sexp) (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11045 (and (vhdl-parse-string "\\([^();\n]*\\)" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11046 (match-string-no-properties 1))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11047 ;; special case: closing parenthesis is on separate line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11048 (when (and init (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" init))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11049 (setq comment (substring init (match-beginning 2)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11050 (setq init (substring init 0 (match-beginning 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11051 (vhdl-forward-syntactic-ws))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11052 (skip-chars-forward " \t")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11053 ;; parse inline comment, special case: as above, no initial.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11054 (unless comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11055 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11056 (match-string-no-properties 1))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11057 (vhdl-forward-syntactic-ws)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11058 (setq end-of-list (vhdl-parse-string ")" t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11059 (vhdl-parse-string "\\s-*;\\s-*")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11060 ;; parse inline comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11061 (unless comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11062 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11063 (match-string-no-properties 1))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11064 ;; save everything in list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11065 (setq generic-list (append generic-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11066 (list (list names type init
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11067 comment group-comment))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11068 ;; parse group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11069 (setq group-comment (vhdl-parse-group-comment))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11070 ;; parse port clause
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11071 (when (vhdl-parse-string "port[ \t\n]*(" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11072 ;; parse group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11073 (setq group-comment (vhdl-parse-group-comment))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11074 (setq end-of-list (vhdl-parse-string ")[ \t\n]*;[ \t\n]*" t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11075 (while (not end-of-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11076 ;; parse object
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11077 (setq object
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11078 (and (vhdl-parse-string "\\<\\(signal\\|quantity\\|terminal\\)\\>[ \t\n]*" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11079 (match-string-no-properties 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11080 ;; parse names (accept extended identifiers)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11081 (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11082 (setq names (list (match-string-no-properties 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11083 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11084 (setq names (append names (list (match-string-no-properties 1)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11085 ;; parse direction
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11086 (vhdl-parse-string ":[ \t\n]*")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11087 (setq direct
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11088 (and (vhdl-parse-string "\\<\\(in\\|out\\|inout\\|buffer\\|linkage\\)\\>[ \t\n]+" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11089 (match-string-no-properties 1)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11090 ;; parse type
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11091 (vhdl-parse-string "\\([^();\n]+\\)")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11092 (setq type (match-string-no-properties 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11093 (setq comment nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11094 (while (looking-at "(")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11095 (setq type (concat type
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11096 (buffer-substring-no-properties
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11097 (point) (progn (forward-sexp) (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11098 (and (vhdl-parse-string "\\([^();\n]*\\)" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11099 (match-string-no-properties 1)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11100 ;; special case: closing parenthesis is on separate line
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11101 (when (and type (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" type))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11102 (setq comment (substring type (match-beginning 2)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11103 (setq type (substring type 0 (match-beginning 1))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11104 ;; strip of trailing group-comment
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11105 (string-match "\\(\\(\\s-*\\S-+\\)+\\)\\s-*" type)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11106 (setq type (substring type 0 (match-end 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11107 (vhdl-forward-syntactic-ws)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11108 (setq end-of-list (vhdl-parse-string ")" t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11109 (vhdl-parse-string "\\s-*;\\s-*")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11110 ;; parse inline comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11111 (unless comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11112 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11113 (match-string-no-properties 1))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11114 ;; save everything in list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11115 (setq port-list (append port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11116 (list (list names object direct type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11117 comment group-comment))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11118 ;; parse group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11119 (setq group-comment (vhdl-parse-group-comment))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11120 ; (vhdl-parse-string "end\\>")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11121 ;; parse context clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11122 (setq context-clause (vhdl-scan-context-clause))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11123 ; ;; add surrounding package to context clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11124 ; (when (and (equal decl-type "component")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11125 ; (re-search-backward "^\\s-*package\\s-+\\(\\w+\\)" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11126 ; (setq context-clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11127 ; (append context-clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11128 ; (list (cons (vhdl-work-library)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11129 ; (match-string-no-properties 1))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11130 (message "Reading port of %s \"%s\"...done" decl-type name)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11131 nil)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11132 ;; finish parsing
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11133 (if parse-error
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11134 (error parse-error)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11135 (setq vhdl-port-list (list name generic-list port-list context-clause)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11136 vhdl-port-reversed-direction nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11137 vhdl-port-flattened nil)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11138
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11139 (defun vhdl-port-paste-context-clause (&optional exclude-pack-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11140 "Paste a context clause."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11141 (let ((margin (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11142 (clause-list (nth 3 vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11143 clause)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11144 (while clause-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11145 (setq clause (car clause-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11146 (unless (or (and exclude-pack-name (equal (downcase (cdr clause))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11147 (downcase exclude-pack-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11148 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11149 (re-search-backward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11150 (concat "^\\s-*use\\s-+" (car clause)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11151 "\." (cdr clause) "\\>") nil t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11152 (vhdl-template-standard-package (car clause) (cdr clause))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11153 (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11154 (setq clause-list (cdr clause-list)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11155
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11156 (defun vhdl-port-paste-generic (&optional no-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11157 "Paste a generic clause."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11158 (let ((margin (current-indentation))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11159 (generic-list (nth 1 vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11160 list-margin start names generic)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11161 ;; paste generic clause
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11162 (when generic-list
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11163 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11164 (vhdl-insert-keyword "GENERIC (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11165 (unless vhdl-argument-list-indent
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11166 (insert "\n") (indent-to (+ margin vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11167 (setq list-margin (current-column))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11168 (while generic-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11169 (setq generic (car generic-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11170 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11171 (when (memq vhdl-include-group-comments '(decl always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11172 (vhdl-paste-group-comment (nth 4 generic) list-margin))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11173 ;; paste names
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11174 (setq names (nth 0 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11175 (while names
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11176 (insert (car names))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11177 (setq names (cdr names))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11178 (when names (insert ", ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11179 ;; paste type
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11180 (insert " : " (nth 1 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11181 ;; paste initialization
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11182 (when (and (not no-init) (nth 2 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11183 (insert " := " (nth 2 generic)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11184 (unless (cdr generic-list) (insert ")"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11185 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11186 ;; paste comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11187 (when (and vhdl-include-port-comments (nth 3 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11188 (vhdl-comment-insert-inline (nth 3 generic) t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11189 (setq generic-list (cdr generic-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11190 (when generic-list (insert "\n") (indent-to list-margin)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11191 ;; align generic clause
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11192 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1 t)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11193
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11194 (defun vhdl-port-paste-port ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11195 "Paste a port clause."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11196 (let ((margin (current-indentation))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11197 (port-list (nth 2 vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11198 list-margin start names port)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11199 ;; paste port clause
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11200 (when port-list
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11201 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11202 (vhdl-insert-keyword "PORT (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11203 (unless vhdl-argument-list-indent
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11204 (insert "\n") (indent-to (+ margin vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11205 (setq list-margin (current-column))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11206 (while port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11207 (setq port (car port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11208 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11209 (when (memq vhdl-include-group-comments '(decl always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11210 (vhdl-paste-group-comment (nth 5 port) list-margin))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11211 ;; paste object
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11212 (when (nth 1 port) (insert (nth 1 port) " "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11213 ;; paste names
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11214 (setq names (nth 0 port))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11215 (while names
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11216 (insert (car names))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11217 (setq names (cdr names))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11218 (when names (insert ", ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11219 ;; paste direction
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11220 (insert " : ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11221 (when (nth 2 port) (insert (nth 2 port) " "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11222 ;; paste type
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11223 (insert (nth 3 port))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11224 (unless (cdr port-list) (insert ")"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11225 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11226 ;; paste comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11227 (when (and vhdl-include-port-comments (nth 4 port))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11228 (vhdl-comment-insert-inline (nth 4 port) t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11229 (setq port-list (cdr port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11230 (when port-list (insert "\n") (indent-to list-margin)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11231 ;; align port clause
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11232 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11233
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11234 (defun vhdl-port-paste-declaration (kind &optional no-indent)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11235 "Paste as an entity or component declaration."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11236 (unless no-indent (indent-according-to-mode))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11237 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11238 (name (nth 0 vhdl-port-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11239 (vhdl-insert-keyword (if (eq kind 'entity) "ENTITY " "COMPONENT "))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11240 (insert name)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11241 (when (or (eq kind 'entity) (not (vhdl-standard-p '87)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11242 (vhdl-insert-keyword " IS"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11243 ;; paste generic and port clause
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11244 (when (nth 1 vhdl-port-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11245 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11246 (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
11247 (insert "\n"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11248 (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11249 (vhdl-port-paste-generic (eq kind 'component)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11250 (when (nth 2 vhdl-port-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11251 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11252 (when (and (memq vhdl-insert-empty-lines '(unit all))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11253 (eq kind 'entity))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11254 (insert "\n"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11255 (indent-to (+ margin vhdl-basic-offset)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11256 (vhdl-port-paste-port)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11257 (insert "\n")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11258 (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
11259 (insert "\n"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11260 (indent-to margin)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11261 (vhdl-insert-keyword "END")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11262 (if (eq kind 'entity)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11263 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11264 (unless (vhdl-standard-p '87) (vhdl-insert-keyword " ENTITY"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11265 (insert " " name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11266 (vhdl-insert-keyword " COMPONENT")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11267 (unless (vhdl-standard-p '87) (insert " " name)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11268 (insert ";")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11269
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11270 (defun vhdl-port-paste-entity (&optional no-indent)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11271 "Paste as an entity declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11272 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11273 (if (not vhdl-port-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11274 (error "ERROR: No port read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11275 (message "Pasting port as entity \"%s\"..." (car vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11276 (vhdl-port-paste-declaration 'entity no-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11277 (message "Pasting port as entity \"%s\"...done" (car vhdl-port-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11278
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11279 (defun vhdl-port-paste-component (&optional no-indent)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11280 "Paste as a component declaration."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11281 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11282 (if (not vhdl-port-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11283 (error "ERROR: No port read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11284 (message "Pasting port as component \"%s\"..." (car vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11285 (vhdl-port-paste-declaration 'component no-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11286 (message "Pasting port as component \"%s\"...done" (car vhdl-port-list))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11287
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11288 (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
11289 "Paste as a generic map."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11290 (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11291 (unless secondary (indent-according-to-mode))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11292 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11293 list-margin start generic
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11294 (generic-list (nth 1 vhdl-port-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11295 (when generic-list
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11296 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11297 (vhdl-insert-keyword "GENERIC MAP (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11298 (if (not vhdl-association-list-with-formals)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11299 ;; paste list of actual generics
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11300 (while generic-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11301 (insert (if no-constants
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11302 (car (nth 0 (car generic-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11303 (or (nth 2 (car generic-list)) " ")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11304 (setq generic-list (cdr generic-list))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11305 (insert (if generic-list ", " ")"))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11306 (when (and (not generic-list) secondary
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11307 (null (nth 2 vhdl-port-list)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11308 (insert ";")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11309 (unless vhdl-argument-list-indent
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11310 (insert "\n") (indent-to (+ margin vhdl-basic-offset)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11311 (setq list-margin (current-column))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11312 (while generic-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11313 (setq generic (car generic-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11314 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11315 (when (eq vhdl-include-group-comments 'always)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11316 (vhdl-paste-group-comment (nth 4 generic) list-margin))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11317 ;; paste formal and actual generic
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11318 (insert (car (nth 0 generic)) " => "
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11319 (if no-constants
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11320 (car (nth 0 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11321 (or (nth 2 generic) "")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11322 (setq generic-list (cdr generic-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11323 (insert (if generic-list "," ")"))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11324 (when (and (not generic-list) secondary
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11325 (null (nth 2 vhdl-port-list)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11326 (insert ";"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11327 ;; paste comment
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11328 (when (or vhdl-include-type-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11329 (and vhdl-include-port-comments (nth 3 generic)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11330 (vhdl-comment-insert-inline
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11331 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11332 (when vhdl-include-type-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11333 (concat "[" (nth 1 generic) "] "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11334 (when vhdl-include-port-comments (nth 3 generic))) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11335 (when generic-list (insert "\n") (indent-to list-margin)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11336 ;; align generic map
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11337 (when vhdl-auto-align
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11338 (vhdl-align-region-groups start (point) 1 t))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11339
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11340 (defun vhdl-port-paste-port-map ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11341 "Paste as a port map."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11342 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11343 list-margin start port
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11344 (port-list (nth 2 vhdl-port-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11345 (when port-list
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11346 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11347 (vhdl-insert-keyword "PORT MAP (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11348 (if (not vhdl-association-list-with-formals)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11349 ;; paste list of actual ports
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11350 (while port-list
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11351 (insert (vhdl-replace-string vhdl-actual-port-name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11352 (car (nth 0 (car port-list)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11353 (setq port-list (cdr port-list))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11354 (insert (if port-list ", " ")")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11355 (unless vhdl-argument-list-indent
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11356 (insert "\n") (indent-to (+ margin vhdl-basic-offset)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11357 (setq list-margin (current-column))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11358 (while port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11359 (setq port (car port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11360 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11361 (when (eq vhdl-include-group-comments 'always)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11362 (vhdl-paste-group-comment (nth 5 port) list-margin))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11363 ;; paste formal and actual port
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11364 (insert (car (nth 0 port)) " => ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11365 (insert (vhdl-replace-string vhdl-actual-port-name
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11366 (car (nth 0 port))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11367 (setq port-list (cdr port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11368 (insert (if port-list "," ");"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11369 ;; paste comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11370 (when (or vhdl-include-direction-comments
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11371 vhdl-include-type-comments
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11372 (and vhdl-include-port-comments (nth 4 port)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11373 (vhdl-comment-insert-inline
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11374 (concat
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11375 (cond ((and vhdl-include-direction-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11376 vhdl-include-type-comments)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11377 (concat "[" (format "%-4s" (concat (nth 2 port) " "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11378 (nth 3 port) "] "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11379 ((and vhdl-include-direction-comments (nth 2 port))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11380 (format "%-6s" (concat "[" (nth 2 port) "] ")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11381 (vhdl-include-direction-comments " ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11382 (vhdl-include-type-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11383 (concat "[" (nth 3 port) "] ")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11384 (when vhdl-include-port-comments (nth 4 port))) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11385 (when port-list (insert "\n") (indent-to list-margin)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11386 ;; align port clause
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11387 (when vhdl-auto-align
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11388 (vhdl-align-region-groups start (point) 1))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11389
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11390 (defun vhdl-port-paste-instance (&optional name no-indent title)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11391 "Paste as an instantiation."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11392 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11393 (if (not vhdl-port-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11394 (error "ERROR: No port read")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11395 (let ((orig-vhdl-port-list vhdl-port-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11396 ;; 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
11397 (vhdl-port-flatten)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11398 (unless no-indent (indent-according-to-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11399 (let ((margin (current-indentation)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11400 ;; paste instantiation
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11401 (cond (name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11402 (insert name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11403 ((equal (cdr vhdl-instance-name) "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11404 (setq name (vhdl-template-field "instance name")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11405 ((string-match "\%d" (cdr vhdl-instance-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11406 (let ((n 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11407 (while (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11408 (setq name (format (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11409 vhdl-instance-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11410 (nth 0 vhdl-port-list)) n))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11411 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11412 (vhdl-re-search-forward name nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11413 (setq n (1+ n)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11414 (insert name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11415 (t (insert (vhdl-replace-string vhdl-instance-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11416 (nth 0 vhdl-port-list)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11417 (message "Pasting port as instantiation \"%s\"..." name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11418 (insert ": ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11419 (when title
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11420 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11421 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11422 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11423 (insert "-- instance \"" name "\"\n")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11424 (if (not (vhdl-use-direct-instantiation))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11425 (insert (nth 0 vhdl-port-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11426 (vhdl-insert-keyword "ENTITY ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11427 (insert (vhdl-work-library) "." (nth 0 vhdl-port-list)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11428 (when (nth 1 vhdl-port-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11429 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11430 (vhdl-port-paste-generic-map t t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11431 (when (nth 2 vhdl-port-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11432 (insert "\n") (indent-to (+ margin vhdl-basic-offset))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11433 (vhdl-port-paste-port-map))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11434 (unless (or (nth 1 vhdl-port-list) (nth 2 vhdl-port-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11435 (insert ";"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11436 (message "Pasting port as instantiation \"%s\"...done" name))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11437 (setq vhdl-port-list orig-vhdl-port-list))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11438
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11439 (defun vhdl-port-paste-constants (&optional no-indent)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11440 "Paste generics as constants."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11441 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11442 (if (not vhdl-port-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11443 (error "ERROR: No port read")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11444 (let ((orig-vhdl-port-list vhdl-port-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11445 (message "Pasting port as constants...")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11446 ;; 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
11447 (vhdl-port-flatten)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11448 (unless no-indent (indent-according-to-mode))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11449 (let ((margin (current-indentation))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11450 start generic name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11451 (generic-list (nth 1 vhdl-port-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11452 (when generic-list
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11453 (setq start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11454 (while generic-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11455 (setq generic (car generic-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11456 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11457 (when (memq vhdl-include-group-comments '(decl always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11458 (vhdl-paste-group-comment (nth 4 generic) margin))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11459 (vhdl-insert-keyword "CONSTANT ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11460 ;; paste generic constants
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11461 (setq name (nth 0 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11462 (when name
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11463 (insert (car name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11464 ;; paste type
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11465 (insert " : " (nth 1 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11466 ;; paste initialization
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11467 (when (nth 2 generic)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11468 (insert " := " (nth 2 generic)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11469 (insert ";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11470 ;; paste comment
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11471 (when (and vhdl-include-port-comments (nth 3 generic))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11472 (vhdl-comment-insert-inline (nth 3 generic) t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11473 (setq generic-list (cdr generic-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11474 (when generic-list (insert "\n") (indent-to margin))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11475 ;; align signal list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11476 (when vhdl-auto-align
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11477 (vhdl-align-region-groups start (point) 1))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11478 (message "Pasting port as constants...done")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11479 (setq vhdl-port-list orig-vhdl-port-list))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11480
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11481 (defun vhdl-port-paste-signals (&optional initialize no-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11482 "Paste ports as internal signals."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11483 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11484 (if (not vhdl-port-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11485 (error "ERROR: No port read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11486 (message "Pasting port as signals...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11487 (unless no-indent (indent-according-to-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11488 (let ((margin (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11489 start port names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11490 (port-list (nth 2 vhdl-port-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11491 (when port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11492 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11493 (while port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11494 (setq port (car port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11495 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11496 (when (memq vhdl-include-group-comments '(decl always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11497 (vhdl-paste-group-comment (nth 5 port) margin))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11498 ;; paste object
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11499 (if (nth 1 port)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11500 (insert (nth 1 port) " ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11501 (vhdl-insert-keyword "SIGNAL "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11502 ;; paste actual port signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11503 (setq names (nth 0 port))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11504 (while names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11505 (insert (vhdl-replace-string vhdl-actual-port-name (car names)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11506 (setq names (cdr names))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11507 (when names (insert ", ")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11508 ;; paste type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11509 (insert " : " (nth 3 port))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11510 ;; paste initialization (inputs only)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11511 (when (and initialize (equal "IN" (upcase (nth 2 port))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11512 (insert " := " (if (string-match "(.+)" (nth 3 port))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11513 "(others => '0')" "'0'")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11514 (insert ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11515 ;; paste comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11516 (when (or vhdl-include-direction-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11517 (and vhdl-include-port-comments (nth 4 port)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11518 (vhdl-comment-insert-inline
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11519 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11520 (cond ((and vhdl-include-direction-comments (nth 2 port))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11521 (format "%-6s" (concat "[" (nth 2 port) "] ")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11522 (vhdl-include-direction-comments " "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11523 (when vhdl-include-port-comments (nth 4 port))) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11524 (setq port-list (cdr port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11525 (when port-list (insert "\n") (indent-to margin)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11526 ;; align signal list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11527 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11528 (message "Pasting port as signals...done")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11529
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11530 (defun vhdl-port-paste-initializations (&optional no-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11531 "Paste ports as signal initializations."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11532 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11533 (if (not vhdl-port-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11534 (error "ERROR: No port read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11535 (let ((orig-vhdl-port-list vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11536 (message "Pasting port as initializations...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11537 ;; flatten local copy of port list (must be flat for signal initial.)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11538 (vhdl-port-flatten)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11539 (unless no-indent (indent-according-to-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11540 (let ((margin (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11541 start port name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11542 (port-list (nth 2 vhdl-port-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11543 (when port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11544 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11545 (while port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11546 (setq port (car port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11547 ;; paste actual port signal (inputs only)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11548 (when (equal "IN" (upcase (nth 2 port)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11549 (setq name (car (nth 0 port)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11550 (insert (vhdl-replace-string vhdl-actual-port-name name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11551 ;; paste initialization
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11552 (insert " <= " (if (string-match "(.+)" (nth 3 port))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11553 "(others => '0')" "'0'") ";"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11554 (setq port-list (cdr port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11555 (when (and port-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11556 (equal "IN" (upcase (nth 2 (car port-list)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11557 (insert "\n") (indent-to margin)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11558 ;; align signal list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11559 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11560 (message "Pasting port as initializations...done")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11561 (setq vhdl-port-list orig-vhdl-port-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11562
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11563 (defun vhdl-port-paste-testbench ()
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11564 "Paste as a bare-bones testbench."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11565 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11566 (if (not vhdl-port-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11567 (error "ERROR: No port read")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11568 (let ((case-fold-search t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11569 (ent-name (vhdl-replace-string vhdl-testbench-entity-name
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11570 (nth 0 vhdl-port-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11571 (source-buffer (current-buffer))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11572 arch-name config-name ent-file-name arch-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11573 ent-buffer arch-buffer position)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11574 ;; open entity file
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11575 (unless (eq vhdl-testbench-create-files 'none)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11576 (setq ent-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11577 (concat (vhdl-replace-string vhdl-testbench-entity-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11578 ent-name t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11579 "." (file-name-extension (buffer-file-name))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11580 (if (file-exists-p ent-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11581 (if (y-or-n-p
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11582 (concat "File \"" ent-file-name "\" exists; overwrite? "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11583 (progn (find-file ent-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11584 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11585 (set-buffer-modified-p nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11586 (if (eq vhdl-testbench-create-files 'separate)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11587 (setq ent-file-name nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11588 (error "ERROR: Pasting port as testbench...aborted")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11589 (find-file ent-file-name)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11590 (unless (and (eq vhdl-testbench-create-files 'separate)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11591 (null ent-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11592 ;; paste entity header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11593 (if vhdl-testbench-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11594 (progn (vhdl-template-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11595 (concat "Testbench for design \""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11596 (nth 0 vhdl-port-list) "\""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11597 (goto-char (point-max)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11598 (vhdl-comment-display-line) (insert "\n\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11599 ;; paste std_logic_1164 package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11600 (when vhdl-testbench-include-library
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11601 (vhdl-template-package-std-logic-1164)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11602 (insert "\n\n") (vhdl-comment-display-line) (insert "\n\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11603 ;; paste entity declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11604 (vhdl-insert-keyword "ENTITY ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11605 (insert ent-name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11606 (vhdl-insert-keyword " IS")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11607 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11608 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11609 (vhdl-insert-keyword "END ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11610 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ENTITY "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11611 (insert ent-name ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11612 (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11613 (vhdl-comment-display-line) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11614 ;; get architecture name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11615 (setq arch-name (if (equal (cdr vhdl-testbench-architecture-name) "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11616 (read-from-minibuffer "architecture name: "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11617 nil vhdl-minibuffer-local-map)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11618 (vhdl-replace-string vhdl-testbench-architecture-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11619 (nth 0 vhdl-port-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11620 (message "Pasting port as testbench \"%s(%s)\"..." ent-name arch-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11621 ;; open architecture file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11622 (if (not (eq vhdl-testbench-create-files 'separate))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11623 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11624 (setq ent-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11625 (setq arch-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11626 (concat (vhdl-replace-string vhdl-testbench-architecture-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11627 (concat ent-name " " arch-name) t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11628 "." (file-name-extension (buffer-file-name))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11629 (when (and (file-exists-p arch-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11630 (not (y-or-n-p (concat "File \"" arch-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11631 "\" exists; overwrite? "))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11632 (error "ERROR: Pasting port as testbench...aborted"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11633 (find-file arch-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11634 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11635 (set-buffer-modified-p nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11636 ;; paste architecture header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11637 (if vhdl-testbench-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11638 (progn (vhdl-template-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11639 (concat "Testbench architecture for design \""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11640 (nth 0 vhdl-port-list) "\""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11641 (goto-char (point-max)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11642 (vhdl-comment-display-line) (insert "\n\n")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11643 ;; paste architecture body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11644 (vhdl-insert-keyword "ARCHITECTURE ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11645 (insert arch-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11646 (vhdl-insert-keyword " OF ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11647 (insert ent-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11648 (vhdl-insert-keyword " IS")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11649 (insert "\n\n") (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11650 ;; paste component declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11651 (unless (vhdl-use-direct-instantiation)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11652 (vhdl-port-paste-component t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11653 (insert "\n\n") (indent-to vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11654 ;; paste constants
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11655 (when (nth 1 vhdl-port-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11656 (insert "-- component generics\n") (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11657 (vhdl-port-paste-constants t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11658 (insert "\n\n") (indent-to vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11659 ;; paste internal signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11660 (insert "-- component ports\n") (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11661 (vhdl-port-paste-signals vhdl-testbench-initialize-signals t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11662 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11663 ;; paste custom declarations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11664 (unless (equal "" vhdl-testbench-declarations)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11665 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11666 (vhdl-insert-string-or-file vhdl-testbench-declarations))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11667 (setq position (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11668 (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11669 (vhdl-comment-display-line) (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11670 (when vhdl-testbench-include-configuration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11671 (setq config-name (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11672 vhdl-testbench-configuration-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11673 (concat ent-name " " arch-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11674 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11675 (vhdl-insert-keyword "CONFIGURATION ") (insert config-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11676 (vhdl-insert-keyword " OF ") (insert ent-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11677 (vhdl-insert-keyword " IS\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11678 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11679 (vhdl-insert-keyword "FOR ") (insert arch-name "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11680 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11681 (vhdl-insert-keyword "END FOR;\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11682 (vhdl-insert-keyword "END ") (insert config-name ";\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11683 (vhdl-comment-display-line) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11684 (goto-char position)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11685 (vhdl-template-begin-end
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11686 (unless (vhdl-standard-p '87) "ARCHITECTURE") arch-name 0 t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11687 ;; paste instantiation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11688 (insert "-- component instantiation\n") (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11689 (vhdl-port-paste-instance
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11690 (vhdl-replace-string vhdl-testbench-dut-name (nth 0 vhdl-port-list)) t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11691 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11692 ;; paste custom statements
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11693 (unless (equal "" vhdl-testbench-statements)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
11694 (insert "\n")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11695 (vhdl-insert-string-or-file vhdl-testbench-statements))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11696 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11697 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11698 (unless (eq vhdl-testbench-create-files 'none)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11699 (setq arch-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11700 (when ent-buffer (set-buffer ent-buffer) (save-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11701 (set-buffer arch-buffer) (save-buffer))
65584
6dbba0bd58df Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents: 65491
diff changeset
11702 (message "%s"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11703 (concat (format "Pasting port as testbench \"%s(%s)\"...done"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11704 ent-name arch-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11705 (and ent-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11706 (format "\n File created: \"%s\"" ent-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11707 (and arch-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11708 (format "\n File created: \"%s\"" arch-file-name)))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11709
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11710
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11711 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11712 ;;; Subprogram interface translation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11713 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11714
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11715 (defvar vhdl-subprog-list nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11716 "Variable to hold last subprogram interface parsed.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11717 ;; structure: (parenthesised expression means list of such entries)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11718 ;; (subprog-name kind
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11719 ;; ((names) object direct type init comment group-comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11720 ;; return-type return-comment group-comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11721
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11722 (defvar vhdl-subprog-flattened nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11723 "Indicates whether an subprogram interface has been flattened.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11724
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11725 (defun vhdl-subprog-flatten ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11726 "Flatten interface list so that only one parameter exists per line."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11727 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11728 (if (not vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11729 (error "ERROR: No subprogram interface has been read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11730 (message "Flattening subprogram interface...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11731 (let ((old-subprog-list (nth 2 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11732 new-subprog-list old-subprog new-subprog names)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11733 ;; traverse parameter list and flatten entries
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11734 (while old-subprog-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11735 (setq old-subprog (car old-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11736 (setq names (car old-subprog))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11737 (while names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11738 (setq new-subprog (cons (list (car names)) (cdr old-subprog)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11739 (setq new-subprog-list (append new-subprog-list (list new-subprog)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11740 (setq names (cdr names)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11741 (setq old-subprog-list (cdr old-subprog-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11742 (setq vhdl-subprog-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11743 (list (nth 0 vhdl-subprog-list) (nth 1 vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11744 new-subprog-list (nth 3 vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11745 (nth 4 vhdl-subprog-list) (nth 5 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11746 vhdl-subprog-flattened t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11747 (message "Flattening subprogram interface...done"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11748
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11749 (defun vhdl-subprog-copy ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11750 "Get interface information from a subprogram specification."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11751 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11752 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11753 (let (parse-error pos end-of-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11754 name kind param-list object names direct type init
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11755 comment group-comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11756 return-type return-comment return-group-comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11757 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11758 (setq
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11759 parse-error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11760 (catch 'parse
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11761 ;; check if within function declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11762 (setq pos (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11763 (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11764 (when (looking-at "[ \t\n]*\\((\\|;\\|is\\>\\)") (goto-char (match-end 0)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11765 (unless (and (re-search-backward "^\\s-*\\(\\(procedure\\)\\|\\(\\(pure\\|impure\\)\\s-+\\)?function\\)\\s-+\\(\"?\\w+\"?\\)[ \t\n]*\\(\\((\\)\\|;\\|is\\>\\)" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11766 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11767 (save-excursion (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11768 (forward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11769 (<= pos (point))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11770 (throw 'parse "ERROR: Not within a subprogram specification"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11771 (setq name (match-string-no-properties 5))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11772 (setq kind (if (match-string 2) 'procedure 'function))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11773 (setq end-of-list (not (match-string 7)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11774 (message "Reading interface of subprogram \"%s\"..." name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11775 ;; parse parameter list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11776 (setq group-comment (vhdl-parse-group-comment))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11777 (setq end-of-list (or end-of-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11778 (vhdl-parse-string ")[ \t\n]*\\(;\\|\\(is\\|return\\)\\>\\)" t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11779 (while (not end-of-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11780 ;; parse object
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11781 (setq object
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11782 (and (vhdl-parse-string "\\(constant\\|signal\\|variable\\|file\\|quantity\\|terminal\\)[ \t\n]*" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11783 (match-string-no-properties 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11784 ;; parse names (accept extended identifiers)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11785 (vhdl-parse-string "\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11786 (setq names (list (match-string-no-properties 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11787 (while (vhdl-parse-string ",[ \t\n]*\\(\\w+\\|\\\\[^\\]+\\\\\\)[ \t\n]*" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11788 (setq names (append names (list (match-string-no-properties 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11789 ;; parse direction
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11790 (vhdl-parse-string ":[ \t\n]*")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11791 (setq direct
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11792 (and (vhdl-parse-string "\\(in\\|out\\|inout\\|buffer\\|linkage\\)[ \t\n]+" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11793 (match-string-no-properties 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11794 ;; parse type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11795 (vhdl-parse-string "\\([^():;\n]+\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11796 (setq type (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11797 (setq comment nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11798 (while (looking-at "(")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11799 (setq type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11800 (concat type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11801 (buffer-substring-no-properties
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11802 (point) (progn (forward-sexp) (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11803 (and (vhdl-parse-string "\\([^():;\n]*\\)" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11804 (match-string-no-properties 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11805 ;; special case: closing parenthesis is on separate line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11806 (when (and type (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" type))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11807 (setq comment (substring type (match-beginning 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11808 (setq type (substring type 0 (match-beginning 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11809 ;; strip off trailing group-comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11810 (string-match "\\(\\(\\s-*\\S-+\\)+\\)\\s-*" type)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11811 (setq type (substring type 0 (match-end 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11812 ;; parse initialization expression
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11813 (setq init nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11814 (when (vhdl-parse-string ":=[ \t\n]*" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11815 (vhdl-parse-string "\\([^();\n]*\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11816 (setq init (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11817 (while (looking-at "(")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11818 (setq init
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11819 (concat init
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11820 (buffer-substring-no-properties
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11821 (point) (progn (forward-sexp) (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11822 (and (vhdl-parse-string "\\([^();\n]*\\)" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11823 (match-string-no-properties 1))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11824 ;; special case: closing parenthesis is on separate line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11825 (when (and init (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" init))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11826 (setq comment (substring init (match-beginning 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11827 (setq init (substring init 0 (match-beginning 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11828 (vhdl-forward-syntactic-ws))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11829 (skip-chars-forward " \t")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11830 ;; parse inline comment, special case: as above, no initial.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11831 (unless comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11832 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11833 (match-string-no-properties 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11834 (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11835 (setq end-of-list (vhdl-parse-string ")\\s-*" t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11836 ;; parse inline comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11837 (unless comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11838 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11839 (match-string-no-properties 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11840 (setq return-group-comment (vhdl-parse-group-comment))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11841 (vhdl-parse-string "\\(;\\|\\(is\\|\\(return\\)\\)\\>\\)\\s-*")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11842 ;; parse return type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11843 (when (match-string 3)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11844 (vhdl-parse-string "[ \t\n]*\\(.+\\)[ \t\n]*\\(;\\|is\\>\\)\\s-*")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11845 (setq return-type (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11846 (when (and return-type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11847 (string-match "\\(\\s-*--\\s-*\\)\\(.*\\)" return-type))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11848 (setq return-comment (substring return-type (match-beginning 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11849 (setq return-type (substring return-type 0 (match-beginning 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11850 ;; strip of trailing group-comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11851 (string-match "\\(\\(\\s-*\\S-+\\)+\\)\\s-*" return-type)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11852 (setq return-type (substring return-type 0 (match-end 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11853 ;; parse return comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11854 (unless return-comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11855 (setq return-comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11856 (match-string-no-properties 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11857 ;; parse inline comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11858 (unless comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11859 (setq comment (and (vhdl-parse-string "--\\s-*\\([^\n]*\\)" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11860 (match-string-no-properties 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11861 ;; save everything in list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11862 (setq param-list (append param-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11863 (list (list names object direct type init
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11864 comment group-comment))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11865 ;; parse group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11866 (setq group-comment (vhdl-parse-group-comment)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11867 (message "Reading interface of subprogram \"%s\"...done" name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11868 nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11869 ;; finish parsing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11870 (if parse-error
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11871 (error parse-error)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11872 (setq vhdl-subprog-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11873 (list name kind param-list return-type return-comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11874 return-group-comment)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11875 vhdl-subprog-flattened nil)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11876
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11877 (defun vhdl-subprog-paste-specification (kind)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11878 "Paste as a subprogram specification."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11879 (indent-according-to-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11880 (let ((margin (current-column))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11881 (param-list (nth 2 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11882 list-margin start names param)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11883 ;; paste keyword and name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11884 (vhdl-insert-keyword
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11885 (if (eq (nth 1 vhdl-subprog-list) 'procedure) "PROCEDURE " "FUNCTION "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11886 (insert (nth 0 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11887 (if (not param-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11888 (if (eq kind 'decl) (insert ";") (vhdl-insert-keyword " is"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11889 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11890 ;; paste parameter list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11891 (insert " (")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11892 (unless vhdl-argument-list-indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11893 (insert "\n") (indent-to (+ margin vhdl-basic-offset)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11894 (setq list-margin (current-column))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11895 (while param-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11896 (setq param (car param-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11897 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11898 (when (memq vhdl-include-group-comments (list kind 'always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11899 (vhdl-paste-group-comment (nth 6 param) list-margin))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11900 ;; paste object
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11901 (when (nth 1 param) (insert (nth 1 param) " "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11902 ;; paste names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11903 (setq names (nth 0 param))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11904 (while names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11905 (insert (car names))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11906 (setq names (cdr names))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11907 (when names (insert ", ")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11908 ;; paste direction
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11909 (insert " : ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11910 (when (nth 2 param) (insert (nth 2 param) " "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11911 ;; paste type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11912 (insert (nth 3 param))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11913 ;; paste initialization
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11914 (when (nth 4 param) (insert " := " (nth 4 param)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11915 ;; terminate line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11916 (if (cdr param-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11917 (insert ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11918 (insert ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11919 (when (null (nth 3 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11920 (if (eq kind 'decl) (insert ";") (vhdl-insert-keyword " is"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11921 ;; paste comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11922 (when (and vhdl-include-port-comments (nth 5 param))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11923 (vhdl-comment-insert-inline (nth 5 param) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11924 (setq param-list (cdr param-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11925 (when param-list (insert "\n") (indent-to list-margin)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11926 (when (nth 3 vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11927 (insert "\n") (indent-to list-margin)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11928 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11929 (when (memq vhdl-include-group-comments (list kind 'always))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11930 (vhdl-paste-group-comment (nth 5 vhdl-subprog-list) list-margin))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11931 ;; paste return type
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11932 (insert "return " (nth 3 vhdl-subprog-list))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
11933 (if (eq kind 'decl) (insert ";") (vhdl-insert-keyword " is"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11934 (when (and vhdl-include-port-comments (nth 4 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11935 (vhdl-comment-insert-inline (nth 4 vhdl-subprog-list) t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11936 ;; align parameter list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11937 (when vhdl-auto-align (vhdl-align-region-groups start (point) 1 t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11938 ;; paste body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11939 (when (eq kind 'body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11940 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11941 (vhdl-template-begin-end
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11942 (unless (vhdl-standard-p '87)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11943 (if (eq (nth 1 vhdl-subprog-list) 'procedure) "PROCEDURE" "FUNCTION"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11944 (nth 0 vhdl-subprog-list) margin))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11945
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11946 (defun vhdl-subprog-paste-declaration ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11947 "Paste as a subprogram declaration."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11948 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11949 (if (not vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11950 (error "ERROR: No subprogram interface read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11951 (message "Pasting interface as subprogram declaration \"%s\"..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11952 (car vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11953 ;; paste specification
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11954 (vhdl-subprog-paste-specification 'decl)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11955 (message "Pasting interface as subprogram declaration \"%s\"...done"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11956 (car vhdl-subprog-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11957
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11958 (defun vhdl-subprog-paste-body ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11959 "Paste as a subprogram body."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11960 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11961 (if (not vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11962 (error "ERROR: No subprogram interface read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11963 (message "Pasting interface as subprogram body \"%s\"..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11964 (car vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11965 ;; paste specification and body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11966 (vhdl-subprog-paste-specification 'body)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11967 (message "Pasting interface as subprogram body \"%s\"...done"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11968 (car vhdl-subprog-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11969
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11970 (defun vhdl-subprog-paste-call ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11971 "Paste as a subprogram call."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11972 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11973 (if (not vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11974 (error "ERROR: No subprogram interface read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11975 (let ((orig-vhdl-subprog-list vhdl-subprog-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11976 param-list margin list-margin param start)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11977 ;; flatten local copy of interface list (must be flat for parameter mapping)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11978 (vhdl-subprog-flatten)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11979 (setq param-list (nth 2 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11980 (indent-according-to-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11981 (setq margin (current-indentation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11982 (message "Pasting interface as subprogram call \"%s\"..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11983 (car vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11984 ;; paste name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11985 (insert (nth 0 vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11986 (if (not param-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11987 (insert ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11988 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11989 ;; paste parameter list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11990 (insert " (")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11991 (unless vhdl-argument-list-indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11992 (insert "\n") (indent-to (+ margin vhdl-basic-offset)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11993 (setq list-margin (current-column))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11994 (while param-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11995 (setq param (car param-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11996 ;; paste group comment and spacing
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11997 (when (eq vhdl-include-group-comments 'always)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11998 (vhdl-paste-group-comment (nth 6 param) list-margin))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
11999 ;; paste formal port
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12000 (insert (car (nth 0 param)) " => ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12001 (setq param-list (cdr param-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12002 (insert (if param-list "," ");"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12003 ;; paste comment
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12004 (when (and vhdl-include-port-comments (nth 5 param))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12005 (vhdl-comment-insert-inline (nth 5 param)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12006 (when param-list (insert "\n") (indent-to list-margin)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12007 ;; align parameter list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12008 (when vhdl-auto-align
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12009 (vhdl-align-region-groups start (point) 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12010 (message "Pasting interface as subprogram call \"%s\"...done"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12011 (car vhdl-subprog-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12012 (setq vhdl-subprog-list orig-vhdl-subprog-list))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12013
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12014
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12015 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12016 ;;; Miscellaneous
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12017 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12018
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12019 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12020 ;; Hippie expand customization
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12021
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12022 (defvar vhdl-expand-upper-case nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12023
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12024 (defun vhdl-try-expand-abbrev (old)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12025 "Try expanding abbreviations from `vhdl-abbrev-list'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12026 (unless old
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12027 (he-init-string (he-dabbrev-beg) (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12028 (setq he-expand-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12029 (let ((abbrev-list vhdl-abbrev-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12030 (sel-abbrev-list '()))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12031 (while abbrev-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12032 (when (or (not (stringp (car abbrev-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12033 (string-match
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12034 (concat "^" he-search-string) (car abbrev-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12035 (setq sel-abbrev-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12036 (cons (car abbrev-list) sel-abbrev-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12037 (setq abbrev-list (cdr abbrev-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12038 (nreverse sel-abbrev-list))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12039 (while (and he-expand-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12040 (or (not (stringp (car he-expand-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12041 (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
12042 ; (equal (car he-expand-list) he-search-string)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12043 (unless (stringp (car he-expand-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12044 (setq vhdl-expand-upper-case (car he-expand-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12045 (setq he-expand-list (cdr he-expand-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12046 (if (null he-expand-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12047 (progn (when old (he-reset-string))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12048 nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12049 (he-substitute-string
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12050 (if vhdl-expand-upper-case
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12051 (upcase (car he-expand-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12052 (car he-expand-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12053 t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12054 (setq he-expand-list (cdr he-expand-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12055 t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12056
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12057 (defun vhdl-he-list-beg ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12058 "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
12059 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
12060 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12061 (condition-case ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12062 (progn (backward-up-list 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12063 (skip-syntax-backward "w_")) ; crashes in `viper-mode'
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12064 (error ()))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12065 (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12066
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12067 ;; override `he-list-beg' from `hippie-exp'
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12068 (unless (and (boundp 'viper-mode) viper-mode)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12069 (defalias 'he-list-beg 'vhdl-he-list-beg))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12070
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12071 ;; function for expanding abbrevs and dabbrevs
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12072 (defun vhdl-expand-abbrev (arg))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12073 (fset 'vhdl-expand-abbrev (make-hippie-expand-function
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12074 '(try-expand-dabbrev
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12075 try-expand-dabbrev-all-buffers
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12076 vhdl-try-expand-abbrev)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12077
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12078 ;; function for expanding parenthesis
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12079 (defun vhdl-expand-paren (arg))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12080 (fset 'vhdl-expand-paren (make-hippie-expand-function
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12081 '(try-expand-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12082 try-expand-list-all-buffers)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12083
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12084 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12085 ;; Case fixing
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12086
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12087 (defun vhdl-fix-case-region-1 (beg end upper-case word-regexp &optional count)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
12088 "Convert all words matching WORD-REGEXP in region to lower or upper case,
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
12089 depending on parameter UPPER-CASE."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12090 (let ((case-replace nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12091 (last-update 0))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12092 (vhdl-prepare-search-2
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12093 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12094 (goto-char end)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12095 (setq end (point-marker))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12096 (goto-char beg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12097 (while (re-search-forward word-regexp end t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12098 (or (vhdl-in-literal)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12099 (if upper-case
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12100 (upcase-word -1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12101 (downcase-word -1)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12102 (when (and count vhdl-progress-interval (not noninteractive)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12103 (< vhdl-progress-interval
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12104 (- (nth 1 (current-time)) last-update)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12105 (message "Fixing case... (%2d%s)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12106 (+ (* count 25) (/ (* 25 (- (point) beg)) (- end beg)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12107 "%")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12108 (setq last-update (nth 1 (current-time)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12109 (goto-char end)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12110
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12111 (defun vhdl-fix-case-region (beg end &optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12112 "Convert all VHDL words in region to lower or upper case, depending on
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12113 options vhdl-upper-case-{keywords,types,attributes,enum-values}."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12114 (interactive "r\nP")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12115 (vhdl-fix-case-region-1
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12116 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
12117 (vhdl-fix-case-region-1
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12118 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
12119 (vhdl-fix-case-region-1
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12120 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
12121 (vhdl-fix-case-region-1
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12122 beg end vhdl-upper-case-enum-values vhdl-enum-values-regexp 3)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12123 (when vhdl-progress-interval (message "Fixing case...done")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12124
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12125 (defun vhdl-fix-case-buffer ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12126 "Convert all VHDL words in buffer to lower or upper case, depending on
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12127 options vhdl-upper-case-{keywords,types,attributes,enum-values}."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12128 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12129 (vhdl-fix-case-region (point-min) (point-max)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12130
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12131 (defun vhdl-fix-case-word (&optional arg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12132 "Convert word after cursor to upper case if necessary."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12133 (interactive "p")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12134 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12135 (when arg (backward-word 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12136 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12137 (when (and vhdl-upper-case-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12138 (looking-at vhdl-keywords-regexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12139 (upcase-word 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12140 (when (and vhdl-upper-case-types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12141 (looking-at vhdl-types-regexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12142 (upcase-word 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12143 (when (and vhdl-upper-case-attributes
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12144 (looking-at vhdl-attributes-regexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12145 (upcase-word 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12146 (when (and vhdl-upper-case-enum-values
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12147 (looking-at vhdl-enum-values-regexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12148 (upcase-word 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12149
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12151 ;; Line handling functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12152
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12153 (defun vhdl-current-line ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12154 "Return the line number of the line containing point."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12155 (save-restriction
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12156 (widen)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12157 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12158 (beginning-of-line)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12159 (1+ (count-lines 1 (point))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12160
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12161 (defun vhdl-line-kill-entire (&optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12162 "Delete entire line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12163 (interactive "p")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12164 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12165 (kill-line (or arg 1)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12166
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12167 (defun vhdl-line-kill (&optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12168 "Kill current line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12169 (interactive "p")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12170 (vhdl-line-kill-entire arg))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12171
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12172 (defun vhdl-line-copy (&optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12173 "Copy current line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12174 (interactive "p")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12175 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12176 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12177 (let ((position (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12178 (forward-line (or arg 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12179 (copy-region-as-kill position (point)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12180
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12181 (defun vhdl-line-yank ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12182 "Yank entire line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12183 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12184 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12185 (yank))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12186
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12187 (defun vhdl-line-expand (&optional prefix-arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12188 "Hippie-expand current line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12189 (interactive "P")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12190 (let ((case-fold-search t) (case-replace nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12191 (hippie-expand-try-functions-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12192 '(try-expand-line try-expand-line-all-buffers)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12193 (hippie-expand prefix-arg)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12194
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12195 (defun vhdl-line-transpose-next (&optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12196 "Interchange this line with next line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12197 (interactive "p")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12198 (forward-line 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12199 (transpose-lines (or arg 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12200 (forward-line -1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12201
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12202 (defun vhdl-line-transpose-previous (&optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12203 "Interchange this line with previous line."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12204 (interactive "p")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12205 (forward-line 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12206 (transpose-lines (- 0 (or arg 0)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12207 (forward-line -1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12208
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12209 (defun vhdl-line-open ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12210 "Open a new line and indent."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12211 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12212 (end-of-line -0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12213 (newline-and-indent))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12214
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12215 (defun vhdl-delete-indentation ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12216 "Join lines. That is, call `delete-indentation' with `fill-prefix' so that
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12217 it works within comments too."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12218 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12219 (let ((fill-prefix "-- "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12220 (delete-indentation)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12221
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12222 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12223 ;; Move functions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12224
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12225 (defun vhdl-forward-same-indent ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12226 "Move forward to next line with same indent."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12227 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12228 (let ((pos (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12229 (indent (current-indentation)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12230 (beginning-of-line 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12231 (while (and (not (eobp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12232 (or (looking-at "^\\s-*\\(--.*\\)?$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12233 (> (current-indentation) indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12234 (beginning-of-line 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12235 (if (= (current-indentation) indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12236 (back-to-indentation)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12237 (message "No following line with same indent found in this block")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12238 (goto-char pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12239 nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12240
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12241 (defun vhdl-backward-same-indent ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12242 "Move backward to previous line with same indent."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12243 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12244 (let ((pos (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12245 (indent (current-indentation)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12246 (beginning-of-line -0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12247 (while (and (not (bobp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12248 (or (looking-at "^\\s-*\\(--.*\\)?$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12249 (> (current-indentation) indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12250 (beginning-of-line -0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12251 (if (= (current-indentation) indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12252 (back-to-indentation)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12253 (message "No preceding line with same indent found in this block")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12254 (goto-char pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12255 nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12256
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12257 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12258 ;; Statistics
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12259
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12260 (defun vhdl-statistics-buffer ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12261 "Get some file statistics."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12262 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12263 (let ((no-stats 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12264 (no-code-lines 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12265 (no-lines (count-lines (point-min) (point-max))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12266 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12267 ;; count statements
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12268 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12269 (while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\)\\|;" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12270 (if (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12271 (goto-char (match-end 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12272 (setq no-stats (1+ no-stats))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12273 ;; count code lines
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12274 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12275 (while (not (eobp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12276 (unless (looking-at "^\\s-*\\(--.*\\)?$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12277 (setq no-code-lines (1+ no-code-lines)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12278 (beginning-of-line 2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12279 ;; print results
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12280 (message "\n\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12281 File statistics: \"%s\"\n\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12282 ---------------------\n\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12283 # statements : %5d\n\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12284 # code lines : %5d\n\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12285 # total lines : %5d\n\ "
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12286 (buffer-file-name) no-stats no-code-lines no-lines)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12287 (unless vhdl-emacs-21 (vhdl-show-messages))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12288
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12289 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12290 ;; Help functions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12291
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12292 (defun vhdl-re-search-forward (regexp &optional bound noerror count)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12293 "Like `re-search-forward', but does not match within literals."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12294 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12295 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12296 (while (and (setq pos (re-search-forward regexp bound noerror count))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12297 (vhdl-in-literal))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12298 (when pos (goto-char pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12299 pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12300
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12301 (defun vhdl-re-search-backward (regexp &optional bound noerror count)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12302 "Like `re-search-backward', but does not match within literals."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12303 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12304 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12305 (while (and (setq pos (re-search-backward regexp bound noerror count))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12306 (vhdl-in-literal))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12307 (when pos (goto-char pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12308 pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12309
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12310
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12311 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12312 ;;; Project
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12313 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12314
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12315 (defun vhdl-set-project (name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12316 "Set current project to NAME."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12317 (interactive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12318 (list (let ((completion-ignore-case t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12319 (completing-read "Project name: " vhdl-project-alist nil t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12320 (cond ((equal name "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12321 (setq vhdl-project nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12322 (message "Current VHDL project: None"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12323 ((assoc name vhdl-project-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12324 (setq vhdl-project name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12325 (message "Current VHDL project: \"%s\"" name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12326 (t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12327 (vhdl-warning (format "Unknown VHDL project: \"%s\"" name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12328 (vhdl-speedbar-update-current-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12329
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12330 (defun vhdl-set-default-project ()
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12331 "Set current project as default on startup."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12332 (interactive)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12333 (customize-set-variable 'vhdl-project vhdl-project)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12334 (customize-save-customized))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12335
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12336 (defun vhdl-toggle-project (name token indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12337 "Set current project to NAME or unset if NAME is current project."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12338 (vhdl-set-project (if (equal name vhdl-project) "" name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12339
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12340 (defun vhdl-export-project (file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12341 "Write project setup for current project."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12342 (interactive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12343 (let ((name (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12344 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12345 (cons "\\(.*\\) \\(.*\\)" (car vhdl-project-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12346 (concat (subst-char-in-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12347 ? ?_ (or (vhdl-project-p)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12348 (error "ERROR: No current project")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12349 " " (user-login-name))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12350 (list (read-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12351 "Write project file: "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12352 (when (file-name-absolute-p name) "") nil nil name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12353 (setq file-name (abbreviate-file-name file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12354 (let ((orig-buffer (current-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12355 (unless (file-exists-p (file-name-directory file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12356 (make-directory (file-name-directory file-name) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12357 (if (not (file-writable-p file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12358 (error "ERROR: File not writable: \"%s\"" file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12359 (set-buffer (find-file-noselect file-name t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12360 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12361 (insert ";; -*- Emacs-Lisp -*-\n\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12362 ";;; " (file-name-nondirectory file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12363 " - project setup file for Emacs VHDL Mode " vhdl-version "\n\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12364 ";; Project : " vhdl-project "\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12365 ";; Saved : " (format-time-string "%Y-%m-%d %T ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12366 (user-login-name) "\n\n\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12367 ";; project name\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12368 "(setq vhdl-project \"" vhdl-project "\")\n\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12369 ";; project setup\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12370 "(aput 'vhdl-project-alist vhdl-project\n'")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12371 (pp (aget vhdl-project-alist vhdl-project) (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12372 (insert ")\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12373 (save-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12374 (kill-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12375 (set-buffer orig-buffer))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12376
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12377 (defun vhdl-import-project (file-name &optional auto not-make-current)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12378 "Read project setup and set current project."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12379 (interactive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12380 (let ((name (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12381 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12382 (cons "\\(.*\\) \\(.*\\)" (car vhdl-project-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12383 (concat "" " " (user-login-name))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12384 (list (read-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12385 "Read project file: " (when (file-name-absolute-p name) "") nil t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12386 (file-name-directory name)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12387 (when (file-exists-p file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12388 (condition-case ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12389 (let ((current-project vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12390 (load-file file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12391 (when (/= (length (aget vhdl-project-alist vhdl-project t)) 10)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12392 (adelete 'vhdl-project-alist vhdl-project)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12393 (error ""))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12394 (when not-make-current
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12395 (setq vhdl-project current-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12396 (vhdl-update-mode-menu)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12397 (vhdl-speedbar-refresh)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12398 (unless not-make-current
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12399 (message "Current VHDL project: \"%s\"%s"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12400 vhdl-project (if auto " (auto-loaded)" ""))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12401 (error (vhdl-warning
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12402 (format "ERROR: Invalid project setup file: \"%s\"" file-name))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12403
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12404 (defun vhdl-duplicate-project ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12405 "Duplicate setup of current project."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12406 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12407 (let ((new-name (read-from-minibuffer "New project name: "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12408 (project-entry (aget vhdl-project-alist vhdl-project t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12409 (setq vhdl-project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12410 (append vhdl-project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12411 (list (cons new-name project-entry))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12412 (vhdl-update-mode-menu)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12413
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12414 (defun vhdl-auto-load-project ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12415 "Automatically load project setup at startup."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12416 (let ((file-name-list vhdl-project-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12417 file-list list-length)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12418 (while file-name-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12419 (setq file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12420 (append file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12421 (file-expand-wildcards
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12422 (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12423 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12424 (cons "\\(.*\\) \\(.*\\)" (car file-name-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12425 (concat "\*" " " (user-login-name)))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12426 (setq list-length (or list-length (length file-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12427 (setq file-name-list (cdr file-name-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12428 (while file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12429 (vhdl-import-project (expand-file-name (car file-list)) t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12430 (not (> list-length 0)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12431 (setq list-length (1- list-length))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12432 (setq file-list (cdr file-list)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12433
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12434 ;; automatically load project setup when idle after startup
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12435 (when (memq 'startup vhdl-project-auto-load)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12436 (if noninteractive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12437 (vhdl-auto-load-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12438 (vhdl-run-when-idle .1 nil 'vhdl-auto-load-project)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12439
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12440
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12441 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12442 ;;; Hideshow
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12443 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12444 ;; (using `hideshow.el')
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12445
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12446 (defconst vhdl-hs-start-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12447 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12448 "\\(^\\)\\s-*\\("
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12449 ;; generic/port clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12450 "\\(generic\\|port\\)[ \t\n]*(\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12451 ;; component
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12452 "component\\>\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12453 ;; component instantiation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12454 "\\(\\w\\|\\s_\\)+[ \t\n]*:[ \t\n]*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12455 "\\(\\(component\\|configuration\\|entity\\)[ \t\n]+\\)?"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12456 "\\(\\w\\|\\s_\\)+\\([ \t\n]*(\\(\\w\\|\\s_\\)+)\\)?[ \t\n]*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12457 "\\(generic\\|port\\)[ \t\n]+map[ \t\n]*(\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12458 ;; subprogram
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12459 "\\(function\\|procedure\\)\\>\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12460 ;; process, block
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12461 "\\(\\(\\w\\|\\s_\\)+[ \t\n]*:[ \t\n]*\\)?\\(process\\|block\\)\\>\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12462 ;; configuration declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12463 "configuration\\>"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12464 "\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12465 "Regexp to match start of construct to hide.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12466
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12467 (defun vhdl-hs-forward-sexp-func (count)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
12468 "Find end of construct to hide (for hideshow). Only searches forward."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12469 (let ((pos (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12470 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12471 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12472 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12473 ;; generic/port clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12474 ((looking-at "^\\s-*\\(generic\\|port\\)[ \t\n]*(")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12475 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12476 (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12477 (forward-sexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12478 ;; component declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12479 ((looking-at "^\\s-*component\\>")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12480 (re-search-forward "^\\s-*end\\s-+component\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12481 ;; component instantiation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12482 ((looking-at
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12483 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12484 "^\\s-*\\w+\\s-*:[ \t\n]*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12485 "\\(\\(component\\|configuration\\|entity\\)[ \t\n]+\\)?"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12486 "\\w+\\(\\s-*(\\w+)\\)?[ \t\n]*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12487 "\\(generic\\|port\\)\\s-+map[ \t\n]*("))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12488 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12489 (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12490 (forward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12491 (setq pos (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12492 (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12493 (when (looking-at "port\\s-+map[ \t\n]*(")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12494 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12495 (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12496 (forward-sexp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12497 (setq pos (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12498 (goto-char pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12499 ;; subprogram declaration/body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12500 ((looking-at "^\\s-*\\(function\\|procedure\\)\\s-+\\(\\w+\\|\".+\"\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12501 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12502 (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12503 (when (looking-at "(")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12504 (forward-sexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12505 (while (and (re-search-forward "\\(;\\)\\|\\(\\<is\\>\\)" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12506 (vhdl-in-literal)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12507 ;; subprogram body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12508 (when (match-string 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12509 (re-search-forward "^\\s-*\\<begin\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12510 (backward-word 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12511 (vhdl-forward-sexp)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12512 ;; block (recursive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12513 ((looking-at "^\\s-*\\w+\\s-*:\\s-*block\\>")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12514 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12515 (while (and (re-search-forward "^\\s-*\\(\\(\\w+\\s-*:\\s-*block\\>\\)\\|\\(end\\s-+block\\>\\)\\)" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12516 (match-beginning 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12517 (vhdl-hs-forward-sexp-func count)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12518 ;; process
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12519 ((looking-at "^\\s-*\\(\\w+\\s-*:\\s-*\\)?process\\>")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12520 (re-search-forward "^\\s-*end\\s-+process\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12521 ;; configuration declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12522 ((looking-at "^\\s-*configuration\\>")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12523 (forward-word 4)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12524 (vhdl-forward-sexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12525 (t (goto-char pos))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12526
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12527 (defun vhdl-hideshow-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12528 "Initialize `hideshow'."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12529 (when vhdl-hideshow-menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12530 (vhdl-hs-minor-mode 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12531
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12532 (defun vhdl-hs-minor-mode (&optional arg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12533 "Toggle hideshow minor mode and update menu bar."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12534 (interactive "P")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12535 (require 'hideshow)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12536 ;; check for hideshow version 5.x
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12537 (if (not (boundp 'hs-block-start-mdata-select))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12538 (vhdl-warning-when-idle "Install included `hideshow.el' patch first (see INSTALL file)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12539 ;; initialize hideshow
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12540 (unless (assoc 'vhdl-mode hs-special-modes-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12541 (setq hs-special-modes-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12542 (cons (list 'vhdl-mode vhdl-hs-start-regexp nil "--\\( \\|$\\)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12543 'vhdl-hs-forward-sexp-func nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12544 hs-special-modes-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12545 (make-local-variable 'hs-minor-mode-hook)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12546 (if vhdl-hide-all-init
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12547 (add-hook 'hs-minor-mode-hook 'hs-hide-all)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12548 (remove-hook 'hs-minor-mode-hook 'hs-hide-all))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12549 (hs-minor-mode arg)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12550 (vhdl-mode-line-update))) ; hack to update menu bar
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12551
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12552
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12553 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12554 ;;; Font locking
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12555 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12556 ;; (using `font-lock.el')
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12557
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12558 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12559 ;; Help functions
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12560
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12561 (defun vhdl-within-translate-off ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12562 "Return point if within translate-off region, else nil."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12563 (and (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12564 (re-search-backward
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12565 "^\\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
12566 (equal "off" (match-string 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12567 (point)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12568
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12569 (defun vhdl-start-translate-off (limit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12570 "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
12571 (when (re-search-forward
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12572 "^\\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
12573 (match-beginning 0)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12574
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12575 (defun vhdl-end-translate-off (limit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12576 "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
12577 (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
12578
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12579 (defun vhdl-match-translate-off (limit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12580 "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
12581 (when (< (point) limit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12582 (let ((start (or (vhdl-within-translate-off)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12583 (vhdl-start-translate-off limit)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12584 (case-fold-search t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12585 (when start
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12586 (let ((end (or (vhdl-end-translate-off limit) limit)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12587 (set-match-data (list start end))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12588 (goto-char end))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12589
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12590 (defun vhdl-font-lock-match-item (limit)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
12591 "Match, and move over, any declaration item after point. Adapted from
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12592 `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
12593 (condition-case nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12594 (save-restriction
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12595 (narrow-to-region (point-min) limit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12596 ;; match item
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12597 (when (looking-at "\\s-*\\([a-zA-Z]\\w*\\)")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12598 (save-match-data
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12599 (goto-char (match-end 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12600 ;; move to next item
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12601 (if (looking-at "\\(\\s-*,\\)")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12602 (goto-char (match-end 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12603 (end-of-line) t))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12604 (error t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12605
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12606 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12607 ;; Syntax definitions
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12608
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12609 (defconst vhdl-font-lock-syntactic-keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12610 '(("\\(\'\\).\\(\'\\)" (1 (7 . ?\')) (2 (7 . ?\'))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12611 "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
12612
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12613 (defvar vhdl-font-lock-keywords nil
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12614 "Regular expressions to highlight in VHDL Mode.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12615
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12616 (defvar vhdl-font-lock-keywords-0
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12617 ;; set in `vhdl-font-lock-init' because dependent on user options
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12618 "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
12619 This does highlighting of template prompts and directives (pragmas).")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12620
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12621 (defvar vhdl-font-lock-keywords-1 nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12622 ;; set in `vhdl-font-lock-init' because dependent on user options
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12623 "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
12624 This does highlighting of keywords and standard identifiers.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12625
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12626 (defconst vhdl-font-lock-keywords-2
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12627 (list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12628 ;; highlight names of units, subprograms, and components when declared
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12629 (list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12630 (concat
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12631 "^\\s-*\\("
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12632 "architecture\\|configuration\\|entity\\|package\\(\\s-+body\\)?\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12633 "\\(\\(impure\\|pure\\)\\s-+\\)?function\\|procedure\\|component"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12634 "\\)\\s-+\\(\\w+\\)")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12635 5 'font-lock-function-name-face)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12636
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12637 ;; highlight entity names of architectures and configurations
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12638 (list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12639 "^\\s-*\\(architecture\\|configuration\\)\\s-+\\w+\\s-+of\\s-+\\(\\w+\\)"
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12640 2 'font-lock-function-name-face)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12641
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12642 ;; highlight labels of common constructs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12643 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12644 (concat
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12645 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n]*\\(\\("
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12646 "assert\\|block\\|case\\|exit\\|for\\|if\\|loop\\|next\\|null\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12647 "postponed\\|process\\|"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12648 (when (vhdl-standard-p 'ams) "procedural\\|")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12649 "with\\|while"
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12650 "\\)\\>\\|\\w+\\s-*\\(([^\n]*)\\|\\.\\w+\\)*\\s-*<=\\)")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12651 1 'font-lock-function-name-face)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12652
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12653 ;; highlight label and component name of component instantiations
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12654 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12655 (concat
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12656 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n]*\\(\\w+\\)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12657 "\\(\\s-*\\(--[^\n]*\\)?$\\|\\s-+\\(generic\\|port\\)\\s-+map\\>\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12658 '(1 font-lock-function-name-face) '(2 font-lock-function-name-face))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12659
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12660 ;; highlight label and instantiated unit of component instantiations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12661 (list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12662 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12663 "^\\s-*\\(\\w+\\)\\s-*:[ \t\n]*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12664 "\\(component\\|configuration\\|entity\\)\\s-+"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12665 "\\(\\w+\\)\\(\\.\\(\\w+\\)\\)?\\(\\s-*(\\(\\w+\\))\\)?")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12666 '(1 font-lock-function-name-face) '(3 font-lock-function-name-face)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12667 '(5 font-lock-function-name-face nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12668 '(7 font-lock-function-name-face nil t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12669
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12670 ;; highlight names and labels at end of constructs
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12671 (list
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12672 (concat
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12673 "^\\s-*end\\s-+\\(\\("
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12674 "architecture\\|block\\|case\\|component\\|configuration\\|entity\\|"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12675 "for\\|function\\|generate\\|if\\|loop\\|package\\(\\s-+body\\)?\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12676 "procedure\\|\\(postponed\\s-+\\)?process\\|"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12677 (when (vhdl-standard-p 'ams) "procedural\\|")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12678 "units"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12679 "\\)\\s-+\\)?\\(\\w*\\)")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12680 5 'font-lock-function-name-face)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12681
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12682 ;; highlight labels in exit and next statements
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12683 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12684 (concat
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12685 "^\\s-*\\(\\w+\\s-*:\\s-*\\)?\\(exit\\|next\\)\\s-+\\(\\w*\\)")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12686 3 'font-lock-function-name-face)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12687
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12688 ;; highlight entity name in attribute specifications
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12689 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12690 (concat
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12691 "^\\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
12692 1 'font-lock-function-name-face)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12693
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12694 ;; highlight labels in block and component specifications
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12695 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12696 (concat
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12697 "^\\s-*for\\s-+\\(\\w+\\(,\\s-*\\w+\\)*\\)\\>\\s-*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12698 "\\(:[ \t\n]*\\(\\w+\\)\\|[^i \t]\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12699 '(1 font-lock-function-name-face) '(4 font-lock-function-name-face nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12700
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12701 ;; highlight names in library clauses
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12702 (list "^\\s-*library\\>"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12703 '(vhdl-font-lock-match-item nil nil (1 font-lock-function-name-face)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12704
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12705 ;; highlight names in use clauses
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12706 (list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12707 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12708 "\\<use\\s-+\\(\\(entity\\|configuration\\)\\s-+\\)?"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12709 "\\(\\w+\\)\\(\\.\\(\\w+\\)\\)?\\((\\(\\w+\\))\\)?")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12710 '(3 font-lock-function-name-face) '(5 font-lock-function-name-face nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12711 '(7 font-lock-function-name-face nil t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12712
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12713 ;; highlight attribute name in attribute declarations/specifications
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12714 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12715 (concat
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12716 "^\\s-*attribute\\s-+\\(\\w+\\)")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12717 1 'vhdl-font-lock-attribute-face)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12718
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12719 ;; 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
12720 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12721 (concat
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12722 "^\\s-*\\(sub\\)?\\(nature\\|type\\)\\s-+\\(\\w+\\)")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12723 3 'font-lock-type-face)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12724
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12725 ;; highlight signal/variable/constant declaration names
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12726 (list "\\(:[^=]\\)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12727 '(vhdl-font-lock-match-item
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12728 (progn (goto-char (match-beginning 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12729 (skip-syntax-backward " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12730 (skip-syntax-backward "w_")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12731 (skip-syntax-backward " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12732 (while (= (preceding-char) ?,)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12733 (backward-char 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12734 (skip-syntax-backward " ")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12735 (skip-syntax-backward "w_")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12736 (skip-syntax-backward " ")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12737 ; (skip-chars-backward "^-(\n\";")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12738 (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
12739
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12740 ;; highlight formal parameters in component instantiations and subprogram
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12741 ;; calls
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12742 (list "\\(=>\\)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12743 '(vhdl-font-lock-match-item
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12744 (progn (goto-char (match-beginning 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12745 (skip-syntax-backward " ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12746 (while (= (preceding-char) ?\)) (backward-sexp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12747 (skip-syntax-backward "w_")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12748 (skip-syntax-backward " ")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12749 (when (memq (preceding-char) '(?n ?N ?|))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12750 (goto-char (point-max))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12751 (goto-char (match-end 1)) (1 font-lock-variable-name-face)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12752
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12753 ;; highlight alias/group/quantity declaration names and for-loop/-generate
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12754 ;; variables
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12755 (list "\\<\\(alias\\|for\\|group\\|quantity\\)\\s-+\\w+\\s-+\\(across\\|in\\|is\\)\\>"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12756 '(vhdl-font-lock-match-item
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12757 (progn (goto-char (match-end 1)) (match-beginning 2))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12758 nil (1 font-lock-variable-name-face)))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12759 )
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12760 "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
12761 This does context sensitive highlighting of names and labels.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12762
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12763 (defvar vhdl-font-lock-keywords-3 nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12764 ;; set in `vhdl-font-lock-init' because dependent on user options
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12765 "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
12766 This does highlighting of words with special syntax.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12767
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12768 (defvar vhdl-font-lock-keywords-4 nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12769 ;; set in `vhdl-font-lock-init' because dependent on user options
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12770 "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
12771 This does highlighting of additional reserved words.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12772
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12773 (defconst vhdl-font-lock-keywords-5
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12774 ;; background highlight translate-off regions
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12775 '((vhdl-match-translate-off (0 vhdl-font-lock-translate-off-face append)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12776 "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
12777 This does background highlighting of translate-off regions.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12778
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12779 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12780 ;; Font and color definitions
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12781
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12782 (defvar vhdl-font-lock-prompt-face 'vhdl-font-lock-prompt-face
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12783 "Face name to use for prompts.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12784
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12785 (defvar vhdl-font-lock-attribute-face 'vhdl-font-lock-attribute-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12786 "Face name to use for standardized attributes.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12787
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12788 (defvar vhdl-font-lock-enumvalue-face 'vhdl-font-lock-enumvalue-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12789 "Face name to use for standardized enumeration values.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12790
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12791 (defvar vhdl-font-lock-function-face 'vhdl-font-lock-function-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12792 "Face name to use for standardized functions and packages.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12793
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12794 (defvar vhdl-font-lock-directive-face 'vhdl-font-lock-directive-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12795 "Face name to use for directives.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12796
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12797 (defvar vhdl-font-lock-reserved-words-face 'vhdl-font-lock-reserved-words-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12798 "Face name to use for additional reserved words.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12799
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12800 (defvar vhdl-font-lock-translate-off-face 'vhdl-font-lock-translate-off-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12801 "Face name to use for translate-off regions.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12802
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12803 ;; face names to use for words with special syntax.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12804 (let ((syntax-alist vhdl-special-syntax-alist)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12805 name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12806 (while syntax-alist
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12807 (setq name (vhdl-function-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12808 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face"))
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12809 (eval `(defvar ,name ',name
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12810 ,(concat "Face name to use for "
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12811 (nth 0 (car syntax-alist)) ".")))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12812 (setq syntax-alist (cdr syntax-alist))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12813
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12814 (defgroup vhdl-highlight-faces nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12815 "Faces for highlighting."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12816 :group 'vhdl-highlight)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12817
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12818 ;; add faces used from `font-lock'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12819 (custom-add-to-group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12820 'vhdl-highlight-faces 'font-lock-comment-face 'custom-face)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12821 (custom-add-to-group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12822 'vhdl-highlight-faces 'font-lock-string-face 'custom-face)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12823 (custom-add-to-group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12824 'vhdl-highlight-faces 'font-lock-keyword-face 'custom-face)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12825 (custom-add-to-group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12826 'vhdl-highlight-faces 'font-lock-type-face 'custom-face)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12827 (custom-add-to-group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12828 'vhdl-highlight-faces 'font-lock-function-name-face 'custom-face)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12829 (custom-add-to-group
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12830 'vhdl-highlight-faces 'font-lock-variable-name-face 'custom-face)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12831
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12832 (defface vhdl-font-lock-prompt-face
65314
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 65302
diff changeset
12833 '((((min-colors 88) (class color) (background light))
61394
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 60925
diff changeset
12834 (:foreground "Red1" :bold t))
65314
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 65302
diff changeset
12835 (((class color) (background light)) (:foreground "Red" :bold t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12836 (((class color) (background dark)) (:foreground "Pink" :bold t))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12837 (t (:inverse-video t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12838 "Font lock mode face used to highlight prompts."
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12839 :group 'vhdl-highlight-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12840
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12841 (defface vhdl-font-lock-attribute-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12842 '((((class color) (background light)) (:foreground "Orchid"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12843 (((class color) (background dark)) (:foreground "LightSteelBlue"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12844 (t (:italic t :bold t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12845 "Font lock mode face used to highlight standardized attributes."
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12846 :group 'vhdl-highlight-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12847
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12848 (defface vhdl-font-lock-enumvalue-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12849 '((((class color) (background light)) (:foreground "SaddleBrown"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12850 (((class color) (background dark)) (:foreground "BurlyWood"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12851 (t (:italic t :bold t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12852 "Font lock mode face used to highlight standardized enumeration values."
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12853 :group 'vhdl-highlight-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12854
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12855 (defface vhdl-font-lock-function-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12856 '((((class color) (background light)) (:foreground "Cyan4"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12857 (((class color) (background dark)) (:foreground "Orchid1"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12858 (t (:italic t :bold t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12859 "Font lock mode face used to highlight standardized functions and packages."
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12860 :group 'vhdl-highlight-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12861
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12862 (defface vhdl-font-lock-directive-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12863 '((((class color) (background light)) (:foreground "CadetBlue"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12864 (((class color) (background dark)) (:foreground "Aquamarine"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12865 (t (:italic t :bold t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12866 "Font lock mode face used to highlight directives."
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12867 :group 'vhdl-highlight-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12868
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12869 (defface vhdl-font-lock-reserved-words-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12870 '((((class color) (background light)) (:foreground "Orange" :bold t))
63428
252224857a7b (vhdl-speedbar-place-component): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents: 62917
diff changeset
12871 (((min-colors 88) (class color) (background dark))
61394
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 60925
diff changeset
12872 (:foreground "Yellow1" :bold t))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12873 (((class color) (background dark)) (:foreground "Yellow" :bold t))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12874 (t ()))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12875 "Font lock mode face used to highlight additional reserved words."
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12876 :group 'vhdl-highlight-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12877
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12878 (defface vhdl-font-lock-translate-off-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12879 '((((class color) (background light)) (:background "LightGray"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12880 (((class color) (background dark)) (:background "DimGray"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12881 (t ()))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12882 "Font lock mode face used to background highlight translate-off regions."
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12883 :group 'vhdl-highlight-faces)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12884
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12885 ;; 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
12886 (let ((syntax-alist vhdl-special-syntax-alist))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12887 (while syntax-alist
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12888 (eval `(defface ,(vhdl-function-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12889 "vhdl-font-lock" (caar syntax-alist) "face")
26464
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12890 '((((class color) (background light))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12891 (:foreground ,(nth 2 (car syntax-alist))))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12892 (((class color) (background dark))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12893 (:foreground ,(nth 3 (car syntax-alist))))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12894 (t ()))
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12895 ,(concat "Font lock mode face used to highlight "
7abca91f0853 Use new backquote syntax.
Gerd Moellmann <gerd@gnu.org>
parents: 24835
diff changeset
12896 (nth 0 (car syntax-alist)) ".")
65735
9bfed8eb991b (vhdl-font-lock-prompt-face)
Juri Linkov <juri@jurta.org>
parents: 65584
diff changeset
12897 :group 'vhdl-highlight-faces))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12898 (setq syntax-alist (cdr syntax-alist))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12899
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12900 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12901 ;; Font lock initialization
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12902
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12903 (defun vhdl-font-lock-init ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12904 "Initialize fontification."
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12905 ;; highlight template prompts and directives
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12906 (setq vhdl-font-lock-keywords-0
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12907 (list (list (concat "\\(^\\|[ \t(.']\\)\\(<"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12908 vhdl-template-prompt-syntax ">\\)")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12909 2 'vhdl-font-lock-prompt-face t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12910 (list (concat "--\\s-*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12911 vhdl-directive-keywords-regexp "\\s-+\\(.*\\)$")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12912 2 'vhdl-font-lock-directive-face t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12913 ;; highlight c-preprocessor directives
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12914 (list "^#[ \t]*\\(\\w+\\)\\([ \t]+\\(\\w+\\)\\)?"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12915 '(1 font-lock-builtin-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12916 '(3 font-lock-variable-name-face nil t))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12917 ;; highlight keywords and standardized types, attributes, enumeration
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12918 ;; values, and subprograms
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12919 (setq vhdl-font-lock-keywords-1
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12920 (list
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12921 (list (concat "'" vhdl-attributes-regexp)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12922 1 'vhdl-font-lock-attribute-face)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12923 (list vhdl-types-regexp 1 'font-lock-type-face)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12924 (list vhdl-functions-regexp 1 'vhdl-font-lock-function-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12925 (list vhdl-packages-regexp 1 'vhdl-font-lock-function-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12926 (list vhdl-enum-values-regexp 1 'vhdl-font-lock-enumvalue-face)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12927 (list vhdl-keywords-regexp 1 'font-lock-keyword-face)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12928 ;; highlight words with special syntax.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12929 (setq vhdl-font-lock-keywords-3
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12930 (let ((syntax-alist vhdl-special-syntax-alist)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12931 keywords)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12932 (while syntax-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12933 (setq keywords
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12934 (cons
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12935 (cons (concat "\\<\\(" (nth 1 (car syntax-alist)) "\\)\\>")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12936 (vhdl-function-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12937 "vhdl-font-lock" (nth 0 (car syntax-alist)) "face"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12938 keywords))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12939 (setq syntax-alist (cdr syntax-alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12940 keywords))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12941 ;; highlight additional reserved words
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12942 (setq vhdl-font-lock-keywords-4
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12943 (list (list vhdl-reserved-words-regexp 1
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12944 'vhdl-font-lock-reserved-words-face)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12945 ;; highlight everything together
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12946 (setq vhdl-font-lock-keywords
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12947 (append
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12948 vhdl-font-lock-keywords-0
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12949 (when vhdl-highlight-keywords vhdl-font-lock-keywords-1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12950 (when (or vhdl-highlight-forbidden-words
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12951 vhdl-highlight-verilog-keywords) vhdl-font-lock-keywords-4)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12952 (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
12953 (when vhdl-highlight-names vhdl-font-lock-keywords-2)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12954 (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
12955
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12956 ;; initialize fontification for VHDL Mode
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12957 (vhdl-font-lock-init)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12958
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12959 (defun vhdl-fontify-buffer ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12960 "Re-initialize fontification and fontify buffer."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12961 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12962 (setq font-lock-defaults
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12963 (list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12964 'vhdl-font-lock-keywords nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12965 (not vhdl-highlight-case-sensitive) '((?\_ . "w")) 'beginning-of-line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12966 '(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12967 (when (fboundp 'font-lock-unset-defaults)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12968 (font-lock-unset-defaults)) ; not implemented in XEmacs
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12969 (font-lock-set-defaults)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12970 (font-lock-mode nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
12971 (font-lock-mode t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12972
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12973 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12974 ;; Initialization for postscript printing
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12975
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12976 (defun vhdl-ps-print-settings ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12977 "Initialize custom face and page settings for postscript printing."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12978 ;; define custom face settings
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12979 (unless (or (not vhdl-print-customize-faces)
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12980 ps-print-color-p)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12981 (set (make-local-variable 'ps-bold-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12982 '(font-lock-keyword-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12983 font-lock-type-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12984 vhdl-font-lock-attribute-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12985 vhdl-font-lock-enumvalue-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12986 vhdl-font-lock-directive-face))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12987 (set (make-local-variable 'ps-italic-faces)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12988 '(font-lock-comment-face
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12989 font-lock-function-name-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12990 font-lock-type-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12991 vhdl-font-lock-attribute-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12992 vhdl-font-lock-enumvalue-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
12993 vhdl-font-lock-directive-face))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12994 (set (make-local-variable 'ps-underlined-faces)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12995 '(font-lock-string-face))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12996 (setq ps-always-build-face-reference t))
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12997 ;; define page settings, so that a line containing 79 characters (default)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12998 ;; fits into one column
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
12999 (when vhdl-print-two-column
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13000 (set (make-local-variable 'ps-landscape-mode) t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13001 (set (make-local-variable 'ps-number-of-columns) 2)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13002 (set (make-local-variable 'ps-font-size) 7.0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13003 (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
13004 (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
13005 (set (make-local-variable 'ps-header-offset) 12.0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13006 (when (eq ps-paper-type 'letter)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13007 (set (make-local-variable 'ps-inter-column) 40.0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13008 (set (make-local-variable 'ps-left-margin) 40.0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13009 (set (make-local-variable 'ps-right-margin) 40.0))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13010
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13011 (defun vhdl-ps-print-init ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13012 "Initialize postscript printing."
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
13013 (if (featurep 'xemacs)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13014 (when (boundp 'ps-print-color-p)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13015 (vhdl-ps-print-settings))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13016 (make-local-variable 'ps-print-hook)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13017 (add-hook 'ps-print-hook 'vhdl-ps-print-settings)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13018
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13019
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13020 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13021 ;;; Hierarchy browser (using `speedbar.el')
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13022 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13023 ;; 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
13024 ;; directory by using the speedbar.
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13025
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13026 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13027 ;; Variables
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13028
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13029 (defvar vhdl-entity-alist nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13030 "Cache with entities and corresponding architectures for each
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13031 project/directory.")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13032 ;; structure: (parenthesised expression means list of such entries)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13033 ;; (cache-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13034 ;; (ent-key ent-name ent-file ent-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13035 ;; (arch-key arch-name arch-file arch-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13036 ;; (inst-key inst-name inst-file inst-line inst-comp-name inst-ent-key
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13037 ;; inst-arch-key inst-conf-key inst-lib-key inst-path)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13038 ;; (lib-name pack-key))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13039 ;; mra-key (lib-name pack-key))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13040
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13041 (defvar vhdl-config-alist nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13042 "Cache with configurations for each project/directory.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13043 ;; structure: (parenthesised expression means list of such entries)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13044 ;; (cache-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13045 ;; (conf-key conf-name conf-file conf-line ent-key arch-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13046 ;; (inst-key inst-comp-name inst-ent-key inst-arch-key
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13047 ;; inst-conf-key inst-lib-key)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13048 ;; (lib-name pack-key)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13049
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13050 (defvar vhdl-package-alist nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13051 "Cache with packages for each project/directory.")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13052 ;; structure: (parenthesised expression means list of such entries)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13053 ;; (cache-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13054 ;; (pack-key pack-name pack-file pack-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13055 ;; (comp-key comp-name comp-file comp-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13056 ;; (func-key func-name func-file func-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13057 ;; (lib-name pack-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13058 ;; pack-body-file pack-body-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13059 ;; (func-key func-name func-body-file func-body-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13060 ;; (lib-name pack-key)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13061
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13062 (defvar vhdl-ent-inst-alist nil
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13063 "Cache with instantiated entities for each project/directory.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13064 ;; structure: (parenthesised expression means list of such entries)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13065 ;; (cache-key (inst-ent-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13066
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13067 (defvar vhdl-file-alist nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13068 "Cache with design units in each file for each project/directory.")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13069 ;; structure: (parenthesised expression means list of such entries)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13070 ;; (cache-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13071 ;; (file-name (ent-list) (arch-list) (arch-ent-list) (conf-list)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13072 ;; (pack-list) (pack-body-list) (inst-list) (inst-ent-list))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13073
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13074 (defvar vhdl-directory-alist nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13075 "Cache with source directories for each project.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13076 ;; structure: (parenthesised expression means list of such entries)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13077 ;; (cache-key (directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13078
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13079 (defvar vhdl-speedbar-shown-unit-alist nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13080 "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
13081 directory and project.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13082
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13083 (defvar vhdl-speedbar-shown-project-list nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13084 "List of projects simultaneously open in the current speedbar.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13085
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13086 (defvar vhdl-updated-project-list nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13087 "List of projects and directories with updated files.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13088
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13089 (defvar vhdl-modified-file-list nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13090 "List of modified files to be rescanned for hierarchy updating.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13091
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13092 (defvar vhdl-speedbar-hierarchy-depth 0
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13093 "Depth of instantiation hierarchy to display.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13094
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13095 (defvar vhdl-speedbar-show-projects nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13096 "Non-nil means project hierarchy is displayed in speedbar, directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13097 hierarchy otherwise.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13098
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13099 (defun vhdl-get-end-of-unit ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13100 "Return position of end of current unit."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13101 (let ((pos (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13102 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13103 (while (and (re-search-forward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13104 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13105 (goto-char (match-beginning 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13106 (vhdl-backward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13107 (and (/= (preceding-char) ?\;) (not (bobp))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13108 (re-search-backward "^[ \t]*end\\>" pos 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13109 (point))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13110
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13111 (defun vhdl-match-string-downcase (num &optional string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13112 "Like `match-string-no-properties' with down-casing."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13113 (let ((match (match-string-no-properties num string)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13114 (and match (downcase match))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13115
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13116
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13117 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13118 ;; Scan functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13119
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13120 (defun vhdl-scan-context-clause ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13121 "Scan the context clause that preceeds a design unit."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13122 (let (lib-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13123 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13124 (when (re-search-backward "^[ \t]*\\(architecture\\|configuration\\|entity\\|package\\)\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13125 (while (and (re-search-backward "^[ \t]*\\(end\\|use\\)\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13126 (equal "USE" (upcase (match-string 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13127 (when (looking-at "^[ \t]*use[ \t\n]*\\(\\w+\\)\\.\\(\\w+\\)\\.\\w+")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13128 (setq lib-alist (cons (cons (match-string-no-properties 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13129 (vhdl-match-string-downcase 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13130 lib-alist))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13131 lib-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13132
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13133 (defun vhdl-scan-directory-contents (name &optional project update num-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13134 non-final)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
13135 "Scan contents of VHDL files in directory or file pattern NAME."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13136 (string-match "\\(.*[/\\]\\)\\(.*\\)" name)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13137 ; (unless (file-directory-p (match-string 1 name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13138 ; (message "No such directory: \"%s\"" (match-string 1 name)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13139 (let* ((dir-name (match-string 1 name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13140 (file-pattern (match-string 2 name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13141 (is-directory (= 0 (length file-pattern)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13142 (file-list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13143 (if update
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13144 (list name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13145 (if is-directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13146 (vhdl-get-source-files t dir-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13147 (vhdl-directory-files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13148 dir-name t (wildcard-to-regexp file-pattern)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13149 (key (or project dir-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13150 (file-exclude-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13151 (or (nth 3 (aget vhdl-project-alist project)) ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13152 (limit-design-file-size (nth 0 vhdl-speedbar-scan-limit))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13153 (limit-hier-file-size (nth 0 (nth 1 vhdl-speedbar-scan-limit)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13154 (limit-hier-inst-no (nth 1 (nth 1 vhdl-speedbar-scan-limit)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13155 ent-alist conf-alist pack-alist ent-inst-list file-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13156 tmp-list tmp-entry no-files files-exist big-files)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13157 (when (or project update)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13158 (setq ent-alist (aget vhdl-entity-alist key t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13159 conf-alist (aget vhdl-config-alist key t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13160 pack-alist (aget vhdl-package-alist key t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13161 ent-inst-list (car (aget vhdl-ent-inst-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13162 file-alist (aget vhdl-file-alist key t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13163 (when (and (not is-directory) (null file-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13164 (message "No such file: \"%s\"" name))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13165 (setq files-exist file-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13166 (when file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13167 (setq no-files (length file-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13168 (message "Scanning %s %s\"%s\"..."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13169 (if is-directory "directory" "files") (or num-string "") name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13170 ;; exclude files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13171 (unless (equal file-exclude-regexp "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13172 (let ((case-fold-search nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13173 file-tmp-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13174 (while file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13175 (unless (string-match file-exclude-regexp (car file-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13176 (setq file-tmp-list (cons (car file-list) file-tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13177 (setq file-list (cdr file-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13178 (setq file-list (nreverse file-tmp-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13179 ;; do for all files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13180 (while file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13181 (unless noninteractive
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13182 (message "Scanning %s %s\"%s\"... (%2d%s)"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13183 (if is-directory "directory" "files")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13184 (or num-string "") name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13185 (/ (* 100 (- no-files (length file-list))) no-files) "%"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13186 (let ((file-name (abbreviate-file-name (car file-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13187 ent-list arch-list arch-ent-list conf-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13188 pack-list pack-body-list inst-list inst-ent-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13189 ;; scan file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13190 (vhdl-visit-file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13191 file-name nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13192 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13193 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13194 ;; scan for design units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13195 (if (and limit-design-file-size
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13196 (< limit-design-file-size (buffer-size)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13197 (progn (message "WARNING: Scan limit (design units: file size) reached in file:\n \"%s\"" file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13198 (setq big-files t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13199 ;; scan for entities
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13200 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13201 (while (re-search-forward "^[ \t]*entity[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13202 (let* ((ent-name (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13203 (ent-key (downcase ent-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13204 (ent-entry (aget ent-alist ent-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13205 (lib-alist (vhdl-scan-context-clause)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13206 (if (nth 1 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13207 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13208 "Entity declared twice (used 1.): \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13209 ent-name (nth 1 ent-entry) (nth 2 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13210 file-name (vhdl-current-line))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13211 (setq ent-list (cons ent-key ent-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13212 (aput 'ent-alist ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13213 (list ent-name file-name (vhdl-current-line)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13214 (nth 3 ent-entry) (nth 4 ent-entry)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13215 lib-alist)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13216 ;; scan for architectures
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13217 (goto-char (point-min))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13218 (while (re-search-forward "^[ \t]*architecture[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13219 (let* ((arch-name (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13220 (arch-key (downcase arch-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13221 (ent-name (match-string-no-properties 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13222 (ent-key (downcase ent-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13223 (ent-entry (aget ent-alist ent-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13224 (arch-alist (nth 3 ent-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13225 (arch-entry (aget arch-alist arch-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13226 (lib-arch-alist (vhdl-scan-context-clause)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13227 (if arch-entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13228 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13229 "Architecture declared twice (used 1.): \"%s\" of \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13230 arch-name ent-name (nth 1 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13231 (nth 2 arch-entry) file-name (vhdl-current-line))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13232 (setq arch-list (cons arch-key arch-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13233 arch-ent-list (cons ent-key arch-ent-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13234 (aput 'arch-alist arch-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13235 (list arch-name file-name (vhdl-current-line) nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13236 lib-arch-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13237 (aput 'ent-alist ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13238 (list (or (nth 0 ent-entry) ent-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13239 (nth 1 ent-entry) (nth 2 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13240 (vhdl-sort-alist arch-alist)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13241 arch-key (nth 5 ent-entry))))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13242 ;; scan for configurations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13243 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13244 (while (re-search-forward "^[ \t]*configuration[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13245 (let* ((conf-name (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13246 (conf-key (downcase conf-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13247 (conf-entry (aget conf-alist conf-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13248 (ent-name (match-string-no-properties 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13249 (ent-key (downcase ent-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13250 (lib-alist (vhdl-scan-context-clause))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13251 (conf-line (vhdl-current-line))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13252 (end-of-unit (vhdl-get-end-of-unit))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13253 arch-key comp-conf-list inst-key-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13254 inst-comp-key inst-ent-key inst-arch-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13255 inst-conf-key inst-lib-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13256 (when (vhdl-re-search-forward "\\<for[ \t\n]+\\(\\w+\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13257 (setq arch-key (vhdl-match-string-downcase 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13258 (if conf-entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13259 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13260 "Configuration declared twice (used 1.): \"%s\" of \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13261 conf-name ent-name (nth 1 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13262 (nth 2 conf-entry) file-name conf-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13263 (setq conf-list (cons conf-key conf-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13264 ;; scan for subconfigurations and subentities
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13265 (while (re-search-forward "^[ \t]*for[ \t\n]+\\(\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*\\)[ \t\n]*:[ \t\n]*\\(\\w+\\)[ \t\n]+" end-of-unit t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13266 (setq inst-comp-key (vhdl-match-string-downcase 3)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13267 inst-key-list (split-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13268 (vhdl-match-string-downcase 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13269 "[ \t\n]*,[ \t\n]*"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13270 (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13271 (when (looking-at "use[ \t\n]+\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\w+\\)\\.\\(\\w+\\)[ \t\n]*\\((\\(\\w+\\))\\)?")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13272 (setq
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13273 inst-lib-key (vhdl-match-string-downcase 3)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13274 inst-ent-key (and (match-string 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13275 (vhdl-match-string-downcase 4))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13276 inst-arch-key (and (match-string 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13277 (vhdl-match-string-downcase 6))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13278 inst-conf-key (and (not (match-string 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13279 (vhdl-match-string-downcase 4)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13280 (while inst-key-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13281 (setq comp-conf-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13282 (cons (list (car inst-key-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13283 inst-comp-key inst-ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13284 inst-arch-key inst-conf-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13285 inst-lib-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13286 comp-conf-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13287 (setq inst-key-list (cdr inst-key-list)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13288 (aput 'conf-alist conf-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13289 (list conf-name file-name conf-line ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13290 arch-key comp-conf-list lib-alist)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13291 ;; scan for packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13292 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13293 (while (re-search-forward "^[ \t]*package[ \t\n]+\\(body[ \t\n]+\\)?\\(\\w+\\)[ \t\n]+is\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13294 (let* ((pack-name (match-string-no-properties 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13295 (pack-key (downcase pack-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13296 (is-body (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13297 (pack-entry (aget pack-alist pack-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13298 (pack-line (vhdl-current-line))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13299 (end-of-unit (vhdl-get-end-of-unit))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13300 comp-name func-name comp-alist func-alist lib-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13301 (if (if is-body (nth 6 pack-entry) (nth 1 pack-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13302 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13303 "Package%s declared twice (used 1.): \"%s\"\n 1. in \"%s\" (line %d)\n 2. in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13304 (if is-body " body" "") pack-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13305 (if is-body (nth 6 pack-entry) (nth 1 pack-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13306 (if is-body (nth 7 pack-entry) (nth 2 pack-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13307 file-name (vhdl-current-line))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13308 ;; scan for context clauses
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13309 (setq lib-alist (vhdl-scan-context-clause))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13310 ;; scan for component and subprogram declarations/bodies
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13311 (while (re-search-forward "^[ \t]*\\(component\\|function\\|procedure\\)[ \t\n]+\\(\\w+\\|\".*\"\\)" end-of-unit t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13312 (if (equal (upcase (match-string 1)) "COMPONENT")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13313 (setq comp-name (match-string-no-properties 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13314 comp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13315 (cons (list (downcase comp-name) comp-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13316 file-name (vhdl-current-line))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13317 comp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13318 (setq func-name (match-string-no-properties 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13319 func-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13320 (cons (list (downcase func-name) func-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13321 file-name (vhdl-current-line))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13322 func-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13323 (setq func-alist (nreverse func-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13324 (setq comp-alist (nreverse comp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13325 (if is-body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13326 (setq pack-body-list (cons pack-key pack-body-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13327 (setq pack-list (cons pack-key pack-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13328 (aput
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13329 'pack-alist pack-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13330 (if is-body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13331 (list (or (nth 0 pack-entry) pack-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13332 (nth 1 pack-entry) (nth 2 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13333 (nth 3 pack-entry) (nth 4 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13334 (nth 5 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13335 file-name pack-line func-alist lib-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13336 (list pack-name file-name pack-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13337 comp-alist func-alist lib-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13338 (nth 6 pack-entry) (nth 7 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13339 (nth 8 pack-entry) (nth 9 pack-entry))))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13340 ;; scan for hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13341 (if (and limit-hier-file-size
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13342 (< limit-hier-file-size (buffer-size)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13343 (progn (message "WARNING: Scan limit (hierarchy: file size) reached in file:\n \"%s\"" file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13344 (setq big-files t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13345 ;; scan for architectures
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13346 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13347 (while (re-search-forward "^[ \t]*architecture[ \t\n]+\\(\\w+\\)[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13348 (let* ((ent-name (match-string-no-properties 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13349 (ent-key (downcase ent-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13350 (arch-name (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13351 (arch-key (downcase arch-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13352 (ent-entry (aget ent-alist ent-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13353 (arch-alist (nth 3 ent-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13354 (arch-entry (aget arch-alist arch-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13355 (beg-of-unit (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13356 (end-of-unit (vhdl-get-end-of-unit))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13357 (inst-no 0)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13358 inst-alist inst-path)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13359 ;; scan for contained instantiations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13360 (while (and (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13361 (concat "^[ \t]*\\(\\w+\\)[ \t\n]*:[ \t\n]*\\("
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13362 "\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(generic\\|port\\)[ \t\n]+map\\>\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13363 "component[ \t\n]+\\(\\w+\\)\\|"
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13364 "\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?\\|"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13365 "\\(\\(for\\|if\\)\\>[^;:]+\\<generate\\>\\|block\\>\\)\\)\\|"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13366 "\\(^[ \t]*end[ \t\n]+\\(generate\\|block\\)\\>\\)") end-of-unit t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13367 (or (not limit-hier-inst-no)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13368 (<= (setq inst-no (1+ inst-no))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13369 limit-hier-inst-no)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13370 (cond
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13371 ;; block/generate beginning found
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13372 ((match-string 14)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13373 (setq inst-path
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13374 (cons (match-string-no-properties 1) inst-path)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13375 ;; block/generate end found
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13376 ((match-string 16)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13377 (setq inst-path (cdr inst-path)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13378 ;; instantiation found
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13379 (t
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13380 (let* ((inst-name (match-string-no-properties 1))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13381 (inst-key (downcase inst-name))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13382 (inst-comp-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13383 (or (match-string-no-properties 3)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13384 (match-string-no-properties 6)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13385 (inst-ent-key
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13386 (or (and (match-string 8)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13387 (vhdl-match-string-downcase 11))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13388 (and inst-comp-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13389 (downcase inst-comp-name))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13390 (inst-arch-key (vhdl-match-string-downcase 13))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13391 (inst-conf-key
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13392 (and (not (match-string 8))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13393 (vhdl-match-string-downcase 11)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13394 (inst-lib-key (vhdl-match-string-downcase 10)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13395 (goto-char (match-end 1))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13396 (setq inst-list (cons inst-key inst-list)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13397 inst-ent-list
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13398 (cons inst-ent-key inst-ent-list))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13399 (setq inst-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13400 (append
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13401 inst-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13402 (list (list inst-key inst-name file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13403 (vhdl-current-line) inst-comp-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13404 inst-ent-key inst-arch-key
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13405 inst-conf-key inst-lib-key
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13406 (reverse inst-path)))))))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13407 ;; scan for contained configuration specifications
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13408 (goto-char beg-of-unit)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13409 (while (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13410 (concat "^[ \t]*for[ \t\n]+\\(\\w+\\([ \t\n]*,[ \t\n]*\\w+\\)*\\)[ \t\n]*:[ \t\n]*\\(\\w+\\)[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13411 "use[ \t\n]+\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?") end-of-unit t)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13412 (let* ((inst-comp-name (match-string-no-properties 3))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13413 (inst-ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13414 (and (match-string 6)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13415 (vhdl-match-string-downcase 9)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13416 (inst-arch-key (vhdl-match-string-downcase 11))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13417 (inst-conf-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13418 (and (not (match-string 6))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13419 (vhdl-match-string-downcase 9)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13420 (inst-lib-key (vhdl-match-string-downcase 8))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13421 (inst-key-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13422 (split-string (vhdl-match-string-downcase 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13423 "[ \t\n]*,[ \t\n]*"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13424 (tmp-inst-alist inst-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13425 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13426 (while tmp-inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13427 (when (and (or (equal "all" (car inst-key-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13428 (member (nth 0 (car tmp-inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13429 inst-key-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13430 (equal
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13431 (downcase
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13432 (or (nth 4 (car tmp-inst-alist)) ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13433 (downcase inst-comp-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13434 (setq inst-entry (car tmp-inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13435 (setq inst-ent-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13436 (cons (or inst-ent-key (nth 5 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13437 (vhdl-delete
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13438 (nth 5 inst-entry) inst-ent-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13439 (setq inst-entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13440 (list (nth 0 inst-entry) (nth 1 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13441 (nth 2 inst-entry) (nth 3 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13442 (nth 4 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13443 (or inst-ent-key (nth 5 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13444 (or inst-arch-key (nth 6 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13445 inst-conf-key inst-lib-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13446 (setcar tmp-inst-alist inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13447 (setq tmp-inst-alist (cdr tmp-inst-alist)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13448 ;; save in cache
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13449 (aput 'arch-alist arch-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13450 (list (nth 0 arch-entry) (nth 1 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13451 (nth 2 arch-entry) inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13452 (nth 4 arch-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13453 (aput 'ent-alist ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13454 (list (nth 0 ent-entry) (nth 1 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13455 (nth 2 ent-entry) (vhdl-sort-alist arch-alist)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13456 (nth 4 ent-entry) (nth 5 ent-entry)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13457 (when (and limit-hier-inst-no
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13458 (> inst-no limit-hier-inst-no))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13459 (message "WARNING: Scan limit (hierarchy: instances per architecture) reached in file:\n \"%s\"" file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13460 (setq big-files t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13461 (goto-char end-of-unit))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13462 ;; remember design units for this file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13463 (aput 'file-alist file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13464 (list ent-list arch-list arch-ent-list conf-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13465 pack-list pack-body-list inst-list inst-ent-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13466 (setq ent-inst-list (append inst-ent-list ent-inst-list))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13467 (setq file-list (cdr file-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13468 (when (or (and (not project) files-exist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13469 (and project (not non-final)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13470 ;; consistency checks:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13471 ;; check whether each architecture has a corresponding entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13472 (setq tmp-list ent-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13473 (while tmp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13474 (when (null (nth 2 (car tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13475 (setq tmp-entry (car (nth 4 (car tmp-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13476 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13477 "Architecture of non-existing entity: \"%s\" of \"%s\"\n in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13478 (nth 1 tmp-entry) (nth 1 (car tmp-list)) (nth 2 tmp-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13479 (nth 3 tmp-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13480 (setq tmp-list (cdr tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13481 ;; check whether configuration has a corresponding entity/architecture
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13482 (setq tmp-list conf-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13483 (while tmp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13484 (if (setq tmp-entry (aget ent-alist (nth 4 (car tmp-list)) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13485 (unless (aget (nth 3 tmp-entry) (nth 5 (car tmp-list)) t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13486 (setq tmp-entry (car tmp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13487 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13488 "Configuration of non-existing architecture: \"%s\" of \"%s(%s)\"\n in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13489 (nth 1 tmp-entry) (nth 4 tmp-entry) (nth 5 tmp-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13490 (nth 2 tmp-entry) (nth 3 tmp-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13491 (setq tmp-entry (car tmp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13492 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13493 "Configuration of non-existing entity: \"%s\" of \"%s\"\n in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13494 (nth 1 tmp-entry) (nth 4 tmp-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13495 (nth 2 tmp-entry) (nth 3 tmp-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13496 (setq tmp-list (cdr tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13497 ;; check whether each package body has a package declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13498 (setq tmp-list pack-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13499 (while tmp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13500 (when (null (nth 2 (car tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13501 (setq tmp-entry (car tmp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13502 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13503 "Package body of non-existing package: \"%s\"\n in \"%s\" (line %d)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13504 (nth 1 tmp-entry) (nth 7 tmp-entry) (nth 8 tmp-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13505 (setq tmp-list (cdr tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13506 ;; sort lists
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13507 (setq ent-alist (vhdl-sort-alist ent-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13508 (setq conf-alist (vhdl-sort-alist conf-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13509 (setq pack-alist (vhdl-sort-alist pack-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13510 ;; remember updated directory/project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13511 (add-to-list 'vhdl-updated-project-list (or project dir-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13512 ;; clear directory alists
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13513 (unless project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13514 (adelete 'vhdl-entity-alist key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13515 (adelete 'vhdl-config-alist key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13516 (adelete 'vhdl-package-alist key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13517 (adelete 'vhdl-ent-inst-alist key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13518 (adelete 'vhdl-file-alist key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13519 ;; put directory contents into cache
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13520 (aput 'vhdl-entity-alist key ent-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13521 (aput 'vhdl-config-alist key conf-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13522 (aput 'vhdl-package-alist key pack-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13523 (aput 'vhdl-ent-inst-alist key (list ent-inst-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13524 (aput 'vhdl-file-alist key file-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13525 ;; final messages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13526 (message "Scanning %s %s\"%s\"...done"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13527 (if is-directory "directory" "files") (or num-string "") name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13528 (unless project (message "Scanning directory...done"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13529 (when big-files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13530 (vhdl-warning-when-idle "Scanning is incomplete.\n --> see user option `vhdl-speedbar-scan-limit'"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13531 ;; save cache when scanned non-interactively
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13532 (when (or (not project) (not non-final))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13533 (when (and noninteractive vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13534 (vhdl-save-cache key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13535 t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13536
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13537 (defun vhdl-scan-project-contents (project)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13538 "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
13539 of PROJECT."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13540 (let ((dir-list (or (nth 2 (aget vhdl-project-alist project)) '("")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13541 (default-dir (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13542 (nth 1 (aget vhdl-project-alist project))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13543 (file-exclude-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13544 (or (nth 3 (aget vhdl-project-alist project)) ""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13545 dir-list-tmp dir dir-name num-dir act-dir recursive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13546 ;; clear project alists
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13547 (adelete 'vhdl-entity-alist project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13548 (adelete 'vhdl-config-alist project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13549 (adelete 'vhdl-package-alist project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13550 (adelete 'vhdl-ent-inst-alist project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13551 (adelete 'vhdl-file-alist project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13552 ;; expand directory names by default-directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13553 (message "Collecting source files...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13554 (while dir-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13555 (setq dir (vhdl-resolve-env-variable (car dir-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13556 (string-match "\\(\\(-r \\)?\\)\\(.*\\)" dir)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13557 (setq recursive (match-string 1 dir)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13558 dir-name (match-string 3 dir))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13559 (setq dir-list-tmp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13560 (cons (concat recursive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13561 (if (file-name-absolute-p dir-name) "" default-dir)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13562 dir-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13563 dir-list-tmp))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13564 (setq dir-list (cdr dir-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13565 ;; resolve path wildcards
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13566 (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
13567 ;; expand directories
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13568 (while dir-list-tmp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13569 (setq dir (car dir-list-tmp))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13570 ;; get subdirectories
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13571 (if (string-match "-r \\(.*[/\\]\\)" dir)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13572 (setq dir-list (append dir-list (vhdl-get-subdirs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13573 (match-string 1 dir))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13574 (setq dir-list (append dir-list (list dir))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13575 (setq dir-list-tmp (cdr dir-list-tmp)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13576 ;; exclude files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13577 (unless (equal file-exclude-regexp "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13578 (let ((case-fold-search nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13579 (while dir-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13580 (unless (string-match file-exclude-regexp (car dir-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13581 (setq dir-list-tmp (cons (car dir-list) dir-list-tmp)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13582 (setq dir-list (cdr dir-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13583 (setq dir-list (nreverse dir-list-tmp))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13584 (message "Collecting source files...done")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13585 ;; scan for design units for each directory in DIR-LIST
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13586 (setq dir-list-tmp nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13587 num-dir (length dir-list)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13588 act-dir 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13589 (while dir-list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13590 (setq dir-name (abbreviate-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13591 (expand-file-name (car dir-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13592 (vhdl-scan-directory-contents dir-name project nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13593 (format "(%s/%s) " act-dir num-dir)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13594 (cdr dir-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13595 (add-to-list 'dir-list-tmp (file-name-directory dir-name))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13596 (setq dir-list (cdr dir-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13597 act-dir (1+ act-dir)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13598 (aput 'vhdl-directory-alist project (list (nreverse dir-list-tmp)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13599 (message "Scanning project \"%s\"...done" project)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13600
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13601 (defun vhdl-update-file-contents (file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13602 "Update hierarchy information by contents of current buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13603 (setq file-name (abbreviate-file-name file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13604 (let* ((dir-name (file-name-directory file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13605 (directory-alist vhdl-directory-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13606 updated)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13607 (while directory-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13608 (when (member dir-name (nth 1 (car directory-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13609 (let* ((vhdl-project (nth 0 (car directory-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13610 (project (vhdl-project-p))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13611 (ent-alist (aget vhdl-entity-alist (or project dir-name) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13612 (conf-alist (aget vhdl-config-alist (or project dir-name) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13613 (pack-alist (aget vhdl-package-alist (or project dir-name) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13614 (ent-inst-list (car (aget vhdl-ent-inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13615 (or project dir-name) t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13616 (file-alist (aget vhdl-file-alist (or project dir-name) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13617 (file-entry (aget file-alist file-name t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13618 (ent-list (nth 0 file-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13619 (arch-list (nth 1 file-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13620 (arch-ent-list (nth 2 file-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13621 (conf-list (nth 3 file-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13622 (pack-list (nth 4 file-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13623 (pack-body-list (nth 5 file-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13624 (inst-ent-list (nth 7 file-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13625 (cache-key (or project dir-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13626 arch-alist key ent-key entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13627 ;; delete design units previously contained in this file:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13628 ;; entities
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13629 (while ent-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13630 (setq key (car ent-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13631 entry (aget ent-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13632 (when (equal file-name (nth 1 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13633 (if (nth 3 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13634 (aput 'ent-alist key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13635 (list (nth 0 entry) nil nil (nth 3 entry) nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13636 (adelete 'ent-alist key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13637 (setq ent-list (cdr ent-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13638 ;; architectures
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13639 (while arch-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13640 (setq key (car arch-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13641 ent-key (car arch-ent-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13642 entry (aget ent-alist ent-key t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13643 arch-alist (nth 3 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13644 (when (equal file-name (nth 1 (aget arch-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13645 (adelete 'arch-alist key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13646 (if (or (nth 1 entry) arch-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13647 (aput 'ent-alist ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13648 (list (nth 0 entry) (nth 1 entry) (nth 2 entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13649 arch-alist (nth 4 entry) (nth 5 entry)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13650 (adelete 'ent-alist ent-key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13651 (setq arch-list (cdr arch-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13652 arch-ent-list (cdr arch-ent-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13653 ;; configurations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13654 (while conf-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13655 (setq key (car conf-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13656 (when (equal file-name (nth 1 (aget conf-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13657 (adelete 'conf-alist key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13658 (setq conf-list (cdr conf-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13659 ;; package declarations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13660 (while pack-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13661 (setq key (car pack-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13662 entry (aget pack-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13663 (when (equal file-name (nth 1 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13664 (if (nth 6 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13665 (aput 'pack-alist key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13666 (list (nth 0 entry) nil nil nil nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13667 (nth 6 entry) (nth 7 entry) (nth 8 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13668 (nth 9 entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13669 (adelete 'pack-alist key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13670 (setq pack-list (cdr pack-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13671 ;; package bodies
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13672 (while pack-body-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13673 (setq key (car pack-body-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13674 entry (aget pack-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13675 (when (equal file-name (nth 6 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13676 (if (nth 1 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13677 (aput 'pack-alist key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13678 (list (nth 0 entry) (nth 1 entry) (nth 2 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13679 (nth 3 entry) (nth 4 entry) (nth 5 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13680 nil nil nil nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13681 (adelete 'pack-alist key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13682 (setq pack-body-list (cdr pack-body-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13683 ;; instantiated entities
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13684 (while inst-ent-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13685 (setq ent-inst-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13686 (vhdl-delete (car inst-ent-list) ent-inst-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13687 (setq inst-ent-list (cdr inst-ent-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13688 ;; update caches
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13689 (vhdl-aput 'vhdl-entity-alist cache-key ent-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13690 (vhdl-aput 'vhdl-config-alist cache-key conf-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13691 (vhdl-aput 'vhdl-package-alist cache-key pack-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13692 (vhdl-aput 'vhdl-ent-inst-alist cache-key (list ent-inst-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13693 ;; scan file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13694 (vhdl-scan-directory-contents file-name project t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13695 (when (or (and vhdl-speedbar-show-projects project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13696 (and (not vhdl-speedbar-show-projects) (not project)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13697 (vhdl-speedbar-refresh project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13698 (setq updated t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13699 (setq directory-alist (cdr directory-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13700 updated))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13701
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13702 (defun vhdl-update-hierarchy ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13703 "Update directory and hierarchy information in speedbar."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13704 (let ((file-list (reverse vhdl-modified-file-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13705 updated)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13706 (when (and vhdl-speedbar-update-on-saving file-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13707 (while file-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13708 (setq updated
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13709 (or (vhdl-update-file-contents (car file-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13710 updated))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13711 (setq file-list (cdr file-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13712 (setq vhdl-modified-file-list nil)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13713 (vhdl-speedbar-update-current-unit)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13714 (when updated (message "Updating hierarchy...done")))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13715
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13716 ;; structure (parenthesised expression means list of such entries)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13717 ;; (inst-key inst-file-marker comp-ent-key comp-ent-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13718 ;; comp-arch-key comp-arch-file-marker comp-conf-key comp-conf-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13719 ;; comp-lib-name level)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13720 (defun vhdl-get-hierarchy (ent-alist conf-alist ent-key arch-key conf-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13721 conf-inst-alist level indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13722 &optional include-top ent-hier)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13723 "Get instantiation hierarchy beginning in architecture ARCH-KEY of
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13724 entity ENT-KEY."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13725 (let* ((ent-entry (aget ent-alist ent-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13726 (arch-entry (if arch-key (aget (nth 3 ent-entry) arch-key t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13727 (cdar (last (nth 3 ent-entry)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13728 (inst-alist (nth 3 arch-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13729 inst-entry inst-ent-entry inst-arch-entry inst-conf-entry comp-entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13730 hier-list subcomp-list tmp-list inst-key inst-comp-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13731 inst-ent-key inst-arch-key inst-conf-key inst-lib-key)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13732 (when (= level 0) (message "Extract design hierarchy..."))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13733 (when include-top
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13734 (setq level (1+ level)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13735 (when (member ent-key ent-hier)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13736 (error "ERROR: Instantiation loop detected, component instantiates itself: \"%s\"" ent-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13737 ;; check configured architecture (already checked during scanning)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13738 ; (unless (or (null conf-inst-alist) (assoc arch-key (nth 3 ent-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13739 ; (vhdl-warning-when-idle "Configuration for non-existing architecture used: \"%s\"" conf-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13740 ;; process all instances
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13741 (while inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13742 (setq inst-entry (car inst-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13743 inst-key (nth 0 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13744 inst-comp-name (nth 4 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13745 inst-conf-key (nth 7 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13746 ;; search entry in configuration's instantiations list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13747 (setq tmp-list conf-inst-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13748 (while (and tmp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13749 (not (and (member (nth 0 (car tmp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13750 (list "all" inst-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13751 (equal (nth 1 (car tmp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13752 (downcase (or inst-comp-name ""))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13753 (setq tmp-list (cdr tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13754 (setq inst-conf-key (or (nth 4 (car tmp-list)) inst-conf-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13755 (setq inst-conf-entry (aget conf-alist inst-conf-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13756 (when (and inst-conf-key (not inst-conf-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13757 (vhdl-warning-when-idle "Configuration not found: \"%s\"" inst-conf-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13758 ;; determine entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13759 (setq inst-ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13760 (or (nth 2 (car tmp-list)) ; from configuration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13761 (nth 3 inst-conf-entry) ; from subconfiguration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13762 (nth 3 (aget conf-alist (nth 7 inst-entry) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13763 ; from configuration spec.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13764 (nth 5 inst-entry))) ; from direct instantiation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13765 (setq inst-ent-entry (aget ent-alist inst-ent-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13766 ;; determine architecture
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13767 (setq inst-arch-key
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13768 (or (nth 3 (car tmp-list)) ; from configuration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13769 (nth 4 inst-conf-entry) ; from subconfiguration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13770 (nth 6 inst-entry) ; from direct instantiation
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13771 (nth 4 (aget conf-alist (nth 7 inst-entry)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13772 ; from configuration spec.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13773 (nth 4 inst-ent-entry) ; MRA
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13774 (caar (nth 3 inst-ent-entry)))) ; first alphabetically
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13775 (setq inst-arch-entry (aget (nth 3 inst-ent-entry) inst-arch-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13776 ;; set library
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13777 (setq inst-lib-key
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13778 (or (nth 5 (car tmp-list)) ; from configuration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13779 (nth 8 inst-entry))) ; from direct instantiation
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13780 ;; gather information for this instance
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13781 (setq comp-entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13782 (list (nth 1 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13783 (cons (nth 2 inst-entry) (nth 3 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13784 (or (nth 0 inst-ent-entry) (nth 4 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13785 (cons (nth 1 inst-ent-entry) (nth 2 inst-ent-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13786 (or (nth 0 inst-arch-entry) inst-arch-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13787 (cons (nth 1 inst-arch-entry) (nth 2 inst-arch-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13788 (or (nth 0 inst-conf-entry) inst-conf-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13789 (cons (nth 1 inst-conf-entry) (nth 2 inst-conf-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13790 inst-lib-key level))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13791 ;; get subcomponent hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13792 (setq subcomp-list (vhdl-get-hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13793 ent-alist conf-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13794 inst-ent-key inst-arch-key inst-conf-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13795 (nth 5 inst-conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13796 (1+ level) indent nil (cons ent-key ent-hier)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13797 ;; add to list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13798 (setq hier-list (append hier-list (list comp-entry) subcomp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13799 (setq inst-alist (cdr inst-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13800 (when include-top
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13801 (setq hier-list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13802 (cons (list nil nil (nth 0 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13803 (cons (nth 1 ent-entry) (nth 2 ent-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13804 (nth 0 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13805 (cons (nth 1 arch-entry) (nth 2 arch-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13806 nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13807 nil (1- level))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13808 hier-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13809 (when (or (= level 0) (and include-top (= level 1))) (message ""))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13810 hier-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13811
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13812 (defun vhdl-get-instantiations (ent-key indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13813 "Get all instantiations of entity ENT-KEY."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13814 (let ((ent-alist (aget vhdl-entity-alist (vhdl-speedbar-line-key indent) t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13815 arch-alist inst-alist ent-inst-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13816 ent-entry arch-entry inst-entry)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13817 (while ent-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13818 (setq ent-entry (car ent-alist))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13819 (setq arch-alist (nth 4 ent-entry))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13820 (while arch-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13821 (setq arch-entry (car arch-alist))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13822 (setq inst-alist (nth 4 arch-entry))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13823 (while inst-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13824 (setq inst-entry (car inst-alist))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13825 (when (equal ent-key (nth 5 inst-entry))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13826 (setq ent-inst-list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13827 (cons (list (nth 1 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13828 (cons (nth 2 inst-entry) (nth 3 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13829 (nth 1 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13830 (cons (nth 2 ent-entry) (nth 3 ent-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13831 (nth 1 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13832 (cons (nth 2 arch-entry) (nth 3 arch-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13833 ent-inst-list)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13834 (setq inst-alist (cdr inst-alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13835 (setq arch-alist (cdr arch-alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13836 (setq ent-alist (cdr ent-alist)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13837 (nreverse ent-inst-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13838
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13839 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13840 ;; Caching in file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13841
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13842 (defun vhdl-save-caches ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13843 "Save all updated hierarchy caches to file."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13844 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13845 (condition-case nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13846 (when vhdl-speedbar-save-cache
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13847 ;; update hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13848 (vhdl-update-hierarchy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13849 (let ((project-list vhdl-updated-project-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13850 (message "Saving hierarchy caches...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13851 ;; write updated project caches
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13852 (while project-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13853 (vhdl-save-cache (car project-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13854 (setq project-list (cdr project-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13855 (message "Saving hierarchy caches...done")))
75143
96ef09c54974 (vhdl-save-caches): Fix typo in error message.
Juanma Barranquero <lekktu@gmail.com>
parents: 74434
diff changeset
13856 (error (progn (vhdl-warning "ERROR: An error occurred while saving the hierarchy caches")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13857 (sit-for 2)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13858
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13859 (defun vhdl-save-cache (key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13860 "Save current hierarchy cache to file."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13861 (let* ((orig-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13862 (vhdl-project key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13863 (project (vhdl-project-p))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13864 (default-directory key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13865 (directory (abbreviate-file-name (vhdl-default-directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13866 (file-name (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13867 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13868 (cons "\\(.*\\) \\(.*\\)" vhdl-speedbar-cache-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13869 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13870 (subst-char-in-string ? ?_ (or project "dir"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13871 " " (user-login-name)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13872 (file-dir-name (expand-file-name file-name directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13873 (cache-key (or project directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13874 (key (if project "project" "directory")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13875 (unless (file-exists-p (file-name-directory file-dir-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13876 (make-directory (file-name-directory file-dir-name) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13877 (if (not (file-writable-p file-dir-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13878 (progn (vhdl-warning (format "File not writable: \"%s\""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13879 (abbreviate-file-name file-dir-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13880 (sit-for 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13881 (message "Saving cache: \"%s\"" file-dir-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13882 (set-buffer (find-file-noselect file-dir-name t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13883 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13884 (insert ";; -*- Emacs-Lisp -*-\n\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13885 ";;; " (file-name-nondirectory file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13886 " - design hierarchy cache file for Emacs VHDL Mode "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13887 vhdl-version "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13888 (insert "\n;; " (if project "Project " "Directory") " : ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13889 (if project (insert project) (prin1 directory (current-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13890 (insert "\n;; Saved : " (format-time-string "%Y-%m-%d %T ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13891 (user-login-name) "\n\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13892 "\n;; version number\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13893 "(setq vhdl-cache-version \"" vhdl-version "\")\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13894 "\n;; " (if project "project" "directory") " name"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13895 "\n(setq " key " ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13896 (prin1 (or project directory) (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13897 (insert ")\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13898 (when (member 'hierarchy vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13899 (insert "\n;; entity and architecture cache\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13900 "(aput 'vhdl-entity-alist " key " '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13901 (print (aget vhdl-entity-alist cache-key t) (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13902 (insert ")\n\n;; configuration cache\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13903 "(aput 'vhdl-config-alist " key " '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13904 (print (aget vhdl-config-alist cache-key t) (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13905 (insert ")\n\n;; package cache\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13906 "(aput 'vhdl-package-alist " key " '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13907 (print (aget vhdl-package-alist cache-key t) (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13908 (insert ")\n\n;; instantiated entities cache\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13909 "(aput 'vhdl-ent-inst-alist " key " '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13910 (print (aget vhdl-ent-inst-alist cache-key t) (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13911 (insert ")\n\n;; design units per file cache\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13912 "(aput 'vhdl-file-alist " key " '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13913 (print (aget vhdl-file-alist cache-key t) (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13914 (when project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13915 (insert ")\n\n;; source directories in project cache\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13916 "(aput 'vhdl-directory-alist " key " '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13917 (print (aget vhdl-directory-alist cache-key t) (current-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13918 (insert ")\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13919 (when (member 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13920 (insert "\n;; shown design units cache\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13921 "(aput 'vhdl-speedbar-shown-unit-alist " key " '")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13922 (print (aget vhdl-speedbar-shown-unit-alist cache-key t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13923 (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13924 (insert ")\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13925 (setq vhdl-updated-project-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13926 (delete cache-key vhdl-updated-project-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13927 (save-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13928 (kill-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13929 (set-buffer orig-buffer))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13930
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13931 (defun vhdl-load-cache (key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13932 "Load hierarchy cache information from file."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13933 (let* ((vhdl-project key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13934 (default-directory key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13935 (directory (vhdl-default-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13936 (file-name (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13937 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13938 (cons "\\(.*\\) \\(.*\\)" vhdl-speedbar-cache-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13939 (concat
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13940 (subst-char-in-string ? ?_ (or (vhdl-project-p) "dir"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13941 " " (user-login-name)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13942 (file-dir-name (expand-file-name file-name directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13943 vhdl-cache-version)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13944 (unless (memq 'vhdl-save-caches kill-emacs-hook)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13945 (add-hook 'kill-emacs-hook 'vhdl-save-caches))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13946 (when (file-exists-p file-dir-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13947 (condition-case ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13948 (progn (load-file file-dir-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13949 (string< (mapconcat
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61431
diff changeset
13950 (lambda (a) (format "%3d" (string-to-number a)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
13951 (split-string "3.33" "\\.") "")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13952 (mapconcat
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61431
diff changeset
13953 (lambda (a) (format "%3d" (string-to-number a)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13954 (split-string vhdl-cache-version "\\.") "")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13955 (error (progn (vhdl-warning (format "ERROR: Corrupted cache file: \"%s\"" file-dir-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13956 nil))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13957
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13958 (defun vhdl-require-hierarchy-info ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13959 "Make sure that hierarchy information is available. Load cache or scan files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13960 if required."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13961 (if (vhdl-project-p)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13962 (unless (or (assoc vhdl-project vhdl-file-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13963 (vhdl-load-cache vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13964 (vhdl-scan-project-contents vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13965 (let ((directory (abbreviate-file-name default-directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13966 (unless (or (assoc directory vhdl-file-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13967 (vhdl-load-cache directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13968 (vhdl-scan-directory-contents directory)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13969
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13970 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13971 ;; Add hierarchy browser functionality to speedbar
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13972
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13973 (defvar vhdl-speedbar-key-map nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13974 "Keymap used when in the VHDL hierarchy browser mode.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13975
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13976 (defvar vhdl-speedbar-menu-items nil
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13977 "Additional menu-items to add to speedbar frame.")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13978
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13979 (defun vhdl-speedbar-initialize ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13980 "Initialize speedbar."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13981 ;; general settings
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13982 ; (set (make-local-variable 'speedbar-tag-hierarchy-method) nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13983 ;; VHDL file extensions (extracted from `auto-mode-alist')
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13984 (let ((mode-alist auto-mode-alist))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13985 (while mode-alist
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13986 (when (eq (cdar mode-alist) 'vhdl-mode)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13987 (speedbar-add-supported-extension (caar mode-alist)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13988 (setq mode-alist (cdr mode-alist))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13989 ;; hierarchy browser settings
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13990 (when (boundp 'speedbar-mode-functions-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13991 ;; special functions
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13992 (speedbar-add-mode-functions-list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13993 '("vhdl directory"
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
13994 (speedbar-item-info . vhdl-speedbar-item-info)
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
13995 (speedbar-line-directory . speedbar-files-line-path)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13996 (speedbar-add-mode-functions-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13997 '("vhdl project"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
13998 (speedbar-item-info . vhdl-speedbar-item-info)
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
13999 (speedbar-line-directory . vhdl-speedbar-line-project)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14000 ;; keymap
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14001 (unless vhdl-speedbar-key-map
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14002 (setq vhdl-speedbar-key-map (speedbar-make-specialized-keymap))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14003 (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
14004 (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
14005 (define-key vhdl-speedbar-key-map "+" 'speedbar-expand-line)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14006 (define-key vhdl-speedbar-key-map "=" 'speedbar-expand-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14007 (define-key vhdl-speedbar-key-map "-" 'vhdl-speedbar-contract-level)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14008 (define-key vhdl-speedbar-key-map "_" 'vhdl-speedbar-contract-all)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14009 (define-key vhdl-speedbar-key-map "C" 'vhdl-speedbar-port-copy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14010 (define-key vhdl-speedbar-key-map "P" 'vhdl-speedbar-place-component)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14011 (define-key vhdl-speedbar-key-map "F" 'vhdl-speedbar-configuration)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14012 (define-key vhdl-speedbar-key-map "A" 'vhdl-speedbar-select-mra)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14013 (define-key vhdl-speedbar-key-map "K" 'vhdl-speedbar-make-design)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14014 (define-key vhdl-speedbar-key-map "R" 'vhdl-speedbar-rescan-hierarchy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14015 (define-key vhdl-speedbar-key-map "S" 'vhdl-save-caches)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14016 (let ((key 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14017 (while (<= key 9)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14018 (define-key vhdl-speedbar-key-map (int-to-string key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14019 `(lambda () (interactive) (vhdl-speedbar-set-depth ,key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14020 (setq key (1+ key)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14021 (define-key speedbar-key-map "h"
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14022 (lambda () (interactive)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14023 (speedbar-change-initial-expansion-list "vhdl directory")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14024 (define-key speedbar-key-map "H"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14025 (lambda () (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14026 (speedbar-change-initial-expansion-list "vhdl project")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14027 ;; menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14028 (unless vhdl-speedbar-menu-items
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14029 (setq
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14030 vhdl-speedbar-menu-items
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14031 `(["Edit" speedbar-edit-line t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14032 ["Expand" speedbar-expand-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14033 (save-excursion (beginning-of-line) (looking-at "[0-9]+: *.\\+. "))]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14034 ["Contract" vhdl-speedbar-contract-level t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14035 ["Expand All" vhdl-speedbar-expand-all t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14036 ["Contract All" vhdl-speedbar-contract-all t]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14037 ,(let ((key 0) (menu-list '("Hierarchy Depth")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14038 (while (<= key 9)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14039 (setq menu-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14040 (cons `[,(if (= key 0) "All" (int-to-string key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14041 (vhdl-speedbar-set-depth ,key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14042 :style radio
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14043 :selected (= vhdl-speedbar-hierarchy-depth ,key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14044 :keys ,(int-to-string key)]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14045 menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14046 (setq key (1+ key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14047 (nreverse menu-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14048 "--"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14049 ["Copy Port/Subprogram" vhdl-speedbar-port-copy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14050 (or (vhdl-speedbar-check-unit 'entity)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14051 (vhdl-speedbar-check-unit 'subprogram))]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14052 ["Place Component" vhdl-speedbar-place-component
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14053 (vhdl-speedbar-check-unit 'entity)]
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14054 ["Generate Configuration" vhdl-speedbar-configuration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14055 (vhdl-speedbar-check-unit 'architecture)]
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14056 ["Select as MRA" vhdl-speedbar-select-mra
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14057 (vhdl-speedbar-check-unit 'architecture)]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14058 ["Make" vhdl-speedbar-make-design
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14059 (save-excursion (beginning-of-line) (looking-at "[0-9]+: *[[<]"))]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14060 ["Generate Makefile" vhdl-speedbar-generate-makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14061 (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))]
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14062 ["Rescan Directory" vhdl-speedbar-rescan-hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14063 :active (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
14064 ,(if (featurep 'xemacs) :active :visible) (not vhdl-speedbar-show-projects)]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14065 ["Rescan Project" vhdl-speedbar-rescan-hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14066 :active (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
14067 ,(if (featurep 'xemacs) :active :visible) vhdl-speedbar-show-projects]
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14068 ["Save Caches" vhdl-save-caches vhdl-updated-project-list])))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14069 ;; hook-ups
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14070 (speedbar-add-expansion-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14071 '("vhdl directory" vhdl-speedbar-menu-items vhdl-speedbar-key-map
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14072 vhdl-speedbar-display-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14073 (speedbar-add-expansion-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14074 '("vhdl project" vhdl-speedbar-menu-items vhdl-speedbar-key-map
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14075 vhdl-speedbar-display-projects))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14076 (setq speedbar-stealthy-function-list
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14077 (append
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14078 '(("vhdl directory" vhdl-speedbar-update-current-unit)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14079 ("vhdl project" vhdl-speedbar-update-current-project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14080 vhdl-speedbar-update-current-unit)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14081 ; ("files" (lambda () (setq speedbar-ignored-path-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14082 ; (speedbar-extension-list-to-regex
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14083 ; speedbar-ignored-path-expressions))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14084 )
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14085 speedbar-stealthy-function-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14086 (when (eq vhdl-speedbar-display-mode 'directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14087 (setq speedbar-initial-expansion-list-name "vhdl directory"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14088 (when (eq vhdl-speedbar-display-mode 'project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14089 (setq speedbar-initial-expansion-list-name "vhdl project"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14090 (add-hook 'speedbar-timer-hook 'vhdl-update-hierarchy)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14091
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14092 (defun vhdl-speedbar (&optional arg)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14093 "Open/close speedbar."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14094 (interactive)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14095 (if (not (fboundp 'speedbar))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14096 (error "WARNING: Speedbar is not available or not installed")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14097 (condition-case ()
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14098 (speedbar-frame-mode arg)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14099 (error (error "WARNING: An error occurred while opening speedbar")))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14100
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14101 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14102 ;; Display functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14103
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14104 (defvar vhdl-speedbar-last-selected-project nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14105 "Name of last selected project.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14106
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14107 ;; 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
14108 (defmacro speedbar-with-writable (&rest forms)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14109 "Allow the buffer to be writable and evaluate FORMS."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14110 (list 'let '((inhibit-read-only t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14111 (cons 'progn forms)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14112 (put 'speedbar-with-writable 'lisp-indent-function 0)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14113
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14114 (defun vhdl-speedbar-display-directory (directory depth &optional rescan)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14115 "Display directory and hierarchy information in speedbar."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14116 (setq vhdl-speedbar-show-projects nil)
72214
e48fbb6d599c (vhdl-speedbar-display-directory, vhdl-speedbar-display-projects):
Richard M. Stallman <rms@gnu.org>
parents: 70422
diff changeset
14117 (setq speedbar-ignored-directory-regexp
e48fbb6d599c (vhdl-speedbar-display-directory, vhdl-speedbar-display-projects):
Richard M. Stallman <rms@gnu.org>
parents: 70422
diff changeset
14118 (speedbar-extension-list-to-regex speedbar-ignored-directory-expressions))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14119 (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
14120 (setq speedbar-last-selected-file nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14121 (speedbar-with-writable
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14122 (condition-case nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14123 (progn
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14124 ;; insert directory path
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14125 (speedbar-directory-buttons directory depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14126 ;; insert subdirectories
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14127 (vhdl-speedbar-insert-dirs (speedbar-file-lists directory) depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14128 ;; scan and insert hierarchy of current directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14129 (vhdl-speedbar-insert-dir-hierarchy directory depth
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14130 speedbar-power-click)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14131 ;; expand subdirectories
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14132 (when (= depth 0) (vhdl-speedbar-expand-dirs directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14133 (error (vhdl-warning-when-idle "ERROR: Invalid hierarchy information, unable to display correctly")))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14134
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14135 (defun vhdl-speedbar-display-projects (project depth &optional rescan)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14136 "Display projects and hierarchy information in speedbar."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14137 (setq vhdl-speedbar-show-projects t)
72214
e48fbb6d599c (vhdl-speedbar-display-directory, vhdl-speedbar-display-projects):
Richard M. Stallman <rms@gnu.org>
parents: 70422
diff changeset
14138 (setq speedbar-ignored-directory-regexp ".")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14139 (setq speedbar-last-selected-file nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14140 (setq vhdl-speedbar-last-selected-project nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14141 (speedbar-with-writable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14142 (condition-case nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14143 ;; insert projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14144 (vhdl-speedbar-insert-projects)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14145 (error (vhdl-warning-when-idle "ERROR: Invalid hierarchy information, unable to display correctly"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14146 (setq speedbar-full-text-cache nil)) ; prevent caching
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14147
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14148 (defun vhdl-speedbar-insert-projects ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14149 "Insert all projects in speedbar."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14150 (vhdl-speedbar-make-title-line "Projects:")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14151 (let ((project-alist (if vhdl-project-sort
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14152 (vhdl-sort-alist (copy-alist vhdl-project-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14153 vhdl-project-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14154 (vhdl-speedbar-update-current-unit nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14155 ;; insert projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14156 (while project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14157 (speedbar-make-tag-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14158 'angle ?+ 'vhdl-speedbar-expand-project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14159 (caar project-alist) (caar project-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14160 'vhdl-toggle-project (caar project-alist) 'speedbar-directory-face 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14161 (setq project-alist (cdr project-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14162 (setq project-alist vhdl-project-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14163 ;; expand projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14164 (while project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14165 (when (member (caar project-alist) vhdl-speedbar-shown-project-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14166 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14167 (when (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14168 (concat "^\\([0-9]+:\\s-*<\\)[+]>\\s-+" (caar project-alist) "$") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14169 (goto-char (match-end 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14170 (speedbar-do-function-pointer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14171 (setq project-alist (cdr project-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14172 ; (vhdl-speedbar-update-current-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14173 ; (vhdl-speedbar-update-current-unit nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14174 )
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14175
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14176 (defun vhdl-speedbar-insert-project-hierarchy (project indent &optional rescan)
75518
0d70c66d2c2e (vhdl-components-package-name, vhdl-get-library-unit, vhdl-corresponding-begin,
Juanma Barranquero <lekktu@gmail.com>
parents: 75347
diff changeset
14177 "Insert hierarchy of PROJECT. Rescan directories if RESCAN is non-nil,
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14178 otherwise use cached data."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14179 (when (or rescan (and (not (assoc project vhdl-file-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14180 (not (vhdl-load-cache project))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14181 (vhdl-scan-project-contents project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14182 ;; insert design hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14183 (vhdl-speedbar-insert-hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14184 (aget vhdl-entity-alist project t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14185 (aget vhdl-config-alist project t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14186 (aget vhdl-package-alist project t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14187 (car (aget vhdl-ent-inst-alist project t)) indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14188 (insert (int-to-string indent) ":\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14189 (put-text-property (- (point) 3) (1- (point)) 'invisible t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14190 (put-text-property (1- (point)) (point) 'invisible nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14191 ;; expand design units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14192 (vhdl-speedbar-expand-units project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14193
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14194 (defun vhdl-speedbar-insert-dir-hierarchy (directory depth &optional rescan)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14195 "Insert hierarchy of DIRECTORY. Rescan directory if RESCAN is non-nil,
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14196 otherwise use cached data."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14197 (when (or rescan (and (not (assoc directory vhdl-file-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14198 (not (vhdl-load-cache directory))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14199 (vhdl-scan-directory-contents directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14200 ;; insert design hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14201 (vhdl-speedbar-insert-hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14202 (aget vhdl-entity-alist directory t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14203 (aget vhdl-config-alist directory t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14204 (aget vhdl-package-alist directory t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14205 (car (aget vhdl-ent-inst-alist directory t)) depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14206 ;; expand design units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14207 (vhdl-speedbar-expand-units directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14208 (aput 'vhdl-directory-alist directory (list (list directory))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14209
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14210 (defun vhdl-speedbar-insert-hierarchy (ent-alist conf-alist pack-alist
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14211 ent-inst-list depth)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14212 "Insert hierarchy of ENT-ALIST, CONF-ALIST, and PACK-ALIST."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14213 (if (not (or ent-alist conf-alist pack-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14214 (vhdl-speedbar-make-title-line "No VHDL design units!" depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14215 (let (ent-entry conf-entry pack-entry)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14216 ;; insert entities
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14217 (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
14218 (while ent-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14219 (setq ent-entry (car ent-alist))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14220 (speedbar-make-tag-line
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14221 'bracket ?+ 'vhdl-speedbar-expand-entity (nth 0 ent-entry)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14222 (nth 1 ent-entry) 'vhdl-speedbar-find-file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14223 (cons (nth 2 ent-entry) (nth 3 ent-entry))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14224 'vhdl-speedbar-entity-face depth)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14225 (unless (nth 2 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14226 (end-of-line 0) (insert "!") (forward-char 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14227 (unless (member (nth 0 ent-entry) ent-inst-list)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14228 (end-of-line 0) (insert " (top)") (forward-char 1))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14229 (setq ent-alist (cdr ent-alist)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14230 ;; insert configurations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14231 (when conf-alist (vhdl-speedbar-make-title-line "Configurations:" depth))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14232 (while conf-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14233 (setq conf-entry (car conf-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14234 (speedbar-make-tag-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14235 'bracket ?+ 'vhdl-speedbar-expand-config (nth 0 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14236 (nth 1 conf-entry) 'vhdl-speedbar-find-file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14237 (cons (nth 2 conf-entry) (nth 3 conf-entry))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14238 'vhdl-speedbar-configuration-face depth)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14239 (setq conf-alist (cdr conf-alist)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14240 ;; insert packages
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14241 (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
14242 (while pack-alist
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14243 (setq pack-entry (car pack-alist))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14244 (vhdl-speedbar-make-pack-line
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14245 (nth 0 pack-entry) (nth 1 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14246 (cons (nth 2 pack-entry) (nth 3 pack-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14247 (cons (nth 7 pack-entry) (nth 8 pack-entry))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14248 depth)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14249 (setq pack-alist (cdr pack-alist))))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14250
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14251 (defun vhdl-speedbar-rescan-hierarchy ()
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14252 "Rescan hierarchy for the directory or project under the cursor."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14253 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14254 (let (key path)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14255 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14256 ;; current project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14257 (vhdl-speedbar-show-projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14258 (setq key (vhdl-speedbar-line-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14259 (vhdl-scan-project-contents key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14260 ;; top-level directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14261 ((save-excursion (beginning-of-line) (looking-at "[^0-9]"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14262 (re-search-forward "[0-9]+:" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14263 (vhdl-scan-directory-contents
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
14264 (abbreviate-file-name (speedbar-line-directory))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14265 ;; current directory
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
14266 (t (setq path (speedbar-line-directory))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14267 (string-match "^\\(.+[/\\]\\)" path)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14268 (vhdl-scan-directory-contents
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14269 (abbreviate-file-name (match-string 1 path)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14270 (vhdl-speedbar-refresh key)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14271
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14272 (defun vhdl-speedbar-expand-dirs (directory)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14273 "Expand subdirectories in DIRECTORY according to
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14274 `speedbar-shown-directories'."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14275 ;; (nicked from `speedbar-default-directory-list')
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14276 (let ((sf (cdr (reverse speedbar-shown-directories)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14277 (vhdl-speedbar-update-current-unit nil))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14278 (setq speedbar-shown-directories
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14279 (list (expand-file-name default-directory)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14280 (while sf
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14281 (when (speedbar-goto-this-file (car sf))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14282 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14283 (when (looking-at "[0-9]+:\\s-*<")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14284 (goto-char (match-end 0))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14285 (speedbar-do-function-pointer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14286 (setq sf (cdr sf))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14287 (vhdl-speedbar-update-current-unit nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14288
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14289 (defun vhdl-speedbar-expand-units (key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14290 "Expand design units in directory/project KEY according to
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14291 `vhdl-speedbar-shown-unit-alist'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14292 (let ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14293 (vhdl-speedbar-update-current-unit nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14294 vhdl-updated-project-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14295 (adelete 'vhdl-speedbar-shown-unit-alist key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14296 (vhdl-prepare-search-1
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14297 (while unit-alist ; expand units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14298 (vhdl-speedbar-goto-this-unit key (caar unit-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14299 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14300 (let ((arch-alist (nth 1 (car unit-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14301 position)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14302 (when (looking-at "^[0-9]+:\\s-*\\[")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14303 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14304 (setq position (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14305 (speedbar-do-function-pointer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14306 (select-frame speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14307 (while arch-alist ; expand architectures
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14308 (goto-char position)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14309 (when (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14310 (concat "^[0-9]+:\\s-*\\(\\[\\|{.}\\s-+"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14311 (car arch-alist) "\\>\\)") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14312 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14313 (when (looking-at "^[0-9]+:\\s-*{")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14314 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14315 (speedbar-do-function-pointer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14316 (select-frame speedbar-frame)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14317 (setq arch-alist (cdr arch-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14318 (setq unit-alist (cdr unit-alist))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14319 (vhdl-speedbar-update-current-unit nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14320
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14321 (defun vhdl-speedbar-contract-level ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14322 "Contract current level in current directory/project."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14323 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14324 (when (or (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14325 (beginning-of-line) (looking-at "^[0-9]:\\s-*[[{<]-"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14326 (and (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14327 (beginning-of-line) (looking-at "^\\([0-9]+\\):"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14328 (re-search-backward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14329 (format "^[0-%d]:\\s-*[[{<]-"
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 61431
diff changeset
14330 (max (1- (string-to-number (match-string 1))) 0)) nil t)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14331 (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14332 (speedbar-do-function-pointer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14333 (speedbar-center-buffer-smartly)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14334
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14335 (defun vhdl-speedbar-contract-all ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14336 "Contract all expanded design units in current directory/project."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14337 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14338 (if (and vhdl-speedbar-show-projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14339 (save-excursion (beginning-of-line) (looking-at "^0:")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14340 (progn (setq vhdl-speedbar-shown-project-list nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14341 (vhdl-speedbar-refresh))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14342 (let ((key (vhdl-speedbar-line-key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14343 (adelete 'vhdl-speedbar-shown-unit-alist key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14344 (vhdl-speedbar-refresh (and vhdl-speedbar-show-projects key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14345 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14346 (add-to-list 'vhdl-updated-project-list key)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14347
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14348 (defun vhdl-speedbar-expand-all ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14349 "Expand all design units in current directory/project."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14350 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14351 (let* ((key (vhdl-speedbar-line-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14352 (ent-alist (aget vhdl-entity-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14353 (conf-alist (aget vhdl-config-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14354 (pack-alist (aget vhdl-package-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14355 arch-alist unit-alist subunit-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14356 (add-to-list 'vhdl-speedbar-shown-project-list key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14357 (while ent-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14358 (setq arch-alist (nth 4 (car ent-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14359 (setq subunit-alist nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14360 (while arch-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14361 (setq subunit-alist (cons (caar arch-alist) subunit-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14362 (setq arch-alist (cdr arch-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14363 (setq unit-alist (cons (list (caar ent-alist) subunit-alist) unit-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14364 (setq ent-alist (cdr ent-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14365 (while conf-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14366 (setq unit-alist (cons (list (caar conf-alist)) unit-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14367 (setq conf-alist (cdr conf-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14368 (while pack-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14369 (setq unit-alist (cons (list (caar pack-alist)) unit-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14370 (setq pack-alist (cdr pack-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14371 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14372 (vhdl-speedbar-refresh)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14373 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14374 (add-to-list 'vhdl-updated-project-list key))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14375
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14376 (defun vhdl-speedbar-expand-project (text token indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14377 "Expand/contract the project under the cursor."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14378 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14379 ((string-match "+" text) ; expand project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14380 (speedbar-change-expand-button-char ?-)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14381 (unless (member token vhdl-speedbar-shown-project-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14382 (setq vhdl-speedbar-shown-project-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14383 (cons token vhdl-speedbar-shown-project-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14384 (speedbar-with-writable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14385 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14386 (end-of-line) (forward-char 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14387 (vhdl-speedbar-insert-project-hierarchy token (1+ indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14388 speedbar-power-click))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14389 ((string-match "-" text) ; contract project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14390 (speedbar-change-expand-button-char ?+)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14391 (setq vhdl-speedbar-shown-project-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14392 (delete token vhdl-speedbar-shown-project-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14393 (speedbar-delete-subblock indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14394 (t (error "Nothing to display")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14395 (when (equal (selected-frame) speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14396 (speedbar-center-buffer-smartly)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14397
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14398 (defun vhdl-speedbar-expand-entity (text token indent)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14399 "Expand/contract the entity under the cursor."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14400 (cond
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14401 ((string-match "+" text) ; expand entity
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14402 (let* ((key (vhdl-speedbar-line-key indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14403 (ent-alist (aget vhdl-entity-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14404 (ent-entry (aget ent-alist token t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14405 (arch-alist (nth 3 ent-entry))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14406 (inst-alist (vhdl-get-instantiations token indent))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14407 (subpack-alist (nth 5 ent-entry))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14408 (multiple-arch (> (length arch-alist) 1))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14409 arch-entry inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14410 (if (not (or arch-alist inst-alist subpack-alist))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14411 (speedbar-change-expand-button-char ??)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14412 (speedbar-change-expand-button-char ?-)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14413 ;; add entity to `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14414 (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14415 (aput 'unit-alist token nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14416 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14417 (speedbar-with-writable
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14418 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14419 (end-of-line) (forward-char 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14420 ;; insert architectures
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14421 (when arch-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14422 (vhdl-speedbar-make-title-line "Architectures:" (1+ indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14423 (while arch-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14424 (setq arch-entry (car arch-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14425 (speedbar-make-tag-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14426 'curly ?+ 'vhdl-speedbar-expand-architecture
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14427 (cons token (nth 0 arch-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14428 (nth 1 arch-entry) 'vhdl-speedbar-find-file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14429 (cons (nth 2 arch-entry) (nth 3 arch-entry))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14430 'vhdl-speedbar-architecture-face (1+ indent))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14431 (when (and multiple-arch
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14432 (equal (nth 0 arch-entry) (nth 4 ent-entry)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14433 (end-of-line 0) (insert " (mra)") (forward-char 1))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14434 (setq arch-alist (cdr arch-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14435 ;; insert instantiations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14436 (when inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14437 (vhdl-speedbar-make-title-line "Instantiated as:" (1+ indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14438 (while inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14439 (setq inst-entry (car inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14440 (vhdl-speedbar-make-inst-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14441 (nth 0 inst-entry) (nth 1 inst-entry) (nth 2 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14442 (nth 3 inst-entry) (nth 4 inst-entry) (nth 5 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14443 nil nil nil (1+ indent) 0 " in ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14444 (setq inst-alist (cdr inst-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14445 ;; insert required packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14446 (vhdl-speedbar-insert-subpackages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14447 subpack-alist (1+ indent) indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14448 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14449 (add-to-list 'vhdl-updated-project-list key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14450 (vhdl-speedbar-update-current-unit t t))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14451 ((string-match "-" text) ; contract entity
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14452 (speedbar-change-expand-button-char ?+)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14453 ;; remove entity from `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14454 (let* ((key (vhdl-speedbar-line-key indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14455 (unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14456 (adelete 'unit-alist token)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14457 (if unit-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14458 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14459 (adelete 'vhdl-speedbar-shown-unit-alist key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14460 (speedbar-delete-subblock indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14461 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14462 (add-to-list 'vhdl-updated-project-list key))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14463 (t (error "Nothing to display")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14464 (when (equal (selected-frame) speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14465 (speedbar-center-buffer-smartly)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14466
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14467 (defun vhdl-speedbar-expand-architecture (text token indent)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14468 "Expand/contract the architecture under the cursor."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14469 (cond
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14470 ((string-match "+" text) ; expand architecture
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14471 (let* ((key (vhdl-speedbar-line-key (1- indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14472 (ent-alist (aget vhdl-entity-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14473 (conf-alist (aget vhdl-config-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14474 (hier-alist (vhdl-get-hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14475 ent-alist conf-alist (car token) (cdr token) nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14476 0 (1- indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14477 (ent-entry (aget ent-alist (car token) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14478 (arch-entry (aget (nth 3 ent-entry) (cdr token) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14479 (subpack-alist (nth 4 arch-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14480 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14481 (if (not (or hier-alist subpack-alist))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14482 (speedbar-change-expand-button-char ??)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14483 (speedbar-change-expand-button-char ?-)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14484 ;; add architecture to `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14485 (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14486 (arch-alist (nth 0 (aget unit-alist (car token) t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14487 (aput 'unit-alist (car token) (list (cons (cdr token) arch-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14488 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14489 (speedbar-with-writable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14490 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14491 (end-of-line) (forward-char 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14492 ;; insert instance hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14493 (when hier-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14494 (vhdl-speedbar-make-title-line "Subcomponent hierarchy:"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14495 (1+ indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14496 (while hier-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14497 (setq entry (car hier-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14498 (when (or (= vhdl-speedbar-hierarchy-depth 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14499 (< (nth 9 entry) vhdl-speedbar-hierarchy-depth))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14500 (vhdl-speedbar-make-inst-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14501 (nth 0 entry) (nth 1 entry) (nth 2 entry) (nth 3 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14502 (nth 4 entry) (nth 5 entry) (nth 6 entry) (nth 7 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14503 (nth 8 entry) (1+ indent) (1+ (nth 9 entry)) ": "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14504 (setq hier-alist (cdr hier-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14505 ;; insert required packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14506 (vhdl-speedbar-insert-subpackages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14507 subpack-alist (1+ indent) (1- indent))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14508 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14509 (add-to-list 'vhdl-updated-project-list key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14510 (vhdl-speedbar-update-current-unit t t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14511 ((string-match "-" text) ; contract architecture
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14512 (speedbar-change-expand-button-char ?+)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14513 ;; remove architecture from `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14514 (let* ((key (vhdl-speedbar-line-key (1- indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14515 (unit-alist (aget vhdl-speedbar-shown-unit-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14516 (arch-alist (nth 0 (aget unit-alist (car token) t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14517 (aput 'unit-alist (car token) (list (delete (cdr token) arch-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14518 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14519 (speedbar-delete-subblock indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14520 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14521 (add-to-list 'vhdl-updated-project-list key))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14522 (t (error "Nothing to display")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14523 (when (equal (selected-frame) speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14524 (speedbar-center-buffer-smartly)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14525
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14526 (defun vhdl-speedbar-expand-config (text token indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14527 "Expand/contract the configuration under the cursor."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14528 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14529 ((string-match "+" text) ; expand configuration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14530 (let* ((key (vhdl-speedbar-line-key indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14531 (conf-alist (aget vhdl-config-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14532 (conf-entry (aget conf-alist token))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14533 (ent-alist (aget vhdl-entity-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14534 (hier-alist (vhdl-get-hierarchy
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14535 ent-alist conf-alist (nth 3 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14536 (nth 4 conf-entry) token (nth 5 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14537 0 indent t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14538 (subpack-alist (nth 6 conf-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14539 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14540 (if (not (or hier-alist subpack-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14541 (speedbar-change-expand-button-char ??)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14542 (speedbar-change-expand-button-char ?-)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14543 ;; add configuration to `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14544 (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14545 (aput 'unit-alist token nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14546 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14547 (speedbar-with-writable
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14548 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14549 (end-of-line) (forward-char 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14550 ;; insert instance hierarchy
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14551 (when hier-alist
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14552 (vhdl-speedbar-make-title-line "Design hierarchy:" (1+ indent)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14553 (while hier-alist
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14554 (setq entry (car hier-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14555 (when (or (= vhdl-speedbar-hierarchy-depth 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14556 (<= (nth 9 entry) vhdl-speedbar-hierarchy-depth))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14557 (vhdl-speedbar-make-inst-line
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14558 (nth 0 entry) (nth 1 entry) (nth 2 entry) (nth 3 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14559 (nth 4 entry) (nth 5 entry) (nth 6 entry) (nth 7 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14560 (nth 8 entry) (1+ indent) (nth 9 entry) ": "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14561 (setq hier-alist (cdr hier-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14562 ;; insert required packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14563 (vhdl-speedbar-insert-subpackages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14564 subpack-alist (1+ indent) indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14565 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14566 (add-to-list 'vhdl-updated-project-list key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14567 (vhdl-speedbar-update-current-unit t t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14568 ((string-match "-" text) ; contract configuration
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14569 (speedbar-change-expand-button-char ?+)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14570 ;; remove configuration from `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14571 (let* ((key (vhdl-speedbar-line-key indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14572 (unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14573 (adelete 'unit-alist token)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14574 (if unit-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14575 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14576 (adelete 'vhdl-speedbar-shown-unit-alist key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14577 (speedbar-delete-subblock indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14578 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14579 (add-to-list 'vhdl-updated-project-list key))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14580 (t (error "Nothing to display")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14581 (when (equal (selected-frame) speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14582 (speedbar-center-buffer-smartly)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14583
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14584 (defun vhdl-speedbar-expand-package (text token indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14585 "Expand/contract the package under the cursor."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14586 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14587 ((string-match "+" text) ; expand package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14588 (let* ((key (vhdl-speedbar-line-key indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14589 (pack-alist (aget vhdl-package-alist key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14590 (pack-entry (aget pack-alist token t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14591 (comp-alist (nth 3 pack-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14592 (func-alist (nth 4 pack-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14593 (func-body-alist (nth 8 pack-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14594 (subpack-alist (append (nth 5 pack-entry) (nth 9 pack-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14595 comp-entry func-entry func-body-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14596 (if (not (or comp-alist func-alist subpack-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14597 (speedbar-change-expand-button-char ??)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14598 (speedbar-change-expand-button-char ?-)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14599 ;; add package to `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14600 (let* ((unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14601 (aput 'unit-alist token nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14602 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14603 (speedbar-with-writable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14604 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14605 (end-of-line) (forward-char 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14606 ;; insert components
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14607 (when comp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14608 (vhdl-speedbar-make-title-line "Components:" (1+ indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14609 (while comp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14610 (setq comp-entry (car comp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14611 (speedbar-make-tag-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14612 nil nil nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14613 (cons token (nth 0 comp-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14614 (nth 1 comp-entry) 'vhdl-speedbar-find-file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14615 (cons (nth 2 comp-entry) (nth 3 comp-entry))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14616 'vhdl-speedbar-entity-face (1+ indent))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14617 (setq comp-alist (cdr comp-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14618 ;; insert subprograms
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14619 (when func-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14620 (vhdl-speedbar-make-title-line "Subprograms:" (1+ indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14621 (while func-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14622 (setq func-entry (car func-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14623 func-body-entry (aget func-body-alist (car func-entry) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14624 (when (nth 2 func-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14625 (vhdl-speedbar-make-subprogram-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14626 (nth 1 func-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14627 (cons (nth 2 func-entry) (nth 3 func-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14628 (cons (nth 1 func-body-entry) (nth 2 func-body-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14629 (1+ indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14630 (setq func-alist (cdr func-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14631 ;; insert required packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14632 (vhdl-speedbar-insert-subpackages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14633 subpack-alist (1+ indent) indent)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14634 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14635 (add-to-list 'vhdl-updated-project-list key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14636 (vhdl-speedbar-update-current-unit t t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14637 ((string-match "-" text) ; contract package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14638 (speedbar-change-expand-button-char ?+)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14639 ;; remove package from `vhdl-speedbar-shown-unit-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14640 (let* ((key (vhdl-speedbar-line-key indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14641 (unit-alist (aget vhdl-speedbar-shown-unit-alist key t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14642 (adelete 'unit-alist token)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14643 (if unit-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14644 (aput 'vhdl-speedbar-shown-unit-alist key unit-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14645 (adelete 'vhdl-speedbar-shown-unit-alist key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14646 (speedbar-delete-subblock indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14647 (when (memq 'display vhdl-speedbar-save-cache)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14648 (add-to-list 'vhdl-updated-project-list key))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14649 (t (error "Nothing to display")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14650 (when (equal (selected-frame) speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14651 (speedbar-center-buffer-smartly)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14652
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14653 (defun vhdl-speedbar-insert-subpackages (subpack-alist indent dir-indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14654 "Insert required packages."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14655 (let* ((pack-alist (aget vhdl-package-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14656 (vhdl-speedbar-line-key dir-indent) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14657 pack-key lib-name pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14658 (when subpack-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14659 (vhdl-speedbar-make-title-line "Packages Used:" indent))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14660 (while subpack-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14661 (setq pack-key (cdar subpack-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14662 lib-name (caar subpack-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14663 (setq pack-entry (aget pack-alist pack-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14664 (vhdl-speedbar-make-subpack-line
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14665 (or (nth 0 pack-entry) pack-key) lib-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14666 (cons (nth 1 pack-entry) (nth 2 pack-entry))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14667 (cons (nth 6 pack-entry) (nth 7 pack-entry)) indent)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14668 (setq subpack-alist (cdr subpack-alist)))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14669
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14670 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14671 ;; Display help functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14672
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14673 (defvar vhdl-speedbar-update-current-unit t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14674 "Non-nil means to run `vhdl-speedbar-update-current-unit'.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14675
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14676 (defun vhdl-speedbar-update-current-project ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14677 "Highlight project that is currently active."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14678 (when (and vhdl-speedbar-show-projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14679 (not (equal vhdl-speedbar-last-selected-project vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14680 (and (boundp 'speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14681 (frame-live-p speedbar-frame)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14682 (let ((last-frame (selected-frame))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14683 (project-alist vhdl-project-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14684 pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14685 (select-frame speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14686 (speedbar-with-writable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14687 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14688 (while project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14689 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14690 (when (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14691 (concat "<.> \\(" (caar project-alist) "\\)$") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14692 (put-text-property (match-beginning 1) (match-end 1) 'face
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14693 (if (equal (caar project-alist) vhdl-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14694 'speedbar-selected-face
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14695 'speedbar-directory-face))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14696 (when (equal (caar project-alist) vhdl-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14697 (setq pos (1- (match-beginning 1)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14698 (setq project-alist (cdr project-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14699 (when pos (goto-char pos)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14700 (select-frame last-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14701 (setq vhdl-speedbar-last-selected-project vhdl-project)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14702 t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14703
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14704 (defun vhdl-speedbar-update-current-unit (&optional no-position always)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14705 "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
14706 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
14707 (let ((last-frame (selected-frame))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14708 (project-list vhdl-speedbar-shown-project-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14709 file-alist pos file-name)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14710 ;; get current file name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14711 (if (fboundp 'speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14712 (speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14713 (select-frame speedbar-attached-frame))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14714 (setq file-name (abbreviate-file-name (or (buffer-file-name) "")))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14715 (when (and vhdl-speedbar-update-current-unit
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14716 (or always (not (equal file-name speedbar-last-selected-file))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14717 (if vhdl-speedbar-show-projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14718 (while project-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14719 (setq file-alist (append file-alist (aget vhdl-file-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14720 (car project-list) t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14721 (setq project-list (cdr project-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14722 (setq file-alist (aget vhdl-file-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14723 (abbreviate-file-name default-directory) t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14724 (select-frame speedbar-frame)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14725 (set-buffer speedbar-buffer)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14726 (speedbar-with-writable
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14727 (vhdl-prepare-search-1
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14728 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14729 ;; unhighlight last units
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14730 (let* ((file-entry (aget file-alist speedbar-last-selected-file t)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14731 (vhdl-speedbar-update-units
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14732 "\\[.\\] " (nth 0 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14733 speedbar-last-selected-file 'vhdl-speedbar-entity-face)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14734 (vhdl-speedbar-update-units
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14735 "{.} " (nth 1 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14736 speedbar-last-selected-file 'vhdl-speedbar-architecture-face)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14737 (vhdl-speedbar-update-units
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14738 "\\[.\\] " (nth 3 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14739 speedbar-last-selected-file 'vhdl-speedbar-configuration-face)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14740 (vhdl-speedbar-update-units
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14741 "[]>] " (nth 4 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14742 speedbar-last-selected-file 'vhdl-speedbar-package-face)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14743 (vhdl-speedbar-update-units
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14744 "\\[.\\].+(" '("body")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14745 speedbar-last-selected-file 'vhdl-speedbar-package-face)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14746 (vhdl-speedbar-update-units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14747 "> " (nth 6 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14748 speedbar-last-selected-file 'vhdl-speedbar-instantiation-face))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14749 ;; highlight current units
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14750 (let* ((file-entry (aget file-alist file-name t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14751 (setq
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14752 pos (vhdl-speedbar-update-units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14753 "\\[.\\] " (nth 0 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14754 file-name 'vhdl-speedbar-entity-selected-face pos)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14755 pos (vhdl-speedbar-update-units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14756 "{.} " (nth 1 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14757 file-name 'vhdl-speedbar-architecture-selected-face pos)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14758 pos (vhdl-speedbar-update-units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14759 "\\[.\\] " (nth 3 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14760 file-name 'vhdl-speedbar-configuration-selected-face pos)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14761 pos (vhdl-speedbar-update-units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14762 "[]>] " (nth 4 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14763 file-name 'vhdl-speedbar-package-selected-face pos)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14764 pos (vhdl-speedbar-update-units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14765 "\\[.\\].+(" '("body")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14766 file-name 'vhdl-speedbar-package-selected-face pos)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14767 pos (vhdl-speedbar-update-units
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14768 "> " (nth 6 file-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14769 file-name 'vhdl-speedbar-instantiation-selected-face pos))))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14770 ;; move speedbar so the first highlighted unit is visible
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14771 (when (and pos (not no-position))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14772 (goto-char pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14773 (speedbar-center-buffer-smartly)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14774 (speedbar-position-cursor-on-line))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14775 (setq speedbar-last-selected-file file-name))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14776 (select-frame last-frame)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14777 t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14778
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14779 (defun vhdl-speedbar-update-units (text unit-list file-name face
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14780 &optional pos)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14781 "Help function to highlight design units."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14782 (while unit-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14783 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14784 (while (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14785 (concat text "\\(" (car unit-list) "\\)\\>") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14786 (when (equal file-name (car (get-text-property
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14787 (match-beginning 1) 'speedbar-token)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14788 (setq pos (or pos (point-marker)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14789 (put-text-property (match-beginning 1) (match-end 1) 'face face)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14790 (setq unit-list (cdr unit-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14791 pos)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14792
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14793 (defun vhdl-speedbar-make-inst-line (inst-name inst-file-marker
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14794 ent-name ent-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14795 arch-name arch-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14796 conf-name conf-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14797 lib-name depth offset delimiter)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14798 "Insert instantiation entry."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14799 (let ((start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14800 visible-start)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14801 (insert (int-to-string depth) ":")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14802 (put-text-property start (point) 'invisible t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14803 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14804 (insert-char ? (* depth speedbar-indentation-width))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14805 (while (> offset 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14806 (insert "|")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14807 (insert-char (if (= offset 1) ?- ? ) (1- speedbar-indentation-width))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14808 (setq offset (1- offset)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14809 (put-text-property visible-start (point) 'invisible nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14810 (setq start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14811 (insert ">")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14812 (speedbar-make-button start (point) nil nil nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14813 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14814 (insert " ")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14815 (setq start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14816 (if (not inst-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14817 (insert "(top)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14818 (insert inst-name)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14819 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14820 start (point) 'vhdl-speedbar-instantiation-face 'speedbar-highlight-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14821 'vhdl-speedbar-find-file inst-file-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14822 (insert delimiter)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14823 (when ent-name
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14824 (setq start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14825 (insert ent-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14826 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14827 start (point) 'vhdl-speedbar-entity-face 'speedbar-highlight-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14828 'vhdl-speedbar-find-file ent-file-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14829 (when arch-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14830 (insert " (")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14831 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14832 (insert arch-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14833 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14834 start (point) 'vhdl-speedbar-architecture-face 'speedbar-highlight-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14835 'vhdl-speedbar-find-file arch-file-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14836 (insert ")"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14837 (when conf-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14838 (insert " (")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14839 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14840 (insert conf-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14841 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14842 start (point) 'vhdl-speedbar-configuration-face 'speedbar-highlight-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14843 'vhdl-speedbar-find-file conf-file-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14844 (insert ")")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14845 (when (and lib-name (not (equal lib-name (downcase (vhdl-work-library)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14846 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14847 (insert " (" lib-name ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14848 (put-text-property (+ 2 start) (1- (point)) 'face
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14849 'vhdl-speedbar-library-face))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14850 (insert-char ?\n 1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14851 (put-text-property visible-start (point) 'invisible nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14852
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14853 (defun vhdl-speedbar-make-pack-line (pack-key pack-name pack-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14854 body-file-marker depth)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14855 "Insert package entry."
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14856 (let ((start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14857 visible-start)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14858 (insert (int-to-string depth) ":")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14859 (put-text-property start (point) 'invisible t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14860 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14861 (insert-char ? (* depth speedbar-indentation-width))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14862 (put-text-property visible-start (point) 'invisible nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14863 (setq start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14864 (insert "[+]")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14865 (speedbar-make-button
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14866 start (point) 'speedbar-button-face 'speedbar-highlight-face
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14867 'vhdl-speedbar-expand-package pack-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14868 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14869 (insert-char ? 1 nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14870 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14871 (insert pack-name)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14872 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14873 start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14874 'vhdl-speedbar-find-file pack-file-marker)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14875 (unless (car pack-file-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14876 (insert "!"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14877 (when (car body-file-marker)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14878 (insert " (")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14879 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14880 (insert "body")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14881 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14882 start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14883 'vhdl-speedbar-find-file body-file-marker)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14884 (insert ")"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14885 (insert-char ?\n 1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14886 (put-text-property visible-start (point) 'invisible nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14887
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14888 (defun vhdl-speedbar-make-subpack-line (pack-name lib-name pack-file-marker
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14889 pack-body-file-marker depth)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14890 "Insert used package entry."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14891 (let ((start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14892 visible-start)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14893 (insert (int-to-string depth) ":")
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14894 (put-text-property start (point) 'invisible t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14895 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14896 (insert-char ? (* depth speedbar-indentation-width))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14897 (put-text-property visible-start (point) 'invisible nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14898 (setq start (point))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14899 (insert ">")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14900 (speedbar-make-button start (point) nil nil nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14901 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14902 (insert " ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14903 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14904 (insert pack-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14905 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14906 start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14907 'vhdl-speedbar-find-file pack-file-marker)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14908 (when (car pack-body-file-marker)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14909 (insert " (")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14910 (setq start (point))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14911 (insert "body")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14912 (speedbar-make-button
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14913 start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14914 'vhdl-speedbar-find-file pack-body-file-marker)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14915 (insert ")"))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14916 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14917 (insert " (" lib-name ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14918 (put-text-property (+ 2 start) (1- (point)) 'face
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14919 'vhdl-speedbar-library-face)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14920 (insert-char ?\n 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14921 (put-text-property visible-start (point) 'invisible nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14922
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14923 (defun vhdl-speedbar-make-subprogram-line (func-name func-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14924 func-body-file-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14925 depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14926 "Insert subprogram entry."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14927 (let ((start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14928 visible-start)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14929 (insert (int-to-string depth) ":")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14930 (put-text-property start (point) 'invisible t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14931 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14932 (insert-char ? (* depth speedbar-indentation-width))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14933 (put-text-property visible-start (point) 'invisible nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14934 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14935 (insert ">")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14936 (speedbar-make-button start (point) nil nil nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14937 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14938 (insert " ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14939 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14940 (insert func-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14941 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14942 start (point) 'vhdl-speedbar-subprogram-face 'speedbar-highlight-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14943 'vhdl-speedbar-find-file func-file-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14944 (when (car func-body-file-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14945 (insert " (")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14946 (setq start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14947 (insert "body")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14948 (speedbar-make-button
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
14949 start (point) 'vhdl-speedbar-subprogram-face 'speedbar-highlight-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14950 'vhdl-speedbar-find-file func-body-file-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14951 (insert ")"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14952 (insert-char ?\n 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14953 (put-text-property visible-start (point) 'invisible nil)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14954
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14955 (defun vhdl-speedbar-make-title-line (text &optional depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14956 "Insert design unit title entry."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14957 (let ((start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14958 visible-start)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14959 (when depth
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14960 (insert (int-to-string depth) ":")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14961 (put-text-property start (point) 'invisible t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14962 (setq visible-start (point))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14963 (insert-char ? (* (or depth 0) speedbar-indentation-width))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14964 (setq start (point))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14965 (insert text)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14966 (speedbar-make-button start (point) nil nil nil nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14967 (insert-char ?\n 1)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
14968 (put-text-property visible-start (point) 'invisible nil)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14969
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14970 (defun vhdl-speedbar-insert-dirs (files level)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14971 "Insert subdirectories."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14972 (let ((dirs (car files)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14973 (while dirs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14974 (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
14975 (car dirs) 'speedbar-dir-follow nil
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14976 'speedbar-directory-face level)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14977 (setq dirs (cdr dirs)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14978
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14979 (defun vhdl-speedbar-dired (text token indent)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14980 "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
14981 (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
14982 (setq speedbar-shown-directories
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14983 (cons (expand-file-name
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
14984 (concat (speedbar-line-directory indent) token "/"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14985 speedbar-shown-directories))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14986 (speedbar-change-expand-button-char ?-)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14987 (speedbar-reset-scanners)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14988 (speedbar-with-writable
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14989 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14990 (end-of-line) (forward-char 1)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14991 (vhdl-speedbar-insert-dirs
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14992 (speedbar-file-lists
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
14993 (concat (speedbar-line-directory indent) token "/"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14994 (1+ indent))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14995 (speedbar-reset-scanners)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14996 (vhdl-speedbar-insert-dir-hierarchy
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14997 (abbreviate-file-name
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
14998 (concat (speedbar-line-directory indent) token "/"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
14999 (1+ indent) speedbar-power-click)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15000 (vhdl-speedbar-update-current-unit t t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15001 ((string-match "-" text) ; we have to contract this node
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15002 (speedbar-reset-scanners)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15003 (let ((oldl speedbar-shown-directories)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15004 (newl nil)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15005 (td (expand-file-name
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
15006 (concat (speedbar-line-directory indent) token))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15007 (while oldl
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15008 (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
15009 (setq newl (cons (car oldl) newl)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15010 (setq oldl (cdr oldl)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15011 (setq speedbar-shown-directories (nreverse newl)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15012 (speedbar-change-expand-button-char ?+)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15013 (speedbar-delete-subblock indent))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15014 (t (error "Nothing to display")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15015 (when (equal (selected-frame) speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15016 (speedbar-center-buffer-smartly)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15017
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15018 (defun vhdl-speedbar-item-info ()
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15019 "Derive and display information about this line item."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15020 (save-excursion
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15021 (beginning-of-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15022 ;; skip invisible number info
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15023 (when (looking-at "^[0-9]+:") (goto-char (match-end 0)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15024 (cond
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15025 ;; project/directory entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15026 ((looking-at "\\s-*<[-+?]>\\s-+\\([^\n]+\\)$")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15027 (if vhdl-speedbar-show-projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15028 (message "Project \"%s\"" (match-string-no-properties 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15029 (speedbar-files-item-info)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15030 ;; design unit entry
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15031 ((looking-at "\\(\\s-*\\([[{][-+?][]}]\\|[| -]*>\\) \\)\"?\\w")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15032 (goto-char (match-end 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15033 (let ((face (get-text-property (point) 'face)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15034 (message
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15035 "%s \"%s\" in \"%s\""
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15036 ;; design unit kind
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15037 (cond ((or (eq face 'vhdl-speedbar-entity-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15038 (eq face 'vhdl-speedbar-entity-selected-face))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15039 (if (equal (match-string 2) ">") "Component" "Entity"))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15040 ((or (eq face 'vhdl-speedbar-architecture-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15041 (eq face 'vhdl-speedbar-architecture-selected-face))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15042 "Architecture")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15043 ((or (eq face 'vhdl-speedbar-configuration-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15044 (eq face 'vhdl-speedbar-configuration-selected-face))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15045 "Configuration")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15046 ((or (eq face 'vhdl-speedbar-package-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15047 (eq face 'vhdl-speedbar-package-selected-face))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15048 "Package")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15049 ((or (eq face 'vhdl-speedbar-instantiation-face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15050 (eq face 'vhdl-speedbar-instantiation-selected-face))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15051 "Instantiation")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15052 ((eq face 'vhdl-speedbar-subprogram-face)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15053 "Subprogram")
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15054 (t ""))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15055 ;; design unit name
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15056 (buffer-substring-no-properties
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15057 (progn (looking-at "\"?\\(\\(\\w\\|_\\)+\\)\"?") (match-beginning 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15058 (match-end 1))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15059 ;; file name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15060 (file-relative-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15061 (or (car (get-text-property (point) 'speedbar-token))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15062 "?")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15063 (vhdl-default-directory)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15064 (t (message "")))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15065
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15066 (defun vhdl-speedbar-line-text ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15067 "Calls `speedbar-line-text' and removes text properties."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15068 (let ((string (speedbar-line-text)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15069 (set-text-properties 0 (length string) nil string)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15070 string))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15071
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15072 (defun vhdl-speedbar-higher-text ()
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15073 "Get speedbar-line-text of higher level."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15074 (let (depth string)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15075 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15076 (beginning-of-line)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15077 (looking-at "^\\([0-9]+\\):")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15078 (setq depth (string-to-number (match-string 1)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15079 (when (re-search-backward (format "^%d: *[[<{][-+?][]>}] \\([^ \n]+\\)" (1- depth)) nil t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15080 (setq string (match-string 1))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15081 (set-text-properties 0 (length string) nil string)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15082 string))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15083
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15084 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15085 ;; Help functions
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15086
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15087 (defun vhdl-speedbar-line-key (&optional indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15088 "Get currently displayed directory of project name."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15089 (if vhdl-speedbar-show-projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15090 (vhdl-speedbar-line-project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15091 (abbreviate-file-name
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
15092 (file-name-as-directory (speedbar-line-directory indent)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15093
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15094 (defun vhdl-speedbar-line-project (&optional indent)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15095 "Get currently displayed project name."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15096 (and vhdl-speedbar-show-projects
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15097 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15098 (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15099 (re-search-backward "^[0-9]+:\\s-*<[-+?]>\\s-+\\([^\n]+\\)$" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15100 (match-string-no-properties 1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15101
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15102 (defun vhdl-add-modified-file ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15103 "Add file to `vhdl-modified-file-list'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15104 (when vhdl-file-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15105 (add-to-list 'vhdl-modified-file-list (buffer-file-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15106 nil)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15107
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15108 (defun vhdl-resolve-paths (path-list)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15109 "Resolve path wildcards in PATH-LIST."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15110 (let (path-list-1 path-list-2 path-beg path-end dir)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15111 ;; eliminate non-existent directories
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15112 (while path-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15113 (setq dir (car path-list))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15114 (string-match "\\(-r \\)?\\(\\([^?*]*[/\\]\\)*\\)" dir)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15115 (if (file-directory-p (match-string 2 dir))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15116 (setq path-list-1 (cons dir path-list-1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15117 (vhdl-warning-when-idle "No such directory: \"%s\"" (match-string 2 dir)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15118 (setq path-list (cdr path-list)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15119 ;; resolve path wildcards
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15120 (while path-list-1
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15121 (setq dir (car path-list-1))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15122 (if (string-match "\\(-r \\)?\\(\\([^?*]*[/\\]\\)*\\)\\([^/\\]*[?*][^/\\]*\\)\\([/\\].*\\)" dir)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15123 (progn
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15124 (setq path-beg (match-string 1 dir)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15125 path-end (match-string 5 dir))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15126 (setq path-list-1
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15127 (append
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15128 (mapcar
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15129 (function
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15130 (lambda (var) (concat path-beg var path-end)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15131 (let ((all-list (vhdl-directory-files
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15132 (match-string 2 dir) t
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15133 (concat "\\<" (wildcard-to-regexp
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15134 (match-string 4 dir)))))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15135 dir-list)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15136 (while all-list
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15137 (when (file-directory-p (car all-list))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15138 (setq dir-list (cons (car all-list) dir-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15139 (setq all-list (cdr all-list)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15140 dir-list))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15141 (cdr path-list-1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15142 (string-match "\\(-r \\)?\\(.*\\)[/\\].*" dir)
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15143 (when (file-directory-p (match-string 2 dir))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15144 (setq path-list-2 (cons dir path-list-2)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15145 (setq path-list-1 (cdr path-list-1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15146 (nreverse path-list-2)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15147
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15148 (defun vhdl-speedbar-goto-this-unit (directory unit)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15149 "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
15150 (let ((dest (point)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15151 (if (and (if vhdl-speedbar-show-projects
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15152 (progn (goto-char (point-min)) t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15153 (speedbar-goto-this-file directory))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15154 (re-search-forward (concat "[]}] " unit "\\>") nil t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15155 (progn (speedbar-position-cursor-on-line)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15156 t)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15157 (goto-char dest)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15158 nil)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15159
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15160 (defun vhdl-speedbar-find-file (text token indent)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15161 "When user clicks on TEXT, load file with name and position in TOKEN.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15162 Jump to the design unit if `vhdl-speedbar-jump-to-unit' is t or if the file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15163 is already shown in a buffer."
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15164 (if (not (car token))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15165 (error "ERROR: File cannot be found")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15166 (let ((buffer (get-file-buffer (car token))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15167 (speedbar-find-file-in-frame (car token))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15168 (when (or vhdl-speedbar-jump-to-unit buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15169 (goto-line (cdr token))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15170 (recenter))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15171 (vhdl-speedbar-update-current-unit t t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15172 (speedbar-set-timer speedbar-update-speed)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15173 (speedbar-maybee-jump-to-attached-frame))))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15174
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15175 (defun vhdl-speedbar-port-copy ()
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15176 "Copy the port of the entity/component or subprogram under the cursor."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15177 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15178 (let ((is-entity (vhdl-speedbar-check-unit 'entity)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15179 (if (not (or is-entity (vhdl-speedbar-check-unit 'subprogram)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15180 (error "ERROR: No entity/component or subprogram under cursor")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15181 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15182 (if (looking-at "\\([0-9]\\)+:\\s-*\\(\\[[-+?]\\]\\|>\\) \\(\\(\\w\\|\\s_\\)+\\)")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15183 (condition-case info
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15184 (let ((token (get-text-property
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15185 (match-beginning 3) 'speedbar-token)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15186 (vhdl-visit-file (car token) t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15187 (progn (goto-line (cdr token))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15188 (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15189 (if is-entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15190 (vhdl-port-copy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15191 (vhdl-subprog-copy)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15192 (error (error "ERROR: %s not scanned successfully\n (%s)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15193 (if is-entity "Port" "Interface") (cadr info))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15194 (error "ERROR: No entity/component or subprogram on current line")))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15195
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15196 (defun vhdl-speedbar-place-component ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15197 "Place the entity/component under the cursor as component."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15198 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15199 (if (not (vhdl-speedbar-check-unit 'entity))
63428
252224857a7b (vhdl-speedbar-place-component): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents: 62917
diff changeset
15200 (error "ERROR: No entity/component under cursor")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15201 (vhdl-speedbar-port-copy)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15202 (if (fboundp 'speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15203 (speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15204 (select-frame speedbar-attached-frame))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15205 (vhdl-compose-place-component)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15206 (select-frame speedbar-frame)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15207
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15208 (defun vhdl-speedbar-configuration ()
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15209 "Generate configuration for the architecture under the cursor."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15210 (interactive)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15211 (if (not (vhdl-speedbar-check-unit 'architecture))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15212 (error "ERROR: No architecture under cursor")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15213 (let ((arch-name (vhdl-speedbar-line-text))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15214 (ent-name (vhdl-speedbar-higher-text)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15215 (if (fboundp 'speedbar-select-attached-frame)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15216 (speedbar-select-attached-frame)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15217 (select-frame speedbar-attached-frame))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15218 (vhdl-compose-configuration ent-name arch-name))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15219
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15220 (defun vhdl-speedbar-select-mra ()
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15221 "Select the architecture under the cursor as MRA."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15222 (interactive)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15223 (if (not (vhdl-speedbar-check-unit 'architecture))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15224 (error "ERROR: No architecture under cursor")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15225 (let* ((arch-key (downcase (vhdl-speedbar-line-text)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15226 (ent-key (downcase (vhdl-speedbar-higher-text)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15227 (ent-alist (aget vhdl-entity-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15228 (or (vhdl-project-p) default-directory) t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15229 (ent-entry (aget ent-alist ent-key t)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15230 (setcar (cddr (cddr ent-entry)) arch-key) ; (nth 4 ent-entry)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15231 (speedbar-refresh))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15232
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15233 (defun vhdl-speedbar-make-design ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15234 "Make (compile) design unit or directory/project under the cursor."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15235 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15236 (if (not (save-excursion (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15237 (looking-at "[0-9]+: *\\(\\(\\[\\)\\|<\\)")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15238 (error "ERROR: No primary design unit or directory/project under cursor")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15239 (let ((is-unit (match-string 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15240 (unit-name (vhdl-speedbar-line-text))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15241 (vhdl-project (vhdl-speedbar-line-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15242 (directory (file-name-as-directory
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
15243 (or (speedbar-line-file) (speedbar-line-directory)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15244 (if (fboundp 'speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15245 (speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15246 (select-frame speedbar-attached-frame))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15247 (let ((default-directory directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15248 (vhdl-make (and is-unit unit-name))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15249
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15250 (defun vhdl-speedbar-generate-makefile ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15251 "Generate Makefile for directory/project under the cursor."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15252 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15253 (let ((vhdl-project (vhdl-speedbar-line-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15254 (default-directory (file-name-as-directory
65809
f528ccbc5de9 * speedbar.el (speedbar-ignored-path-regexp, speedbar-line-path)
Chong Yidong <cyd@stupidchicken.com>
parents: 65735
diff changeset
15255 (or (speedbar-line-file) (speedbar-line-directory)))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15256 (vhdl-generate-makefile)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15257
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15258 (defun vhdl-speedbar-check-unit (design-unit)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15259 "Check whether design unit under cursor corresponds to DESIGN-UNIT (or its
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15260 expansion function)."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15261 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15262 (speedbar-position-cursor-on-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15263 (cond ((eq design-unit 'entity)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15264 (memq (get-text-property (match-end 0) 'face)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15265 '(vhdl-speedbar-entity-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15266 vhdl-speedbar-entity-selected-face)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15267 ((eq design-unit 'architecture)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15268 (memq (get-text-property (match-end 0) 'face)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15269 '(vhdl-speedbar-architecture-face
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15270 vhdl-speedbar-architecture-selected-face)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15271 ((eq design-unit 'subprogram)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15272 (eq (get-text-property (match-end 0) 'face)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15273 'vhdl-speedbar-subprogram-face))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15274 (t nil))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15275
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15276 (defun vhdl-speedbar-set-depth (depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15277 "Set hierarchy display depth to DEPTH and refresh speedbar."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15278 (setq vhdl-speedbar-hierarchy-depth depth)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15279 (speedbar-refresh))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15280
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15281 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15282 ;; Fontification
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15283
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15284 (defface vhdl-speedbar-entity-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15285 '((((class color) (background light)) (:foreground "ForestGreen"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15286 (((class color) (background dark)) (:foreground "PaleGreen")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15287 "Face used for displaying entity names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15288 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15289
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15290 (defface vhdl-speedbar-architecture-face
65314
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 65302
diff changeset
15291 '((((min-colors 88) (class color) (background light)) (:foreground "Blue1"))
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 65302
diff changeset
15292 (((class color) (background light)) (:foreground "Blue"))
65491
411b230f06b5 (conf-alist, conf-entry, conf-key, ent-alist): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 65314
diff changeset
15293
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15294 (((class color) (background dark)) (:foreground "LightSkyBlue")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15295 "Face used for displaying architecture names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15296 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15297
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15298 (defface vhdl-speedbar-configuration-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15299 '((((class color) (background light)) (:foreground "DarkGoldenrod"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15300 (((class color) (background dark)) (:foreground "Salmon")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15301 "Face used for displaying configuration names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15302 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15303
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15304 (defface vhdl-speedbar-package-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15305 '((((class color) (background light)) (:foreground "Grey50"))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15306 (((class color) (background dark)) (:foreground "Grey80")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15307 "Face used for displaying package names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15308 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15309
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15310 (defface vhdl-speedbar-library-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15311 '((((class color) (background light)) (:foreground "Purple"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15312 (((class color) (background dark)) (:foreground "Orchid1")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15313 "Face used for displaying library names."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15314 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15315
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15316 (defface vhdl-speedbar-instantiation-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15317 '((((class color) (background light)) (:foreground "Brown"))
61394
31aa9a390538 * mh-customize.el (mh-speedbar-selected-folder-face): Special case
Dan Nicolaescu <dann@ics.uci.edu>
parents: 60925
diff changeset
15318 (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1"))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15319 (((class color) (background dark)) (:foreground "Yellow")))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15320 "Face used for displaying instantiation names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15321 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15322
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15323 (defface vhdl-speedbar-subprogram-face
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15324 '((((class color) (background light)) (:foreground "Orchid4"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15325 (((class color) (background dark)) (:foreground "BurlyWood2")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15326 "Face used for displaying subprogram names."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15327 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15328
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15329 (defface vhdl-speedbar-entity-selected-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15330 '((((class color) (background light)) (:foreground "ForestGreen" :underline t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15331 (((class color) (background dark)) (:foreground "PaleGreen" :underline t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15332 "Face used for displaying entity names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15333 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15334
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15335 (defface vhdl-speedbar-architecture-selected-face
65314
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 65302
diff changeset
15336 '((((min-colors 88) (class color) (background light)) (:foreground
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 65302
diff changeset
15337 "Blue1" :underline t))
6c488c4c11c6 * term/xterm.el (terminal-init-xterm): Add eval-when-compile to
Dan Nicolaescu <dann@ics.uci.edu>
parents: 65302
diff changeset
15338 (((class color) (background light)) (:foreground "Blue" :underline t))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15339 (((class color) (background dark)) (:foreground "LightSkyBlue" :underline t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15340 "Face used for displaying architecture names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15341 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15342
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15343 (defface vhdl-speedbar-configuration-selected-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15344 '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15345 (((class color) (background dark)) (:foreground "Salmon" :underline t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15346 "Face used for displaying configuration names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15347 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15348
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15349 (defface vhdl-speedbar-package-selected-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15350 '((((class color) (background light)) (:foreground "Grey50" :underline t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15351 (((class color) (background dark)) (:foreground "Grey80" :underline t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15352 "Face used for displaying package names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15353 :group 'speedbar-faces)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15354
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15355 (defface vhdl-speedbar-instantiation-selected-face
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15356 '((((class color) (background light)) (:foreground "Brown" :underline t))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15357 (((class color) (background dark)) (:foreground "Yellow" :underline t)))
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15358 "Face used for displaying instantiation names."
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15359 :group 'speedbar-faces)
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
15360
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15361 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15362 ;; Initialization
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15363
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15364 ;; add speedbar
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15365 (when (fboundp 'speedbar)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15366 (condition-case ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15367 (when (and vhdl-speedbar-auto-open
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15368 (not (and (boundp 'speedbar-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15369 (frame-live-p speedbar-frame))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15370 (speedbar-frame-mode 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15371 (if (fboundp 'speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15372 (speedbar-select-attached-frame)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15373 (select-frame speedbar-attached-frame)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15374 (error (vhdl-warning-when-idle "ERROR: An error occurred while opening speedbar"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15375
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15376 ;; initialize speedbar
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15377 (if (not (boundp 'speedbar-frame))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15378 (add-hook 'speedbar-load-hook 'vhdl-speedbar-initialize)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15379 (vhdl-speedbar-initialize)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15380 (when speedbar-frame (vhdl-speedbar-refresh)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15381
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15382
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15383 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15384 ;;; Structural composition
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15385 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15386
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15387 (defun vhdl-get-components-package-name ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15388 "Return the name of the components package."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15389 (let ((project (vhdl-project-p)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15390 (if project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15391 (vhdl-replace-string (car vhdl-components-package-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15392 (subst-char-in-string ? ?_ project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15393 (cdr vhdl-components-package-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15394
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15395 (defun vhdl-compose-new-component ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15396 "Create entity and architecture for new component."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15397 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15398 (let* ((case-fold-search t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15399 (ent-name (read-from-minibuffer "entity name: "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15400 nil vhdl-minibuffer-local-map))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15401 (arch-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15402 (if (equal (cdr vhdl-compose-architecture-name) "")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15403 (read-from-minibuffer "architecture name: "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15404 nil vhdl-minibuffer-local-map)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15405 (vhdl-replace-string vhdl-compose-architecture-name ent-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15406 ent-file-name arch-file-name ent-buffer arch-buffer project)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15407 (message "Creating component \"%s(%s)\"..." ent-name arch-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15408 ;; open entity file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15409 (unless (eq vhdl-compose-create-files 'none)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15410 (setq ent-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15411 (concat (vhdl-replace-string vhdl-entity-file-name ent-name t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15412 "." (file-name-extension (buffer-file-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15413 (when (and (file-exists-p ent-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15414 (not (y-or-n-p (concat "File \"" ent-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15415 "\" exists; overwrite? "))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15416 (error "ERROR: Creating component...aborted"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15417 (find-file ent-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15418 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15419 (set-buffer-modified-p nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15420 ;; insert header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15421 (if vhdl-compose-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15422 (progn (vhdl-template-header)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15423 (goto-char (point-max)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15424 (vhdl-comment-display-line) (insert "\n\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15425 ;; insert library clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15426 (vhdl-template-package-std-logic-1164)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15427 (when vhdl-use-components-package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15428 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15429 (vhdl-template-standard-package (vhdl-work-library)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15430 (vhdl-get-components-package-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15431 (insert "\n\n") (vhdl-comment-display-line) (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15432 ;; insert entity declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15433 (vhdl-insert-keyword "ENTITY ") (insert ent-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15434 (vhdl-insert-keyword " IS\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15435 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15436 (indent-to vhdl-basic-offset) (vhdl-insert-keyword "GENERIC (\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15437 (indent-to (* 2 vhdl-basic-offset)) (insert ");\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15438 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15439 (indent-to vhdl-basic-offset) (vhdl-insert-keyword "PORT (\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15440 (indent-to (* 2 vhdl-basic-offset)) (insert ");\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15441 (when (memq vhdl-insert-empty-lines '(unit all)) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15442 (vhdl-insert-keyword "END ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15443 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ENTITY "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15444 (insert ent-name ";\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15445 (vhdl-comment-display-line) (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15446 ;; open architecture file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15447 (if (not (eq vhdl-compose-create-files 'separate))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15448 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15449 (setq ent-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15450 (setq arch-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15451 (concat (vhdl-replace-string vhdl-architecture-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15452 (concat ent-name " " arch-name) t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15453 "." (file-name-extension (buffer-file-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15454 (when (and (file-exists-p arch-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15455 (not (y-or-n-p (concat "File \"" arch-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15456 "\" exists; overwrite? "))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15457 (error "ERROR: Creating component...aborted"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15458 (find-file arch-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15459 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15460 (set-buffer-modified-p nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15461 ;; insert header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15462 (if vhdl-compose-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15463 (progn (vhdl-template-header)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15464 (goto-char (point-max)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15465 (vhdl-comment-display-line) (insert "\n\n")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15466 ;; insert architecture body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15467 (vhdl-insert-keyword "ARCHITECTURE ") (insert arch-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15468 (vhdl-insert-keyword " OF ") (insert ent-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15469 (vhdl-insert-keyword " IS\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15470 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15471 (indent-to vhdl-basic-offset) (insert "-- Internal signal declarations\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15472 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15473 (unless (or vhdl-use-components-package (vhdl-use-direct-instantiation))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15474 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15475 (indent-to vhdl-basic-offset) (insert "-- Component declarations\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15476 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15477 (vhdl-insert-keyword "BEGIN")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15478 (when vhdl-self-insert-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15479 (insert " -- ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15480 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ARCHITECTURE "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15481 (insert arch-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15482 (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15483 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15484 (indent-to vhdl-basic-offset) (insert "-- Component instantiations\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15485 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15486 (vhdl-insert-keyword "END ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15487 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "ARCHITECTURE "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15488 (insert arch-name ";\n\n")
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15489 ;; insert footer and save
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15490 (if (and vhdl-compose-include-header (not (equal vhdl-file-footer "")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15491 (vhdl-template-footer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15492 (vhdl-comment-display-line) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15493 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15494 (setq arch-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15495 (when ent-buffer (set-buffer ent-buffer) (save-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15496 (set-buffer arch-buffer) (save-buffer)
65584
6dbba0bd58df Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents: 65491
diff changeset
15497 (message "%s"
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15498 (concat (format "Creating component \"%s(%s)\"...done" ent-name arch-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15499 (and ent-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15500 (format "\n File created: \"%s\"" ent-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15501 (and arch-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15502 (format "\n File created: \"%s\"" arch-file-name))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15503
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15504 (defun vhdl-compose-place-component ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15505 "Place new component by pasting current port as component declaration and
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15506 component instantiation."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15507 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15508 (if (not vhdl-port-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15509 (error "ERROR: No port has been read")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15510 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15511 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15512 (unless (or (re-search-backward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15513 (re-search-forward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15514 (error "ERROR: No architecture found"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15515 (let* ((ent-name (match-string 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15516 (ent-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15517 (concat (vhdl-replace-string vhdl-entity-file-name ent-name t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15518 "." (file-name-extension (buffer-file-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15519 (orig-buffer (current-buffer)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15520 (message "Placing component \"%s\"..." (nth 0 vhdl-port-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15521 ;; place component declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15522 (unless (or vhdl-use-components-package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15523 (vhdl-use-direct-instantiation)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15524 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15525 (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15526 (concat "^\\s-*component\\s-+"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15527 (car vhdl-port-list) "\\>") nil t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15528 (re-search-forward "^begin\\>" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15529 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15530 (skip-chars-backward " \t\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15531 (insert "\n\n") (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15532 (vhdl-port-paste-component t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15533 ;; place component instantiation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15534 (re-search-forward "^end\\>" nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15535 (beginning-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15536 (skip-chars-backward " \t\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15537 (insert "\n\n") (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15538 (vhdl-port-paste-instance nil t t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15539 ;; place use clause for used packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15540 (when (nth 3 vhdl-port-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15541 ;; open entity file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15542 (when (file-exists-p ent-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15543 (find-file ent-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15544 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15545 (unless (re-search-forward (concat "^entity[ \t\n]+" ent-name "[ \t\n]+is\\>") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15546 (error "ERROR: Entity not found: \"%s\"" ent-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15547 (goto-char (match-beginning 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15548 (if (and (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15549 (re-search-backward "^\\(library\\|use\\)\\|end\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15550 (match-string 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15551 (progn (goto-char (match-end 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15552 (beginning-of-line 2))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15553 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15554 (backward-char))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15555 (vhdl-port-paste-context-clause)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15556 (switch-to-buffer orig-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15557 (message "Placing component \"%s\"...done" (nth 0 vhdl-port-list)))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15558
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15559 (defun vhdl-compose-wire-components ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15560 "Connect components."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15561 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15562 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15563 (vhdl-prepare-search-2
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15564 (unless (or (re-search-backward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15565 (re-search-forward "^architecture[ \t\n]+\\w+[ \t\n]+of[ \t\n]+\\(\\w+\\)[ \t\n]+is\\>" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15566 (error "ERROR: No architecture found"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15567 (let* ((ent-name (match-string 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15568 (ent-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15569 (concat (vhdl-replace-string vhdl-entity-file-name ent-name t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15570 "." (file-name-extension (buffer-file-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15571 (arch-decl-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15572 (arch-stat-pos (re-search-forward "^begin\\>" nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15573 (arch-end-pos (re-search-forward "^end\\>" nil))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15574 (pack-name (vhdl-get-components-package-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15575 (pack-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15576 (concat (vhdl-replace-string vhdl-package-file-name pack-name t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15577 "." (file-name-extension (buffer-file-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15578 inst-name comp-name comp-ent-name comp-ent-file-name has-generic
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15579 port-alist generic-alist inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15580 signal-name signal-entry signal-alist local-list written-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15581 single-in-list multi-in-list single-out-list multi-out-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15582 constant-name constant-entry constant-alist single-list multi-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15583 port-beg-pos port-in-pos port-out-pos port-inst-pos port-end-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15584 generic-beg-pos generic-pos generic-inst-pos generic-end-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15585 signal-beg-pos signal-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15586 constant-temp-pos port-temp-pos signal-temp-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15587 (message "Wiring components...")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15588 ;; process all instances
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15589 (goto-char arch-stat-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15590 (while (re-search-forward
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15591 (concat "^[ \t]*\\(\\w+\\)[ \t\n]*:[ \t\n]*\\("
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15592 "\\(component[ \t\n]+\\)?\\(\\w+\\)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15593 "[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(\\(generic\\)\\|port\\)[ \t\n]+map\\|"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15594 "\\(\\(entity\\)\\|configuration\\)[ \t\n]+\\(\\(\\w+\\)\\.\\)?\\(\\w+\\)\\([ \t\n]*(\\(\\w+\\))\\)?"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15595 "[ \t\n]+\\(--[^\n]*\n[ \t\n]*\\)*\\(\\(generic\\)\\|port\\)[ \t\n]+map\\)[ \t\n]*(") arch-end-pos t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15596 (setq inst-name (match-string-no-properties 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15597 comp-name (match-string-no-properties 4)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15598 comp-ent-name (match-string-no-properties 12)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15599 has-generic (or (match-string 7) (match-string 17)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15600 ;; get port ...
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15601 (if comp-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15602 ;; ... from component declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15603 (vhdl-visit-file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15604 (when vhdl-use-components-package pack-file-name) t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15605 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15606 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15607 (unless (re-search-forward (concat "^\\s-*component[ \t\n]+" comp-name "\\>") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15608 (error "ERROR: Component declaration not found: \"%s\"" comp-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15609 (vhdl-port-copy)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15610 ;; ... from entity declaration (direct instantiation)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15611 (setq comp-ent-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15612 (concat (vhdl-replace-string vhdl-entity-file-name comp-ent-name t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15613 "." (file-name-extension (buffer-file-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15614 (vhdl-visit-file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15615 comp-ent-file-name t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15616 (save-excursion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15617 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15618 (unless (re-search-forward (concat "^\\s-*entity[ \t\n]+" comp-ent-name "\\>") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15619 (error "ERROR: Entity declaration not found: \"%s\"" comp-ent-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15620 (vhdl-port-copy))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15621 (vhdl-port-flatten t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15622 (setq generic-alist (nth 1 vhdl-port-list)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15623 port-alist (nth 2 vhdl-port-list)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15624 vhdl-port-list nil)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15625 (setq constant-alist nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15626 signal-alist nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15627 (when has-generic
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15628 ;; process all constants in generic map
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15629 (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15630 (while (vhdl-parse-string "\\(\\(\\w+\\)[ \t\n]*=>[ \t\n]*\\)?\\(\\w+\\),?" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15631 (setq constant-name (match-string-no-properties 3))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15632 (setq constant-entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15633 (cons constant-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15634 (if (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15635 (or (aget generic-alist (match-string 2) t)
63490
65b21147737a (zone-mode-update-serial): Don't use `format' on `error' arguments.
Juanma Barranquero <lekktu@gmail.com>
parents: 63456
diff changeset
15636 (error "ERROR: Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15637 (cdar generic-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15638 (setq constant-alist (cons constant-entry constant-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15639 (setq constant-name (downcase constant-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15640 (if (or (member constant-name single-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15641 (member constant-name multi-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15642 (progn (setq single-list (delete constant-name single-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15643 (add-to-list 'multi-list constant-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15644 (add-to-list 'single-list constant-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15645 (unless (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15646 (setq generic-alist (cdr generic-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15647 (vhdl-forward-syntactic-ws))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15648 (vhdl-re-search-forward "\\<port\\s-+map[ \t\n]*(" nil t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15649 ;; process all signals in port map
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15650 (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15651 (while (vhdl-parse-string "\\(\\(\\w+\\)[ \t\n]*=>[ \t\n]*\\)?\\(\\w+\\),?" t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15652 (setq signal-name (match-string-no-properties 3))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15653 (setq signal-entry (cons signal-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15654 (if (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15655 (or (aget port-alist (match-string 2) t)
63490
65b21147737a (zone-mode-update-serial): Don't use `format' on `error' arguments.
Juanma Barranquero <lekktu@gmail.com>
parents: 63456
diff changeset
15656 (error "ERROR: Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15657 (cdar port-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15658 (setq signal-alist (cons signal-entry signal-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15659 (setq signal-name (downcase signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15660 (if (equal (upcase (nth 2 signal-entry)) "IN")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15661 ;; input signal
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15662 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15663 ((member signal-name local-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15664 nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15665 ((or (member signal-name single-out-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15666 (member signal-name multi-out-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15667 (setq single-out-list (delete signal-name single-out-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15668 (setq multi-out-list (delete signal-name multi-out-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15669 (add-to-list 'local-list signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15670 ((member signal-name single-in-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15671 (setq single-in-list (delete signal-name single-in-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15672 (add-to-list 'multi-in-list signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15673 ((not (member signal-name multi-in-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15674 (add-to-list 'single-in-list signal-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15675 ;; output signal
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15676 (cond
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15677 ((member signal-name local-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15678 nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15679 ((or (member signal-name single-in-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15680 (member signal-name multi-in-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15681 (setq single-in-list (delete signal-name single-in-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15682 (setq multi-in-list (delete signal-name multi-in-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15683 (add-to-list 'local-list signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15684 ((member signal-name single-out-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15685 (setq single-out-list (delete signal-name single-out-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15686 (add-to-list 'multi-out-list signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15687 ((not (member signal-name multi-out-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15688 (add-to-list 'single-out-list signal-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15689 (unless (match-string 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15690 (setq port-alist (cdr port-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15691 (vhdl-forward-syntactic-ws))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15692 (setq inst-alist (cons (list inst-name (nreverse constant-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15693 (nreverse signal-alist)) inst-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15694 ;; prepare signal insertion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15695 (vhdl-goto-marker arch-decl-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15696 (forward-line 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15697 (re-search-forward "^\\s-*-- Internal signal declarations[ \t\n]*-*\n" arch-stat-pos t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15698 (setq signal-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15699 (while (progn (vhdl-forward-syntactic-ws)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15700 (looking-at "signal\\>"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15701 (beginning-of-line 2)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15702 (delete-region signal-pos (point)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15703 (setq signal-beg-pos signal-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15704 ;; open entity file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15705 (when (file-exists-p ent-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15706 (find-file ent-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15707 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15708 (unless (re-search-forward (concat "^entity[ \t\n]+" ent-name "[ \t\n]+is\\>") nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15709 (error "ERROR: Entity not found: \"%s\"" ent-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15710 ;; prepare generic clause insertion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15711 (unless (and (re-search-forward "\\(^\\s-*generic[ \t\n]*(\\)\\|^end\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15712 (match-string 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15713 (goto-char (match-beginning 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15714 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15715 (insert "generic ();\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15716 (backward-char 4))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15717 (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15718 (setq generic-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15719 (forward-sexp) (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15720 (delete-region generic-pos (point)) (delete-char 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15721 (insert "(\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15722 (when multi-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15723 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15724 (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15725 (insert "-- global generics\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15726 (setq generic-beg-pos (point-marker) generic-pos (point-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15727 generic-inst-pos (point-marker) generic-end-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15728 ;; prepare port clause insertion
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15729 (unless (and (re-search-forward "\\(^\\s-*port[ \t\n]*(\\)\\|^end\\>" nil t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15730 (match-string 1))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15731 (goto-char (match-beginning 0))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15732 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15733 (insert "port ();\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15734 (backward-char 4))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15735 (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15736 (setq port-in-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15737 (forward-sexp) (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15738 (delete-region port-in-pos (point)) (delete-char 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15739 (insert "(\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15740 (when (or multi-in-list multi-out-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15741 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15742 (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15743 (insert "-- global ports\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15744 (setq port-beg-pos (point-marker) port-in-pos (point-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15745 port-out-pos (point-marker) port-inst-pos (point-marker)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15746 port-end-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15747 ;; insert generics, ports and signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15748 (setq inst-alist (nreverse inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15749 (while inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15750 (setq inst-name (nth 0 (car inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15751 constant-alist (nth 1 (car inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15752 signal-alist (nth 2 (car inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15753 constant-temp-pos generic-inst-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15754 port-temp-pos port-inst-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15755 signal-temp-pos signal-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15756 ;; generics
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15757 (while constant-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15758 (setq constant-name (downcase (caar constant-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15759 constant-entry (car constant-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15760 (cond ((member constant-name written-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15761 nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15762 ((member constant-name multi-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15763 (vhdl-goto-marker generic-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15764 (setq generic-end-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15765 (vhdl-max-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15766 generic-end-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15767 (vhdl-compose-insert-generic constant-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15768 (setq generic-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15769 (add-to-list 'written-list constant-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15770 (t
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15771 (vhdl-goto-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15772 (vhdl-max-marker generic-inst-pos generic-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15773 (setq generic-end-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15774 (vhdl-compose-insert-generic constant-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15775 (setq generic-inst-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15776 (add-to-list 'written-list constant-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15777 (setq constant-alist (cdr constant-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15778 (when (/= constant-temp-pos generic-inst-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15779 (vhdl-goto-marker (vhdl-max-marker constant-temp-pos generic-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15780 (insert "\n") (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15781 (insert "-- generics for \"" inst-name "\"\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15782 (vhdl-goto-marker generic-inst-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15783 ;; ports and signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15784 (while signal-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15785 (setq signal-name (downcase (caar signal-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15786 signal-entry (car signal-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15787 (cond ((member signal-name written-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15788 nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15789 ((member signal-name multi-in-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15790 (vhdl-goto-marker port-in-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15791 (setq port-end-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15792 (vhdl-max-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15793 port-end-pos (vhdl-compose-insert-port signal-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15794 (setq port-in-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15795 (add-to-list 'written-list signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15796 ((member signal-name multi-out-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15797 (vhdl-goto-marker (vhdl-max-marker port-out-pos port-in-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15798 (setq port-end-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15799 (vhdl-max-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15800 port-end-pos (vhdl-compose-insert-port signal-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15801 (setq port-out-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15802 (add-to-list 'written-list signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15803 ((or (member signal-name single-in-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15804 (member signal-name single-out-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15805 (vhdl-goto-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15806 (vhdl-max-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15807 port-inst-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15808 (vhdl-max-marker port-out-pos port-in-pos)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15809 (setq port-end-pos (vhdl-compose-insert-port signal-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15810 (setq port-inst-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15811 (add-to-list 'written-list signal-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15812 ((equal (upcase (nth 2 signal-entry)) "OUT")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15813 (vhdl-goto-marker signal-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15814 (vhdl-compose-insert-signal signal-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15815 (setq signal-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15816 (add-to-list 'written-list signal-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15817 (setq signal-alist (cdr signal-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15818 (when (/= port-temp-pos port-inst-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15819 (vhdl-goto-marker
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15820 (vhdl-max-marker port-temp-pos
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15821 (vhdl-max-marker port-in-pos port-out-pos)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15822 (insert "\n") (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15823 (insert "-- ports to \"" inst-name "\"\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15824 (vhdl-goto-marker port-inst-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15825 (when (/= signal-temp-pos signal-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15826 (vhdl-goto-marker signal-temp-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15827 (insert "\n") (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15828 (insert "-- outputs of \"" inst-name "\"\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15829 (vhdl-goto-marker signal-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15830 (setq inst-alist (cdr inst-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15831 ;; finalize generic/port clause
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15832 (vhdl-goto-marker generic-end-pos) (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15833 (when (= generic-beg-pos generic-end-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15834 (insert "\n") (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15835 (insert ";") (backward-char))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15836 (insert ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15837 (vhdl-goto-marker port-end-pos) (backward-char)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15838 (when (= port-beg-pos port-end-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15839 (insert "\n") (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15840 (insert ";") (backward-char))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15841 (insert ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15842 ;; align everything
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15843 (when vhdl-auto-align
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15844 (vhdl-goto-marker generic-beg-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15845 (vhdl-align-region-groups generic-beg-pos generic-end-pos 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15846 (vhdl-align-region-groups port-beg-pos port-end-pos 1)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15847 (vhdl-goto-marker signal-beg-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15848 (vhdl-align-region-groups signal-beg-pos signal-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15849 (switch-to-buffer (marker-buffer signal-beg-pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15850 (message "Wiring components...done")))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15851
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15852 (defun vhdl-compose-insert-generic (entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15853 "Insert ENTRY as generic declaration."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15854 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15855 (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15856 (insert (nth 0 entry) " : " (nth 1 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15857 (when (nth 2 entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15858 (insert " := " (nth 2 entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15859 (insert ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15860 (setq pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15861 (when (and vhdl-include-port-comments (nth 3 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15862 (vhdl-comment-insert-inline (nth 3 entry) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15863 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15864 pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15865
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15866 (defun vhdl-compose-insert-port (entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15867 "Insert ENTRY as port declaration."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15868 (let (pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15869 (indent-to (* 2 vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15870 (insert (nth 0 entry) " : " (nth 2 entry) " " (nth 3 entry) ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15871 (setq pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15872 (when (and vhdl-include-port-comments (nth 4 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15873 (vhdl-comment-insert-inline (nth 4 entry) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15874 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15875 pos))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15876
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15877 (defun vhdl-compose-insert-signal (entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15878 "Insert ENTRY as signal declaration."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15879 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15880 (insert "signal " (nth 0 entry) " : " (nth 3 entry) ";")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15881 (when (and vhdl-include-port-comments (nth 4 entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15882 (vhdl-comment-insert-inline (nth 4 entry) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15883 (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15884
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15885 (defun vhdl-compose-components-package ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15886 "Generate a package containing component declarations for all entities in the
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15887 current project/directory."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15888 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15889 (vhdl-require-hierarchy-info)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15890 (let* ((project (vhdl-project-p))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15891 (pack-name (vhdl-get-components-package-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15892 (pack-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15893 (concat (vhdl-replace-string vhdl-package-file-name pack-name t)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15894 "." (file-name-extension (buffer-file-name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15895 (ent-alist (aget vhdl-entity-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15896 (or project default-directory) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15897 (lazy-lock-minimum-size 0)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15898 clause-pos component-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15899 (message "Generating components package \"%s\"..." pack-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15900 ;; open package file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15901 (when (and (file-exists-p pack-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15902 (not (y-or-n-p (concat "File \"" pack-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15903 "\" exists; overwrite? "))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15904 (error "ERROR: Generating components package...aborted"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15905 (find-file pack-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15906 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15907 ;; insert header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15908 (if vhdl-compose-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15909 (progn (vhdl-template-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15910 (concat "Components package (generated by Emacs VHDL Mode "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15911 vhdl-version ")"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15912 (goto-char (point-max)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15913 (vhdl-comment-display-line) (insert "\n\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15914 ;; insert std_logic_1164 package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15915 (vhdl-template-package-std-logic-1164)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15916 (insert "\n") (setq clause-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15917 (insert "\n") (vhdl-comment-display-line) (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15918 ;; insert package declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15919 (vhdl-insert-keyword "PACKAGE ") (insert pack-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15920 (vhdl-insert-keyword " IS\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15921 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15922 (indent-to vhdl-basic-offset) (insert "-- Component declarations\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15923 (indent-to vhdl-basic-offset) (vhdl-comment-display-line) (insert "\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15924 (indent-to vhdl-basic-offset)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15925 (setq component-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15926 (insert "\n\n") (vhdl-insert-keyword "END ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15927 (unless (vhdl-standard-p '87) (vhdl-insert-keyword "PACKAGE "))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15928 (insert pack-name ";\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15929 ;; insert footer
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15930 (if (and vhdl-compose-include-header (not (equal vhdl-file-footer "")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15931 (vhdl-template-footer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15932 (vhdl-comment-display-line) (insert "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15933 ;; insert component declarations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15934 (while ent-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15935 (vhdl-visit-file (nth 2 (car ent-alist)) nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15936 (progn (goto-line (nth 3 (car ent-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15937 (end-of-line)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15938 (vhdl-port-copy)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15939 (goto-char component-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15940 (vhdl-port-paste-component t)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15941 (when (cdr ent-alist) (insert "\n\n") (indent-to vhdl-basic-offset))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15942 (setq component-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15943 (goto-char clause-pos)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15944 (vhdl-port-paste-context-clause pack-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15945 (setq clause-pos (point-marker))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15946 (setq ent-alist (cdr ent-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15947 (goto-char (point-min))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15948 (save-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15949 (message "Generating components package \"%s\"...done\n File created: \"%s\""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15950 pack-name pack-file-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
15951
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15952 (defun vhdl-compose-configuration-architecture (ent-name arch-name inst-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15953 &optional insert-conf)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15954 "Generate block configuration for architecture."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15955 (let ((margin (current-indentation))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15956 (beg (save-excursion (beginning-of-line) (point)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15957 ent-entry inst-entry inst-path inst-prev-path cons-key tmp-alist)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15958 ;; insert block configuration (for architecture)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15959 (vhdl-insert-keyword "FOR ") (insert arch-name "\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15960 (setq margin (+ margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15961 ;; process all instances
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15962 (while inst-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15963 (setq inst-entry (car inst-alist))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15964 ;; is component?
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15965 (when (nth 4 inst-entry)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15966 (setq insert-conf t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15967 (setq inst-path (nth 9 inst-entry))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15968 ;; skip common path with previous instance
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15969 (while (and inst-path (equal (car inst-path) (car inst-prev-path)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15970 (setq inst-path (cdr inst-path)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15971 inst-prev-path (cdr inst-prev-path)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15972 ;; insert block configuration end (for previous block/generate)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15973 (while inst-prev-path
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15974 (setq margin (- margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15975 (indent-to margin)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15976 (vhdl-insert-keyword "END FOR;\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15977 (setq inst-prev-path (cdr inst-prev-path)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15978 ;; insert block configuration beginning (for current block/generate)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15979 (indent-to margin)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15980 (while inst-path
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15981 (setq margin (+ margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15982 (vhdl-insert-keyword "FOR ")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15983 (insert (car inst-path) "\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15984 (indent-to margin)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15985 (setq inst-path (cdr inst-path)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15986 ;; insert component configuration beginning
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15987 (vhdl-insert-keyword "FOR ")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15988 (insert (nth 1 inst-entry) " : " (nth 4 inst-entry) "\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15989 ;; find subconfiguration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15990 (setq conf-key (nth 7 inst-entry))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15991 (setq tmp-alist conf-alist)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15992 ;; use first configuration found for instance's entity
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15993 (while (and tmp-alist (null conf-key))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15994 (when (equal (nth 5 inst-entry) (nth 4 (car tmp-alist)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15995 (setq conf-key (nth 0 (car tmp-alist))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15996 (setq tmp-alist (cdr tmp-alist)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15997 (setq conf-entry (aget conf-alist conf-key t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15998 ;; insert binding indication ...
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
15999 ;; ... with subconfiguration (if exists)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16000 (if (and vhdl-compose-configuration-use-subconfiguration conf-entry)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16001 (progn
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16002 (indent-to (+ margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16003 (vhdl-insert-keyword "USE CONFIGURATION ")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16004 (insert (vhdl-work-library) "." (nth 0 conf-entry))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16005 (insert ";\n"))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16006 ;; ... with entity (if exists)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16007 (setq ent-entry (aget ent-alist (nth 5 inst-entry) t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16008 (when ent-entry
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16009 (indent-to (+ margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16010 (vhdl-insert-keyword "USE ENTITY ")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16011 (insert (vhdl-work-library) "." (nth 0 ent-entry))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16012 ;; insert architecture name (if architecture exists)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16013 (when (nth 3 ent-entry)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16014 (setq arch-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16015 ;; choose architecture name a) from configuration,
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16016 ;; b) from mra, or c) from first architecture
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16017 (or (nth 0 (aget (nth 3 ent-entry)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16018 (or (nth 6 inst-entry)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16019 (nth 4 ent-entry)) t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16020 (nth 1 (car (nth 3 ent-entry)))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16021 (insert "(" arch-name ")"))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16022 (insert ";\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16023 ;; insert block configuration (for architecture of subcomponent)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16024 (when (and vhdl-compose-configuration-hierarchical
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16025 (nth 3 ent-entry))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16026 (indent-to (+ margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16027 (vhdl-compose-configuration-architecture
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16028 (nth 0 ent-entry) arch-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16029 (nth 3 (aget (nth 3 ent-entry) (downcase arch-name) t))))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16030 ;; insert component configuration end
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16031 (indent-to margin)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16032 (vhdl-insert-keyword "END FOR;\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16033 (setq inst-prev-path (nth 9 inst-entry)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16034 (setq inst-alist (cdr inst-alist)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16035 ;; insert block configuration end (for block/generate)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16036 (while inst-prev-path
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16037 (setq margin (- margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16038 (indent-to margin)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16039 (vhdl-insert-keyword "END FOR;\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16040 (setq inst-prev-path (cdr inst-prev-path)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16041 (indent-to (- margin vhdl-basic-offset))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16042 ;; insert block configuration end or remove beginning (for architecture)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16043 (if insert-conf
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16044 (vhdl-insert-keyword "END FOR;\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16045 (delete-region beg (point)))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16046
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16047 (defun vhdl-compose-configuration (&optional ent-name arch-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16048 "Generate configuration declaration."
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16049 (interactive)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16050 (vhdl-require-hierarchy-info)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16051 (let ((ent-alist (aget vhdl-entity-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16052 (or (vhdl-project-p) default-directory) t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16053 (conf-alist (aget vhdl-config-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16054 (or (vhdl-project-p) default-directory) t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16055 (from-speedbar ent-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16056 inst-alist conf-name conf-file-name pos)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16057 (vhdl-prepare-search-2
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16058 ;; get entity and architecture name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16059 (unless ent-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16060 (save-excursion
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16061 (unless (and (re-search-backward "^\\(architecture\\s-+\\(\\w+\\)\\s-+of\\s-+\\(\\w+\\)\\|end\\)\\>" nil t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16062 (not (equal "END" (upcase (match-string 1))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16063 (setq ent-name (match-string-no-properties 3))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16064 (setq arch-name (match-string-no-properties 2)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16065 (error "ERROR: Not within an architecture"))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16066 (setq conf-name (vhdl-replace-string
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16067 vhdl-compose-configuration-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16068 (concat ent-name " " arch-name)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16069 (setq inst-alist
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16070 (nth 3 (aget (nth 3 (aget ent-alist (downcase ent-name) t))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16071 (downcase arch-name) t))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16072 (message "Generating configuration \"%s\"..." conf-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16073 (if vhdl-compose-configuration-create-file
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16074 ;; open configuration file
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16075 (progn
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16076 (setq conf-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16077 (concat (vhdl-replace-string vhdl-configuration-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16078 conf-name t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16079 "." (file-name-extension (buffer-file-name))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16080 (when (and (file-exists-p conf-file-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16081 (not (y-or-n-p (concat "File \"" conf-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16082 "\" exists; overwrite? "))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16083 (error "ERROR: Creating configuration...aborted"))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16084 (find-file conf-file-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16085 (erase-buffer)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16086 (set-buffer-modified-p nil)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16087 ;; insert header
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16088 (if vhdl-compose-include-header
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16089 (progn (vhdl-template-header
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16090 (concat "Configuration declaration for design \""
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16091 ent-name "(" arch-name ")\""))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16092 (goto-char (point-max)))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16093 (vhdl-comment-display-line) (insert "\n\n")))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16094 ;; goto end of architecture
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16095 (unless from-speedbar
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16096 (re-search-forward "^end\\>" nil)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16097 (end-of-line) (insert "\n\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16098 (vhdl-comment-display-line) (insert "\n\n")))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16099 ;; insert library clause
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16100 (setq pos (point))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16101 (vhdl-template-standard-package (vhdl-work-library) nil)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16102 (when (/= pos (point))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16103 (insert "\n\n"))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16104 ;; insert configuration
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16105 (vhdl-insert-keyword "CONFIGURATION ") (insert conf-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16106 (vhdl-insert-keyword " OF ") (insert ent-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16107 (vhdl-insert-keyword " IS\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16108 (indent-to vhdl-basic-offset)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16109 ;; insert block configuration (for architecture)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16110 (vhdl-compose-configuration-architecture ent-name arch-name inst-alist t)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16111 (vhdl-insert-keyword "END ") (insert conf-name ";")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16112 (when conf-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16113 ;; insert footer and save
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16114 (insert "\n\n")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16115 (if (and vhdl-compose-include-header (not (equal vhdl-file-footer "")))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16116 (vhdl-template-footer)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16117 (vhdl-comment-display-line) (insert "\n"))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16118 (save-buffer))
65584
6dbba0bd58df Message format fixes, commit no. 3
Deepak Goel <deego@gnufans.org>
parents: 65491
diff changeset
16119 (message "%s"
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16120 (concat (format "Generating configuration \"%s\"...done" conf-name)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16121 (and conf-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16122 (format "\n File created: \"%s\"" conf-file-name))))))
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16123
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16124
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16125 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16126 ;;; Compilation / Makefile generation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16127 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16128 ;; (using `compile.el')
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16129
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16130 (defun vhdl-makefile-name ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16131 "Return the Makefile name of the current project or the current compiler if
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16132 no project is defined."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16133 (let ((project-alist (aget vhdl-project-alist vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16134 (compiler-alist (aget vhdl-compiler-alist vhdl-compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16135 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16136 (cons "\\(.*\\)\n\\(.*\\)"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16137 (or (nth 8 project-alist) (nth 8 compiler-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16138 (concat (nth 9 compiler-alist) "\n" (nth 6 project-alist)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16139
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16140 (defun vhdl-compile-directory ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16141 "Return the directory where compilation/make should be run."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16142 (let* ((project (aget vhdl-project-alist (vhdl-project-p t)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16143 (compiler (aget vhdl-compiler-alist vhdl-compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16144 (directory (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16145 (if project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16146 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16147 (cons "\\(.*\\)" (nth 5 project)) (nth 9 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16148 (nth 6 compiler)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16149 (file-name-as-directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16150 (if (file-name-absolute-p directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16151 directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16152 (expand-file-name directory (vhdl-default-directory))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16153
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16154 (defun vhdl-uniquify (in-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16155 "Remove duplicate elements from IN-LIST."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16156 (let (out-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16157 (while in-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16158 (add-to-list 'out-list (car in-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16159 (setq in-list (cdr in-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16160 out-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16161
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16162 (defun vhdl-set-compiler (name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16163 "Set current compiler to NAME."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16164 (interactive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16165 (list (let ((completion-ignore-case t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16166 (completing-read "Compiler name: " vhdl-compiler-alist nil t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16167 (if (assoc name vhdl-compiler-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16168 (progn (setq vhdl-compiler name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16169 (message "Current compiler: \"%s\"" vhdl-compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16170 (vhdl-warning (format "Unknown compiler: \"%s\"" name))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16171
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16172 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16173 ;; Compilation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16174
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16175 (defun vhdl-compile-init ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16176 "Initialize for compilation."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16177 (when (or (null compilation-error-regexp-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16178 (not (assoc (car (nth 11 (car vhdl-compiler-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16179 compilation-error-regexp-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16180 ;; `compilation-error-regexp-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16181 (let ((commands-alist vhdl-compiler-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16182 regexp-alist sublist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16183 (while commands-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16184 (setq sublist (nth 11 (car commands-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16185 (unless (or (equal "" (car sublist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16186 (assoc (car sublist) regexp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16187 (setq regexp-alist (cons (list (nth 0 sublist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16188 (if (= 0 (nth 1 sublist))
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
16189 (if (featurep 'xemacs) 9 nil)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16190 (nth 1 sublist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16191 (nth 2 sublist) (nth 3 sublist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16192 regexp-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16193 (setq commands-alist (cdr commands-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16194 (setq compilation-error-regexp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16195 (append compilation-error-regexp-alist (nreverse regexp-alist))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16196 ;; `compilation-file-regexp-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16197 (let ((commands-alist vhdl-compiler-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16198 regexp-alist sublist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16199 ;; matches vhdl-mode file name output
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16200 (setq regexp-alist '(("^Compiling \"\\(.+\\)\"" 1)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16201 (while commands-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16202 (setq sublist (nth 12 (car commands-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16203 (unless (or (equal "" (car sublist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16204 (assoc (car sublist) regexp-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16205 (setq regexp-alist (cons sublist regexp-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16206 (setq commands-alist (cdr commands-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16207 (setq compilation-file-regexp-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16208 (append compilation-file-regexp-alist (nreverse regexp-alist))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16209
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16210 (defvar vhdl-compile-file-name nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16211 "Name of file to be compiled.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16212
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16213 (defun vhdl-compile-print-file-name ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16214 "Function called within `compile' to print out file name for compilers that
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16215 do not print any file names."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16216 (insert "Compiling \"" vhdl-compile-file-name "\"\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16217
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16218 (defun vhdl-get-compile-options (project compiler file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16219 &optional file-options-only)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16220 "Get compiler options. Returning nil means do not compile this file."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16221 (let* ((compiler-options (nth 1 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16222 (project-entry (aget (nth 4 project) vhdl-compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16223 (project-options (nth 0 project-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16224 (exception-list (and file-name (nth 2 project-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16225 (work-library (vhdl-work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16226 (case-fold-search nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16227 file-options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16228 (while (and exception-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16229 (not (string-match (caar exception-list) file-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16230 (setq exception-list (cdr exception-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16231 (if (and exception-list (not (cdar exception-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16232 nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16233 (if (and file-options-only (not exception-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16234 'default
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16235 (setq file-options (cdar exception-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16236 ;; insert library name in compiler-specific options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16237 (setq compiler-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16238 (vhdl-replace-string (cons "\\(.*\\)" compiler-options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16239 work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16240 ;; insert compiler-specific options in project-specific options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16241 (when project-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16242 (setq project-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16243 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16244 (cons "\\(.*\\)\n\\(.*\\)" project-options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16245 (concat work-library "\n" compiler-options))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16246 ;; insert project-specific options in file-specific options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16247 (when file-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16248 (setq file-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16249 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16250 (cons "\\(.*\\)\n\\(.*\\)\n\\(.*\\)" file-options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16251 (concat work-library "\n" compiler-options "\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16252 project-options))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16253 ;; return options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16254 (or file-options project-options compiler-options)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16255
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16256 (defun vhdl-get-make-options (project compiler)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16257 "Get make options."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16258 (let* ((compiler-options (nth 3 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16259 (project-entry (aget (nth 4 project) vhdl-compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16260 (project-options (nth 1 project-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16261 (makefile-name (vhdl-makefile-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16262 ;; insert Makefile name in compiler-specific options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16263 (setq compiler-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16264 (vhdl-replace-string (cons "\\(.*\\)" (nth 3 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16265 makefile-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16266 ;; insert compiler-specific options in project-specific options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16267 (when project-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16268 (setq project-options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16269 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16270 (cons "\\(.*\\)\n\\(.*\\)" project-options)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16271 (concat makefile-name "\n" compiler-options))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16272 ;; return options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16273 (or project-options compiler-options)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16274
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16275 (defun vhdl-compile ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16276 "Compile current buffer using the VHDL compiler specified in
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16277 `vhdl-compiler'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16278 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16279 (vhdl-compile-init)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16280 (let* ((project (aget vhdl-project-alist vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16281 (compiler (or (aget vhdl-compiler-alist vhdl-compiler nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16282 (error "ERROR: No such compiler: \"%s\"" vhdl-compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16283 (command (nth 0 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16284 (file-name (buffer-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16285 (options (vhdl-get-compile-options project compiler file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16286 (default-directory (vhdl-compile-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16287 compilation-process-setup-function)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16288 (unless (file-directory-p default-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16289 (error "ERROR: Compile directory does not exist: \"%s\"" default-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16290 ;; put file name into quotes if it contains spaces
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16291 (when (string-match " " file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16292 (setq file-name (concat "\"" file-name "\"")))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16293 ;; print out file name if compiler does not
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16294 (setq vhdl-compile-file-name (buffer-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16295 (when (and (= 0 (nth 1 (nth 10 compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16296 (= 0 (nth 1 (nth 11 compiler))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16297 (setq compilation-process-setup-function 'vhdl-compile-print-file-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16298 ;; run compilation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16299 (if options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16300 (when command
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16301 (compile (concat command " " options " " file-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16302 (vhdl-warning "Your project settings tell me not to compile this file"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16303
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16304 (defvar vhdl-make-target "all"
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16305 "Default target for `vhdl-make' command.")
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16306
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16307 (defun vhdl-make (&optional target)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16308 "Call make command for compilation of all updated source files (requires
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16309 `Makefile'). Optional argument TARGET allows to compile the design
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16310 specified by a target."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16311 (interactive)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16312 (setq vhdl-make-target
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16313 (or target (read-from-minibuffer "Target: " vhdl-make-target
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16314 vhdl-minibuffer-local-map)))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16315 (vhdl-compile-init)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16316 (let* ((project (aget vhdl-project-alist vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16317 (compiler (or (aget vhdl-compiler-alist vhdl-compiler)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16318 (error "ERROR: No such compiler: \"%s\"" vhdl-compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16319 (command (nth 2 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16320 (options (vhdl-get-make-options project compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16321 (default-directory (vhdl-compile-directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16322 (unless (file-directory-p default-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16323 (error "ERROR: Compile directory does not exist: \"%s\"" default-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16324 ;; run make
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16325 (compile (concat (if (equal command "") "make" command)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16326 " " options " " vhdl-make-target))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16327
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16328 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16329 ;; Makefile generation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16330
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16331 (defun vhdl-generate-makefile ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16332 "Generate `Makefile'."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16333 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16334 (let* ((compiler (or (aget vhdl-compiler-alist vhdl-compiler)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16335 (error "ERROR: No such compiler: \"%s\"" vhdl-compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16336 (command (nth 4 compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16337 ;; generate makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16338 (if command
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16339 (let ((default-directory (vhdl-compile-directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16340 (compile (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16341 (cons "\\(.*\\) \\(.*\\)" command)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16342 (concat (vhdl-makefile-name) " " (vhdl-work-library)))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16343 (vhdl-generate-makefile-1))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16344
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16345 (defun vhdl-get-packages (lib-alist work-library)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16346 "Get packages from LIB-ALIST that belong to WORK-LIBRARY."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16347 (let (pack-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16348 (while lib-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16349 (when (equal (downcase (caar lib-alist)) (downcase work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16350 (setq pack-list (cons (cdar lib-alist) pack-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16351 (setq lib-alist (cdr lib-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16352 pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16353
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16354 (defun vhdl-generate-makefile-1 ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16355 "Generate Makefile for current project or directory."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16356 ;; scan hierarchy if required
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16357 (if (vhdl-project-p)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16358 (unless (or (assoc vhdl-project vhdl-file-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16359 (vhdl-load-cache vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16360 (vhdl-scan-project-contents vhdl-project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16361 (let ((directory (abbreviate-file-name default-directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16362 (unless (or (assoc directory vhdl-file-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16363 (vhdl-load-cache directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16364 (vhdl-scan-directory-contents directory))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16365 (let* ((directory (abbreviate-file-name (vhdl-default-directory)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16366 (project (vhdl-project-p))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16367 (ent-alist (aget vhdl-entity-alist (or project directory) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16368 (conf-alist (aget vhdl-config-alist (or project directory) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16369 (pack-alist (aget vhdl-package-alist (or project directory) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16370 (regexp-list (nth 12 (aget vhdl-compiler-alist vhdl-compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16371 (ent-regexp (cons "\\(.*\\)" (nth 0 regexp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16372 (arch-regexp (cons "\\(.*\\) \\(.*\\)" (nth 1 regexp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16373 (conf-regexp (cons "\\(.*\\)" (nth 2 regexp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16374 (pack-regexp (cons "\\(.*\\)" (nth 3 regexp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16375 (pack-body-regexp (cons "\\(.*\\)" (nth 4 regexp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16376 (adjust-case (nth 5 regexp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16377 (work-library (downcase (vhdl-work-library)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16378 (compile-directory (expand-file-name (vhdl-compile-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16379 default-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16380 (makefile-name (vhdl-makefile-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16381 rule-alist arch-alist inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16382 target-list depend-list unit-list prim-list second-list subcomp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16383 lib-alist lib-body-alist pack-list all-pack-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16384 ent-key ent-file-name arch-key arch-file-name ent-arch-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16385 conf-key conf-file-name pack-key pack-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16386 ent-entry arch-entry conf-entry pack-entry inst-entry
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16387 pack-body-key pack-body-file-name inst-ent-key inst-conf-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16388 tmp-key tmp-list rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16389 ;; check prerequisites
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16390 (unless (file-exists-p compile-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16391 (make-directory compile-directory t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16392 (unless regexp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16393 (error "Please contact the VHDL Mode maintainer for support of \"%s\""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16394 vhdl-compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16395 (message "Generating makefile \"%s\"..." makefile-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16396 ;; rules for all entities
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16397 (setq tmp-list ent-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16398 (while ent-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16399 (setq ent-entry (car ent-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16400 ent-key (nth 0 ent-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16401 (when (nth 2 ent-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16402 (setq ent-file-name (file-relative-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16403 (nth 2 ent-entry) compile-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16404 arch-alist (nth 4 ent-entry)
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16405 lib-alist (nth 6 ent-entry)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16406 rule (aget rule-alist ent-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16407 target-list (nth 0 rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16408 depend-list (nth 1 rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16409 second-list nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16410 subcomp-list nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16411 (setq tmp-key (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16412 ent-regexp (funcall adjust-case ent-key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16413 (setq unit-list (cons (cons ent-key tmp-key) unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16414 ;; rule target for this entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16415 (setq target-list (cons ent-key target-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16416 ;; rule dependencies for all used packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16417 (setq pack-list (vhdl-get-packages lib-alist work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16418 (setq depend-list (append depend-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16419 (setq all-pack-list pack-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16420 ;; add rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16421 (aput 'rule-alist ent-file-name (list target-list depend-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16422 ;; rules for all corresponding architectures
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16423 (while arch-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16424 (setq arch-entry (car arch-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16425 arch-key (nth 0 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16426 ent-arch-key (concat ent-key "-" arch-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16427 arch-file-name (file-relative-name (nth 2 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16428 compile-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16429 inst-alist (nth 4 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16430 lib-alist (nth 5 arch-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16431 rule (aget rule-alist arch-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16432 target-list (nth 0 rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16433 depend-list (nth 1 rule))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16434 (setq tmp-key (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16435 arch-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16436 (funcall adjust-case (concat arch-key " " ent-key))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16437 (setq unit-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16438 (cons (cons ent-arch-key tmp-key) unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16439 (setq second-list (cons ent-arch-key second-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16440 ;; rule target for this architecture
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16441 (setq target-list (cons ent-arch-key target-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16442 ;; rule dependency for corresponding entity
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16443 (setq depend-list (cons ent-key depend-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16444 ;; rule dependencies for contained component instantiations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16445 (while inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16446 (setq inst-entry (car inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16447 (when (or (null (nth 8 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16448 (equal (downcase (nth 8 inst-entry)) work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16449 (setq inst-ent-key (or (nth 7 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16450 (nth 5 inst-entry)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16451 (setq depend-list (cons inst-ent-key depend-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16452 subcomp-list (cons inst-ent-key subcomp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16453 (setq inst-alist (cdr inst-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16454 ;; rule dependencies for all used packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16455 (setq pack-list (vhdl-get-packages lib-alist work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16456 (setq depend-list (append depend-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16457 (setq all-pack-list (append all-pack-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16458 ;; add rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16459 (aput 'rule-alist arch-file-name (list target-list depend-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16460 (setq arch-alist (cdr arch-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16461 (setq prim-list (cons (list ent-key second-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16462 (append subcomp-list all-pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16463 prim-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16464 (setq ent-alist (cdr ent-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16465 (setq ent-alist tmp-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16466 ;; rules for all configurations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16467 (setq tmp-list conf-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16468 (while conf-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16469 (setq conf-entry (car conf-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16470 conf-key (nth 0 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16471 conf-file-name (file-relative-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16472 (nth 2 conf-entry) compile-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16473 ent-key (nth 4 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16474 arch-key (nth 5 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16475 inst-alist (nth 6 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16476 lib-alist (nth 7 conf-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16477 rule (aget rule-alist conf-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16478 target-list (nth 0 rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16479 depend-list (nth 1 rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16480 subcomp-list (list ent-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16481 (setq tmp-key (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16482 conf-regexp (funcall adjust-case conf-key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16483 (setq unit-list (cons (cons conf-key tmp-key) unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16484 ;; rule target for this configuration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16485 (setq target-list (cons conf-key target-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16486 ;; rule dependency for corresponding entity and architecture
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16487 (setq depend-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16488 (cons ent-key (cons (concat ent-key "-" arch-key) depend-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16489 ;; rule dependencies for used packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16490 (setq pack-list (vhdl-get-packages lib-alist work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16491 (setq depend-list (append depend-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16492 ;; rule dependencies for contained component configurations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16493 (while inst-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16494 (setq inst-entry (car inst-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16495 (setq inst-ent-key (nth 2 inst-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16496 ; comp-arch-key (nth 2 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16497 inst-conf-key (nth 4 inst-entry))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16498 (when (equal (downcase (nth 5 inst-entry)) work-library)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16499 (when inst-ent-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16500 (setq depend-list (cons inst-ent-key depend-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16501 subcomp-list (cons inst-ent-key subcomp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16502 ; (when comp-arch-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16503 ; (setq depend-list (cons (concat comp-ent-key "-" comp-arch-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16504 ; depend-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16505 (when inst-conf-key
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16506 (setq depend-list (cons inst-conf-key depend-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16507 subcomp-list (cons inst-conf-key subcomp-list))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16508 (setq inst-alist (cdr inst-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16509 ;; add rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16510 (aput 'rule-alist conf-file-name (list target-list depend-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16511 (setq prim-list (cons (list conf-key nil (append subcomp-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16512 prim-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16513 (setq conf-alist (cdr conf-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16514 (setq conf-alist tmp-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16515 ;; rules for all packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16516 (setq tmp-list pack-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16517 (while pack-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16518 (setq pack-entry (car pack-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16519 pack-key (nth 0 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16520 pack-body-key nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16521 (when (nth 2 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16522 (setq pack-file-name (file-relative-name (nth 2 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16523 compile-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16524 lib-alist (nth 6 pack-entry) lib-body-alist (nth 10 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16525 rule (aget rule-alist pack-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16526 target-list (nth 0 rule) depend-list (nth 1 rule))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16527 (setq tmp-key (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16528 pack-regexp (funcall adjust-case pack-key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16529 (setq unit-list (cons (cons pack-key tmp-key) unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16530 ;; rule target for this package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16531 (setq target-list (cons pack-key target-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16532 ;; rule dependencies for all used packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16533 (setq pack-list (vhdl-get-packages lib-alist work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16534 (setq depend-list (append depend-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16535 (setq all-pack-list pack-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16536 ;; add rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16537 (aput 'rule-alist pack-file-name (list target-list depend-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16538 ;; rules for this package's body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16539 (when (nth 7 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16540 (setq pack-body-key (concat pack-key "-body")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16541 pack-body-file-name (file-relative-name (nth 7 pack-entry)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16542 compile-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16543 rule (aget rule-alist pack-body-file-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16544 target-list (nth 0 rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16545 depend-list (nth 1 rule))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16546 (setq tmp-key (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16547 pack-body-regexp (funcall adjust-case pack-key)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16548 (setq unit-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16549 (cons (cons pack-body-key tmp-key) unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16550 ;; rule target for this package's body
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16551 (setq target-list (cons pack-body-key target-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16552 ;; rule dependency for corresponding package declaration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16553 (setq depend-list (cons pack-key depend-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16554 ;; rule dependencies for all used packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16555 (setq pack-list (vhdl-get-packages lib-body-alist work-library))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16556 (setq depend-list (append depend-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16557 (setq all-pack-list (append all-pack-list pack-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16558 ;; add rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16559 (aput 'rule-alist pack-body-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16560 (list target-list depend-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16561 (setq prim-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16562 (cons (list pack-key (when pack-body-key (list pack-body-key))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16563 all-pack-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16564 prim-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16565 (setq pack-alist (cdr pack-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16566 (setq pack-alist tmp-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16567 ;; generate Makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16568 (let* ((project (aget vhdl-project-alist project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16569 (compiler (aget vhdl-compiler-alist vhdl-compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16570 (compiler-id (nth 9 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16571 (library-directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16572 (vhdl-resolve-env-variable
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16573 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16574 (cons "\\(.*\\)" (or (nth 7 project) (nth 7 compiler)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16575 compiler-id)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16576 (makefile-path-name (expand-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16577 makefile-name compile-directory))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16578 (orig-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16579 cell second-list subcomp-list options unit-key unit-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16580 ;; sort lists
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16581 (setq unit-list (vhdl-sort-alist unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16582 (setq prim-list (vhdl-sort-alist prim-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16583 (setq tmp-list rule-alist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16584 (while tmp-list ; pre-sort rule targets
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16585 (setq cell (cdar tmp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16586 (setcar cell (sort (car cell) 'string<))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16587 (setq tmp-list (cdr tmp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16588 (setq rule-alist ; sort by first rule target
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16589 (sort rule-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16590 (function (lambda (a b)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16591 (string< (car (cadr a)) (car (cadr b)))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16592 ;; open and clear Makefile
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16593 (set-buffer (find-file-noselect makefile-path-name t t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16594 (erase-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16595 (insert "# -*- Makefile -*-\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16596 "### " (file-name-nondirectory makefile-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16597 " - VHDL Makefile generated by Emacs VHDL Mode " vhdl-version
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16598 "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16599 (if project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16600 (insert "\n# Project : " (nth 0 project))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16601 (insert "\n# Directory : \"" directory "\""))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16602 (insert "\n# Platform : " vhdl-compiler
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16603 "\n# Generated : " (format-time-string "%Y-%m-%d %T ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16604 (user-login-name) "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16605 ;; insert compile and option variable settings
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16606 (insert "\n\n# Define compilation command and options\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16607 "\nCOMPILE = " (nth 0 compiler)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16608 "\nOPTIONS = " (vhdl-get-compile-options project compiler nil)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16609 "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16610 ;; insert library paths
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16611 (setq library-directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16612 (directory-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16613 (if (file-name-absolute-p library-directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16614 library-directory
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16615 (file-relative-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16616 (expand-file-name library-directory directory)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16617 compile-directory))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16618 (insert "\n\n# Define library paths\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16619 "\nLIBRARY-" work-library " = " library-directory "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16620 ;; insert variable definitions for all library unit files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16621 (insert "\n\n# Define library unit files\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16622 (setq tmp-list unit-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16623 (while unit-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16624 (insert "\nUNIT-" work-library "-" (caar unit-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16625 " = \\\n\t$(LIBRARY-" work-library ")/" (cdar unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16626 (setq unit-list (cdr unit-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16627 ;; insert variable definition for list of all library unit files
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16628 (insert "\n\n\n# Define list of all library unit files\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16629 "\nALL_UNITS =")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16630 (setq unit-list tmp-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16631 (while unit-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16632 (insert " \\\n\t" "$(UNIT-" work-library "-" (caar unit-list) ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16633 (setq unit-list (cdr unit-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16634 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16635 (setq unit-list tmp-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16636 ;; insert `make all' rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16637 (insert "\n\n\n# Rule for compiling entire design\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16638 "\nall :"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16639 " \\\n\t\tlibrary"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16640 " \\\n\t\t$(ALL_UNITS)\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16641 ;; insert `make clean' rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16642 (insert "\n\n# Rule for cleaning entire design\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16643 "\nclean : "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16644 "\n\t-rm -f $(ALL_UNITS)\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16645 ;; insert `make library' rule
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16646 (insert "\n\n# Rule for creating library directory\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16647 "\nlibrary :"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16648 " \\\n\t\t$(LIBRARY-" work-library ")\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16649 "\n$(LIBRARY-" work-library ") :"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16650 "\n\t"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16651 (vhdl-replace-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16652 (cons "\\(.*\\)\n\\(.*\\)" (nth 5 compiler))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16653 (concat "$(LIBRARY-" work-library ")\n" (vhdl-work-library)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16654 "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16655 ;; insert rule for each library unit
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16656 (insert "\n\n# Rules for compiling single library units and their subhierarchy\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16657 (while prim-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16658 (setq second-list (sort (nth 1 (car prim-list)) 'string<))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16659 (setq subcomp-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16660 (sort (vhdl-uniquify (nth 2 (car prim-list))) 'string<))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16661 (setq unit-key (caar prim-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16662 unit-name (or (nth 0 (aget ent-alist unit-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16663 (nth 0 (aget conf-alist unit-key t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16664 (nth 0 (aget pack-alist unit-key t))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16665 (insert "\n" unit-key)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16666 (unless (equal unit-key unit-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16667 (insert " \\\n" unit-name))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16668 (insert " :"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16669 " \\\n\t\tlibrary"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16670 " \\\n\t\t$(UNIT-" work-library "-" unit-key ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16671 (while second-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16672 (insert " \\\n\t\t$(UNIT-" work-library "-" (car second-list) ")")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16673 (setq second-list (cdr second-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16674 (while subcomp-list
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16675 (when (and (assoc (car subcomp-list) unit-list)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16676 (not (equal unit-key (car subcomp-list))))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16677 (insert " \\\n\t\t" (car subcomp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16678 (setq subcomp-list (cdr subcomp-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16679 (insert "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16680 (setq prim-list (cdr prim-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16681 ;; insert rule for each library unit file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16682 (insert "\n\n# Rules for compiling single library unit files\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16683 (while rule-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16684 (setq rule (car rule-alist))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16685 ;; get compiler options for this file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16686 (setq options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16687 (vhdl-get-compile-options project compiler (nth 0 rule) t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16688 ;; insert rule if file is supposed to be compiled
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16689 (setq target-list (nth 1 rule)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16690 depend-list (sort (vhdl-uniquify (nth 2 rule)) 'string<))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16691 ;; insert targets
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16692 (setq tmp-list target-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16693 (while target-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16694 (insert "\n$(UNIT-" work-library "-" (car target-list) ")"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16695 (if (cdr target-list) " \\" " :"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16696 (setq target-list (cdr target-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16697 (setq target-list tmp-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16698 ;; insert file name as first dependency
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16699 (insert " \\\n\t\t" (nth 0 rule))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16700 ;; insert dependencies (except if also target or unit does not exist)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16701 (while depend-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16702 (when (and (not (member (car depend-list) target-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16703 (assoc (car depend-list) unit-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16704 (insert " \\\n\t\t"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16705 "$(UNIT-" work-library "-" (car depend-list) ")"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16706 (setq depend-list (cdr depend-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16707 ;; insert compile command
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16708 (if options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16709 (insert "\n\t$(COMPILE) "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16710 (if (eq options 'default) "$(OPTIONS)" options) " "
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16711 (nth 0 rule) "\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16712 (setq tmp-list target-list)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16713 (while target-list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16714 (insert "\n\t@touch $(UNIT-" work-library "-" (car target-list) ")"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16715 (if (cdr target-list) " \\" "\n"))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16716 (setq target-list (cdr target-list)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16717 (setq target-list tmp-list))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16718 (setq rule-alist (cdr rule-alist)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16719 (insert "\n\n### " makefile-name " ends here\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16720 ;; run Makefile generation hook
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16721 (run-hooks 'vhdl-makefile-generation-hook)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16722 (message "Generating makefile \"%s\"...done" makefile-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16723 ;; save and close file
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16724 (if (file-writable-p makefile-path-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16725 (progn (save-buffer)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16726 (kill-buffer (current-buffer))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16727 (set-buffer orig-buffer)
70422
84417eaa098c (vhdl-generate-makefile-1): Use add-to-history.
Kim F. Storm <storm@cua.dk>
parents: 68773
diff changeset
16728 (add-to-history 'file-name-history makefile-path-name))
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16729 (vhdl-warning-when-idle
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16730 (format "File not writable: \"%s\""
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16731 (abbreviate-file-name makefile-path-name)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16732 (switch-to-buffer (current-buffer))))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16733
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
16734
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
16735 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
16736 ;;; Bug reports
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
16737 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16738 ;; (using `reporter.el')
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16739
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16740 (defconst vhdl-mode-help-address
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16741 "Reto Zimmermann <reto@gnu.org>"
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16742 "Address for VHDL Mode bug reports.")
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16743
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16744 (defun vhdl-submit-bug-report ()
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16745 "Submit via mail a bug report on VHDL Mode."
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16746 (interactive)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16747 ;; load in reporter
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16748 (and
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16749 (y-or-n-p "Do you want to submit a report on VHDL Mode? ")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16750 (let ((reporter-prompt-for-summary-p t))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16751 (reporter-submit-bug-report
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16752 vhdl-mode-help-address
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16753 (concat "VHDL Mode " vhdl-version)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16754 (list
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16755 ;; report all important user options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16756 'vhdl-offsets-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16757 'vhdl-comment-only-line-offset
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16758 'tab-width
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16759 'vhdl-electric-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16760 'vhdl-stutter-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16761 'vhdl-indent-tabs-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16762 'vhdl-project-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16763 'vhdl-project
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16764 'vhdl-project-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16765 'vhdl-project-auto-load
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16766 'vhdl-project-sort
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16767 'vhdl-compiler-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16768 'vhdl-compiler
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16769 'vhdl-compile-use-local-error-regexp
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16770 'vhdl-makefile-generation-hook
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16771 'vhdl-default-library
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16772 'vhdl-standard
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16773 'vhdl-basic-offset
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16774 'vhdl-upper-case-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16775 'vhdl-upper-case-types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16776 'vhdl-upper-case-attributes
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16777 'vhdl-upper-case-enum-values
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16778 'vhdl-upper-case-constants
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16779 'vhdl-use-direct-instantiation
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16780 'vhdl-compose-configuration-name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16781 'vhdl-entity-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16782 'vhdl-architecture-file-name
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16783 'vhdl-configuration-file-name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16784 'vhdl-package-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16785 'vhdl-file-name-case
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16786 'vhdl-electric-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16787 'vhdl-optional-labels
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16788 'vhdl-insert-empty-lines
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16789 'vhdl-argument-list-indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16790 'vhdl-association-list-with-formals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16791 'vhdl-conditions-in-parenthesis
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16792 'vhdl-zero-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16793 'vhdl-one-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16794 'vhdl-file-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16795 'vhdl-file-footer
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16796 'vhdl-company-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16797 'vhdl-copyright-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16798 'vhdl-platform-spec
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16799 'vhdl-date-format
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16800 'vhdl-modify-date-prefix-string
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16801 'vhdl-modify-date-on-saving
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16802 'vhdl-reset-kind
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16803 'vhdl-reset-active-high
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16804 'vhdl-clock-rising-edge
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16805 'vhdl-clock-edge-condition
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16806 'vhdl-clock-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16807 'vhdl-reset-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16808 'vhdl-model-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16809 'vhdl-include-port-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16810 'vhdl-include-direction-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16811 'vhdl-include-type-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16812 'vhdl-include-group-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16813 'vhdl-actual-port-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16814 'vhdl-instance-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16815 'vhdl-testbench-entity-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16816 'vhdl-testbench-architecture-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16817 'vhdl-testbench-configuration-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16818 'vhdl-testbench-dut-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16819 'vhdl-testbench-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16820 'vhdl-testbench-declarations
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16821 'vhdl-testbench-statements
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16822 'vhdl-testbench-initialize-signals
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16823 'vhdl-testbench-include-library
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16824 'vhdl-testbench-include-configuration
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16825 'vhdl-testbench-create-files
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16826 'vhdl-testbench-entity-file-name
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16827 'vhdl-testbench-architecture-file-name
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16828 'vhdl-compose-create-files
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16829 'vhdl-compose-configuration-create-file
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16830 'vhdl-compose-configuration-hierarchical
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16831 'vhdl-compose-configuration-use-subconfiguration
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16832 'vhdl-compose-include-header
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16833 'vhdl-compose-architecture-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16834 'vhdl-components-package-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16835 'vhdl-use-components-package
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16836 'vhdl-self-insert-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16837 'vhdl-prompt-for-comments
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16838 'vhdl-inline-comment-column
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16839 'vhdl-end-comment-column
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16840 'vhdl-auto-align
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16841 'vhdl-align-groups
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16842 'vhdl-align-group-separate
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16843 'vhdl-align-same-indent
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16844 'vhdl-highlight-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16845 'vhdl-highlight-names
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16846 'vhdl-highlight-special-words
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16847 'vhdl-highlight-forbidden-words
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16848 'vhdl-highlight-verilog-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16849 'vhdl-highlight-translate-off
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16850 'vhdl-highlight-case-sensitive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16851 'vhdl-special-syntax-alist
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16852 'vhdl-forbidden-words
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16853 'vhdl-forbidden-syntax
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16854 'vhdl-directive-keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16855 'vhdl-speedbar-auto-open
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16856 'vhdl-speedbar-display-mode
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16857 'vhdl-speedbar-scan-limit
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16858 'vhdl-speedbar-jump-to-unit
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16859 'vhdl-speedbar-update-on-saving
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16860 'vhdl-speedbar-save-cache
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16861 'vhdl-speedbar-cache-file-name
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16862 'vhdl-index-menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16863 'vhdl-source-file-menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16864 'vhdl-hideshow-menu
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16865 'vhdl-hide-all-init
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16866 'vhdl-print-two-column
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16867 'vhdl-print-customize-faces
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16868 'vhdl-intelligent-tab
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16869 'vhdl-indent-syntax-based
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16870 'vhdl-word-completion-case-sensitive
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16871 'vhdl-word-completion-in-minibuffer
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16872 'vhdl-underscore-is-part-of-word
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16873 'vhdl-mode-hook)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16874 (function
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16875 (lambda ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16876 (insert
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16877 (if vhdl-special-indent-hook
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16878 (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16879 "vhdl-special-indent-hook is set to '"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16880 (format "%s" vhdl-special-indent-hook)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16881 ".\nPerhaps this is your problem?\n"
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16882 "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16883 "\n"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16884 nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16885 "Hi Reto,"))))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16886
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16887
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16888 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16889 ;;; Documentation
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16890 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16891
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16892 (defconst vhdl-doc-release-notes nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16893 "\
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16894 Release Notes for VHDL Mode 3.33
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16895 ================================
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16896
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16897 - New Features
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16898 - User Options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16899
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16900
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16901 New Features
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16902 ------------
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16903
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16904 CONFIGURATION DECLARATION GENERATION:
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16905 - Automatic generation of a configuration declaration for a design.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16906 (See documentation (`C-c C-h') in section on STRUCTURAL COMPOSITION.)
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16907
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16908
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16909 User Options
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16910 ------------
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16911
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16912 `vhdl-configuration-file-name': (new)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16913 Specify how the configuration file name is obtained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16914 `vhdl-compose-configuration-name': (new)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16915 Specify how the configuration name is optained.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16916 `vhdl-compose-configuration-create-file': (new)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16917 Specify whether a new file should be created for a configuration.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16918 `vhdl-compose-configuration-hierarchical': (new)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16919 Specify whether hierarchical configurations should be created.
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16920 `vhdl-compose-configuration-use-subconfiguration': (new)
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16921 Specify whether subconfigurations should be used inside configurations.
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16922 ")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16923
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16924
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16925 (defconst vhdl-doc-keywords nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16926 "\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16927 Reserved words in VHDL
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16928 ----------------------
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16929
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16930 VHDL'93 (IEEE Std 1076-1993):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16931 `vhdl-93-keywords' : keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16932 `vhdl-93-types' : standardized types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16933 `vhdl-93-attributes' : standardized attributes
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16934 `vhdl-93-enum-values' : standardized enumeration values
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16935 `vhdl-93-functions' : standardized functions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16936 `vhdl-93-packages' : standardized packages and libraries
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16937
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16938 VHDL-AMS (IEEE Std 1076.1):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16939 `vhdl-ams-keywords' : keywords
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16940 `vhdl-ams-types' : standardized types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16941 `vhdl-ams-attributes' : standardized attributes
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16942 `vhdl-ams-enum-values' : standardized enumeration values
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16943 `vhdl-ams-functions' : standardized functions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16944
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16945 Math Packages (IEEE Std 1076.2):
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16946 `vhdl-math-types' : standardized types
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16947 `vhdl-math-constants' : standardized constants
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16948 `vhdl-math-functions' : standardized functions
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16949 `vhdl-math-packages' : standardized packages
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16950
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16951 Forbidden words:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16952 `vhdl-verilog-keywords' : Verilog reserved words
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16953
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16954 NOTE: click `mouse-2' on variable names above (not in XEmacs).")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16955
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16956
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16957 (defconst vhdl-doc-coding-style nil
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16958 "\
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16959 For VHDL coding style and naming convention guidelines, see the following
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16960 references:
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16961
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16962 \[1] Ben Cohen.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16963 \"VHDL Coding Styles and Methodologies\".
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16964 Kluwer Academic Publishers, 1999.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16965 http://members.aol.com/vhdlcohen/vhdl/
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16966
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16967 \[2] Michael Keating and Pierre Bricaud.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16968 \"Reuse Methodology Manual, Second Edition\".
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16969 Kluwer Academic Publishers, 1999.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16970 http://www.openmore.com/openmore/rmm2.html
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16971
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16972 \[3] European Space Agency.
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16973 \"VHDL Modelling Guidelines\".
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16974 ftp://ftp.estec.esa.nl/pub/vhdl/doc/ModelGuide.{pdf,ps}
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16975
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16976 Use user options `vhdl-highlight-special-words' and `vhdl-special-syntax-alist'
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16977 to visually support naming conventions.")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16978
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16979
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16980 (defun vhdl-version ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16981 "Echo the current version of VHDL Mode in the minibuffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16982 (interactive)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16983 (message "VHDL Mode %s (%s)" vhdl-version vhdl-time-stamp)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16984 (vhdl-keep-region-active))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16985
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16986 (defun vhdl-doc-variable (variable)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16987 "Display VARIABLE's documentation in *Help* buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16988 (interactive)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
16989 (unless (featurep 'xemacs)
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
16990 (help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16991 (with-output-to-temp-buffer
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
16992 (if (fboundp 'help-buffer) (help-buffer) "*Help*")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16993 (princ (documentation-property variable 'variable-documentation))
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
16994 (with-current-buffer standard-output
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16995 (help-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16996 (print-help-return-message)))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16997
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16998 (defun vhdl-doc-mode ()
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
16999 "Display VHDL Mode documentation in *Help* buffer."
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
17000 (interactive)
85511
f873840f9fea * emulation/edt-mapper.el (function-key-map):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 84923
diff changeset
17001 (unless (featurep 'xemacs)
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
17002 (help-setup-xref (list #'vhdl-doc-mode) (interactive-p)))
65302
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
17003 (with-output-to-temp-buffer
c4e83cd72e41 Merge vhdl-mode.el version 3.33.6, from Reto Zimmermann <reto@gnu.org>.
Romain Francoise <romain@orebokech.com>
parents: 65241
diff changeset
17004 (if (fboundp 'help-buffer) (help-buffer) "*Help*")
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
17005 (princ mode-name)
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
17006 (princ " mode:\n")
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
17007 (princ (documentation 'vhdl-mode))
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
17008 (with-current-buffer standard-output
50023
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
17009 (help-mode))
3f28dcd281b6 Version 3.32.12 released. Major revision.
Juanma Barranquero <lekktu@gmail.com>
parents: 50020
diff changeset
17010 (print-help-return-message)))
24732
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
17011
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
17012
b2451ff2b19e Completely revised and massively extended.
Karl Heuer <kwzh@gnu.org>
parents: 23465
diff changeset
17013 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17014
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17015 (provide 'vhdl-mode)
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17016
61431
bf74e258742e (vhdl-mode-map-init): Don't override default
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 61394
diff changeset
17017 ;; arch-tag: 780d7073-9b5d-4c6c-b0d8-26b28783aba3
20665
5d82beffb498 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17018 ;;; vhdl-mode.el ends here