GNU bug report logs - #55389
28.1; vhdl-generate-makefile fails if there is not VHDL project

Previous Next

Package: emacs;

Reported by: Cyril Arnould <cyril.arnould <at> outlook.com>

Date: Thu, 12 May 2022 19:19:01 UTC

Severity: normal

Tags: moreinfo

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55389 in the body.
You can then email your comments to 55389 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#55389; Package emacs. (Thu, 12 May 2022 19:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Cyril Arnould <cyril.arnould <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 12 May 2022 19:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 28.1; vhdl-generate-makefile fails if there is not VHDL project
Date: Thu, 12 May 2022 19:13:15 +0000
[Message part 1 (text/plain, inline)]
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. Note that I've never used this feature before so I don't know
exactly how it's supposed to behave, I wanted to try it out. The
makefile I get from the older vhdl-mode.el does seem to make sense though, I’ve
attached it for reference.


In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
of 2022-04-09 built on fv-az449-585
Repository revision: 04afff7cc015bc553c5f7abe57d6b6b23448bbea
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Pro (v10.0.2009.19044.1645)

Configured using:
'configure --prefix=/mingw64 --build=x86_64-w64-mingw32 --with-modules
--without-dbus --without-compress-install --with-native-compilation
'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe'
CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1 LDFLAGS=-pipe'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LIBXML2 MODULES NATIVE_COMP NOTIFY
W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM
ZLIB

Important settings:
  value of $LANG: en_GB
  locale-coding-system: cp1252

Major mode: VHDL/es

Minor modes in effect:
  vhdl-stutter-mode: t
  vhdl-electric-mode: t
  display-line-numbers-mode: t
  override-global-mode: t
  delete-selection-mode: t
  tabbar-mwheel-mode: t
  tabbar-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  cua-mode: t
  company-tng-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
help-fns radix-tree cl-print debug backtrace cus-start time-date
vc-dispatcher vc-svn vhdl-mode hippie-exp dired-aux comp comp-cstr
warnings dired dired-loaddefs display-line-numbers cl-extra use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key use-package-core finder-inf server delsel
tabbar grep compile text-property-search comint ring flycheck ansi-color
find-func help-mode rx dash cua-base company-tng company easy-mmode
edmacro kmacro pcase cus-load tex-site info package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads w32notify w32 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 451621 148985)
(symbols 48 21732 155)
(strings 32 129708 28702)
(string-bytes 1 3547925)
(vectors 16 38307)
(vector-slots 8 638853 354540)
(floats 8 94 629)
(intervals 56 601 449)
(buffers 992 15))
[Message part 2 (text/html, inline)]
[Makefile (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55389; Package emacs. (Fri, 13 May 2022 12:04:01 GMT) Full text and rfc822 format available.

Message #8 received at 55389 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: 55389 <at> debbugs.gnu.org
Subject: Re: bug#55389: 28.1;
 vhdl-generate-makefile fails if there is not VHDL project
Date: Fri, 13 May 2022 15:03:38 +0300
> From: Cyril Arnould <cyril.arnould <at> 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)))




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 13 May 2022 12:40:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55389; Package emacs. (Fri, 13 May 2022 18:32:01 GMT) Full text and rfc822 format available.

Message #13 received at 55389 <at> debbugs.gnu.org (full text, mbox):

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "55389 <at> debbugs.gnu.org" <55389 <at> debbugs.gnu.org>
Subject: AW: bug#55389: 28.1; vhdl-generate-makefile fails if there is not
 VHDL project
Date: Fri, 13 May 2022 18:31:21 +0000
[Message part 1 (text/plain, inline)]
Yep, that fixes things. Thanks!
[Message part 2 (text/html, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Tue, 17 May 2022 13:36:01 GMT) Full text and rfc822 format available.

Notification sent to Cyril Arnould <cyril.arnould <at> outlook.com>:
bug acknowledged by developer. (Tue, 17 May 2022 13:36:02 GMT) Full text and rfc822 format available.

Message #18 received at 55389-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: cyril.arnould <at> outlook.com
Cc: 55389-done <at> debbugs.gnu.org
Subject: Re: bug#55389: 28.1;
 vhdl-generate-makefile fails if there is not VHDL project
Date: Tue, 17 May 2022 16:34:50 +0300
> Cc: 55389 <at> debbugs.gnu.org
> Date: Fri, 13 May 2022 15:03:38 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: Cyril Arnould <cyril.arnould <at> 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.

No further comments, so I'm closing this bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Jun 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 315 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.