summaryrefslogtreecommitdiff
path: root/lisp/progmodes/vhdl-mode.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-05-13 15:00:21 +0300
committerEli Zaretskii <eliz@gnu.org>2022-05-13 15:00:21 +0300
commita769cbfcfb6e9603bcd15e90f387207f8c061bf1 (patch)
treea3101eb590bf040989b09a050364ff4bc4333300 /lisp/progmodes/vhdl-mode.el
parentf03c5d81bd4a7af1364558b406e2b87a78b3af73 (diff)
downloademacs-a769cbfcfb6e9603bcd15e90f387207f8c061bf1.tar.gz
Fix lexical-binding fallout in vhdl-mode.el
* lisp/progmodes/vhdl-mode.el (arch-alist, pack-alist) (file-alist, unit-alist, rule-alist): Defvar them, since vhdl-aput expects them to be dynamically bound. (Bug#55389) (vhdl-speedbar-insert-hierarchy): Rename the PACK-ALIST argument to PACKAGE-ALIST, to avoid shadowing the global variable.
Diffstat (limited to 'lisp/progmodes/vhdl-mode.el')
-rw-r--r--lisp/progmodes/vhdl-mode.el23
1 files changed, 14 insertions, 9 deletions
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index e562a463e15..4e5f5df8142 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -153,7 +153,11 @@
(defvar lazy-lock-defer-on-scrolling)
(defvar lazy-lock-defer-on-the-fly)
(defvar speedbar-attached-frame)
-
+(defvar arch-alist)
+(defvar pack-alist)
+(defvar file-alist)
+(defvar unit-alist)
+(defvar rule-alist)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Variables
@@ -14948,10 +14952,10 @@ otherwise use cached data."
(vhdl-speedbar-expand-units directory)
(vhdl-aput 'vhdl-directory-alist directory (list (list directory))))
-(defun vhdl-speedbar-insert-hierarchy ( ent-alist-arg conf-alist-arg pack-alist
- ent-inst-list depth)
- "Insert hierarchy of ENT-ALIST, CONF-ALIST, and PACK-ALIST."
- (if (not (or ent-alist conf-alist pack-alist))
+(defun vhdl-speedbar-insert-hierarchy ( ent-alist-arg conf-alist-arg
+ package-alist ent-inst-list depth)
+ "Insert hierarchy of ENT-ALIST, CONF-ALIST, and PACKAGE-ALIST."
+ (if (not (or ent-alist conf-alist package-alist))
(vhdl-speedbar-make-title-line "No VHDL design units!" depth)
(let ((ent-alist ent-alist-arg)
(conf-alist conf-alist-arg)
@@ -14981,15 +14985,15 @@ otherwise use cached data."
'vhdl-speedbar-configuration-face depth)
(setq conf-alist (cdr conf-alist)))
;; insert packages
- (when pack-alist (vhdl-speedbar-make-title-line "Packages:" depth))
- (while pack-alist
- (setq pack-entry (car pack-alist))
+ (when package-alist (vhdl-speedbar-make-title-line "Packages:" depth))
+ (while package-alist
+ (setq pack-entry (car package-alist))
(vhdl-speedbar-make-pack-line
(nth 0 pack-entry) (nth 1 pack-entry)
(cons (nth 2 pack-entry) (nth 3 pack-entry))
(cons (nth 7 pack-entry) (nth 8 pack-entry))
depth)
- (setq pack-alist (cdr pack-alist))))))
+ (setq package-alist (cdr package-alist))))))
(declare-function speedbar-line-directory "speedbar" (&optional depth))
@@ -17208,6 +17212,7 @@ specified by a target."
(unless (or (assoc directory vhdl-file-alist)
(vhdl-load-cache directory))
(vhdl-scan-directory-contents directory))))
+ (defvar rule-alist) ; we need it to be dynamically bound
(let* ((directory (abbreviate-file-name (vhdl-default-directory)))
(project (vhdl-project-p))
(ent-alist (vhdl-aget vhdl-entity-alist (or project directory)))