all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Cyril Arnould <cyril.arnould@outlook.com>
Cc: 55389@debbugs.gnu.org
Subject: bug#55389: 28.1; vhdl-generate-makefile fails if there is not VHDL project
Date: Fri, 13 May 2022 15:03:38 +0300	[thread overview]
Message-ID: <83zgjlmyg5.fsf@gnu.org> (raw)
In-Reply-To: <AS4PR10MB6110D5BF266FB331828C0F5AE3CB9@AS4PR10MB6110.EURPRD10.PROD.OUTLOOK.COM> (message from Cyril Arnould on Thu, 12 May 2022 19:13:15 +0000)

> From: Cyril Arnould <cyril.arnould@outlook.com>
> Date: Thu, 12 May 2022 19:13:15 +0000
> 
> When visiting any VHDL file, trying to execute vhdl-generate-makefile
> (C-c M-k) will fail if vhdl-project is nil. The resulting error message
> and backtrace are as follows:
> 
> vhdl-generate-makefile-1: Symbol’s value as variable is void: rule-alist
> 
> Debugger entered--Lisp error: (void-variable rule-alist)
>   vhdl-aput(rule-alist "counter.vhd" (("counter") nil))
>   vhdl-generate-makefile-1()
>   vhdl-generate-makefile()
>   funcall-interactively(vhdl-generate-makefile)
>   command-execute(vhdl-generate-makefile)
> 
> I suspect this might be due to changes when lexical-binding was enabled,
> I went back to commit d365c947b53a2a1e4b43ab65922ebfeca23943d1 where it's
> working.

Yes, this is fallout from converting vhdl-mode.el to lexical-binding.
I installed a fix on the emacs-28 branch.  The patch I installed is
below; please see if there are any issues left after applying it.

Thanks.

diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index e562a46..4e5f5df 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -153,7 +153,11 @@ lazy-lock-defer-contextually
 (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 @@ vhdl-speedbar-insert-dir-hierarchy
   (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 @@ vhdl-speedbar-insert-hierarchy
 	 '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 @@ vhdl-generate-makefile-1
       (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)))





  reply	other threads:[~2022-05-13 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 19:13 bug#55389: 28.1; vhdl-generate-makefile fails if there is not VHDL project Cyril Arnould
2022-05-13 12:03 ` Eli Zaretskii [this message]
2022-05-13 18:31   ` bug#55389: AW: " Cyril Arnould
2022-05-17 13:34   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zgjlmyg5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=55389@debbugs.gnu.org \
    --cc=cyril.arnould@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.