GNU bug report logs - #54730
28.1; vhdl-update-sensitivity-list not working in Windows

Previous Next

Package: emacs;

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

Date: Tue, 5 Apr 2022 16:27:02 UTC

Severity: normal

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 54730 in the body.
You can then email your comments to 54730 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#54730; Package emacs. (Tue, 05 Apr 2022 16:27: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. (Tue, 05 Apr 2022 16:27: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-update-sensitivity-list not working in Windows
Date: Tue, 5 Apr 2022 16:17:37 +0000
[Message part 1 (text/plain, inline)]
vhdl-update-sensitivity-list is not working anymore in Windows. I
have a very simple process:

  -- Flip Flops
  p_memzing : process (Clk_CI, Rst_RBI)
  begin
    if Rst_RBI = '0' then               -- asynchronous reset (active low)
      BlockCount_DP <= (others => '0');
      Length_DP     <= (others => '0');
    elsif Clk_CI'event and Clk_CI = '1' then  -- rising clock edge
      BlockCount_DP <= BlockCount_DN;
      Length_DP     <= Length_DN;
    end if;
  end process p_memzing;

If I execute vhdl-update-sensitivity-list-process, I get the error
message "Symbol’s value as variable is void: proc-end". If I execute
vhdl-update-sensitivity-list-buffer instead, I get no error message but
the sensitivity list is not updated properly, e.g. if I delete Clk_CI
from the sensitivity list, it is not added back.

This problem occurs in both natively-compiled VHDL mode as well as
byte-compiled VHDL mode. I have also deleted my .emacs configuration
file to reproduce the bug in a more vanilla environment. This was
working fine under Emacs 27.2.



In GNU Emacs 28.1 (build 52, x86_64-w64-mingw32)
of 2022-04-04 built on AVALON
Repository revision: 5a223c7f2ef4c31abbd46367b6ea83cd19d30aa7
Repository branch: heads/emacs-28.1
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Pro (v10.0.2009.19044.1586)

Configured using:
'configure --without-dbus --with-native-compilation
--without-compress-install CFLAGS=-O2'

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

(NATIVE_COMP present but libgccjit not available)

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

Major mode: VHDL

Minor modes in effect:
  delete-selection-mode: t
  cua-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-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
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map seq byte-opt gv bytecomp
byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils cus-start cus-load delsel cua-base
time-date subr-x cl-loaddefs cl-lib vc-dispatcher vc-svn vhdl-mode
hippie-exp compile text-property-search comint ansi-color ring
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 lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 93119 15570)
(symbols 48 10242 1)
(strings 32 31838 2138)
(string-bytes 1 976465)
(vectors 16 17355)
(vector-slots 8 268523 16886)
(floats 8 39 323)
(intervals 56 742 0)
(buffers 992 13))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 16:44:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: 54730 <at> debbugs.gnu.org
Subject: Re: bug#54730: 28.1;
 vhdl-update-sensitivity-list not working in Windows
Date: Tue, 05 Apr 2022 19:43:53 +0300
> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> Date: Tue, 5 Apr 2022 16:17:37 +0000
> 
> vhdl-update-sensitivity-list is not working anymore in Windows.

You say "on Windows" because it works on other systems?

> I have a very simple process:
> 
>   -- Flip Flops
>   p_memzing : process (Clk_CI, Rst_RBI)
>   begin
>     if Rst_RBI = '0' then               -- asynchronous reset (active low)
>       BlockCount_DP <= (others => '0');
>       Length_DP     <= (others => '0');
>     elsif Clk_CI'event and Clk_CI = '1' then  -- rising clock edge
>       BlockCount_DP <= BlockCount_DN;
>       Length_DP     <= Length_DN;
>     end if;
>   end process p_memzing;
> 
> If I execute vhdl-update-sensitivity-list-process, I get the error
> message "Symbol’s value as variable is void: proc-end". If I execute
> vhdl-update-sensitivity-list-buffer instead, I get no error message but
> the sensitivity list is not updated properly, e.g. if I delete Clk_CI
> from the sensitivity list, it is not added back.

