* bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows @ 2022-04-05 16:17 Cyril Arnould 2022-04-05 16:43 ` Eli Zaretskii 0 siblings, 1 reply; 10+ messages in thread From: Cyril Arnould @ 2022-04-05 16:17 UTC (permalink / raw) To: 54730 [-- Attachment #1: Type: text/plain, Size: 4212 bytes --] 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)) [-- Attachment #2: Type: text/html, Size: 8783 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 16:17 bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows Cyril Arnould @ 2022-04-05 16:43 ` Eli Zaretskii 2022-04-05 17:08 ` bug#54730: AW: " Cyril Arnould 0 siblings, 1 reply; 10+ messages in thread From: Eli Zaretskii @ 2022-04-05 16:43 UTC (permalink / raw) To: Cyril Arnould; +Cc: 54730 > From: Cyril Arnould <cyril.arnould@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. ^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 16:43 ` Eli Zaretskii @ 2022-04-05 17:08 ` Cyril Arnould 2022-04-05 17:12 ` Cyril Arnould 2022-04-05 17:26 ` Eli Zaretskii 0 siblings, 2 replies; 10+ messages in thread From: Cyril Arnould @ 2022-04-05 17:08 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 54730@debbugs.gnu.org [-- Attachment #1.1: Type: text/plain, Size: 2363 bytes --] 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@gnu.org> Gesendet: Dienstag, 5. April 2022 18:43 An: Cyril Arnould<mailto:cyril.arnould@outlook.com> Cc: 54730@debbugs.gnu.org<mailto:54730@debbugs.gnu.org> Betreff: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows > From: Cyril Arnould <cyril.arnould@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. [-- Attachment #1.2: Type: text/html, Size: 5080 bytes --] [-- Attachment #2: counter.vhdl --] [-- Type: application/octet-stream, Size: 1103 bytes --] library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity counter is port ( Clk_CI : in std_logic; Rst_RBI : in std_logic); -- The bitlength of the data end counter; architecture Behavioral of counter is ----------------------------------------------------------------------------- -- Signals ----------------------------------------------------------------------------- signal BlockCount_DP, BlockCount_DN : unsigned(58 downto 0); -- Stores the length of the current block signal Length_DP, Length_DN : std_logic_vector(4 downto 0); begin -- Behavioral BlockCount_DN <= (others => '0'); Length_DN <= (others => '0'); -- 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; end Behavioral; ^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 17:08 ` bug#54730: AW: " Cyril Arnould @ 2022-04-05 17:12 ` Cyril Arnould 2022-04-05 17:26 ` Eli Zaretskii 1 sibling, 0 replies; 10+ messages in thread From: Cyril Arnould @ 2022-04-05 17:12 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 54730@debbugs.gnu.org [-- Attachment #1: Type: text/plain, Size: 2864 bytes --] 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@outlook.com> Gesendet: Dienstag, 5. April 2022 19:08 An: Eli Zaretskii<mailto:eliz@gnu.org> Cc: 54730@debbugs.gnu.org<mailto:54730@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@gnu.org> Gesendet: Dienstag, 5. April 2022 18:43 An: Cyril Arnould<mailto:cyril.arnould@outlook.com> Cc: 54730@debbugs.gnu.org<mailto:54730@debbugs.gnu.org> Betreff: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows > From: Cyril Arnould <cyril.arnould@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. [-- Attachment #2: Type: text/html, Size: 6125 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 17:08 ` bug#54730: AW: " Cyril Arnould 2022-04-05 17:12 ` Cyril Arnould @ 2022-04-05 17:26 ` Eli Zaretskii 2022-04-05 17:53 ` bug#54730: AW: " Cyril Arnould 1 sibling, 1 reply; 10+ messages in thread From: Eli Zaretskii @ 2022-04-05 17:26 UTC (permalink / raw) To: Cyril Arnould; +Cc: 54730 > From: Cyril Arnould <cyril.arnould@outlook.com> > CC: "54730@debbugs.gnu.org" <54730@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))))) ^ permalink raw reply related [flat|nested] 10+ messages in thread
* bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 17:26 ` Eli Zaretskii @ 2022-04-05 17:53 ` Cyril Arnould 2022-04-05 18:09 ` Robert Pluim 2022-04-05 18:18 ` Eli Zaretskii 0 siblings, 2 replies; 10+ messages in thread From: Cyril Arnould @ 2022-04-05 17:53 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 54730@debbugs.gnu.org [-- Attachment #1: Type: text/plain, Size: 5305 bytes --] 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@gnu.org> Gesendet: Dienstag, 5. April 2022 19:26 An: Cyril Arnould<mailto:cyril.arnould@outlook.com> Cc: 54730@debbugs.gnu.org<mailto:54730@debbugs.gnu.org> Betreff: Re: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows > From: Cyril Arnould <cyril.arnould@outlook.com> > CC: "54730@debbugs.gnu.org" <54730@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))))) [-- Attachment #2: Type: text/html, Size: 11642 bytes --] ^ permalink raw reply related [flat|nested] 10+ messages in thread
* bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 17:53 ` bug#54730: AW: " Cyril Arnould @ 2022-04-05 18:09 ` Robert Pluim 2022-04-05 21:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors 2022-04-05 18:18 ` Eli Zaretskii 1 sibling, 1 reply; 10+ messages in thread From: Robert Pluim @ 2022-04-05 18:09 UTC (permalink / raw) To: Cyril Arnould; +Cc: 54730@debbugs.gnu.org, Stefan Monnier >>>>> On Tue, 5 Apr 2022 17:53:20 +0000, Cyril Arnould <cyril.arnould@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 -- ^ permalink raw reply related [flat|nested] 10+ messages in thread
* bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 18:09 ` Robert Pluim @ 2022-04-05 21:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors 2022-04-05 22:27 ` bug#54730: AW: " Cyril Arnould 0 siblings, 1 reply; 10+ messages in thread From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-04-05 21:21 UTC (permalink / raw) To: Robert Pluim Cc: Reto Zimmermann, Eli Zaretskii, 54730@debbugs.gnu.org, Cyril Arnould Robert Pluim [2022-04-05 20:09:28] wrote: >>>>>> On Tue, 5 Apr 2022 17:53:20 +0000, Cyril Arnould <cyril.arnould@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)) ^ permalink raw reply related [flat|nested] 10+ messages in thread
* bug#54730: AW: bug#54730: AW: bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 21:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-04-05 22:27 ` Cyril Arnould 0 siblings, 0 replies; 10+ messages in thread From: Cyril Arnould @ 2022-04-05 22:27 UTC (permalink / raw) To: Stefan Monnier, Robert Pluim; +Cc: Reto Zimmermann, 54730@debbugs.gnu.org [-- Attachment #1: Type: text/plain, Size: 218 bytes --] 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. [-- Attachment #2: Type: text/html, Size: 1404 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows 2022-04-05 17:53 ` bug#54730: AW: " Cyril Arnould 2022-04-05 18:09 ` Robert Pluim @ 2022-04-05 18:18 ` Eli Zaretskii 1 sibling, 0 replies; 10+ messages in thread From: Eli Zaretskii @ 2022-04-05 18:18 UTC (permalink / raw) To: Cyril Arnould; +Cc: 54730-done > From: Cyril Arnould <cyril.arnould@outlook.com> > CC: "54730@debbugs.gnu.org" <54730@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. ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-04-05 22:27 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-04-05 16:17 bug#54730: 28.1; vhdl-update-sensitivity-list not working in Windows Cyril Arnould 2022-04-05 16:43 ` Eli Zaretskii 2022-04-05 17:08 ` bug#54730: AW: " Cyril Arnould 2022-04-05 17:12 ` Cyril Arnould 2022-04-05 17:26 ` Eli Zaretskii 2022-04-05 17:53 ` bug#54730: AW: " Cyril Arnould 2022-04-05 18:09 ` Robert Pluim 2022-04-05 21:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors 2022-04-05 22:27 ` bug#54730: AW: " Cyril Arnould 2022-04-05 18:18 ` Eli Zaretskii
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.