;;; vhdl-mode.el --- major mode for editing VHDL code
-;; Copyright (C) 1992-2003 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2003, 2004, 2005 Free Software Foundation, Inc.
;; Authors: Reto Zimmermann <reto@gnu.org>
;; Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
-;; Maintainer: Reto Zimmermann <reto@gnu.org>
+;; Maintainer: FSF (Because Reto Zimmermann seems to have disappeared)
;; Keywords: languages vhdl
-;; WWW: http://opensource.ethz.ch/emacs/vhdl-mode.html
(defconst vhdl-version "3.32.12"
"VHDL Mode version number.")
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Commentary:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Emacs Versions
-;; supported: GNU Emacs 20.X/21.X, XEmacs 20.X/21.X
+;; supported: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X
;; tested on: GNU Emacs 20.4, XEmacs 21.1 (marginally)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Installation
-;; Prerequisites: GNU Emacs 20.X/21.X, XEmacs 20.X/21.X.
+;; Prerequisites: GNU Emacs 20.X/21.X/22.X, XEmacs 20.X/21.X.
;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation
;; or into an arbitrary directory that is added to the load path by the
;; XEmacs handling
(defconst vhdl-xemacs (string-match "XEmacs" emacs-version)
"Non-nil if XEmacs is used.")
-;; Emacs 21 handling
-(defconst vhdl-emacs-21 (and (= emacs-major-version 21) (not vhdl-xemacs))
- "Non-nil if GNU Emacs 21 is used.")
+;; Emacs 21+ handling
+(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not vhdl-xemacs))
+ "Non-nil if Emacs 21, 22, ... is used.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defgroup vhdl-testbench nil
- "Customizations for testbench generation ."
+ "Customizations for testbench generation."
:group 'vhdl-port)
(defcustom vhdl-testbench-entity-name '(".*" . "\\&_tb")
(defcustom vhdl-highlight-keywords t
"*Non-nil means highlight VHDL keywords and other standardized words.
The following faces are used:
- `font-lock-keyword-face' : keywords
- `font-lock-type-face' : standardized types
- `vhdl-font-lock-attribute-face': standardized attributes
- `vhdl-font-lock-enumvalue-face': standardized enumeration values
- `vhdl-font-lock-function-face' : standardized function and package names
+ `font-lock-keyword-face' : keywords
+ `font-lock-type' : standardized types
+ `vhdl-attribute' : standardized attributes
+ `vhdl-enumvalue' : standardized enumeration values
+ `vhdl-function' : standardized function and package names
NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
entry \"Fontify Buffer\")."
`font-lock-function-name-face' : names in declarations of units,
subprograms, components, as well as labels of VHDL constructs
`font-lock-type-face' : names in type/nature declarations
- `vhdl-font-lock-attribute-face': names in attribute declarations
+ `vhdl-attribute' : names in attribute declarations
`font-lock-variable-name-face' : names in declarations of signals,
variables, constants, subprogram parameters, generics, and ports
"*Non-nil means highlight forbidden words.
The reserved words specified in option `vhdl-forbidden-words' or having the
syntax specified in option `vhdl-forbidden-syntax' are highlighted in a
-warning color (face `vhdl-font-lock-reserved-words-face') to indicate not to
+warning color (face `vhdl-reserved-word') to indicate not to
use them.
NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
(defcustom vhdl-highlight-verilog-keywords nil
"*Non-nil means highlight Verilog keywords as reserved words.
Verilog keywords are highlighted in a warning color (face
-`vhdl-font-lock-reserved-words-face') to indicate not to use them.
+`vhdl-reserved-word') to indicate not to use them.
NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
entry \"Fontify Buffer\")."
"*Non-nil means background-highlight code excluded from translation.
That is, all code between \"-- pragma translate_off\" and
\"-- pragma translate_on\" is highlighted using a different background color
-\(face `vhdl-font-lock-translate-off-face').
+\(face `vhdl-translate-off').
Note: this might slow down on-the-fly fontification (and thus editing).
NOTE: Activate the new setting in a VHDL buffer by re-fontifying it (menu
\"Signal_s\", \"Variable_v\", \"Constant_c\") by distinguishing them using
common substrings or name suffices.
For each entry, a new face is generated with the specified colors and name
-\"vhdl-font-lock-\" + name + \"-face\".
+\"vhdl-\" + name.
NOTE: Activate a changed regexp in a VHDL buffer by re-fontifying it (menu
entry \"Fontify Buffer\"). All other changes require restarting Emacs."
(defun vhdl-run-when-idle (secs repeat function)
"Wait until idle, then run FUNCTION."
- (if vhdl-xemacs
+ (if (fboundp 'start-itimer)
(start-itimer "vhdl-mode" function secs repeat t)
; (run-with-idle-timer secs repeat function)))
;; explicitely activate timer (necessary when Emacs is already idle)
(progn
(when file-opened (kill-buffer (current-buffer)))
(set-buffer source-buffer)
- (error (format "ERROR: File cannot be opened: \"%s\"" ,file-name)))
+ (error "ERROR: File cannot be opened: \"%s\"" ,file-name))
(vhdl-warning (format "File cannot be opened: \"%s\"" ,file-name) t)
nil))))
(condition-case info
(define-key vhdl-mode-map " " 'vhdl-electric-space)
(if vhdl-intelligent-tab
(define-key vhdl-mode-map "\t" 'vhdl-electric-tab)
- (define-key vhdl-mode-map "\t" 'indent-according-to-mode))
+ ;; The default binding of TAB already calls `indent-according-to-mode'.
+ ;; (define-key vhdl-mode-map "\t" 'indent-according-to-mode)
+ )
(define-key vhdl-mode-map "\r" 'vhdl-electric-return)
(define-key vhdl-mode-map "-" 'vhdl-electric-dash)
(define-key vhdl-mode-map "[" 'vhdl-electric-open-bracket)
;; define special minibuffer keymap for enabling word completion in minibuffer
;; (useful in template generator prompts)
-(defvar vhdl-minibuffer-local-map (copy-keymap minibuffer-local-map)
+(defvar vhdl-minibuffer-local-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map minibuffer-local-map)
+ (when vhdl-word-completion-in-minibuffer
+ (define-key map "\t" 'vhdl-minibuffer-tab))
+ map)
"Keymap for minibuffer used in VHDL Mode.")
-(when vhdl-word-completion-in-minibuffer
- (define-key vhdl-minibuffer-local-map "\t" 'vhdl-minibuffer-tab))
-
;; set up electric character functions to work with
;; `delete-selection-mode' (Emacs) and `pending-delete-mode' (XEmacs)
(mapcar
(when (memq 'vhdl vhdl-electric-keywords)
;; VHDL'93 keywords
'(
- ("--" "" vhdl-template-display-comment-hook 0)
- ("abs" "" vhdl-template-default-hook 0)
- ("access" "" vhdl-template-default-hook 0)
- ("after" "" vhdl-template-default-hook 0)
- ("alias" "" vhdl-template-alias-hook 0)
- ("all" "" vhdl-template-default-hook 0)
- ("and" "" vhdl-template-default-hook 0)
- ("arch" "" vhdl-template-architecture-hook 0)
- ("architecture" "" vhdl-template-architecture-hook 0)
- ("array" "" vhdl-template-default-hook 0)
- ("assert" "" vhdl-template-assert-hook 0)
- ("attr" "" vhdl-template-attribute-hook 0)
- ("attribute" "" vhdl-template-attribute-hook 0)
- ("begin" "" vhdl-template-default-indent-hook 0)
- ("block" "" vhdl-template-block-hook 0)
- ("body" "" vhdl-template-default-hook 0)
- ("buffer" "" vhdl-template-default-hook 0)
- ("bus" "" vhdl-template-default-hook 0)
- ("case" "" vhdl-template-case-hook 0)
- ("comp" "" vhdl-template-component-hook 0)
- ("component" "" vhdl-template-component-hook 0)
- ("cond" "" vhdl-template-conditional-signal-asst-hook 0)
- ("conditional" "" vhdl-template-conditional-signal-asst-hook 0)
- ("conf" "" vhdl-template-configuration-hook 0)
- ("configuration" "" vhdl-template-configuration-hook 0)
- ("cons" "" vhdl-template-constant-hook 0)
- ("constant" "" vhdl-template-constant-hook 0)
- ("disconnect" "" vhdl-template-disconnect-hook 0)
- ("downto" "" vhdl-template-default-hook 0)
- ("else" "" vhdl-template-else-hook 0)
- ("elseif" "" vhdl-template-elsif-hook 0)
- ("elsif" "" vhdl-template-elsif-hook 0)
- ("end" "" vhdl-template-default-indent-hook 0)
- ("entity" "" vhdl-template-entity-hook 0)
- ("exit" "" vhdl-template-exit-hook 0)
- ("file" "" vhdl-template-file-hook 0)
- ("for" "" vhdl-template-for-hook 0)
- ("func" "" vhdl-template-function-hook 0)
- ("function" "" vhdl-template-function-hook 0)
- ("generic" "" vhdl-template-generic-hook 0)
- ("group" "" vhdl-template-group-hook 0)
- ("guarded" "" vhdl-template-default-hook 0)
- ("if" "" vhdl-template-if-hook 0)
- ("impure" "" vhdl-template-default-hook 0)
- ("in" "" vhdl-template-default-hook 0)
- ("inertial" "" vhdl-template-default-hook 0)
- ("inout" "" vhdl-template-default-hook 0)
- ("inst" "" vhdl-template-instance-hook 0)
- ("instance" "" vhdl-template-instance-hook 0)
- ("is" "" vhdl-template-default-hook 0)
- ("label" "" vhdl-template-default-hook 0)
- ("library" "" vhdl-template-library-hook 0)
- ("linkage" "" vhdl-template-default-hook 0)
- ("literal" "" vhdl-template-default-hook 0)
- ("loop" "" vhdl-template-bare-loop-hook 0)
- ("map" "" vhdl-template-map-hook 0)
- ("mod" "" vhdl-template-default-hook 0)
- ("nand" "" vhdl-template-default-hook 0)
- ("new" "" vhdl-template-default-hook 0)
- ("next" "" vhdl-template-next-hook 0)
- ("nor" "" vhdl-template-default-hook 0)
- ("not" "" vhdl-template-default-hook 0)
- ("null" "" vhdl-template-default-hook 0)
- ("of" "" vhdl-template-default-hook 0)
- ("on" "" vhdl-template-default-hook 0)
- ("open" "" vhdl-template-default-hook 0)
- ("or" "" vhdl-template-default-hook 0)
- ("others" "" vhdl-template-others-hook 0)
- ("out" "" vhdl-template-default-hook 0)
- ("pack" "" vhdl-template-package-hook 0)
- ("package" "" vhdl-template-package-hook 0)
- ("port" "" vhdl-template-port-hook 0)
- ("postponed" "" vhdl-template-default-hook 0)
- ("procedure" "" vhdl-template-procedure-hook 0)
- ("process" "" vhdl-template-process-hook 0)
- ("pure" "" vhdl-template-default-hook 0)
- ("range" "" vhdl-template-default-hook 0)
- ("record" "" vhdl-template-default-hook 0)
- ("register" "" vhdl-template-default-hook 0)
- ("reject" "" vhdl-template-default-hook 0)
- ("rem" "" vhdl-template-default-hook 0)
- ("report" "" vhdl-template-report-hook 0)
- ("return" "" vhdl-template-return-hook 0)
- ("rol" "" vhdl-template-default-hook 0)
- ("ror" "" vhdl-template-default-hook 0)
- ("select" "" vhdl-template-selected-signal-asst-hook 0)
- ("severity" "" vhdl-template-default-hook 0)
- ("shared" "" vhdl-template-default-hook 0)
- ("sig" "" vhdl-template-signal-hook 0)
- ("signal" "" vhdl-template-signal-hook 0)
- ("sla" "" vhdl-template-default-hook 0)
- ("sll" "" vhdl-template-default-hook 0)
- ("sra" "" vhdl-template-default-hook 0)
- ("srl" "" vhdl-template-default-hook 0)
- ("subtype" "" vhdl-template-subtype-hook 0)
- ("then" "" vhdl-template-default-hook 0)
- ("to" "" vhdl-template-default-hook 0)
- ("transport" "" vhdl-template-default-hook 0)
- ("type" "" vhdl-template-type-hook 0)
- ("unaffected" "" vhdl-template-default-hook 0)
- ("units" "" vhdl-template-default-hook 0)
- ("until" "" vhdl-template-default-hook 0)
- ("use" "" vhdl-template-use-hook 0)
- ("var" "" vhdl-template-variable-hook 0)
- ("variable" "" vhdl-template-variable-hook 0)
- ("wait" "" vhdl-template-wait-hook 0)
- ("when" "" vhdl-template-when-hook 0)
- ("while" "" vhdl-template-while-loop-hook 0)
- ("with" "" vhdl-template-with-hook 0)
- ("xnor" "" vhdl-template-default-hook 0)
- ("xor" "" vhdl-template-default-hook 0)
+ ("--" "" vhdl-template-display-comment-hook 0 t)
+ ("abs" "" vhdl-template-default-hook 0 t)
+ ("access" "" vhdl-template-default-hook 0 t)
+ ("after" "" vhdl-template-default-hook 0 t)
+ ("alias" "" vhdl-template-alias-hook 0 t)
+ ("all" "" vhdl-template-default-hook 0 t)
+ ("and" "" vhdl-template-default-hook 0 t)
+ ("arch" "" vhdl-template-architecture-hook 0 t)
+ ("architecture" "" vhdl-template-architecture-hook 0 t)
+ ("array" "" vhdl-template-default-hook 0 t)
+ ("assert" "" vhdl-template-assert-hook 0 t)
+ ("attr" "" vhdl-template-attribute-hook 0 t)
+ ("attribute" "" vhdl-template-attribute-hook 0 t)
+ ("begin" "" vhdl-template-default-indent-hook 0 t)
+ ("block" "" vhdl-template-block-hook 0 t)
+ ("body" "" vhdl-template-default-hook 0 t)
+ ("buffer" "" vhdl-template-default-hook 0 t)
+ ("bus" "" vhdl-template-default-hook 0 t)
+ ("case" "" vhdl-template-case-hook 0 t)
+ ("comp" "" vhdl-template-component-hook 0 t)
+ ("component" "" vhdl-template-component-hook 0 t)
+ ("cond" "" vhdl-template-conditional-signal-asst-hook 0 t)
+ ("conditional" "" vhdl-template-conditional-signal-asst-hook 0 t)
+ ("conf" "" vhdl-template-configuration-hook 0 t)
+ ("configuration" "" vhdl-template-configuration-hook 0 t)
+ ("cons" "" vhdl-template-constant-hook 0 t)
+ ("constant" "" vhdl-template-constant-hook 0 t)
+ ("disconnect" "" vhdl-template-disconnect-hook 0 t)
+ ("downto" "" vhdl-template-default-hook 0 t)
+ ("else" "" vhdl-template-else-hook 0 t)
+ ("elseif" "" vhdl-template-elsif-hook 0 t)
+ ("elsif" "" vhdl-template-elsif-hook 0 t)
+ ("end" "" vhdl-template-default-indent-hook 0 t)
+ ("entity" "" vhdl-template-entity-hook 0 t)
+ ("exit" "" vhdl-template-exit-hook 0 t)
+ ("file" "" vhdl-template-file-hook 0 t)
+ ("for" "" vhdl-template-for-hook 0 t)
+ ("func" "" vhdl-template-function-hook 0 t)
+ ("function" "" vhdl-template-function-hook 0 t)
+ ("generic" "" vhdl-template-generic-hook 0 t)
+ ("group" "" vhdl-template-group-hook 0 t)
+ ("guarded" "" vhdl-template-default-hook 0 t)
+ ("if" "" vhdl-template-if-hook 0 t)
+ ("impure" "" vhdl-template-default-hook 0 t)
+ ("in" "" vhdl-template-default-hook 0 t)
+ ("inertial" "" vhdl-template-default-hook 0 t)
+ ("inout" "" vhdl-template-default-hook 0 t)
+ ("inst" "" vhdl-template-instance-hook 0 t)
+ ("instance" "" vhdl-template-instance-hook 0 t)
+ ("is" "" vhdl-template-default-hook 0 t)
+ ("label" "" vhdl-template-default-hook 0 t)
+ ("library" "" vhdl-template-library-hook 0 t)
+ ("linkage" "" vhdl-template-default-hook 0 t)
+ ("literal" "" vhdl-template-default-hook 0 t)
+ ("loop" "" vhdl-template-bare-loop-hook 0 t)
+ ("map" "" vhdl-template-map-hook 0 t)
+ ("mod" "" vhdl-template-default-hook 0 t)
+ ("nand" "" vhdl-template-default-hook 0 t)
+ ("new" "" vhdl-template-default-hook 0 t)
+ ("next" "" vhdl-template-next-hook 0 t)
+ ("nor" "" vhdl-template-default-hook 0 t)
+ ("not" "" vhdl-template-default-hook 0 t)
+ ("null" "" vhdl-template-default-hook 0 t)
+ ("of" "" vhdl-template-default-hook 0 t)
+ ("on" "" vhdl-template-default-hook 0 t)
+ ("open" "" vhdl-template-default-hook 0 t)
+ ("or" "" vhdl-template-default-hook 0 t)
+ ("others" "" vhdl-template-others-hook 0 t)
+ ("out" "" vhdl-template-default-hook 0 t)
+ ("pack" "" vhdl-template-package-hook 0 t)
+ ("package" "" vhdl-template-package-hook 0 t)
+ ("port" "" vhdl-template-port-hook 0 t)
+ ("postponed" "" vhdl-template-default-hook 0 t)
+ ("procedure" "" vhdl-template-procedure-hook 0 t)
+ ("process" "" vhdl-template-process-hook 0 t)
+ ("pure" "" vhdl-template-default-hook 0 t)
+ ("range" "" vhdl-template-default-hook 0 t)
+ ("record" "" vhdl-template-default-hook 0 t)
+ ("register" "" vhdl-template-default-hook 0 t)
+ ("reject" "" vhdl-template-default-hook 0 t)
+ ("rem" "" vhdl-template-default-hook 0 t)
+ ("report" "" vhdl-template-report-hook 0 t)
+ ("return" "" vhdl-template-return-hook 0 t)
+ ("rol" "" vhdl-template-default-hook 0 t)
+ ("ror" "" vhdl-template-default-hook 0 t)
+ ("select" "" vhdl-template-selected-signal-asst-hook 0 t)
+ ("severity" "" vhdl-template-default-hook 0 t)
+ ("shared" "" vhdl-template-default-hook 0 t)
+ ("sig" "" vhdl-template-signal-hook 0 t)
+ ("signal" "" vhdl-template-signal-hook 0 t)
+ ("sla" "" vhdl-template-default-hook 0 t)
+ ("sll" "" vhdl-template-default-hook 0 t)
+ ("sra" "" vhdl-template-default-hook 0 t)
+ ("srl" "" vhdl-template-default-hook 0 t)
+ ("subtype" "" vhdl-template-subtype-hook 0 t)
+ ("then" "" vhdl-template-default-hook 0 t)
+ ("to" "" vhdl-template-default-hook 0 t)
+ ("transport" "" vhdl-template-default-hook 0 t)
+ ("type" "" vhdl-template-type-hook 0 t)
+ ("unaffected" "" vhdl-template-default-hook 0 t)
+ ("units" "" vhdl-template-default-hook 0 t)
+ ("until" "" vhdl-template-default-hook 0 t)
+ ("use" "" vhdl-template-use-hook 0 t)
+ ("var" "" vhdl-template-variable-hook 0 t)
+ ("variable" "" vhdl-template-variable-hook 0 t)
+ ("wait" "" vhdl-template-wait-hook 0 t)
+ ("when" "" vhdl-template-when-hook 0 t)
+ ("while" "" vhdl-template-while-loop-hook 0 t)
+ ("with" "" vhdl-template-with-hook 0 t)
+ ("xnor" "" vhdl-template-default-hook 0 t)
+ ("xor" "" vhdl-template-default-hook 0 t)
))
;; VHDL-AMS keywords
(when (and (memq 'vhdl vhdl-electric-keywords) (vhdl-standard-p 'ams))
'(
- ("across" "" vhdl-template-default-hook 0)
- ("break" "" vhdl-template-break-hook 0)
- ("limit" "" vhdl-template-limit-hook 0)
- ("nature" "" vhdl-template-nature-hook 0)
- ("noise" "" vhdl-template-default-hook 0)
- ("procedural" "" vhdl-template-procedural-hook 0)
- ("quantity" "" vhdl-template-quantity-hook 0)
- ("reference" "" vhdl-template-default-hook 0)
- ("spectrum" "" vhdl-template-default-hook 0)
- ("subnature" "" vhdl-template-subnature-hook 0)
- ("terminal" "" vhdl-template-terminal-hook 0)
- ("through" "" vhdl-template-default-hook 0)
- ("tolerance" "" vhdl-template-default-hook 0)
+ ("across" "" vhdl-template-default-hook 0 t)
+ ("break" "" vhdl-template-break-hook 0 t)
+ ("limit" "" vhdl-template-limit-hook 0 t)
+ ("nature" "" vhdl-template-nature-hook 0 t)
+ ("noise" "" vhdl-template-default-hook 0 t)
+ ("procedural" "" vhdl-template-procedural-hook 0 t)
+ ("quantity" "" vhdl-template-quantity-hook 0 t)
+ ("reference" "" vhdl-template-default-hook 0 t)
+ ("spectrum" "" vhdl-template-default-hook 0 t)
+ ("subnature" "" vhdl-template-subnature-hook 0 t)
+ ("terminal" "" vhdl-template-terminal-hook 0 t)
+ ("through" "" vhdl-template-default-hook 0 t)
+ ("tolerance" "" vhdl-template-default-hook 0 t)
))
;; user model keywords
(when (memq 'user vhdl-electric-keywords)
(setq abbrev-list
(cons (list keyword ""
(vhdl-function-name
- "vhdl-model" (nth 0 (car alist)) "hook") 0)
+ "vhdl-model" (nth 0 (car alist)) "hook") 0 t)
abbrev-list)))
(setq alist (cdr alist)))
abbrev-list)))))
("Highlight"
["Highlighting On/Off..."
(customize-option
- (if vhdl-xemacs 'font-lock-auto-fontify 'global-font-lock-mode)) t]
+ (if (fboundp 'global-font-lock-mode)
+ 'global-font-lock-mode 'font-lock-auto-fontify)) t]
["Highlight Keywords"
(progn (customize-set-variable 'vhdl-highlight-keywords
(not vhdl-highlight-keywords))
(set (make-local-variable 'indent-line-function) 'vhdl-indent-line)
(set (make-local-variable 'comment-start) "--")
(set (make-local-variable 'comment-end) "")
- (when vhdl-emacs-21
- (set (make-local-variable 'comment-padding) ""))
+ (set (make-local-variable 'comment-padding) "")
(set (make-local-variable 'comment-column) vhdl-inline-comment-column)
(set (make-local-variable 'end-comment-column) vhdl-end-comment-column)
(set (make-local-variable 'comment-start-skip) "--+\\s-*")
(if noninteractive "" " See menu for documentation and release notes."))
;; run hooks
- (run-hooks 'vhdl-mode-hook))
+ (run-mode-hooks 'vhdl-mode-hook))
(defun vhdl-activate-customizations ()
"Activate all customizations on local variables."
(defun vhdl-read-offset (langelem)
"Read new offset value for LANGELEM from minibuffer.
-Return a legal value only."
+Return a valid value only."
(let ((oldoff (format "%s" (cdr-safe (assq langelem vhdl-offsets-alist))))
(errmsg "Offset must be int, func, var, or one of +, -, ++, --: ")
(prompt "Offset: ")
((string-equal "++" input) '++)
((string-equal "--" input) '--)
((string-match "^-?[0-9]+$" input)
- (string-to-int input))
+ (string-to-number input))
((fboundp (setq interned (intern input)))
interned)
((boundp interned) interned)
stops due to beginning or end of buffer.
Note that if point is between the \"libunit\" keyword and the
corresponding \"begin\" keyword, then that libunit will not be
-recognised, and the search will continue backwards. If point is
-at the \"begin\" keyword, then the defun will be recognised. The
+recognized, and the search will continue backwards. If point is
+at the \"begin\" keyword, then the defun will be recognized. The
returned point is at the first character of the \"libunit\" keyword."
(let ((last-forward (point))
(last-backward
(while (re-search-forward "\\(--.*\n\\|\"[^\"\n]*[\"\n]\\)\\|\\(\\([^/:<>=]\\)\\(:\\|=\\|<\\|>\\|:=\\|<=\\|>=\\|=>\\|/=\\)\\([^=>]\\|$\\)\\)" end t)
(if (match-string 1)
(goto-char (match-end 1))
- (replace-match "\\3 \\4 \\5")
+ (save-excursion
+ (goto-char (match-beginning 4))
+ (unless (eq (preceding-char) ?\ )
+ (insert " "))
+ (goto-char (match-end 4))
+ (unless (eq (following-char) ?\ )
+ (insert " ")))
(goto-char (match-end 4))))
;; eliminate multiple spaces and spaces at end of line
(goto-char beg)
(interactive "r\np")
(save-excursion
(goto-char beg)
- (let ((margin (if interactive (current-indentation) (current-column))))
+ (let ((margin (if arg (current-indentation) (current-column))))
(goto-char end)
(setq end (point-marker))
;; remove inline comments, newlines and whitespace
;; correct different behavior of function `unread-command-events' in XEmacs
(defun vhdl-character-to-event (arg))
(defalias 'vhdl-character-to-event
- (if vhdl-xemacs 'character-to-event 'identity))
+ (if (fboundp 'character-to-event) 'character-to-event 'identity))
(defun vhdl-work-library ()
"Return the working library name of the current project or \"work\" if no
(when (stringp caught) (message caught)))
(when (= invoke-char ?-) (setq abbrev-start-location (point)))
;; delete CR which is still in event queue
- (if vhdl-xemacs
+ (if (fboundp 'enqueue-eval-event)
(enqueue-eval-event 'delete-char -1)
(setq unread-command-events ; push back a delete char
(list (vhdl-character-to-event ?\177))))))))
"Return the line number of the line containing point."
(save-restriction
(widen)
- (save-excursion
- (beginning-of-line)
- (1+ (count-lines 1 (point))))))
+ (1+ (count-lines (point-min) (line-beginning-position)))))
(defun vhdl-line-kill-entire (&optional arg)
"Delete entire line."
# statements : %5d\n\
# code lines : %5d\n\
# total lines : %5d\n\ "
- (buffer-file-name) no-stats no-code-lines no-lines)
- (unless vhdl-emacs-21 (vhdl-show-messages))))
+ (buffer-file-name) no-stats no-code-lines no-lines)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Help functions
(save-match-data
(goto-char (match-end 1))
;; move to next item
- (if (looking-at "\\(\\s-*,\\)")
- (goto-char (match-end 1))
+ (if (looking-at "\\s-*,")
+ (goto-char (match-end 0))
(end-of-line) t))))
(error t)))
(list
(concat
"^\\s-*attribute\\s-+\\(\\w+\\)")
- 1 'vhdl-font-lock-attribute-face)
+ 1 'vhdl-attribute)
;; highlight type/nature name in (sub)type/(sub)nature declarations
(list
(defconst vhdl-font-lock-keywords-5
;; background highlight translate-off regions
- '((vhdl-match-translate-off (0 vhdl-font-lock-translate-off-face append)))
+ '((vhdl-match-translate-off (0 vhdl-translate-off-face append)))
"For consideration as a value of `vhdl-font-lock-keywords'.
This does background highlighting of translate-off regions.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Font and color definitions
-(defvar vhdl-font-lock-prompt-face 'vhdl-font-lock-prompt-face
+(defvar vhdl-prompt-face 'vhdl-prompt
"Face name to use for prompts.")
-(defvar vhdl-font-lock-attribute-face 'vhdl-font-lock-attribute-face
+(defvar vhdl-attribute-face 'vhdl-attribute
"Face name to use for standardized attributes.")
-(defvar vhdl-font-lock-enumvalue-face 'vhdl-font-lock-enumvalue-face
+(defvar vhdl-enumvalue-face 'vhdl-enumvalue
"Face name to use for standardized enumeration values.")
-(defvar vhdl-font-lock-function-face 'vhdl-font-lock-function-face
+(defvar vhdl-function-face 'vhdl-function
"Face name to use for standardized functions and packages.")
-(defvar vhdl-font-lock-directive-face 'vhdl-font-lock-directive-face
+(defvar vhdl-directive-face 'vhdl-directive
"Face name to use for directives.")
-(defvar vhdl-font-lock-reserved-words-face 'vhdl-font-lock-reserved-words-face
+(defvar vhdl-reserved-words-face 'vhdl-reserved-words
"Face name to use for additional reserved words.")
-(defvar vhdl-font-lock-translate-off-face 'vhdl-font-lock-translate-off-face
+(defvar vhdl-translate-off-face 'vhdl-translate-off
"Face name to use for translate-off regions.")
;; face names to use for words with special syntax.
(let ((syntax-alist vhdl-special-syntax-alist)
name)
(while syntax-alist
- (setq name (vhdl-function-name
- "vhdl-font-lock" (nth 0 (car syntax-alist)) "face"))
+ (setq name (vhdl-function-name "vhdl" (nth 0 (car syntax-alist))))
(eval `(defvar ,name ',name
,(concat "Face name to use for "
(nth 0 (car syntax-alist)) ".")))
(custom-add-to-group
'vhdl-highlight-faces 'font-lock-variable-name-face 'custom-face)
-(defface vhdl-font-lock-prompt-face
- '((((class color) (background light)) (:foreground "Red" :bold t))
+(defface vhdl-prompt
+ '((((min-colors 88) (class color) (background light))
+ (:foreground "Red1" :bold t))
+ (((class color) (background light)) (:foreground "Red" :bold t))
(((class color) (background dark)) (:foreground "Pink" :bold t))
(t (:inverse-video t)))
"Font lock mode face used to highlight prompts."
:group 'vhdl-highlight-faces
:group 'font-lock-highlighting-faces)
+;; backward-compatibility alias
+(put 'vhdl-font-lock-prompt-face 'face-alias 'vhdl-prompt)
-(defface vhdl-font-lock-attribute-face
+(defface vhdl-attribute
'((((class color) (background light)) (:foreground "Orchid"))
(((class color) (background dark)) (:foreground "LightSteelBlue"))
(t (:italic t :bold t)))
"Font lock mode face used to highlight standardized attributes."
:group 'vhdl-highlight-faces
:group 'font-lock-highlighting-faces)
+;; backward-compatibility alias
+(put 'vhdl-font-lock-attribute-face 'face-alias 'vhdl-attribute)
-(defface vhdl-font-lock-enumvalue-face
+(defface vhdl-enumvalue
'((((class color) (background light)) (:foreground "SaddleBrown"))
(((class color) (background dark)) (:foreground "BurlyWood"))
(t (:italic t :bold t)))
"Font lock mode face used to highlight standardized enumeration values."
:group 'vhdl-highlight-faces
:group 'font-lock-highlighting-faces)
+;; backward-compatibility alias
+(put 'vhdl-font-lock-enumvalue-face 'face-alias 'vhdl-enumvalue)
-(defface vhdl-font-lock-function-face
+(defface vhdl-function
'((((class color) (background light)) (:foreground "Cyan4"))
(((class color) (background dark)) (:foreground "Orchid1"))
(t (:italic t :bold t)))
"Font lock mode face used to highlight standardized functions and packages."
:group 'vhdl-highlight-faces
:group 'font-lock-highlighting-faces)
+;; backward-compatibility alias
+(put 'vhdl-font-lock-function-face 'face-alias 'vhdl-function)
-(defface vhdl-font-lock-directive-face
+(defface vhdl-directive
'((((class color) (background light)) (:foreground "CadetBlue"))
(((class color) (background dark)) (:foreground "Aquamarine"))
(t (:italic t :bold t)))
"Font lock mode face used to highlight directives."
:group 'vhdl-highlight-faces
:group 'font-lock-highlighting-faces)
+;; backward-compatibility alias
+(put 'vhdl-font-lock-directive-face 'face-alias 'vhdl-directive)
-(defface vhdl-font-lock-reserved-words-face
+(defface vhdl-reserved-word
'((((class color) (background light)) (:foreground "Orange" :bold t))
+ (((min-colors 88) (class color) (background dark))
+ (:foreground "Yellow1" :bold t))
(((class color) (background dark)) (:foreground "Yellow" :bold t))
(t ()))
"Font lock mode face used to highlight additional reserved words."
:group 'vhdl-highlight-faces
:group 'font-lock-highlighting-faces)
+;; backward-compatibility alias
+(put 'vhdl-font-lock-reserved-words-face 'face-alias 'vhdl-reserved-word)
-(defface vhdl-font-lock-translate-off-face
+(defface vhdl-translate-off
'((((class color) (background light)) (:background "LightGray"))
(((class color) (background dark)) (:background "DimGray"))
(t ()))
"Font lock mode face used to background highlight translate-off regions."
:group 'vhdl-highlight-faces
:group 'font-lock-highlighting-faces)
+;; backward-compatibility alias
+(put 'vhdl-font-lock-translate-off-face 'face-alias 'vhdl-translate-off)
;; font lock mode faces used to highlight words with special syntax.
(let ((syntax-alist vhdl-special-syntax-alist))
(while syntax-alist
- (eval `(defface ,(vhdl-function-name
- "vhdl-font-lock" (caar syntax-alist) "face")
+ (eval `(defface ,(vhdl-function-name "vhdl" (caar syntax-alist))
'((((class color) (background light))
(:foreground ,(nth 2 (car syntax-alist))))
(((class color) (background dark))
(setq vhdl-font-lock-keywords-0
(list (list (concat "\\(^\\|[ \t(.']\\)\\(<"
vhdl-template-prompt-syntax ">\\)")
- 2 'vhdl-font-lock-prompt-face t)
+ 2 'vhdl-prompt t)
(list (concat "--\\s-*"
vhdl-directive-keywords-regexp "\\s-+\\(.*\\)$")
- 2 'vhdl-font-lock-directive-face t)))
+ 2 'vhdl-directive t)))
;; highlight keywords and standardized types, attributes, enumeration
;; values, and subprograms
(setq vhdl-font-lock-keywords-1
(list
- (list (concat "'" vhdl-attributes-regexp)
- 1 'vhdl-font-lock-attribute-face)
+ (list (concat "'" vhdl-attributes-regexp) 1 'vhdl-attribute)
(list vhdl-types-regexp 1 'font-lock-type-face)
- (list vhdl-functions-regexp 1 'vhdl-font-lock-function-face)
- (list vhdl-packages-regexp 1 'vhdl-font-lock-function-face)
- (list vhdl-enum-values-regexp 1 'vhdl-font-lock-enumvalue-face)
+ (list vhdl-functions-regexp 1 'vhdl-function)
+ (list vhdl-packages-regexp 1 'vhdl-function)
+ (list vhdl-enum-values-regexp 1 'vhdl-enumvalue)
(list vhdl-keywords-regexp 1 'font-lock-keyword-face)))
;; highlight words with special syntax.
(setq vhdl-font-lock-keywords-3
(cons
(cons (concat "\\<\\(" (nth 1 (car syntax-alist)) "\\)\\>")
(vhdl-function-name
- "vhdl-font-lock" (nth 0 (car syntax-alist)) "face"))
+ "vhdl" (nth 0 (car syntax-alist))))
keywords))
(setq syntax-alist (cdr syntax-alist)))
keywords))
;; highlight additional reserved words
(setq vhdl-font-lock-keywords-4
- (list (list vhdl-reserved-words-regexp 1
- 'vhdl-font-lock-reserved-words-face)))
+ (list (list vhdl-reserved-words-regexp 1 'vhdl-reserved-word)))
;; highlight everything together
(setq vhdl-font-lock-keywords
(append
'(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords)))
(when (fboundp 'font-lock-unset-defaults)
(font-lock-unset-defaults)) ; not implemented in XEmacs
- (font-lock-set-defaults)
+ (font-lock-set-defaults) ;What for? --Stef
(font-lock-mode nil)
(font-lock-mode t))
(unless (or (not vhdl-print-customize-faces)
ps-print-color-p)
(set (make-local-variable 'ps-bold-faces)
- '(font-lock-keyword-face
- font-lock-type-face
- vhdl-font-lock-attribute-face
- vhdl-font-lock-enumvalue-face
- vhdl-font-lock-directive-face))
+ '(font-lock-keyword-face font-lock-type-face
+ vhdl-attribute vhdl-enumvalue vhdl-directive))
(set (make-local-variable 'ps-italic-faces)
'(font-lock-comment-face
- font-lock-function-name-face
- font-lock-type-face
- vhdl-font-lock-attribute-face
- vhdl-font-lock-enumvalue-face
- vhdl-font-lock-directive-face))
+ font-lock-function-name-face font-lock-type-face
+ vhdl-attribute vhdl-enumvalue vhdl-directive))
(set (make-local-variable 'ps-underlined-faces)
'(font-lock-string-face))
(setq ps-always-build-face-reference t))
(condition-case ()
(progn (load-file file-dir-name)
(string< (mapconcat
- (lambda (a) (format "%3d" (string-to-int a)))
+ (lambda (a) (format "%3d" (string-to-number a)))
(split-string "3.31.14" "\\.") "")
(mapconcat
- (lambda (a) (format "%3d" (string-to-int a)))
+ (lambda (a) (format "%3d" (string-to-number a)))
(split-string vhdl-cache-version "\\.") "")))
(error (progn (vhdl-warning (format "ERROR: Corrupted cache file: \"%s\"" file-dir-name))
nil))))))
'bracket ?+ 'vhdl-speedbar-expand-entity (nth 0 ent-entry)
(nth 1 ent-entry) 'vhdl-speedbar-find-file
(cons (nth 2 ent-entry) (nth 3 ent-entry))
- 'vhdl-speedbar-entity-face depth)
+ 'vhdl-speedbar-entity depth)
(unless (nth 2 ent-entry)
(end-of-line 0) (insert "!") (forward-char 1))
(unless (member (nth 0 ent-entry) ent-inst-list)
'bracket ?+ 'vhdl-speedbar-expand-config (nth 0 conf-entry)
(nth 1 conf-entry) 'vhdl-speedbar-find-file
(cons (nth 2 conf-entry) (nth 3 conf-entry))
- 'vhdl-speedbar-configuration-face depth)
+ 'vhdl-speedbar-configuration depth)
(setq conf-alist (cdr conf-alist)))
;; insert packages
(when pack-alist (vhdl-speedbar-make-title-line "Packages:" depth))
(beginning-of-line) (looking-at "^\\([0-9]+\\):"))
(re-search-backward
(format "^[0-%d]:\\s-*[[{<]-"
- (max (1- (string-to-int (match-string 1))) 0)) nil t)))
+ (max (1- (string-to-number (match-string 1))) 0)) nil t)))
(goto-char (match-end 0))
(speedbar-do-function-pointer)
(speedbar-center-buffer-smartly)))
(cons token (nth 0 arch-entry))
(nth 1 arch-entry) 'vhdl-speedbar-find-file
(cons (nth 2 arch-entry) (nth 3 arch-entry))
- 'vhdl-speedbar-architecture-face (1+ indent))
+ 'vhdl-speedbar-architecture (1+ indent))
(setq arch-alist (cdr arch-alist)))
;; insert instantiations
(when inst-alist
(cons token (nth 0 comp-entry))
(nth 1 comp-entry) 'vhdl-speedbar-find-file
(cons (nth 2 comp-entry) (nth 3 comp-entry))
- 'vhdl-speedbar-entity-face (1+ indent))
+ 'vhdl-speedbar-entity (1+ indent))
(setq comp-alist (cdr comp-alist)))
;; insert subprograms
(when func-alist
(let* ((file-entry (aget file-alist speedbar-last-selected-file t)))
(vhdl-speedbar-update-units
"\\[.\\] " (nth 0 file-entry)
- speedbar-last-selected-file 'vhdl-speedbar-entity-face)
+ speedbar-last-selected-file 'vhdl-speedbar-entity)
(vhdl-speedbar-update-units
"{.} " (nth 1 file-entry)
- speedbar-last-selected-file 'vhdl-speedbar-architecture-face)
+ speedbar-last-selected-file 'vhdl-speedbar-architecture)
(vhdl-speedbar-update-units
"\\[.\\] " (nth 3 file-entry)
- speedbar-last-selected-file 'vhdl-speedbar-configuration-face)
+ speedbar-last-selected-file 'vhdl-speedbar-configuration)
(vhdl-speedbar-update-units
"[]>] " (nth 4 file-entry)
- speedbar-last-selected-file 'vhdl-speedbar-package-face)
+ speedbar-last-selected-file 'vhdl-speedbar-package)
(vhdl-speedbar-update-units
"\\[.\\].+(" '("body")
- speedbar-last-selected-file 'vhdl-speedbar-package-face)
+ speedbar-last-selected-file 'vhdl-speedbar-package)
(vhdl-speedbar-update-units
"> " (nth 6 file-entry)
- speedbar-last-selected-file 'vhdl-speedbar-instantiation-face))
+ speedbar-last-selected-file 'vhdl-speedbar-instantiation))
;; highlight current units
(let* ((file-entry (aget file-alist file-name t)))
(setq
pos (vhdl-speedbar-update-units
"\\[.\\] " (nth 0 file-entry)
- file-name 'vhdl-speedbar-entity-selected-face pos)
+ file-name 'vhdl-speedbar-entity-selected pos)
pos (vhdl-speedbar-update-units
"{.} " (nth 1 file-entry)
- file-name 'vhdl-speedbar-architecture-selected-face pos)
+ file-name 'vhdl-speedbar-architecture-selected pos)
pos (vhdl-speedbar-update-units
"\\[.\\] " (nth 3 file-entry)
- file-name 'vhdl-speedbar-configuration-selected-face pos)
+ file-name 'vhdl-speedbar-configuration-selected pos)
pos (vhdl-speedbar-update-units
"[]>] " (nth 4 file-entry)
- file-name 'vhdl-speedbar-package-selected-face pos)
+ file-name 'vhdl-speedbar-package-selected pos)
pos (vhdl-speedbar-update-units
"\\[.\\].+(" '("body")
- file-name 'vhdl-speedbar-package-selected-face pos)
+ file-name 'vhdl-speedbar-package-selected pos)
pos (vhdl-speedbar-update-units
"> " (nth 6 file-entry)
- file-name 'vhdl-speedbar-instantiation-selected-face pos))))))
+ file-name 'vhdl-speedbar-instantiation-selected pos))))))
;; move speedbar so the first highlighted unit is visible
(when (and pos (not no-position))
(goto-char pos)
(insert "(top)")
(insert inst-name)
(speedbar-make-button
- start (point) 'vhdl-speedbar-instantiation-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-instantiation 'speedbar-highlight-face
'vhdl-speedbar-find-file inst-file-marker))
(insert delimiter)
(when ent-name
(setq start (point))
(insert ent-name)
(speedbar-make-button
- start (point) 'vhdl-speedbar-entity-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-entity 'speedbar-highlight-face
'vhdl-speedbar-find-file ent-file-marker)
(when arch-name
(insert " (")
(setq start (point))
(insert arch-name)
(speedbar-make-button
- start (point) 'vhdl-speedbar-architecture-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-architecture 'speedbar-highlight-face
'vhdl-speedbar-find-file arch-file-marker)
(insert ")"))
(when conf-name
(setq start (point))
(insert conf-name)
(speedbar-make-button
- start (point) 'vhdl-speedbar-configuration-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-configuration 'speedbar-highlight-face
'vhdl-speedbar-find-file conf-file-marker)
(insert ")")))
(when (and lib-name (not (equal lib-name (downcase (vhdl-work-library)))))
(setq start (point))
(insert " (" lib-name ")")
(put-text-property (+ 2 start) (1- (point)) 'face
- 'vhdl-speedbar-library-face))
+ 'vhdl-speedbar-library))
(insert-char ?\n 1)
(put-text-property visible-start (point) 'invisible nil)))
(setq start (point))
(insert pack-name)
(speedbar-make-button
- start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-package 'speedbar-highlight-face
'vhdl-speedbar-find-file pack-file-marker)
(unless (car pack-file-marker)
(insert "!"))
(setq start (point))
(insert "body")
(speedbar-make-button
- start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-package 'speedbar-highlight-face
'vhdl-speedbar-find-file body-file-marker)
(insert ")"))
(insert-char ?\n 1)
(setq start (point))
(insert pack-name)
(speedbar-make-button
- start (point) 'vhdl-speedbar-package-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-package 'speedbar-highlight-face
'vhdl-speedbar-find-file pack-file-marker)
(setq start (point))
(insert " (" lib-name ")")
(put-text-property (+ 2 start) (1- (point)) 'face
- 'vhdl-speedbar-library-face)
+ 'vhdl-speedbar-library)
(insert-char ?\n 1)
(put-text-property visible-start (point) 'invisible nil)))
(setq start (point))
(insert func-name)
(speedbar-make-button
- start (point) 'vhdl-speedbar-subprogram-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-subprogram 'speedbar-highlight-face
'vhdl-speedbar-find-file func-file-marker)
(when (car func-body-file-marker)
(insert " (")
(setq start (point))
(insert "body")
(speedbar-make-button
- start (point) 'vhdl-speedbar-subprogram-face 'speedbar-highlight-face
+ start (point) 'vhdl-speedbar-subprogram 'speedbar-highlight-face
'vhdl-speedbar-find-file func-body-file-marker)
(insert ")"))
(insert-char ?\n 1)
(message
"%s \"%s\" in \"%s\""
;; design unit kind
- (cond ((or (eq face 'vhdl-speedbar-entity-face)
- (eq face 'vhdl-speedbar-entity-selected-face))
+ (cond ((or (eq face 'vhdl-speedbar-entity)
+ (eq face 'vhdl-speedbar-entity-selected))
(if (equal (match-string 2) ">") "Component" "Entity"))
- ((or (eq face 'vhdl-speedbar-architecture-face)
- (eq face 'vhdl-speedbar-architecture-selected-face))
+ ((or (eq face 'vhdl-speedbar-architecture)
+ (eq face 'vhdl-speedbar-architecture-selected))
"Architecture")
- ((or (eq face 'vhdl-speedbar-configuration-face)
- (eq face 'vhdl-speedbar-configuration-selected-face))
+ ((or (eq face 'vhdl-speedbar-configuration)
+ (eq face 'vhdl-speedbar-configuration-selected))
"Configuration")
- ((or (eq face 'vhdl-speedbar-package-face)
- (eq face 'vhdl-speedbar-package-selected-face))
+ ((or (eq face 'vhdl-speedbar-package)
+ (eq face 'vhdl-speedbar-package-selected))
"Package")
- ((or (eq face 'vhdl-speedbar-instantiation-face)
- (eq face 'vhdl-speedbar-instantiation-selected-face))
+ ((or (eq face 'vhdl-speedbar-instantiation)
+ (eq face 'vhdl-speedbar-instantiation-selected))
"Instantiation")
- ((eq face 'vhdl-speedbar-subprogram-face)
+ ((eq face 'vhdl-speedbar-subprogram)
"Subprogram")
(t ""))
;; design unit name
"Place the entity/component under the cursor as component."
(interactive)
(if (not (vhdl-speedbar-check-unit 'entity))
- (error "ERROR: No entity/component under cursor.")
+ (error "ERROR: No entity/component under cursor")
(vhdl-speedbar-port-copy)
(if (fboundp 'speedbar-select-attached-frame)
(speedbar-select-attached-frame)
(speedbar-position-cursor-on-line)
(cond ((eq design-unit 'entity)
(memq (get-text-property (match-end 0) 'face)
- '(vhdl-speedbar-entity-face
- vhdl-speedbar-entity-selected-face)))
+ '(vhdl-speedbar-entity
+ vhdl-speedbar-entity-selected)))
((eq design-unit 'subprogram)
(eq (get-text-property (match-end 0) 'face)
- 'vhdl-speedbar-subprogram-face))
+ 'vhdl-speedbar-subprogram))
(t nil))))
(defun vhdl-speedbar-set-depth (depth)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Fontification
-(defface vhdl-speedbar-entity-face
+(defface vhdl-speedbar-entity
'((((class color) (background light)) (:foreground "ForestGreen"))
(((class color) (background dark)) (:foreground "PaleGreen")))
"Face used for displaying entity names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-entity-face 'face-alias 'vhdl-speedbar-entity)
-(defface vhdl-speedbar-architecture-face
- '((((class color) (background light)) (:foreground "Blue"))
+(defface vhdl-speedbar-architecture
+ '((((min-colors 88) (class color) (background light)) (:foreground "Blue1"))
+ (((class color) (background light)) (:foreground "Blue"))
(((class color) (background dark)) (:foreground "LightSkyBlue")))
"Face used for displaying architecture names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-architecture-face 'face-alias 'vhdl-speedbar-architecture)
-(defface vhdl-speedbar-configuration-face
+(defface vhdl-speedbar-configuration
'((((class color) (background light)) (:foreground "DarkGoldenrod"))
(((class color) (background dark)) (:foreground "Salmon")))
"Face used for displaying configuration names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-configuration-face 'face-alias 'vhdl-speedbar-configuration)
-(defface vhdl-speedbar-package-face
+(defface vhdl-speedbar-package
'((((class color) (background light)) (:foreground "Grey50"))
(((class color) (background dark)) (:foreground "Grey80")))
"Face used for displaying package names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-package-face 'face-alias 'vhdl-speedbar-package)
-(defface vhdl-speedbar-library-face
+(defface vhdl-speedbar-library
'((((class color) (background light)) (:foreground "Purple"))
(((class color) (background dark)) (:foreground "Orchid1")))
"Face used for displaying library names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-library-face 'face-alias 'vhdl-speedbar-library)
-(defface vhdl-speedbar-instantiation-face
+(defface vhdl-speedbar-instantiation
'((((class color) (background light)) (:foreground "Brown"))
+ (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1"))
(((class color) (background dark)) (:foreground "Yellow")))
"Face used for displaying instantiation names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-instantiation-face 'face-alias 'vhdl-speedbar-instantiation)
-(defface vhdl-speedbar-subprogram-face
+(defface vhdl-speedbar-subprogram
'((((class color) (background light)) (:foreground "Orchid4"))
(((class color) (background dark)) (:foreground "BurlyWood2")))
"Face used for displaying subprogram names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-subprogram-face 'face-alias 'vhdl-speedbar-subprogram)
-(defface vhdl-speedbar-entity-selected-face
+(defface vhdl-speedbar-entity-selected
'((((class color) (background light)) (:foreground "ForestGreen" :underline t))
(((class color) (background dark)) (:foreground "PaleGreen" :underline t)))
"Face used for displaying entity names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-entity-selected-face 'face-alias 'vhdl-speedbar-entity-selected)
-(defface vhdl-speedbar-architecture-selected-face
- '((((class color) (background light)) (:foreground "Blue" :underline t))
+(defface vhdl-speedbar-architecture-selected
+ '((((min-colors 88) (class color) (background light)) (:foreground "Blue1" :underline t))
+ (((min-colors 88) (class color) (background light)) (:foreground "Blue1" :underline t))
+ (((class color) (background light)) (:foreground "Blue" :underline t))
(((class color) (background dark)) (:foreground "LightSkyBlue" :underline t)))
"Face used for displaying architecture names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-architecture-selected-face 'face-alias 'vhdl-speedbar-architecture-selected)
-(defface vhdl-speedbar-configuration-selected-face
+(defface vhdl-speedbar-configuration-selected
'((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
(((class color) (background dark)) (:foreground "Salmon" :underline t)))
"Face used for displaying configuration names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-configuration-selected-face 'face-alias 'vhdl-speedbar-configuration-selected)
-(defface vhdl-speedbar-package-selected-face
+(defface vhdl-speedbar-package-selected
'((((class color) (background light)) (:foreground "Grey50" :underline t))
(((class color) (background dark)) (:foreground "Grey80" :underline t)))
"Face used for displaying package names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-package-selected-face 'face-alias 'vhdl-speedbar-package-selected)
-(defface vhdl-speedbar-instantiation-selected-face
+(defface vhdl-speedbar-instantiation-selected
'((((class color) (background light)) (:foreground "Brown" :underline t))
+ (((min-colors 88) (class color) (background dark)) (:foreground "Yellow1" :underline t))
(((class color) (background dark)) (:foreground "Yellow" :underline t)))
"Face used for displaying instantiation names."
:group 'speedbar-faces)
+;; backward-compatibility alias
+(put 'vhdl-speedbar-instantiation-selected-face 'face-alias 'vhdl-speedbar-instantiation-selected)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Initialization
(cons constant-name
(if (match-string 1)
(or (aget generic-alist (match-string 2) t)
- (error (format "ERROR: Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name)))
+ (error "ERROR: Formal generic \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
(cdar generic-alist))))
(setq constant-alist (cons constant-entry constant-alist))
(setq constant-name (downcase constant-name))
(setq signal-entry (cons signal-name
(if (match-string 1)
(or (aget port-alist (match-string 2) t)
- (error (format "ERROR: Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name)))
+ (error "ERROR: Formal port \"%s\" mismatch for instance \"%s\"" (match-string 2) inst-name))
(cdar port-alist))))
(setq signal-alist (cons signal-entry signal-alist))
(setq signal-name (downcase signal-name))
(defun vhdl-doc-variable (variable)
"Display VARIABLE's documentation in *Help* buffer."
(interactive)
- (with-output-to-temp-buffer "*Help*"
+ (unless vhdl-xemacs
+ (help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p)))
+ (with-output-to-temp-buffer (if (fboundp 'help-buffer) (help-buffer) "*Help*")
(princ (documentation-property variable 'variable-documentation))
- (unless vhdl-xemacs
- (help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p)))
- (save-excursion
- (set-buffer standard-output)
+ (with-current-buffer standard-output
(help-mode))
(print-help-return-message)))
(defun vhdl-doc-mode ()
"Display VHDL Mode documentation in *Help* buffer."
(interactive)
- (with-output-to-temp-buffer "*Help*"
+ (unless vhdl-xemacs
+ (help-setup-xref (list #'vhdl-doc-mode) (interactive-p)))
+ (with-output-to-temp-buffer (if (fboundp 'help-buffer) (help-buffer) "*Help*")
(princ mode-name)
(princ " mode:\n")
(princ (documentation 'vhdl-mode))
- (unless vhdl-xemacs
- (help-setup-xref (list #'vhdl-doc-mode) (interactive-p)))
- (save-excursion
- (set-buffer standard-output)
+ (with-current-buffer standard-output
(help-mode))
(print-help-return-message)))
(provide 'vhdl-mode)
-;;; arch-tag: 780d7073-9b5d-4c6c-b0d8-26b28783aba3
+;; arch-tag: 780d7073-9b5d-4c6c-b0d8-26b28783aba3
;;; vhdl-mode.el ends here