Can you please provide a complete recipe, including any file(s) one
has to visit etc.?  I don't use VHDL, so I need very precise
instructions to reproduce and debug the problem.  I'm a bit surprised
that you get that void-variable error, since I see proc-end being
let-bound in vhdl-update-sensitivity-list.  I'm probably missing
something.  Could you perhaps set debug-on-error non-nil, and post the
Lisp backtrace from the error?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 17:25:02 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>
Subject: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in
 Windows
Date: Tue, 5 Apr 2022 17:08:28 +0000
[Message part 1 (text/plain, inline)]
I’ve added an example file you can visit in the attachment. To reproduce, simply
put the cursor inside the process (M-g-g 30 RET) and execute
vhdl-update-sensitivity-list-process (C-c C-u C-s). I’m getting the following backtrace:

Debugger entered--Lisp error: (void-variable proc-end)
  (vhdl-re-search-forward "[<:]=" proc-end t)
  eval((vhdl-re-search-forward "[<:]=" proc-end t))
  vhdl-update-sensitivity-list()
  vhdl-update-sensitivity-list-process()
  funcall-interactively(vhdl-update-sensitivity-list-process)
  command-execute(vhdl-update-sensitivity-list-process)

Thanks!

Von: Eli Zaretskii<mailto:eliz <at> gnu.org>
Gesendet: Dienstag, 5. April 2022 18:43
An: Cyril Arnould<mailto:cyril.arnould <at> outlook.com>
Cc: 54730 <at> debbugs.gnu.org<mailto:54730 <at> debbugs.gnu.org>
Betreff: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows

> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> Date: Tue, 5 Apr 2022 16:17:37 +0000
>
> vhdl-update-sensitivity-list is not working anymore in Windows.

You say "on Windows" because it works on other systems?

> I have a very simple process:
>
>   -- Flip Flops
>   p_memzing : process (Clk_CI, Rst_RBI)
>   begin
>     if Rst_RBI = '0' then               -- asynchronous reset (active low)
>       BlockCount_DP <= (others => '0');
>       Length_DP     <= (others => '0');
>     elsif Clk_CI'event and Clk_CI = '1' then  -- rising clock edge
>       BlockCount_DP <= BlockCount_DN;
>       Length_DP     <= Length_DN;
>     end if;
>   end process p_memzing;
>
> If I execute vhdl-update-sensitivity-list-process, I get the error
> message "Symbol’s value as variable is void: proc-end". If I execute
> vhdl-update-sensitivity-list-buffer instead, I get no error message but
> the sensitivity list is not updated properly, e.g. if I delete Clk_CI
> from the sensitivity list, it is not added back.

Can you please provide a complete recipe, including any file(s) one
has to visit etc.?  I don't use VHDL, so I need very precise
instructions to reproduce and debug the problem.  I'm a bit surprised
that you get that void-variable error, since I see proc-end being
let-bound in vhdl-update-sensitivity-list.  I'm probably missing
something.  Could you perhaps set debug-on-error non-nil, and post the
Lisp backtrace from the error?

Thanks.

[Message part 2 (text/html, inline)]
[counter.vhdl (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 17:25:03 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>
Subject: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in
 Windows
Date: Tue, 5 Apr 2022 17:12:25 +0000
[Message part 1 (text/plain, inline)]
Addendum: I’ve specified «on Windows» because Emacs is associated more with GNU/Linux
operating systems and I didn’t want any confusion. I don’t have any GNU/Linux OS installed,
but I could try in a VM if that helps.

Von: Cyril Arnould<mailto:cyril.arnould <at> outlook.com>
Gesendet: Dienstag, 5. April 2022 19:08
An: Eli Zaretskii<mailto:eliz <at> gnu.org>
Cc: 54730 <at> debbugs.gnu.org<mailto:54730 <at> debbugs.gnu.org>
Betreff: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows

I’ve added an example file you can visit in the attachment. To reproduce, simply
put the cursor inside the process (M-g-g 30 RET) and execute
vhdl-update-sensitivity-list-process (C-c C-u C-s). I’m getting the following backtrace:

Debugger entered--Lisp error: (void-variable proc-end)
  (vhdl-re-search-forward "[<:]=" proc-end t)
  eval((vhdl-re-search-forward "[<:]=" proc-end t))
  vhdl-update-sensitivity-list()
  vhdl-update-sensitivity-list-process()
  funcall-interactively(vhdl-update-sensitivity-list-process)
  command-execute(vhdl-update-sensitivity-list-process)

Thanks!

Von: Eli Zaretskii<mailto:eliz <at> gnu.org>
Gesendet: Dienstag, 5. April 2022 18:43
An: Cyril Arnould<mailto:cyril.arnould <at> outlook.com>
Cc: 54730 <at> debbugs.gnu.org<mailto:54730 <at> debbugs.gnu.org>
Betreff: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows

> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> Date: Tue, 5 Apr 2022 16:17:37 +0000
>
> vhdl-update-sensitivity-list is not working anymore in Windows.

You say "on Windows" because it works on other systems?

> I have a very simple process:
>
>   -- Flip Flops
>   p_memzing : process (Clk_CI, Rst_RBI)
>   begin
>     if Rst_RBI = '0' then               -- asynchronous reset (active low)
>       BlockCount_DP <= (others => '0');
>       Length_DP     <= (others => '0');
>     elsif Clk_CI'event and Clk_CI = '1' then  -- rising clock edge
>       BlockCount_DP <= BlockCount_DN;
>       Length_DP     <= Length_DN;
>     end if;
>   end process p_memzing;
>
> If I execute vhdl-update-sensitivity-list-process, I get the error
> message "Symbol’s value as variable is void: proc-end". If I execute
> vhdl-update-sensitivity-list-buffer instead, I get no error message but
> the sensitivity list is not updated properly, e.g. if I delete Clk_CI
> from the sensitivity list, it is not added back.

Can you please provide a complete recipe, including any file(s) one
has to visit etc.?  I don't use VHDL, so I need very precise
instructions to reproduce and debug the problem.  I'm a bit surprised
that you get that void-variable error, since I see proc-end being
let-bound in vhdl-update-sensitivity-list.  I'm probably missing
something.  Could you perhaps set debug-on-error non-nil, and post the
Lisp backtrace from the error?

Thanks.


[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 17:27:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: 54730 <at> debbugs.gnu.org
Subject: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in
 Windows
Date: Tue, 05 Apr 2022 20:26:20 +0300
> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> CC: "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>
> Date: Tue, 5 Apr 2022 17:08:28 +0000
> 
> I’ve added an example file you can visit in the attachment. To reproduce, simply
> put the cursor inside the process (M-g-g 30 RET) and execute
> vhdl-update-sensitivity-list-process (C-c C-u C-s). I’m getting the following backtrace:
> 
> Debugger entered--Lisp error: (void-variable proc-end)
>   (vhdl-re-search-forward "[<:]=" proc-end t)
>   eval((vhdl-re-search-forward "[<:]=" proc-end t))
>   vhdl-update-sensitivity-list()
>   vhdl-update-sensitivity-list-process()
>   funcall-interactively(vhdl-update-sensitivity-list-process)
>   command-execute(vhdl-update-sensitivity-list-process)

Thanks, I think I see the problem now.  Does the below fix the
problem?  If not, can you tell me how to show the sensitivity list,
and what should be the correct result of invoking
vhdl-update-sensitivity-list-process in this case?

diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 64ebc14..e562a46 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -8396,30 +8396,30 @@ vhdl-update-sensitivity-list
 	    ((visible-list (vhdl-get-visible-signals))
 	     ;; define syntactic regions where signals are read
 	     (scan-regions-list
-	      '(;; right-hand side of signal/variable assignment
+	      `(;; right-hand side of signal/variable assignment
 		;; (special case: "<=" is relational operator in a condition)
-		((vhdl-re-search-forward "[<:]=" proc-end t)
-		 (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t))
+		((vhdl-re-search-forward "[<:]=" ,proc-end t)
+		 (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" ,proc-end t))
 		;; if condition
-		((vhdl-re-search-forward "^\\s-*if\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<then\\>" proc-end t))
+		((vhdl-re-search-forward "^\\s-*if\\>" ,proc-end t)
+		 (vhdl-re-search-forward "\\<then\\>" ,proc-end t))
 		;; elsif condition
-		((vhdl-re-search-forward "\\<elsif\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<then\\>" proc-end t))
+		((vhdl-re-search-forward "\\<elsif\\>" ,proc-end t)
+		 (vhdl-re-search-forward "\\<then\\>" ,proc-end t))
 		;; while loop condition
-		((vhdl-re-search-forward "^\\s-*while\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<loop\\>" proc-end t))
+		((vhdl-re-search-forward "^\\s-*while\\>" ,proc-end t)
+		 (vhdl-re-search-forward "\\<loop\\>" ,proc-end t))
 		;; exit/next condition
-		((vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t)
-		 (vhdl-re-search-forward ";" proc-end t))
+		((vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" ,proc-end t)
+		 (vhdl-re-search-forward ";" ,proc-end t))
 		;; assert condition
-		((vhdl-re-search-forward "\\<assert\\>" proc-end t)
-		 (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t))
+		((vhdl-re-search-forward "\\<assert\\>" ,proc-end t)
+		 (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" ,proc-end t))
 		;; case expression
-		((vhdl-re-search-forward "^\\s-*case\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<is\\>" proc-end t))
+		((vhdl-re-search-forward "^\\s-*case\\>" ,proc-end t)
+		 (vhdl-re-search-forward "\\<is\\>" ,proc-end t))
 		;; parameter list of procedure call, array index
-		((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t)
+		((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" ,proc-end t)
 		      (1- (point)))
 		 (progn (backward-char) (forward-sexp)
 			(while (looking-at "(") (forward-sexp)) (point)))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 17:59:01 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>
Subject: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in
 Windows
Date: Tue, 5 Apr 2022 17:53:20 +0000
[Message part 1 (text/plain, inline)]
Nice, it’s working! Too bad this didn’t make it into the 28.1 release, I guess I should have
tested more. So for now the solution is to keep the vhdl-mode.el locally until it finds its
way into a maintenance release?

FYI, the sensitivity list of the VHDL process is what’s enclosed in parentheses, so in this
case it’s «(Clk_CI, Rst_RBI)». If you modify the sensitivity list or delete it entirely and
execute vhdl-update-sensitivity-list, it should return back to the way it was. The
BlockCount_DN and Length_DN signals on the other hand are *not* part of the sensitivity
list because the process only needs to be updated at the Clk_CI’event (or any Rst_RBI’event).


Von: Eli Zaretskii<mailto:eliz <at> gnu.org>
Gesendet: Dienstag, 5. April 2022 19:26
An: Cyril Arnould<mailto:cyril.arnould <at> outlook.com>
Cc: 54730 <at> debbugs.gnu.org<mailto:54730 <at> debbugs.gnu.org>
Betreff: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows

> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> CC: "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>
> Date: Tue, 5 Apr 2022 17:08:28 +0000
>
> I’ve added an example file you can visit in the attachment. To reproduce, simply
> put the cursor inside the process (M-g-g 30 RET) and execute
> vhdl-update-sensitivity-list-process (C-c C-u C-s). I’m getting the following backtrace:
>
> Debugger entered--Lisp error: (void-variable proc-end)
>   (vhdl-re-search-forward "[<:]=" proc-end t)
>   eval((vhdl-re-search-forward "[<:]=" proc-end t))
>   vhdl-update-sensitivity-list()
>   vhdl-update-sensitivity-list-process()
>   funcall-interactively(vhdl-update-sensitivity-list-process)
>   command-execute(vhdl-update-sensitivity-list-process)

Thanks, I think I see the problem now.  Does the below fix the
problem?  If not, can you tell me how to show the sensitivity list,
and what should be the correct result of invoking
vhdl-update-sensitivity-list-process in this case?

diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 64ebc14..e562a46 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -8396,30 +8396,30 @@ vhdl-update-sensitivity-list
             ((visible-list (vhdl-get-visible-signals))
              ;; define syntactic regions where signals are read
              (scan-regions-list
-             '(;; right-hand side of signal/variable assignment
+             `(;; right-hand side of signal/variable assignment
                 ;; (special case: "<=" is relational operator in a condition)
-               ((vhdl-re-search-forward "[<:]=" proc-end t)
-                (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t))
+               ((vhdl-re-search-forward "[<:]=" ,proc-end t)
+                (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" ,proc-end t))
                 ;; if condition
-               ((vhdl-re-search-forward "^\\s-*if\\>" proc-end t)
-                (vhdl-re-search-forward "\\<then\\>" proc-end t))
+               ((vhdl-re-search-forward "^\\s-*if\\>" ,proc-end t)
+                (vhdl-re-search-forward "\\<then\\>" ,proc-end t))
                 ;; elsif condition
-               ((vhdl-re-search-forward "\\<elsif\\>" proc-end t)
-                (vhdl-re-search-forward "\\<then\\>" proc-end t))
+               ((vhdl-re-search-forward "\\<elsif\\>" ,proc-end t)
+                (vhdl-re-search-forward "\\<then\\>" ,proc-end t))
                 ;; while loop condition
-               ((vhdl-re-search-forward "^\\s-*while\\>" proc-end t)
-                (vhdl-re-search-forward "\\<loop\\>" proc-end t))
+               ((vhdl-re-search-forward "^\\s-*while\\>" ,proc-end t)
+                (vhdl-re-search-forward "\\<loop\\>" ,proc-end t))
                 ;; exit/next condition
-               ((vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t)
-                (vhdl-re-search-forward ";" proc-end t))
+               ((vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" ,proc-end t)
+                (vhdl-re-search-forward ";" ,proc-end t))
                 ;; assert condition
-               ((vhdl-re-search-forward "\\<assert\\>" proc-end t)
-                (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t))
+               ((vhdl-re-search-forward "\\<assert\\>" ,proc-end t)
+                (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" ,proc-end t))
                 ;; case expression
-               ((vhdl-re-search-forward "^\\s-*case\\>" proc-end t)
-                (vhdl-re-search-forward "\\<is\\>" proc-end t))
+               ((vhdl-re-search-forward "^\\s-*case\\>" ,proc-end t)
+                (vhdl-re-search-forward "\\<is\\>" ,proc-end t))
                 ;; parameter list of procedure call, array index
-               ((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t)
+               ((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" ,proc-end t)
                       (1- (point)))
                  (progn (backward-char) (forward-sexp)
                         (while (looking-at "(") (forward-sexp)) (point)))))

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 18:10:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list
 not working in Windows
Date: Tue, 05 Apr 2022 20:09:28 +0200
>>>>> On Tue, 5 Apr 2022 17:53:20 +0000, Cyril Arnould <cyril.arnould <at> outlook.com> said:

    Cyril> Nice, it’s working! Too bad this didn’t make it into the 28.1 release, I guess I should have
    Cyril> tested more. So for now the solution is to keep the vhdl-mode.el locally until it finds its
    Cyril> way into a maintenance release?

Yes. Eli might decide to put it in 28.2

An alternative (shorter) fix would be this. Stefan, is there a
preference for how these types of lexical-binding bugs are fixed?

diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index c6693b4de5..a0e7f8a82f 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -8453,8 +8453,8 @@ vhdl-update-sensitivity-list
 	  ;; scan for signals read in process
 	  (while scan-regions-list
 	    (goto-char proc-mid)
-	    (while (and (setq beg (eval (nth 0 (car scan-regions-list))))
-			(setq end (eval (nth 1 (car scan-regions-list)))))
+	    (while (and (setq beg (eval (nth 0 (car scan-regions-list)) `((proc-end . ,proc-end))))
+			(setq end (eval (nth 1 (car scan-regions-list)) `((proc-end . ,proc-end)))))
 	      (goto-char beg)
 	      (unless (or (vhdl-in-literal)
 			  (and seq-region-list

Robert
-- 




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Tue, 05 Apr 2022 18:19:01 GMT) Full text and rfc822 format available.

Notification sent to Cyril Arnould <cyril.arnould <at> outlook.com>:
bug acknowledged by developer. (Tue, 05 Apr 2022 18:19:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: 54730-done <at> debbugs.gnu.org
Subject: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in
 Windows
Date: Tue, 05 Apr 2022 21:18:09 +0300
> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> CC: "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>
> Date: Tue, 5 Apr 2022 17:53:20 +0000
> 
> Nice, it’s working!

Thanks, I installed this on the emacs-28 branch, so it will appear in
Emacs 28.2.

> Too bad this didn’t make it into the 28.1 release, I guess I should
> have tested more. So for now the solution is to keep the
> vhdl-mode.el locally until it finds its way into a maintenance
> release?

Yes.

I'm therefore closing this bug.  Thanks for the easy test case, it
made the debugging a no-brainer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 21:22:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Reto Zimmermann <reto <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>,
 "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>,
 Cyril Arnould <cyril.arnould <at> outlook.com>
Subject: Re: bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list
 not working in Windows
Date: Tue, 05 Apr 2022 17:21:35 -0400
Robert Pluim [2022-04-05 20:09:28] wrote:

>>>>>> On Tue, 5 Apr 2022 17:53:20 +0000, Cyril Arnould <cyril.arnould <at> outlook.com> said:
>
>     Cyril> Nice, it’s working! Too bad this didn’t make it into the 28.1
>     Cyril> release, I guess I should have
>     Cyril> tested more. So for now the solution is to keep the vhdl-mode.el
>     Cyril> locally until it finds its
>     Cyril> way into a maintenance release?
>
> Yes. Eli might decide to put it in 28.2
>
> An alternative (shorter) fix would be this. Stefan, is there a
> preference for how these types of lexical-binding bugs are fixed?

It's a question of style and local details.
E.g. whether you want to preserve compatibility with Emacs<24 or XEmacs.
Personally I dislike such abuses of `eval`, so I'd replace it with
`funcall` as in the (100% untested) patch below.


        Stefan


diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index c6693b4de53..7bb07343ae0 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -8374,6 +8374,52 @@ vhdl-update-sensitivity-list-buffer
      (message "Updating sensitivity lists...done")))
   (when noninteractive (save-buffer)))
 
+(defconst vhdl--signal-regions-functions
+  (list
+   ;; right-hand side of signal/variable assignment
+   ;; (special case: "<=" is relational operator in a condition)
+   (lambda (proc-end)
+     (when (vhdl-re-search-forward "[<:]=" proc-end t)
+       (save-excursion
+	 (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t))))
+   ;; if condition
+   (lambda (proc-end)
+     (when (vhdl-re-search-forward "^\\s-*if\\>" proc-end t)
+       (save-excursion (vhdl-re-search-forward "\\<then\\>" proc-end t))))
+   ;; elsif condition
+   (lambda (proc-end)
+     (when (vhdl-re-search-forward "\\<elsif\\>" proc-end t)
+       (save-excursion (vhdl-re-search-forward "\\<then\\>" proc-end t))))
+   ;; while loop condition
+   (lambda (proc-end)
+     (when (vhdl-re-search-forward "^\\s-*while\\>" proc-end t)
+       (save-excursion (vhdl-re-search-forward "\\<loop\\>" proc-end t))))
+   ;; exit/next condition
+   (lambda (proc-end)
+     (when (vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t)
+       (save-excursion (vhdl-re-search-forward ";" proc-end t))))
+   ;; assert condition
+   (lambda (proc-end)
+     (when (vhdl-re-search-forward "\\<assert\\>" proc-end t)
+       (save-excursion
+	 (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)"
+		                 proc-end t))))
+   ;; case expression
+   (lambda (proc-end)
+     (when (vhdl-re-search-forward "^\\s-*case\\>" proc-end t)
+       (save-excursion (vhdl-re-search-forward "\\<is\\>" proc-end t))))
+   ;; parameter list of procedure call, array index
+   (lambda (proc-end)
+     (when (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t)
+       (forward-char -1)
+       (save-excursion
+	 (forward-sexp)
+	 (while (looking-at "(") (forward-sexp)) (point)))))
+  "Define syntactic regions where signals are read.
+Each function is called with one arg (a limit for the (forward) search) and
+should return either nil or the end position of the region (in which case
+point will be set to its beginning).")
+
 (defun vhdl-update-sensitivity-list ()
   "Update sensitivity list."
     (let ((proc-beg (point))
@@ -8394,35 +8440,7 @@ vhdl-update-sensitivity-list
 	(let
 	    ;; scan for visible signals
 	    ((visible-list (vhdl-get-visible-signals))
-	     ;; define syntactic regions where signals are read
-	     (scan-regions-list
-	      '(;; right-hand side of signal/variable assignment
-		;; (special case: "<=" is relational operator in a condition)
-		((vhdl-re-search-forward "[<:]=" proc-end t)
-		 (vhdl-re-search-forward ";\\|\\<\\(then\\|loop\\|report\\|severity\\|is\\)\\>" proc-end t))
-		;; if condition
-		((vhdl-re-search-forward "^\\s-*if\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<then\\>" proc-end t))
-		;; elsif condition
-		((vhdl-re-search-forward "\\<elsif\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<then\\>" proc-end t))
-		;; while loop condition
-		((vhdl-re-search-forward "^\\s-*while\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<loop\\>" proc-end t))
-		;; exit/next condition
-		((vhdl-re-search-forward "\\<\\(exit\\|next\\)\\s-+\\w+\\s-+when\\>" proc-end t)
-		 (vhdl-re-search-forward ";" proc-end t))
-		;; assert condition
-		((vhdl-re-search-forward "\\<assert\\>" proc-end t)
-		 (vhdl-re-search-forward "\\(\\<report\\>\\|\\<severity\\>\\|;\\)" proc-end t))
-		;; case expression
-		((vhdl-re-search-forward "^\\s-*case\\>" proc-end t)
-		 (vhdl-re-search-forward "\\<is\\>" proc-end t))
-		;; parameter list of procedure call, array index
-		((and (re-search-forward "^\\s-*\\(\\w\\|\\.\\)+[ \t\n\r\f]*(" proc-end t)
-		      (1- (point)))
-		 (progn (backward-char) (forward-sexp)
-			(while (looking-at "(") (forward-sexp)) (point)))))
+	     (scan-regions-list vhdl--signal-regions-functions)
 	     name field read-list sens-list signal-list tmp-list
 	     sens-beg sens-end beg end margin)
 	  ;; scan for signals in old sensitivity list
@@ -8453,9 +8471,7 @@ vhdl-update-sensitivity-list
 	  ;; scan for signals read in process
 	  (while scan-regions-list
 	    (goto-char proc-mid)
-	    (while (and (setq beg (eval (nth 0 (car scan-regions-list))))
-			(setq end (eval (nth 1 (car scan-regions-list)))))
-	      (goto-char beg)
+	    (while (setq end (funcall (car scan-regions-list) proc-end))
 	      (unless (or (vhdl-in-literal)
 			  (and seq-region-list
 			       (let ((tmp-list seq-region-list))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54730; Package emacs. (Tue, 05 Apr 2022 22:28:02 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, Robert Pluim <rpluim <at> gmail.com>
Cc: Reto Zimmermann <reto <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>,
 "54730 <at> debbugs.gnu.org" <54730 <at> debbugs.gnu.org>
Subject: AW: bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not
 working in Windows
Date: Tue, 5 Apr 2022 22:27:46 +0000
[Message part 1 (text/plain, inline)]
I’ve just tried all three variants, they all seem to work fine as far as I can tell. I’ll continue using Eli’s Version since that’s what’s currently committed, I’ll try to check back on the branch in case of changes.
[Message part 2 (text/html, inline)]

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

This bug report was last modified 3 years and 42 days ago.

Previous Next


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